This commit is contained in:
Lana Steuck 2015-09-18 14:20:39 -07:00
commit 9739c41401
595 changed files with 11324 additions and 5625 deletions
jdk
make
src/java.base
macosx
classes
native/libosxsecurity
share/classes
com/sun
java

@ -239,6 +239,53 @@ TARGETS += $(BUILD_LIBZIP)
##########################################################################################
ifeq ($(OPENJDK_TARGET_OS), aix)
LIBJIMAGE_TOOLCHAIN := TOOLCHAIN_LINK_CXX
endif # OPENJDK_TARGET_OS aix
$(eval $(call SetupNativeCompilation,BUILD_LIBJIMAGE, \
LIBRARY := jimage, \
TOOLCHAIN := $(LIBJIMAGE_TOOLCHAIN), \
OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
OPTIMIZATION := LOW, \
SRC := $(JDK_TOPDIR)/src/java.base/share/native/libjimage \
$(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libjimage, \
EXCLUDES := $(LIBJIMAGE_EXCLUDES), \
CFLAGS := $(CFLAGS_JDKLIB) \
$(JIMAGELIB_CPPFLAGS) \
-I$(JDK_TOPDIR)/src/java.base/share/native/libjava \
-I$(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libjava \
-I$(JDK_TOPDIR)/src/java.base/share/native/libjimage \
-I$(SUPPORT_OUTPUTDIR)/headers/java.base, \
CFLAGS_unix := -UDEBUG, \
MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjimage/mapfile-vers, \
LDFLAGS := $(LDFLAGS_JDKLIB) \
$(call SET_SHARED_LIBRARY_ORIGIN) \
$(EXPORT_JIMAGE_FUNCS), \
LDFLAGS_windows := -export:JIMAGE_Open -export:JIMAGE_Close \
-export:JIMAGE_PackageToModule \
-export:JIMAGE_FindResource -export:JIMAGE_GetResource \
-export:JIMAGE_ResourceIterator, \
LDFLAGS_SUFFIX_unix := -ljvm -ldl $(LIBCXX), \
LDFLAGS_SUFFIX_linux := , \
LDFLAGS_SUFFIX_solaris := -lc, \
LDFLAGS_SUFFIX_aix := ,\
LDFLAGS_SUFFIX_macosx := -lc++, \
LDFLAGS_SUFFIX_windows := jvm.lib, \
VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \
RC_FLAGS := $(RC_FLAGS) \
-D "JDK_FNAME=jimage.dll" \
-D "JDK_INTERNAL_NAME=jimage" \
-D "JDK_FTYPE=0x2L", \
OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjimage, \
DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
$(BUILD_LIBJIMAGE): $(BUILD_LIBJAVA)
TARGETS += $(BUILD_LIBJIMAGE)
##########################################################################################
LIBJLI_SRC_DIRS := $(call FindSrcDirsForLib, java.base, jli)
LIBJLI_CFLAGS := $(CFLAGS_JDKLIB)

@ -150,7 +150,6 @@ SUNWprivate_1.1 {
Java_java_lang_StrictMath_exp;
Java_java_lang_StrictMath_log;
Java_java_lang_StrictMath_log10;
Java_java_lang_StrictMath_pow;
Java_java_lang_StrictMath_sin;
Java_java_lang_StrictMath_sqrt;
Java_java_lang_StrictMath_cbrt;
@ -240,16 +239,6 @@ SUNWprivate_1.1 {
Java_java_util_TimeZone_getSystemTimeZoneID;
Java_java_util_TimeZone_getSystemGMTOffsetID;
Java_java_util_concurrent_atomic_AtomicLong_VMSupportsCS8;
Java_jdk_internal_jimage_ImageNativeSubstrate_openImage;
Java_jdk_internal_jimage_ImageNativeSubstrate_closeImage;
Java_jdk_internal_jimage_ImageNativeSubstrate_getIndexAddress;
Java_jdk_internal_jimage_ImageNativeSubstrate_getDataAddress;
Java_jdk_internal_jimage_ImageNativeSubstrate_read;
Java_jdk_internal_jimage_ImageNativeSubstrate_readCompressed;
Java_jdk_internal_jimage_ImageNativeSubstrate_getStringBytes;
Java_jdk_internal_jimage_ImageNativeSubstrate_getAttributes;
Java_jdk_internal_jimage_ImageNativeSubstrate_findAttributes;
Java_jdk_internal_jimage_ImageNativeSubstrate_attributeOffsets;
Java_sun_misc_MessageUtils_toStderr;
Java_sun_misc_MessageUtils_toStdout;
Java_sun_misc_NativeSignalHandler_handle0;

@ -0,0 +1,55 @@
#
# Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation. Oracle designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#
# Define public interface.
SUNWprivate_1.1 {
global:
JNI_OnLoad;
Java_jdk_internal_jimage_ImageNativeSubstrate_openImage;
Java_jdk_internal_jimage_ImageNativeSubstrate_closeImage;
Java_jdk_internal_jimage_ImageNativeSubstrate_getIndexAddress;
Java_jdk_internal_jimage_ImageNativeSubstrate_getDataAddress;
Java_jdk_internal_jimage_ImageNativeSubstrate_read;
Java_jdk_internal_jimage_ImageNativeSubstrate_readCompressed;
Java_jdk_internal_jimage_ImageNativeSubstrate_getStringBytes;
Java_jdk_internal_jimage_ImageNativeSubstrate_getAttributes;
Java_jdk_internal_jimage_ImageNativeSubstrate_findAttributes;
Java_jdk_internal_jimage_ImageNativeSubstrate_attributeOffsets;
Java_jdk_internal_jimage_ImageNativeSubstrate_JIMAGE_1Open;
Java_jdk_internal_jimage_ImageNativeSubstrate_JIMAGE_1Close;
Java_jdk_internal_jimage_ImageNativeSubstrate_JIMAGE_1FindResource;
Java_jdk_internal_jimage_ImageNativeSubstrate_JIMAGE_1GetResource;
Java_jdk_internal_jimage_ImageNativeSubstrate_JIMAGE_1PackageToModule;
Java_jdk_internal_jimage_ImageNativeSubstrate_JIMAGE_1Resources;
JIMAGE_Open;
JIMAGE_Close;
JIMAGE_PackageToModule;
JIMAGE_FindResource;
JIMAGE_GetResource;
JIMAGE_ResourceIterator;
local:
*;
};

@ -12,6 +12,7 @@ text: .text%isMetaName: OUTPUTDIR/zip_util.o;
text: .text%addMetaName: OUTPUTDIR/zip_util.o;
text: .text%ZIP_FindEntry;
text: .text%ZIP_GetEntry;
text: .text%ZIP_InflateFully;
text: .text%ZIP_Lock;
text: .text%ZIP_Unlock;
text: .text%ZIP_FreeEntry;

@ -11,6 +11,7 @@ text: .text%isMetaName: OUTPUTDIR/zip_util.o;
text: .text%addMetaName: OUTPUTDIR/zip_util.o;
text: .text%ZIP_FindEntry;
text: .text%ZIP_GetEntry;
text: .text%ZIP_InflateFully;
text: .text%ZIP_Lock;
text: .text%ZIP_Unlock;
text: .text%ZIP_FreeEntry;

@ -12,6 +12,7 @@ text: .text%isMetaName: OUTPUTDIR/zip_util.o;
text: .text%addMetaName: OUTPUTDIR/zip_util.o;
text: .text%ZIP_FindEntry;
text: .text%ZIP_GetEntry;
text: .text%ZIP_InflateFully;
text: .text%ZIP_Lock;
text: .text%ZIP_Unlock;
text: .text%ZIP_FreeEntry;

@ -63,8 +63,8 @@
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<!-- Call rmic-jmx subtargets -->
<target name="-rmic-jmx" depends="-init,-rmic-jmx-jrmp,-rmic-jmx-iiop"
description="Calls -init,-rmic-jmx-jrmp,-rmic-jmx-iiop"
<target name="-rmic-jmx" depends="-init,-rmic-jmx-jrmp"
description="Calls -init,-rmic-jmx-jrmp"
/>
@ -90,44 +90,6 @@
</target>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<!-- Generate RMI IIOP stub class files for remote objects -->
<target name="-rmic-jmx-iiop" depends="-init,-check-jmx-iiop-uptodate" unless="jmx-iiop-uptodate"
description="Generate RMI IIOP stub class files for remote objects. Do not keep generated java files." >
<rmic base="${classes.dir}"
includeAntRuntime="no"
includeJavaRuntime="no"
stubversion="1.2"
iiop="yes"
>
<include name="javax/management/remote/rmi/RMIConnectionImpl.class" />
<include name="javax/management/remote/rmi/RMIServerImpl.class" />
</rmic>
</target>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<!-- Check if jmx rmic generated IIOP stub and tie class files are up to date -->
<target name="-check-jmx-iiop-uptodate" depends="-init">
<uptodate property="jmx-iiop-uptodate"
srcfile="${classes.dir}/javax/management/remote/rmi/RMIConnectionImpl.class"
targetfile="${classes.dir}/org/omg/stub/javax/management/remote/rmi/_RMIConnectionImpl_Tie.class"
/>
<uptodate property="jmx-iiop-uptodate"
srcfile="${classes.dir}/javax/management/remote/rmi/RMIServerImpl.class"
targetfile="${classes.dir}/org/omg/stub/javax/management/remote/rmi/_RMIServerImpl_Tie.class"
/>
<echo message="jmx-iiop-uptodate=${jmx-iiop-uptodate}" />
</target>
<target name="-post-compile" depends="-init,-rmic-jmx"
description="Jar JMX class files (including RMI stubs)" >
<mkdir dir="${dist.dir}/lib"/>

@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@ -32,38 +32,31 @@ include RmicCommon.gmk
# Generate RMI stubs
#
# For RMI/IIOP call rmic a second time with -standardPackage option
# so that *_tie classes are generated in package without the prefix
# org.omg.stub (6375696)
JMX_RMI_CLASSES := javax.management.remote.rmi.RMIConnectionImpl \
javax.management.remote.rmi.RMIServerImpl
GENRMIIIOPCLASSES :=
ifneq ($(RMICONNECTOR_IIOP), false)
GENRMIIIOPCLASSES := $(RMICONNECTOR_IIOP)
endif
$(eval $(call SetupRMICompilation,RMI_IIOP, \
CLASSES := $(JMX_RMI_CLASSES), \
CLASSES_DIR := $(CLASSES_DIR)/java.management, \
STUB_CLASSES_DIR := $(STUB_CLASSES_DIR)/java.management, \
RUN_V12 := true, \
RUN_IIOP := $(GENRMIIIOPCLASSES), \
RUN_IIOP_STDPKG := $(GENRMIIIOPCLASSES)))
# Keep generated RMI/JRMP Stub source files and copy them to RMIC_GENSRC_DIR
# so that javadoc can include them in the API (4997471)
$(eval $(call SetupRMICompilation,RMI_SRC, \
# Generate into gensrc dir where sources get picked up for javadoc, then move the classes
# into the stub classes dir.
$(eval $(call SetupRMICompilation,RMI_GEN, \
CLASSES := $(JMX_RMI_CLASSES), \
CLASSES_DIR := $(CLASSES_DIR)/java.management, \
STUB_CLASSES_DIR := $(RMIC_GENSRC_DIR)/java.management, \
STUB_CLASSES_DIR := $(RMIC_GENSRC_DIR), \
RUN_V12 := true, \
KEEP_GENERATED := true))
KEEP_GENERATED := true, \
))
# Find all classes generated and move them from the gensrc dir to the stub classes dir
$(RMIC_GENSRC_DIR)/_classes.moved: $(RMI_GEN)
$(eval classfiles := $(shell $(FIND) $(RMIC_GENSRC_DIR) -name "*.class"))
$(foreach src, $(classfiles), \
$(eval target := $(patsubst $(RMIC_GENSRC_DIR)/%, \
$(STUB_CLASSES_DIR)/java.management/%, $(src))) \
$(MKDIR) -p $(dir $(target)) ; \
$(MV) $(src) $(target) $(NEWLINE))
$(TOUCH) $@
##########################################################################################
$(RMIC_GENSRC_DIR)/_the.classes.removed: $(RMI_IIOP) $(RMI_SRC)
$(FIND) $(RMIC_GENSRC_DIR) -name "*.class" $(FIND_DELETE)
$(TOUCH) $@
all: $(RMIC_GENSRC_DIR)/_the.classes.removed $(RMI_IIOP) $(RMI_SRC)
all: $(RMIC_GENSRC_DIR)/_classes.moved $(RMI_GEN)
.PHONY: all

@ -42,7 +42,7 @@ import java.io.IOException;
class DefaultInterface {
private final static NetworkInterface defaultInterface =
private static final NetworkInterface defaultInterface =
chooseDefaultInterface();
static NetworkInterface getDefault() {

@ -106,7 +106,7 @@ public class HostLocaleProviderAdapterImpl {
tmpSet.addAll(Control.getNoFallbackControl(Control.FORMAT_DEFAULT).getCandidateLocales("", l));
supportedLocaleSet = Collections.unmodifiableSet(tmpSet);
}
private final static Locale[] supportedLocale = supportedLocaleSet.toArray(new Locale[0]);
private static final Locale[] supportedLocale = supportedLocaleSet.toArray(new Locale[0]);
@SuppressWarnings("fallthrough")
private static Locale convertMacOSXLocaleToJavaLocale(String macosxloc) {

@ -508,7 +508,7 @@ JNF_COCOA_ENTER(env);
SecKeychainRef defaultKeychain = NULL;
SecKeychainCopyDefault(&defaultKeychain);
SecExternalItemType dataType = (isCertificate == JNI_TRUE ? kSecFormatX509Cert : kSecFormatWrappedPKCS8);
SecExternalFormat dataFormat = (isCertificate == JNI_TRUE ? kSecFormatX509Cert : kSecFormatWrappedPKCS8);
// Convert the password obj into a CFStringRef that the keychain importer can use for encryption.
SecKeyImportExportParameters paramBlock;
@ -533,7 +533,7 @@ JNF_COCOA_ENTER(env);
paramBlock.keyUsage = CSSM_KEYUSE_ANY;
paramBlock.keyAttributes = CSSM_KEYATTR_RETURN_DEFAULT;
err = SecKeychainItemImport(cfDataToImport, NULL, &dataType, NULL,
err = SecKeychainItemImport(cfDataToImport, NULL, &dataFormat, NULL,
0, &paramBlock, defaultKeychain, &createdItems);
if (err == noErr) {

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -864,7 +864,9 @@ public final class JceKeyStore extends KeyStoreSpi {
if (computed[i] != actual[i]) {
throw new IOException(
"Keystore was tampered with, or "
+ "password was incorrect");
+ "password was incorrect",
new UnrecoverableKeyException(
"Password verification failed"));
}
}
}

@ -45,7 +45,7 @@ import java.security.InvalidKeyException;
final class RC2Crypt extends SymmetricCipher {
// PITABLE from the RFC, used in key setup
private final static int[] PI_TABLE = new int[] {
private static final int[] PI_TABLE = new int[] {
0xd9, 0x78, 0xf9, 0xc4, 0x19, 0xdd, 0xb5, 0xed,
0x28, 0xe9, 0xfd, 0x79, 0x4a, 0xa0, 0xd8, 0x9d,
0xc6, 0x7e, 0x37, 0x83, 0x2b, 0x76, 0x53, 0x8e,

@ -59,7 +59,7 @@ public final class RC2Parameters extends AlgorithmParametersSpi {
// TABLE[EKB] from section 6 of RFC 2268, used to convert effective key
// size to/from encoded version number
private final static int[] EKB_TABLE = new int[] {
private static final int[] EKB_TABLE = new int[] {
0xbd, 0x56, 0xea, 0xf2, 0xa2, 0xf1, 0xac, 0x2a,
0xb0, 0x93, 0xd1, 0x9c, 0x1b, 0x33, 0xfd, 0xd0,
0x30, 0x04, 0xb6, 0xdc, 0x7d, 0xdf, 0x32, 0x4b,

@ -66,23 +66,23 @@ import sun.security.util.KeyUtil;
public final class RSACipher extends CipherSpi {
// constant for an empty byte array
private final static byte[] B0 = new byte[0];
private static final byte[] B0 = new byte[0];
// mode constant for public key encryption
private final static int MODE_ENCRYPT = 1;
private static final int MODE_ENCRYPT = 1;
// mode constant for private key decryption
private final static int MODE_DECRYPT = 2;
private static final int MODE_DECRYPT = 2;
// mode constant for private key encryption (signing)
private final static int MODE_SIGN = 3;
private static final int MODE_SIGN = 3;
// mode constant for public key decryption (verifying)
private final static int MODE_VERIFY = 4;
private static final int MODE_VERIFY = 4;
// constant for raw RSA
private final static String PAD_NONE = "NoPadding";
private static final String PAD_NONE = "NoPadding";
// constant for PKCS#1 v1.5 RSA
private final static String PAD_PKCS1 = "PKCS1Padding";
private static final String PAD_PKCS1 = "PKCS1Padding";
// constant for PKCS#2 v2.0 OAEP with MGF1
private final static String PAD_OAEP_MGF1 = "OAEP";
private static final String PAD_OAEP_MGF1 = "OAEP";
// current mode, one of MODE_* above. Set when init() is called
private int mode;

@ -43,7 +43,7 @@ import static com.sun.crypto.provider.TlsPrfGenerator.*;
*/
public final class TlsKeyMaterialGenerator extends KeyGeneratorSpi {
private final static String MSG = "TlsKeyMaterialGenerator must be "
private static final String MSG = "TlsKeyMaterialGenerator must be "
+ "initialized using a TlsKeyMaterialParameterSpec";
@SuppressWarnings("deprecation")

@ -43,7 +43,7 @@ import static com.sun.crypto.provider.TlsPrfGenerator.*;
*/
public final class TlsMasterSecretGenerator extends KeyGeneratorSpi {
private final static String MSG = "TlsMasterSecretGenerator must be "
private static final String MSG = "TlsMasterSecretGenerator must be "
+ "initialized using a TlsMasterSecretParameterSpec";
@SuppressWarnings("deprecation")

@ -50,23 +50,23 @@ abstract class TlsPrfGenerator extends KeyGeneratorSpi {
// magic constants and utility functions, also used by other files
// in this package
private final static byte[] B0 = new byte[0];
private static final byte[] B0 = new byte[0];
final static byte[] LABEL_MASTER_SECRET = // "master secret"
static final byte[] LABEL_MASTER_SECRET = // "master secret"
{ 109, 97, 115, 116, 101, 114, 32, 115, 101, 99, 114, 101, 116 };
final static byte[] LABEL_KEY_EXPANSION = // "key expansion"
static final byte[] LABEL_KEY_EXPANSION = // "key expansion"
{ 107, 101, 121, 32, 101, 120, 112, 97, 110, 115, 105, 111, 110 };
final static byte[] LABEL_CLIENT_WRITE_KEY = // "client write key"
static final byte[] LABEL_CLIENT_WRITE_KEY = // "client write key"
{ 99, 108, 105, 101, 110, 116, 32, 119, 114, 105, 116, 101, 32,
107, 101, 121 };
final static byte[] LABEL_SERVER_WRITE_KEY = // "server write key"
static final byte[] LABEL_SERVER_WRITE_KEY = // "server write key"
{ 115, 101, 114, 118, 101, 114, 32, 119, 114, 105, 116, 101, 32,
107, 101, 121 };
final static byte[] LABEL_IV_BLOCK = // "IV block"
static final byte[] LABEL_IV_BLOCK = // "IV block"
{ 73, 86, 32, 98, 108, 111, 99, 107 };
/*
@ -79,7 +79,7 @@ abstract class TlsPrfGenerator extends KeyGeneratorSpi {
private static final byte[] HMAC_opad128 = genPad((byte)0x5c, 128);
// SSL3 magic mix constants ("A", "BB", "CCC", ...)
final static byte[][] SSL3_CONST = genConst();
static final byte[][] SSL3_CONST = genConst();
static byte[] genPad(byte b, int count) {
byte[] padding = new byte[count];
@ -109,7 +109,7 @@ abstract class TlsPrfGenerator extends KeyGeneratorSpi {
// PRF implementation
private final static String MSG = "TlsPrfGenerator must be "
private static final String MSG = "TlsPrfGenerator must be "
+ "initialized using a TlsPrfParameterSpec";
@SuppressWarnings("deprecation")
@ -368,7 +368,7 @@ abstract class TlsPrfGenerator extends KeyGeneratorSpi {
* appropriate supportsParamters() checks into KeyGenerators (not
* currently there).
*/
static public class V12 extends TlsPrfGenerator {
public static class V12 extends TlsPrfGenerator {
protected SecretKey engineGenerateKey() {
return engineGenerateKey0(true);
}
@ -377,7 +377,7 @@ abstract class TlsPrfGenerator extends KeyGeneratorSpi {
/**
* A KeyGenerator implementation that supports TLS 1.0/1.1.
*/
static public class V10 extends TlsPrfGenerator {
public static class V10 extends TlsPrfGenerator {
protected SecretKey engineGenerateKey() {
return engineGenerateKey0(false);
}

@ -41,7 +41,7 @@ import sun.security.internal.spec.TlsRsaPremasterSecretParameterSpec;
*/
public final class TlsRsaPremasterSecretGenerator extends KeyGeneratorSpi {
private final static String MSG = "TlsRsaPremasterSecretGenerator must be "
private static final String MSG = "TlsRsaPremasterSecretGenerator must be "
+ "initialized using a TlsRsaPremasterSecretParameterSpec";
@SuppressWarnings("deprecation")

@ -342,7 +342,7 @@ class Attribute implements Comparable<Attribute> {
* presence of attributes. That is, flags are a mix of modifier
* bits and attribute indicators.
*/
public static abstract
public abstract static
class Holder {
// We need this abstract method to interpret embedded CP refs.
@ -461,7 +461,7 @@ class Attribute implements Comparable<Attribute> {
// Lightweight interface to hide details of band structure.
// Also used for testing.
public static abstract
public abstract static
class ValueStream {
public int getInt(int bandIndex) { throw undef(); }
public void putInt(int bandIndex, int value) { throw undef(); }
@ -667,7 +667,7 @@ class Attribute implements Comparable<Attribute> {
public boolean hasCallables() {
return (elems.length > 0 && elems[0].kind == EK_CBLE);
}
static private final Element[] noElems = {};
private static final Element[] noElems = {};
public Element[] getCallables() {
if (hasCallables()) {
Element[] nelems = Arrays.copyOf(elems, elems.length);
@ -783,7 +783,7 @@ class Attribute implements Comparable<Attribute> {
* Replaces '\c' by the decimal code of the character c.
* Replaces '0xNNN' by the decimal code of the hex number NNN.
*/
static public
public static
String normalizeLayoutString(String layout) {
StringBuilder buf = new StringBuilder();
for (int i = 0, len = layout.length(); i < len; ) {
@ -1139,7 +1139,7 @@ class Attribute implements Comparable<Attribute> {
bodies.toArray(res);
return res;
}
static private
private static
int skipBody(String layout, int i) {
assert(layout.charAt(i-1) == '[');
if (layout.charAt(i) == ']')
@ -1156,7 +1156,7 @@ class Attribute implements Comparable<Attribute> {
assert(layout.charAt(i) == ']');
return i; // return closing bracket
}
static private
private static
int tokenizeUInt(Layout.Element e, String layout, int i) {
switch (layout.charAt(i++)) {
case 'V': e.len = 0; break;
@ -1167,7 +1167,7 @@ class Attribute implements Comparable<Attribute> {
}
return i;
}
static private
private static
int tokenizeSInt(Layout.Element e, String layout, int i) {
if (layout.charAt(i) == 'S') {
e.flags |= EF_SIGN;
@ -1176,7 +1176,7 @@ class Attribute implements Comparable<Attribute> {
return tokenizeUInt(e, layout, i);
}
static private
private static
boolean isDigit(char c) {
return c >= '0' && c <= '9';
}
@ -1383,7 +1383,7 @@ class Attribute implements Comparable<Attribute> {
return e.body[lastj];
}
static private
private static
int parseInt(Layout.Element e, byte[] bytes, int pos, int[] buf) {
int value = 0;
int loBits = e.len * 8;
@ -1483,7 +1483,7 @@ class Attribute implements Comparable<Attribute> {
}
}
static private
private static
void unparseInt(Layout.Element e, int value, ByteArrayOutputStream out) {
int loBits = e.len * 8;
if (loBits == 0) {

@ -73,7 +73,7 @@ class BandStructure {
boolean optVaryCodings = !p200.getBoolean(Utils.COM_PREFIX+"no.vary.codings");
boolean optBigStrings = !p200.getBoolean(Utils.COM_PREFIX+"no.big.strings");
abstract protected Index getCPIndex(byte tag);
protected abstract Index getCPIndex(byte tag);
// Local copy of highest class version.
private Package.Version highestClassVersion = null;
@ -97,27 +97,27 @@ class BandStructure {
protected BandStructure() {}
final static Coding BYTE1 = Coding.of(1,256);
static final Coding BYTE1 = Coding.of(1,256);
final static Coding CHAR3 = Coding.of(3,128);
static final Coding CHAR3 = Coding.of(3,128);
// Note: Tried sharper (3,16) with no post-zip benefit.
// This is best used with BCI values:
final static Coding BCI5 = Coding.of(5,4); // mostly 1-byte offsets
final static Coding BRANCH5 = Coding.of(5,4,2); // mostly forward branches
static final Coding BCI5 = Coding.of(5,4); // mostly 1-byte offsets
static final Coding BRANCH5 = Coding.of(5,4,2); // mostly forward branches
final static Coding UNSIGNED5 = Coding.of(5,64);
final static Coding UDELTA5 = UNSIGNED5.getDeltaCoding();
static final Coding UNSIGNED5 = Coding.of(5,64);
static final Coding UDELTA5 = UNSIGNED5.getDeltaCoding();
// "sharp" (5,64) zips 0.4% better than "medium" (5,128)
// It zips 1.1% better than "flat" (5,192)
final static Coding SIGNED5 = Coding.of(5,64,1); //sharp
final static Coding DELTA5 = SIGNED5.getDeltaCoding();
static final Coding SIGNED5 = Coding.of(5,64,1); //sharp
static final Coding DELTA5 = SIGNED5.getDeltaCoding();
// Note: Tried (5,128,2) and (5,192,2) with no benefit.
final static Coding MDELTA5 = Coding.of(5,64,2).getDeltaCoding();
static final Coding MDELTA5 = Coding.of(5,64,2).getDeltaCoding();
final private static Coding[] basicCodings = {
private static final Coding[] basicCodings = {
// Table of "Canonical BHSD Codings" from Pack200 spec.
null, // _meta_default
@ -250,7 +250,7 @@ class BandStructure {
null
};
final private static Map<Coding, Integer> basicCodingIndexes;
private static final Map<Coding, Integer> basicCodingIndexes;
static {
assert(basicCodings[_meta_default] == null);
assert(basicCodings[_meta_canon_min] != null);
@ -362,9 +362,9 @@ class BandStructure {
protected long outputSize = -1; // cache
final public Coding regularCoding;
public final Coding regularCoding;
final public int seqForDebug;
public final int seqForDebug;
public int elementCountForDebug;
@ -430,7 +430,7 @@ class BandStructure {
protected abstract long computeOutputSize();
abstract protected void writeDataTo(OutputStream out) throws IOException;
protected abstract void writeDataTo(OutputStream out) throws IOException;
/** Expect a certain number of values. */
void expectLength(int l) {
@ -468,7 +468,7 @@ class BandStructure {
readDataFrom(in);
readyToDisburse();
}
abstract protected void readDataFrom(InputStream in) throws IOException;
protected abstract void readDataFrom(InputStream in) throws IOException;
protected void readyToDisburse() {
if (verbose > 1) Utils.log.fine("readyToDisburse "+this);
setPhase(DISBURSE_PHASE);
@ -1447,7 +1447,7 @@ class BandStructure {
return b;
}
static private final boolean NULL_IS_OK = true;
private static final boolean NULL_IS_OK = true;
MultiBand all_bands = (MultiBand) new MultiBand("(package)", UNSIGNED5).init();
@ -2539,7 +2539,7 @@ class BandStructure {
return false;
}
static private boolean assertDoneDisbursing(Band b) {
private static boolean assertDoneDisbursing(Band b) {
if (b.phase != DISBURSE_PHASE) {
Utils.log.warning("assertDoneDisbursing: still in phase "+b.phase+": "+b);
if (verbose() <= 1) return false; // fail now
@ -2562,7 +2562,7 @@ class BandStructure {
return true;
}
static private void printCDecl(Band b) {
private static void printCDecl(Band b) {
if (b instanceof MultiBand) {
MultiBand mb = (MultiBand) b;
for (int i = 0; i < mb.bandCount; i++) {

@ -56,7 +56,7 @@ class Code extends Attribute.Holder {
return m.getCPMap();
}
static private final ConstantPool.Entry[] noRefs = ConstantPool.noRefs;
private static final ConstantPool.Entry[] noRefs = ConstantPool.noRefs;
// The following fields are used directly by the ClassReader, etc.
int max_stack;

@ -662,7 +662,7 @@ class Coding implements Comparable<Coding>, CodingMethod, Histogram.BitMetric {
return lg;
}
static private final byte[] byteBitWidths = new byte[0x100];
private static final byte[] byteBitWidths = new byte[0x100];
static {
for (int b = 0; b < byteBitWidths.length; b++) {
byteBitWidths[b] = (byte) ceil_lg2(b + 1);

@ -1139,7 +1139,7 @@ class CodingChooser {
}
}
static private
private static
String pct(double num, double den) {
return (Math.round((num / den)*10000)/100.0)+"%";
}

@ -194,7 +194,7 @@ class ConstantPool {
/** Entries in the constant pool. */
public static abstract
public abstract static
class Entry implements Comparable<Object> {
protected final byte tag; // a CONSTANT_foo code
protected int valueHash; // cached hashCode
@ -338,7 +338,7 @@ class ConstantPool {
return (REF_getField <= refKind && refKind <= REF_invokeInterface);
}
public static abstract
public abstract static
class LiteralEntry extends Entry {
protected LiteralEntry(byte tag) {
super(tag);
@ -785,7 +785,7 @@ class ConstantPool {
return new String(sig);
}
static private int skipTo(char semi, String sig, int i) {
private static int skipTo(char semi, String sig, int i) {
i = sig.indexOf(semi, i);
return (i >= 0) ? i : sig.length();
}

@ -36,7 +36,7 @@ class Constants {
private Constants(){}
public final static int JAVA_MAGIC = 0xCAFEBABE;
public static final int JAVA_MAGIC = 0xCAFEBABE;
/*
Java Class Version numbers history
@ -48,93 +48,93 @@ class Constants {
1.8 to 1.7.x 52,0
*/
public final static Package.Version JAVA_MIN_CLASS_VERSION =
public static final Package.Version JAVA_MIN_CLASS_VERSION =
Package.Version.of(45, 03);
public final static Package.Version JAVA5_MAX_CLASS_VERSION =
public static final Package.Version JAVA5_MAX_CLASS_VERSION =
Package.Version.of(49, 00);
public final static Package.Version JAVA6_MAX_CLASS_VERSION =
public static final Package.Version JAVA6_MAX_CLASS_VERSION =
Package.Version.of(50, 00);
public final static Package.Version JAVA7_MAX_CLASS_VERSION =
public static final Package.Version JAVA7_MAX_CLASS_VERSION =
Package.Version.of(51, 00);
public final static Package.Version JAVA8_MAX_CLASS_VERSION =
public static final Package.Version JAVA8_MAX_CLASS_VERSION =
Package.Version.of(52, 00);
public final static int JAVA_PACKAGE_MAGIC = 0xCAFED00D;
public static final int JAVA_PACKAGE_MAGIC = 0xCAFED00D;
public final static Package.Version JAVA5_PACKAGE_VERSION =
public static final Package.Version JAVA5_PACKAGE_VERSION =
Package.Version.of(150, 7);
public final static Package.Version JAVA6_PACKAGE_VERSION =
public static final Package.Version JAVA6_PACKAGE_VERSION =
Package.Version.of(160, 1);
public final static Package.Version JAVA7_PACKAGE_VERSION =
public static final Package.Version JAVA7_PACKAGE_VERSION =
Package.Version.of(170, 1);
public final static Package.Version JAVA8_PACKAGE_VERSION =
public static final Package.Version JAVA8_PACKAGE_VERSION =
Package.Version.of(171, 0);
// upper limit, should point to the latest class version
public final static Package.Version JAVA_MAX_CLASS_VERSION =
public static final Package.Version JAVA_MAX_CLASS_VERSION =
JAVA8_MAX_CLASS_VERSION;
// upper limit should point to the latest package version, for version info!.
public final static Package.Version MAX_PACKAGE_VERSION =
public static final Package.Version MAX_PACKAGE_VERSION =
JAVA7_PACKAGE_VERSION;
public final static int CONSTANT_POOL_INDEX_LIMIT = 0x10000;
public final static int CONSTANT_POOL_NARROW_LIMIT = 0x00100;
public static final int CONSTANT_POOL_INDEX_LIMIT = 0x10000;
public static final int CONSTANT_POOL_NARROW_LIMIT = 0x00100;
public final static String JAVA_SIGNATURE_CHARS = "BSCIJFDZLV([";
public static final String JAVA_SIGNATURE_CHARS = "BSCIJFDZLV([";
public final static byte CONSTANT_Utf8 = 1;
public final static byte CONSTANT_unused2 = 2; // unused, was Unicode
public final static byte CONSTANT_Integer = 3;
public final static byte CONSTANT_Float = 4;
public final static byte CONSTANT_Long = 5;
public final static byte CONSTANT_Double = 6;
public final static byte CONSTANT_Class = 7;
public final static byte CONSTANT_String = 8;
public final static byte CONSTANT_Fieldref = 9;
public final static byte CONSTANT_Methodref = 10;
public final static byte CONSTANT_InterfaceMethodref = 11;
public final static byte CONSTANT_NameandType = 12;
public final static byte CONSTANT_unused13 = 13;
public final static byte CONSTANT_unused14 = 14;
public final static byte CONSTANT_MethodHandle = 15;
public final static byte CONSTANT_MethodType = 16;
public final static byte CONSTANT_unused17 = 17; // unused
public final static byte CONSTANT_InvokeDynamic = 18;
public static final byte CONSTANT_Utf8 = 1;
public static final byte CONSTANT_unused2 = 2; // unused, was Unicode
public static final byte CONSTANT_Integer = 3;
public static final byte CONSTANT_Float = 4;
public static final byte CONSTANT_Long = 5;
public static final byte CONSTANT_Double = 6;
public static final byte CONSTANT_Class = 7;
public static final byte CONSTANT_String = 8;
public static final byte CONSTANT_Fieldref = 9;
public static final byte CONSTANT_Methodref = 10;
public static final byte CONSTANT_InterfaceMethodref = 11;
public static final byte CONSTANT_NameandType = 12;
public static final byte CONSTANT_unused13 = 13;
public static final byte CONSTANT_unused14 = 14;
public static final byte CONSTANT_MethodHandle = 15;
public static final byte CONSTANT_MethodType = 16;
public static final byte CONSTANT_unused17 = 17; // unused
public static final byte CONSTANT_InvokeDynamic = 18;
// pseudo-constants:
public final static byte CONSTANT_None = 0;
public final static byte CONSTANT_Signature = CONSTANT_unused13;
public final static byte CONSTANT_BootstrapMethod = CONSTANT_unused17; // used only in InvokeDynamic constants
public final static byte CONSTANT_Limit = 19;
public static final byte CONSTANT_None = 0;
public static final byte CONSTANT_Signature = CONSTANT_unused13;
public static final byte CONSTANT_BootstrapMethod = CONSTANT_unused17; // used only in InvokeDynamic constants
public static final byte CONSTANT_Limit = 19;
public final static byte CONSTANT_All = 50; // combined global map
public final static byte CONSTANT_LoadableValue = 51; // used for 'KL' and qldc operands
public final static byte CONSTANT_AnyMember = 52; // union of refs to field or (interface) method
public final static byte CONSTANT_FieldSpecific = 53; // used only for 'KQ' ConstantValue attrs
public final static byte CONSTANT_GroupFirst = CONSTANT_All;
public final static byte CONSTANT_GroupLimit = CONSTANT_FieldSpecific+1;
public static final byte CONSTANT_All = 50; // combined global map
public static final byte CONSTANT_LoadableValue = 51; // used for 'KL' and qldc operands
public static final byte CONSTANT_AnyMember = 52; // union of refs to field or (interface) method
public static final byte CONSTANT_FieldSpecific = 53; // used only for 'KQ' ConstantValue attrs
public static final byte CONSTANT_GroupFirst = CONSTANT_All;
public static final byte CONSTANT_GroupLimit = CONSTANT_FieldSpecific+1;
// CONSTANT_MethodHandle reference kinds
public final static byte REF_getField = 1;
public final static byte REF_getStatic = 2;
public final static byte REF_putField = 3;
public final static byte REF_putStatic = 4;
public final static byte REF_invokeVirtual = 5;
public final static byte REF_invokeStatic = 6;
public final static byte REF_invokeSpecial = 7;
public final static byte REF_newInvokeSpecial = 8;
public final static byte REF_invokeInterface = 9;
public static final byte REF_getField = 1;
public static final byte REF_getStatic = 2;
public static final byte REF_putField = 3;
public static final byte REF_putStatic = 4;
public static final byte REF_invokeVirtual = 5;
public static final byte REF_invokeStatic = 6;
public static final byte REF_invokeSpecial = 7;
public static final byte REF_newInvokeSpecial = 8;
public static final byte REF_invokeInterface = 9;
// pseudo-access bits
public final static int ACC_IC_LONG_FORM = (1<<16); //for ic_flags
public static final int ACC_IC_LONG_FORM = (1<<16); //for ic_flags
// attribute "context types"
public static final int ATTR_CONTEXT_CLASS = 0;
@ -199,14 +199,14 @@ class Constants {
public static final int NO_MODTIME = 0; // null modtime value
// some comstantly empty containers
public final static int[] noInts = {};
public final static byte[] noBytes = {};
public final static Object[] noValues = {};
public final static String[] noStrings = {};
public final static List<Object> emptyList = Arrays.asList(noValues);
public static final int[] noInts = {};
public static final byte[] noBytes = {};
public static final Object[] noValues = {};
public static final String[] noStrings = {};
public static final List<Object> emptyList = Arrays.asList(noValues);
// meta-coding
public final static int
public static final int
_meta_default = 0,
_meta_canon_min = 1,
_meta_canon_max = 115,
@ -216,7 +216,7 @@ class Constants {
_meta_limit = 189;
// bytecodes
public final static int
public static final int
_nop = 0, // 0x00
_aconst_null = 1, // 0x01
_iconst_m1 = 2, // 0x02
@ -422,10 +422,10 @@ class Constants {
_bytecode_limit = 202; // 0xca
// End marker, used to terminate bytecode sequences:
public final static int _end_marker = 255;
public static final int _end_marker = 255;
// Escapes:
public final static int _byte_escape = 254;
public final static int _ref_escape = 253;
public static final int _byte_escape = 254;
public static final int _ref_escape = 253;
// Self-relative pseudo-opcodes for better compression.
// A "linker op" is a bytecode which links to a class member.
@ -440,26 +440,26 @@ class Constants {
// For simplicity, we define the full symmetric set of variants.
// However, some of them are relatively useless.
// Self linker ops are enabled by Pack.selfCallVariants (true).
public final static int _first_linker_op = _getstatic;
public final static int _last_linker_op = _invokestatic;
public final static int _num_linker_ops = (_last_linker_op - _first_linker_op) + 1;
public final static int _self_linker_op = _bytecode_limit;
public final static int _self_linker_aload_flag = 1*_num_linker_ops;
public final static int _self_linker_super_flag = 2*_num_linker_ops;
public final static int _self_linker_limit = _self_linker_op + 4*_num_linker_ops;
public static final int _first_linker_op = _getstatic;
public static final int _last_linker_op = _invokestatic;
public static final int _num_linker_ops = (_last_linker_op - _first_linker_op) + 1;
public static final int _self_linker_op = _bytecode_limit;
public static final int _self_linker_aload_flag = 1*_num_linker_ops;
public static final int _self_linker_super_flag = 2*_num_linker_ops;
public static final int _self_linker_limit = _self_linker_op + 4*_num_linker_ops;
// An "invoke init" op is a variant of invokespecial which works
// only with the method name "<init>". There are variants which
// link to the current class, the super class, or the class of the
// immediately previous "newinstance" op. There are 3 of these ops.
// They all take method signature references as operands.
// Invoke init ops are enabled by Pack.initCallVariants (true).
public final static int _invokeinit_op = _self_linker_limit;
public final static int _invokeinit_self_option = 0;
public final static int _invokeinit_super_option = 1;
public final static int _invokeinit_new_option = 2;
public final static int _invokeinit_limit = _invokeinit_op+3;
public static final int _invokeinit_op = _self_linker_limit;
public static final int _invokeinit_self_option = 0;
public static final int _invokeinit_super_option = 1;
public static final int _invokeinit_new_option = 2;
public static final int _invokeinit_limit = _invokeinit_op+3;
public final static int _pseudo_instruction_limit = _invokeinit_limit;
public static final int _pseudo_instruction_limit = _invokeinit_limit;
// linker variant limit == 202+(7*4)+3 == 233
// Ldc variants support strongly typed references to constants.
@ -467,25 +467,25 @@ class Constants {
// which is a great simplification.
// Ldc variants gain us only 0.007% improvement in compression ratio,
// but they simplify the file format greatly.
public final static int _xldc_op = _invokeinit_limit;
public final static int _sldc = _ldc; // previously named _aldc
public final static int _cldc = _xldc_op+0;
public final static int _ildc = _xldc_op+1;
public final static int _fldc = _xldc_op+2;
public final static int _sldc_w = _ldc_w; // previously named _aldc_w
public final static int _cldc_w = _xldc_op+3;
public final static int _ildc_w = _xldc_op+4;
public final static int _fldc_w = _xldc_op+5;
public final static int _lldc2_w = _ldc2_w;
public final static int _dldc2_w = _xldc_op+6;
public static final int _xldc_op = _invokeinit_limit;
public static final int _sldc = _ldc; // previously named _aldc
public static final int _cldc = _xldc_op+0;
public static final int _ildc = _xldc_op+1;
public static final int _fldc = _xldc_op+2;
public static final int _sldc_w = _ldc_w; // previously named _aldc_w
public static final int _cldc_w = _xldc_op+3;
public static final int _ildc_w = _xldc_op+4;
public static final int _fldc_w = _xldc_op+5;
public static final int _lldc2_w = _ldc2_w;
public static final int _dldc2_w = _xldc_op+6;
// anything other than primitive, string, or class must be handled with qldc:
public final static int _qldc = _xldc_op+7;
public final static int _qldc_w = _xldc_op+8;
public final static int _xldc_limit = _xldc_op+9;
public static final int _qldc = _xldc_op+7;
public static final int _qldc_w = _xldc_op+8;
public static final int _xldc_limit = _xldc_op+9;
// handling of InterfaceMethodRef
public final static int _invoke_int_op = _xldc_limit;
public final static int _invokespecial_int = _invoke_int_op+0;
public final static int _invokestatic_int = _invoke_int_op+1;
public final static int _invoke_int_limit = _invoke_int_op+2;
public static final int _invoke_int_op = _xldc_limit;
public static final int _invokespecial_int = _invoke_int_op+0;
public static final int _invokestatic_int = _invoke_int_op+1;
public static final int _invoke_int_limit = _invoke_int_op+2;
}

@ -376,7 +376,7 @@ class Driver {
}
}
static private
private static
File createTempFile(String basefile, String suffix) throws IOException {
File base = new File(basefile);
String prefix = base.getName();
@ -393,7 +393,7 @@ class Driver {
return tmpfile.toFile();
}
static private
private static
void printUsage(boolean doPack, boolean full, PrintStream out) {
String prog = doPack ? "pack200" : "unpack200";
String[] packUsage = (String[])RESOURCE.getObject(DriverResource.PACK_HELP);
@ -408,7 +408,7 @@ class Driver {
}
}
static private
private static
String getZipComment(String jarfile) throws IOException {
byte[] tail = new byte[1000];
long filelen = new File(jarfile).length();

@ -218,7 +218,7 @@ final class Histogram {
return sum;
}
static private
private static
double round(double x, double scale) {
return Math.round(x * scale) / scale;
}

@ -471,14 +471,14 @@ class Instruction {
/// Format definitions.
static private final byte[][] BC_LENGTH = new byte[2][0x100];
static private final byte[][] BC_INDEX = new byte[2][0x100];
static private final byte[][] BC_TAG = new byte[2][0x100];
static private final byte[][] BC_BRANCH = new byte[2][0x100];
static private final byte[][] BC_SLOT = new byte[2][0x100];
static private final byte[][] BC_CON = new byte[2][0x100];
static private final String[] BC_NAME = new String[0x100]; // debug only
static private final String[][] BC_FORMAT = new String[2][_bytecode_limit]; // debug only
private static final byte[][] BC_LENGTH = new byte[2][0x100];
private static final byte[][] BC_INDEX = new byte[2][0x100];
private static final byte[][] BC_TAG = new byte[2][0x100];
private static final byte[][] BC_BRANCH = new byte[2][0x100];
private static final byte[][] BC_SLOT = new byte[2][0x100];
private static final byte[][] BC_CON = new byte[2][0x100];
private static final String[] BC_NAME = new String[0x100]; // debug only
private static final String[][] BC_FORMAT = new String[2][_bytecode_limit]; // debug only
static {
for (int i = 0; i < _bytecode_limit; i++) {
BC_LENGTH[0][i] = -1;

@ -104,7 +104,7 @@ class NativeUnpack {
}
// for JNI callbacks
static private Object currentInstance() {
private static Object currentInstance() {
UnpackerImpl p200 = (UnpackerImpl) Utils.getTLGlobals();
return (p200 == null)? null: p200._nunp;
}

@ -990,7 +990,7 @@ class Package {
}
// Helper for building InnerClasses attributes.
static private
private static
void visitInnerClassRefs(Collection<InnerClass> innerClasses, int mode, Collection<Entry> refs) {
if (innerClasses == null) {
return; // no attribute; nothing to do

@ -218,7 +218,7 @@ class PackageReader extends BandStructure {
return res;
}
final static int MAGIC_BYTES = 4;
static final int MAGIC_BYTES = 4;
void readArchiveMagic() throws IOException {
// Read a minimum of bytes in the first gulp.

@ -265,7 +265,7 @@ class Utils {
}
}
// Wrapper to prevent closing of client-supplied stream.
static private
private static
class NonCloser extends FilterOutputStream {
NonCloser(OutputStream out) { super(out); }
public void close() throws IOException { flush(); }

@ -46,7 +46,7 @@ import javax.net.ssl.SSLPeerUnverifiedException;
* replaced by {@link javax.net.ssl.HttpsURLConnection}.
*/
@Deprecated
abstract public
public abstract
class HttpsURLConnection extends HttpURLConnection
{
/*

@ -61,7 +61,7 @@ public class KeyManagerFactory {
*
* @see java.security.Security security properties
*/
public final static String getDefaultAlgorithm() {
public static final String getDefaultAlgorithm() {
String type;
type = AccessController.doPrivileged(new PrivilegedAction<>() {
public String run() {

@ -61,7 +61,7 @@ public class TrustManagerFactory {
*
* @see java.security.Security security properties
*/
public final static String getDefaultAlgorithm() {
public static final String getDefaultAlgorithm() {
String type;
type = AccessController.doPrivileged(new PrivilegedAction<>() {
public String run() {

@ -56,7 +56,7 @@ public class X509V1CertImpl extends X509Certificate implements Serializable {
static final long serialVersionUID = -2048442350420423405L;
private java.security.cert.X509Certificate wrappedCert;
synchronized private static java.security.cert.CertificateFactory
private static synchronized java.security.cert.CertificateFactory
getFactory()
throws java.security.cert.CertificateException
{

@ -43,8 +43,8 @@ import java.util.Locale;
* </pre>
*/
public final class Client extends NTLM {
final private String hostname;
final private String username;
private final String hostname;
private final String username;
private String domain;
private byte[] pw1, pw2;

@ -36,13 +36,13 @@ public final class NTLMException extends GeneralSecurityException {
/**
* If the incoming packet is invalid.
*/
public final static int PACKET_READ_ERROR = 1;
public static final int PACKET_READ_ERROR = 1;
/**
* If the client cannot get a domain value from the server and the
* caller has not provided one.
*/
public final static int NO_DOMAIN_INFO = 2;
public static final int NO_DOMAIN_INFO = 2;
/**
* If the domain provided by the client does not match the one received
@ -53,22 +53,22 @@ public final class NTLMException extends GeneralSecurityException {
/**
* If the client name is not found on server's user database.
*/
public final static int USER_UNKNOWN = 3;
public static final int USER_UNKNOWN = 3;
/**
* If authentication fails.
*/
public final static int AUTH_FAILED = 4;
public static final int AUTH_FAILED = 4;
/**
* If an illegal version string is provided.
*/
public final static int BAD_VERSION = 5;
public static final int BAD_VERSION = 5;
/**
* Protocol errors.
*/
public final static int PROTOCOL = 6;
public static final int PROTOCOL = 6;
private int errorCode;

@ -49,8 +49,8 @@ import java.util.Locale;
* </pre>
*/
public abstract class Server extends NTLM {
final private String domain;
final private boolean allVersion;
private final String domain;
private final boolean allVersion;
/**
* Creates a Server instance.
* @param version the NTLM version to use, which can be:

@ -554,7 +554,7 @@ public final class Console implements Flushable
});
}
private static Console cons;
private native static boolean istty();
private static native boolean istty();
private Console() {
readLock = new Object();
writeLock = new Object();

@ -585,7 +585,7 @@ loop: while (true) {
* valid modified UTF-8 encoding of a Unicode string.
* @see java.io.DataInputStream#readUnsignedShort()
*/
public final static String readUTF(DataInput in) throws IOException {
public static final String readUTF(DataInput in) throws IOException {
int utflen = in.readUnsignedShort();
byte[] bytearr = null;
char[] chararr = null;

@ -2204,7 +2204,7 @@ public class File
// -- Integration with java.nio.file --
private volatile transient Path filePath;
private transient volatile Path filePath;
/**
* Returns a {@link Path java.nio.file.Path} object constructed from the

@ -101,32 +101,32 @@ public final class FilePermission extends Permission implements Serializable {
/**
* Execute action.
*/
private final static int EXECUTE = 0x1;
private static final int EXECUTE = 0x1;
/**
* Write action.
*/
private final static int WRITE = 0x2;
private static final int WRITE = 0x2;
/**
* Read action.
*/
private final static int READ = 0x4;
private static final int READ = 0x4;
/**
* Delete action.
*/
private final static int DELETE = 0x8;
private static final int DELETE = 0x8;
/**
* Read link action.
*/
private final static int READLINK = 0x10;
private static final int READLINK = 0x10;
/**
* All actions (read,write,execute,delete,readlink)
*/
private final static int ALL = READ|WRITE|EXECUTE|DELETE|READLINK;
private static final int ALL = READ|WRITE|EXECUTE|DELETE|READLINK;
/**
* No actions.
*/
private final static int NONE = 0x0;
private static final int NONE = 0x0;
// the actions mask
private transient int mask;

@ -1079,7 +1079,7 @@ public class ObjectInputStream
/**
* Provide access to the persistent fields read from the input stream.
*/
public static abstract class GetField {
public abstract static class GetField {
/**
* Get the ObjectStreamClass that describes the fields in the stream.

@ -875,7 +875,7 @@ public class ObjectOutputStream
*
* @since 1.2
*/
public static abstract class PutField {
public abstract static class PutField {
/**
* Put the value of the named boolean field into the persistent field.

@ -1839,7 +1839,7 @@ public class ObjectStreamClass implements Serializable {
* Returns true if the given class defines a static initializer method,
* false otherwise.
*/
private native static boolean hasStaticInitializer(Class<?> cl);
private static native boolean hasStaticInitializer(Class<?> cl);
/**
* Class for computing and caching field/constructor/method signatures

@ -36,12 +36,12 @@ public interface ObjectStreamConstants {
/**
* Magic number that is written to the stream header.
*/
final static short STREAM_MAGIC = (short)0xaced;
static final short STREAM_MAGIC = (short)0xaced;
/**
* Version number that is written to the stream header.
*/
final static short STREAM_VERSION = 5;
static final short STREAM_VERSION = 5;
/* Each item in the stream is preceded by a tag
*/
@ -49,95 +49,95 @@ public interface ObjectStreamConstants {
/**
* First tag value.
*/
final static byte TC_BASE = 0x70;
static final byte TC_BASE = 0x70;
/**
* Null object reference.
*/
final static byte TC_NULL = (byte)0x70;
static final byte TC_NULL = (byte)0x70;
/**
* Reference to an object already written into the stream.
*/
final static byte TC_REFERENCE = (byte)0x71;
static final byte TC_REFERENCE = (byte)0x71;
/**
* new Class Descriptor.
*/
final static byte TC_CLASSDESC = (byte)0x72;
static final byte TC_CLASSDESC = (byte)0x72;
/**
* new Object.
*/
final static byte TC_OBJECT = (byte)0x73;
static final byte TC_OBJECT = (byte)0x73;
/**
* new String.
*/
final static byte TC_STRING = (byte)0x74;
static final byte TC_STRING = (byte)0x74;
/**
* new Array.
*/
final static byte TC_ARRAY = (byte)0x75;
static final byte TC_ARRAY = (byte)0x75;
/**
* Reference to Class.
*/
final static byte TC_CLASS = (byte)0x76;
static final byte TC_CLASS = (byte)0x76;
/**
* Block of optional data. Byte following tag indicates number
* of bytes in this block data.
*/
final static byte TC_BLOCKDATA = (byte)0x77;
static final byte TC_BLOCKDATA = (byte)0x77;
/**
* End of optional block data blocks for an object.
*/
final static byte TC_ENDBLOCKDATA = (byte)0x78;
static final byte TC_ENDBLOCKDATA = (byte)0x78;
/**
* Reset stream context. All handles written into stream are reset.
*/
final static byte TC_RESET = (byte)0x79;
static final byte TC_RESET = (byte)0x79;
/**
* long Block data. The long following the tag indicates the
* number of bytes in this block data.
*/
final static byte TC_BLOCKDATALONG= (byte)0x7A;
static final byte TC_BLOCKDATALONG= (byte)0x7A;
/**
* Exception during write.
*/
final static byte TC_EXCEPTION = (byte)0x7B;
static final byte TC_EXCEPTION = (byte)0x7B;
/**
* Long string.
*/
final static byte TC_LONGSTRING = (byte)0x7C;
static final byte TC_LONGSTRING = (byte)0x7C;
/**
* new Proxy Class Descriptor.
*/
final static byte TC_PROXYCLASSDESC = (byte)0x7D;
static final byte TC_PROXYCLASSDESC = (byte)0x7D;
/**
* new Enum constant.
* @since 1.5
*/
final static byte TC_ENUM = (byte)0x7E;
static final byte TC_ENUM = (byte)0x7E;
/**
* Last tag value.
*/
final static byte TC_MAX = (byte)0x7E;
static final byte TC_MAX = (byte)0x7E;
/**
* First wire handle to be assigned.
*/
final static int baseWireHandle = 0x7e0000;
static final int baseWireHandle = 0x7e0000;
/******************************************************/
@ -147,7 +147,7 @@ public interface ObjectStreamConstants {
* Bit mask for ObjectStreamClass flag. Indicates a Serializable class
* defines its own writeObject method.
*/
final static byte SC_WRITE_METHOD = 0x01;
static final byte SC_WRITE_METHOD = 0x01;
/**
* Bit mask for ObjectStreamClass flag. Indicates Externalizable data
@ -157,23 +157,23 @@ public interface ObjectStreamConstants {
* @see #PROTOCOL_VERSION_2
* @since 1.2
*/
final static byte SC_BLOCK_DATA = 0x08;
static final byte SC_BLOCK_DATA = 0x08;
/**
* Bit mask for ObjectStreamClass flag. Indicates class is Serializable.
*/
final static byte SC_SERIALIZABLE = 0x02;
static final byte SC_SERIALIZABLE = 0x02;
/**
* Bit mask for ObjectStreamClass flag. Indicates class is Externalizable.
*/
final static byte SC_EXTERNALIZABLE = 0x04;
static final byte SC_EXTERNALIZABLE = 0x04;
/**
* Bit mask for ObjectStreamClass flag. Indicates class is an enum type.
* @since 1.5
*/
final static byte SC_ENUM = 0x10;
static final byte SC_ENUM = 0x10;
/* *******************************************************************/
@ -187,7 +187,7 @@ public interface ObjectStreamConstants {
* @see java.io.ObjectInputStream#enableResolveObject(boolean)
* @since 1.2
*/
final static SerializablePermission SUBSTITUTION_PERMISSION =
static final SerializablePermission SUBSTITUTION_PERMISSION =
new SerializablePermission("enableSubstitution");
/**
@ -197,7 +197,7 @@ public interface ObjectStreamConstants {
* @see java.io.ObjectInputStream#readObjectOverride()
* @since 1.2
*/
final static SerializablePermission SUBCLASS_IMPLEMENTATION_PERMISSION =
static final SerializablePermission SUBCLASS_IMPLEMENTATION_PERMISSION =
new SerializablePermission("enableSubclassImplementation");
/**
* A Stream Protocol Version. <p>
@ -210,7 +210,7 @@ public interface ObjectStreamConstants {
* @see java.io.ObjectOutputStream#useProtocolVersion(int)
* @since 1.2
*/
public final static int PROTOCOL_VERSION_1 = 1;
public static final int PROTOCOL_VERSION_1 = 1;
/**
@ -231,5 +231,5 @@ public interface ObjectStreamConstants {
* @see #SC_BLOCK_DATA
* @since 1.2
*/
public final static int PROTOCOL_VERSION_2 = 2;
public static final int PROTOCOL_VERSION_2 = 2;
}

@ -157,7 +157,7 @@ public abstract class Reader implements Readable, Closeable {
* If {@code off} is negative, or {@code len} is negative,
* or {@code len} is greater than {@code cbuf.length - off}
*/
abstract public int read(char cbuf[], int off, int len) throws IOException;
public abstract int read(char cbuf[], int off, int len) throws IOException;
/** Maximum skip-buffer size */
private static final int maxSkipBufferSize = 8192;
@ -260,6 +260,6 @@ public abstract class Reader implements Readable, Closeable {
*
* @exception IOException If an I/O error occurs
*/
abstract public void close() throws IOException;
public abstract void close() throws IOException;
}

@ -142,7 +142,7 @@ public abstract class Writer implements Appendable, Closeable, Flushable {
* @throws IOException
* If an I/O error occurs
*/
abstract public void write(char cbuf[], int off, int len) throws IOException;
public abstract void write(char cbuf[], int off, int len) throws IOException;
/**
* Writes a string.
@ -312,7 +312,7 @@ public abstract class Writer implements Appendable, Closeable, Flushable {
* @throws IOException
* If an I/O error occurs
*/
abstract public void flush() throws IOException;
public abstract void flush() throws IOException;
/**
* Closes the stream, flushing it first. Once the stream has been closed,
@ -322,6 +322,6 @@ public abstract class Writer implements Appendable, Closeable, Flushable {
* @throws IOException
* If an I/O error occurs
*/
abstract public void close() throws IOException;
public abstract void close() throws IOException;
}

@ -469,8 +469,8 @@ public final class Class<T> implements java.io.Serializable,
return null;
}
}
private volatile transient Constructor<T> cachedConstructor;
private volatile transient Class<?> newInstanceCallerCache;
private transient volatile Constructor<T> cachedConstructor;
private transient volatile Class<?> newInstanceCallerCache;
/**
@ -1123,7 +1123,7 @@ public final class Class<T> implements java.io.Serializable,
}
}
private final static class EnclosingMethodInfo {
private static final class EnclosingMethodInfo {
private Class<?> enclosingClass;
private String name;
private String descriptor;
@ -2514,11 +2514,11 @@ public final class Class<T> implements java.io.Serializable,
}
}
private volatile transient SoftReference<ReflectionData<T>> reflectionData;
private transient volatile SoftReference<ReflectionData<T>> reflectionData;
// Incremented by the VM on each call to JVM TI RedefineClasses()
// that redefines this class or a superclass.
private volatile transient int classRedefinedCount = 0;
private transient volatile int classRedefinedCount = 0;
// Lazily create and cache ReflectionData
private ReflectionData<T> reflectionData() {
@ -2561,7 +2561,7 @@ public final class Class<T> implements java.io.Serializable,
private native String getGenericSignature0();
// Generic info repository; lazily initialized
private volatile transient ClassRepository genericInfo;
private transient volatile ClassRepository genericInfo;
// accessor for factory
private GenericsFactory getFactory() {
@ -3353,7 +3353,7 @@ public final class Class<T> implements java.io.Serializable,
}
return enumConstants;
}
private volatile transient T[] enumConstants = null;
private transient volatile T[] enumConstants = null;
/**
* Returns a map from simple name to enum constant. This package-private
@ -3375,7 +3375,7 @@ public final class Class<T> implements java.io.Serializable,
}
return enumConstantDirectory;
}
private volatile transient Map<String, T> enumConstantDirectory = null;
private transient volatile Map<String, T> enumConstantDirectory = null;
/**
* Casts an object to the class or interface represented
@ -3523,7 +3523,7 @@ public final class Class<T> implements java.io.Serializable,
// Annotations cache
@SuppressWarnings("UnusedDeclaration")
private volatile transient AnnotationData annotationData;
private transient volatile AnnotationData annotationData;
private AnnotationData annotationData() {
while (true) { // retry loop
@ -3578,7 +3578,7 @@ public final class Class<T> implements java.io.Serializable,
// Annotation types cache their internal (AnnotationType) form
@SuppressWarnings("UnusedDeclaration")
private volatile transient AnnotationType annotationType;
private transient volatile AnnotationType annotationType;
boolean casAnnotationType(AnnotationType oldType, AnnotationType newType) {
return Atomic.casAnnotationType(this, oldType, newType);

@ -1030,7 +1030,7 @@ public abstract class ClassLoader {
return findLoadedClass0(name);
}
private native final Class<?> findLoadedClass0(String name);
private final native Class<?> findLoadedClass0(String name);
/**
* Sets the signers of a class. This should be invoked after defining a

@ -47,14 +47,14 @@ import sun.text.Normalizer;
final class ConditionalSpecialCasing {
// context conditions.
final static int FINAL_CASED = 1;
final static int AFTER_SOFT_DOTTED = 2;
final static int MORE_ABOVE = 3;
final static int AFTER_I = 4;
final static int NOT_BEFORE_DOT = 5;
static final int FINAL_CASED = 1;
static final int AFTER_SOFT_DOTTED = 2;
static final int MORE_ABOVE = 3;
static final int AFTER_I = 4;
static final int NOT_BEFORE_DOT = 5;
// combining class definitions
final static int COMBINING_CLASS_ABOVE = 230;
static final int COMBINING_CLASS_ABOVE = 230;
// Special case mapping entries
static Entry[] entry = {

@ -0,0 +1,383 @@
/*
* Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* 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 java.lang;
/**
* Port of the "Freely Distributable Math Library", version 5.3, from C to Java.
*
* <p>The C version of fdlibm relied on the idiom of pointer aliasing
* a 64-bit double floating-point value as a two-element array of
* 32-bit integers and reading and writing the two halves of the
* double independently. This coding pattern was problematic to C
* optimizers and not directly expressible in Java. Therefore, rather
* than a memory level overlay, if portions of a double need to be
* operated on as integer values, the standard library methods for
* bitwise floating-point to integer conversion,
* Double.longBitsToDouble and Double.doubleToRawLongBits, are directly
* or indirectly used .
*
* <p>The C version of fdlibm also took some pains to signal the
* correct IEEE 754 exceptional conditions divide by zero, invalid,
* overflow and underflow. For example, overflow would be signaled by
* {@code huge * huge} where {@code huge} was a large constant that
* would overflow when squared. Since IEEE floating-point exceptional
* handling is not supported natively in the JVM, such coding patterns
* have been omitted from this port. For example, rather than {@code
* return huge * huge}, this port will use {@code return INFINITY}.
*/
class FdLibm {
// Constants used by multiple algorithms
private static final double INFINITY = Double.POSITIVE_INFINITY;
private FdLibm() {
throw new UnsupportedOperationException("No instances for you.");
}
/**
* Return the low-order 32 bits of the double argument as an int.
*/
private static int __LO(double x) {
long transducer = Double.doubleToRawLongBits(x);
return (int)transducer;
}
/**
* Return a double with its low-order bits of the second argument
* and the high-order bits of the first argument..
*/
private static double __LO(double x, int low) {
long transX = Double.doubleToRawLongBits(x);
return Double.longBitsToDouble((transX & 0xFFFF_FFFF_0000_0000L)|low );
}
/**
* Return the high-order 32 bits of the double argument as an int.
*/
private static int __HI(double x) {
long transducer = Double.doubleToRawLongBits(x);
return (int)(transducer >> 32);
}
/**
* Return a double with its high-order bits of the second argument
* and the low-order bits of the first argument..
*/
private static double __HI(double x, int high) {
long transX = Double.doubleToRawLongBits(x);
return Double.longBitsToDouble((transX & 0x0000_0000_FFFF_FFFFL)|( ((long)high)) << 32 );
}
/**
* Compute x**y
* n
* Method: Let x = 2 * (1+f)
* 1. Compute and return log2(x) in two pieces:
* log2(x) = w1 + w2,
* where w1 has 53 - 24 = 29 bit trailing zeros.
* 2. Perform y*log2(x) = n+y' by simulating muti-precision
* arithmetic, where |y'| <= 0.5.
* 3. Return x**y = 2**n*exp(y'*log2)
*
* Special cases:
* 1. (anything) ** 0 is 1
* 2. (anything) ** 1 is itself
* 3. (anything) ** NAN is NAN
* 4. NAN ** (anything except 0) is NAN
* 5. +-(|x| > 1) ** +INF is +INF
* 6. +-(|x| > 1) ** -INF is +0
* 7. +-(|x| < 1) ** +INF is +0
* 8. +-(|x| < 1) ** -INF is +INF
* 9. +-1 ** +-INF is NAN
* 10. +0 ** (+anything except 0, NAN) is +0
* 11. -0 ** (+anything except 0, NAN, odd integer) is +0
* 12. +0 ** (-anything except 0, NAN) is +INF
* 13. -0 ** (-anything except 0, NAN, odd integer) is +INF
* 14. -0 ** (odd integer) = -( +0 ** (odd integer) )
* 15. +INF ** (+anything except 0,NAN) is +INF
* 16. +INF ** (-anything except 0,NAN) is +0
* 17. -INF ** (anything) = -0 ** (-anything)
* 18. (-anything) ** (integer) is (-1)**(integer)*(+anything**integer)
* 19. (-anything except 0 and inf) ** (non-integer) is NAN
*
* Accuracy:
* pow(x,y) returns x**y nearly rounded. In particular
* pow(integer,integer)
* always returns the correct integer provided it is
* representable.
*/
public static class Pow {
public static strictfp double compute(final double x, final double y) {
double z;
double r, s, t, u, v, w;
int i, j, k, n;
// y == zero: x**0 = 1
if (y == 0.0)
return 1.0;
// +/-NaN return x + y to propagate NaN significands
if (Double.isNaN(x) || Double.isNaN(y))
return x + y;
final double y_abs = Math.abs(y);
double x_abs = Math.abs(x);
// Special values of y
if (y == 2.0) {
return x * x;
} else if (y == 0.5) {
if (x >= -Double.MAX_VALUE) // Handle x == -infinity later
return Math.sqrt(x + 0.0); // Add 0.0 to properly handle x == -0.0
} else if (y_abs == 1.0) { // y is +/-1
return (y == 1.0) ? x : 1.0 / x;
} else if (y_abs == INFINITY) { // y is +/-infinity
if (x_abs == 1.0)
return y - y; // inf**+/-1 is NaN
else if (x_abs > 1.0) // (|x| > 1)**+/-inf = inf, 0
return (y >= 0) ? y : 0.0;
else // (|x| < 1)**-/+inf = inf, 0
return (y < 0) ? -y : 0.0;
}
final int hx = __HI(x);
int ix = hx & 0x7fffffff;
/*
* When x < 0, determine if y is an odd integer:
* y_is_int = 0 ... y is not an integer
* y_is_int = 1 ... y is an odd int
* y_is_int = 2 ... y is an even int
*/
int y_is_int = 0;
if (hx < 0) {
if (y_abs >= 0x1.0p53) // |y| >= 2^53 = 9.007199254740992E15
y_is_int = 2; // y is an even integer since ulp(2^53) = 2.0
else if (y_abs >= 1.0) { // |y| >= 1.0
long y_abs_as_long = (long) y_abs;
if ( ((double) y_abs_as_long) == y_abs) {
y_is_int = 2 - (int)(y_abs_as_long & 0x1L);
}
}
}
// Special value of x
if (x_abs == 0.0 ||
x_abs == INFINITY ||
x_abs == 1.0) {
z = x_abs; // x is +/-0, +/-inf, +/-1
if (y < 0.0)
z = 1.0/z; // z = (1/|x|)
if (hx < 0) {
if (((ix - 0x3ff00000) | y_is_int) == 0) {
z = (z-z)/(z-z); // (-1)**non-int is NaN
} else if (y_is_int == 1)
z = -1.0 * z; // (x < 0)**odd = -(|x|**odd)
}
return z;
}
n = (hx >> 31) + 1;
// (x < 0)**(non-int) is NaN
if ((n | y_is_int) == 0)
return (x-x)/(x-x);
s = 1.0; // s (sign of result -ve**odd) = -1 else = 1
if ( (n | (y_is_int - 1)) == 0)
s = -1.0; // (-ve)**(odd int)
double p_h, p_l, t1, t2;
// |y| is huge
if (y_abs > 0x1.0p31) { // if |y| > 2**31
final double INV_LN2 = 0x1.7154_7652_b82fep0; // 1.44269504088896338700e+00 = 1/ln2
final double INV_LN2_H = 0x1.715476p0; // 1.44269502162933349609e+00 = 24 bits of 1/ln2
final double INV_LN2_L = 0x1.4ae0_bf85_ddf44p-26; // 1.92596299112661746887e-08 = 1/ln2 tail
// Over/underflow if x is not close to one
if (x_abs < 0x1.fffffp-1) // |x| < 0.9999995231628418
return (y < 0.0) ? s * INFINITY : s * 0.0;
if (x_abs > 1.0) // |x| > 1.0
return (y > 0.0) ? s * INFINITY : s * 0.0;
/*
* now |1-x| is tiny <= 2**-20, sufficient to compute
* log(x) by x - x^2/2 + x^3/3 - x^4/4
*/
t = x_abs - 1.0; // t has 20 trailing zeros
w = (t * t) * (0.5 - t * (0.3333333333333333333333 - t * 0.25));
u = INV_LN2_H * t; // INV_LN2_H has 21 sig. bits
v = t * INV_LN2_L - w * INV_LN2;
t1 = u + v;
t1 =__LO(t1, 0);
t2 = v - (t1 - u);
} else {
final double CP = 0x1.ec70_9dc3_a03fdp-1; // 9.61796693925975554329e-01 = 2/(3ln2)
final double CP_H = 0x1.ec709ep-1; // 9.61796700954437255859e-01 = (float)cp
final double CP_L = -0x1.e2fe_0145_b01f5p-28; // -7.02846165095275826516e-09 = tail of CP_H
double z_h, z_l, ss, s2, s_h, s_l, t_h, t_l;
n = 0;
// Take care of subnormal numbers
if (ix < 0x00100000) {
x_abs *= 0x1.0p53; // 2^53 = 9007199254740992.0
n -= 53;
ix = __HI(x_abs);
}
n += ((ix) >> 20) - 0x3ff;
j = ix & 0x000fffff;
// Determine interval
ix = j | 0x3ff00000; // Normalize ix
if (j <= 0x3988E)
k = 0; // |x| <sqrt(3/2)
else if (j < 0xBB67A)
k = 1; // |x| <sqrt(3)
else {
k = 0;
n += 1;
ix -= 0x00100000;
}
x_abs = __HI(x_abs, ix);
// Compute ss = s_h + s_l = (x-1)/(x+1) or (x-1.5)/(x+1.5)
final double BP[] = {1.0,
1.5};
final double DP_H[] = {0.0,
0x1.2b80_34p-1}; // 5.84962487220764160156e-01
final double DP_L[] = {0.0,
0x1.cfde_b43c_fd006p-27};// 1.35003920212974897128e-08
// Poly coefs for (3/2)*(log(x)-2s-2/3*s**3
final double L1 = 0x1.3333_3333_33303p-1; // 5.99999999999994648725e-01
final double L2 = 0x1.b6db_6db6_fabffp-2; // 4.28571428578550184252e-01
final double L3 = 0x1.5555_5518_f264dp-2; // 3.33333329818377432918e-01
final double L4 = 0x1.1746_0a91_d4101p-2; // 2.72728123808534006489e-01
final double L5 = 0x1.d864_a93c_9db65p-3; // 2.30660745775561754067e-01
final double L6 = 0x1.a7e2_84a4_54eefp-3; // 2.06975017800338417784e-01
u = x_abs - BP[k]; // BP[0]=1.0, BP[1]=1.5
v = 1.0 / (x_abs + BP[k]);
ss = u * v;
s_h = ss;
s_h = __LO(s_h, 0);
// t_h=x_abs + BP[k] High
t_h = 0.0;
t_h = __HI(t_h, ((ix >> 1) | 0x20000000) + 0x00080000 + (k << 18) );
t_l = x_abs - (t_h - BP[k]);
s_l = v * ((u - s_h * t_h) - s_h * t_l);
// Compute log(x_abs)
s2 = ss * ss;
r = s2 * s2* (L1 + s2 * (L2 + s2 * (L3 + s2 * (L4 + s2 * (L5 + s2 * L6)))));
r += s_l * (s_h + ss);
s2 = s_h * s_h;
t_h = 3.0 + s2 + r;
t_h = __LO(t_h, 0);
t_l = r - ((t_h - 3.0) - s2);
// u+v = ss*(1+...)
u = s_h * t_h;
v = s_l * t_h + t_l * ss;
// 2/(3log2)*(ss + ...)
p_h = u + v;
p_h = __LO(p_h, 0);
p_l = v - (p_h - u);
z_h = CP_H * p_h; // CP_H + CP_L = 2/(3*log2)
z_l = CP_L * p_h + p_l * CP + DP_L[k];
// log2(x_abs) = (ss + ..)*2/(3*log2) = n + DP_H + z_h + z_l
t = (double)n;
t1 = (((z_h + z_l) + DP_H[k]) + t);
t1 = __LO(t1, 0);
t2 = z_l - (((t1 - t) - DP_H[k]) - z_h);
}
// Split up y into (y1 + y2) and compute (y1 + y2) * (t1 + t2)
double y1 = y;
y1 = __LO(y1, 0);
p_l = (y - y1) * t1 + y * t2;
p_h = y1 * t1;
z = p_l + p_h;
j = __HI(z);
i = __LO(z);
if (j >= 0x40900000) { // z >= 1024
if (((j - 0x40900000) | i)!=0) // if z > 1024
return s * INFINITY; // Overflow
else {
final double OVT = 8.0085662595372944372e-0017; // -(1024-log2(ovfl+.5ulp))
if (p_l + OVT > z - p_h)
return s * INFINITY; // Overflow
}
} else if ((j & 0x7fffffff) >= 0x4090cc00 ) { // z <= -1075
if (((j - 0xc090cc00) | i)!=0) // z < -1075
return s * 0.0; // Underflow
else {
if (p_l <= z - p_h)
return s * 0.0; // Underflow
}
}
/*
* Compute 2**(p_h+p_l)
*/
// Poly coefs for (3/2)*(log(x)-2s-2/3*s**3
final double P1 = 0x1.5555_5555_5553ep-3; // 1.66666666666666019037e-01
final double P2 = -0x1.6c16_c16b_ebd93p-9; // -2.77777777770155933842e-03
final double P3 = 0x1.1566_aaf2_5de2cp-14; // 6.61375632143793436117e-05
final double P4 = -0x1.bbd4_1c5d_26bf1p-20; // -1.65339022054652515390e-06
final double P5 = 0x1.6376_972b_ea4d0p-25; // 4.13813679705723846039e-08
final double LG2 = 0x1.62e4_2fef_a39efp-1; // 6.93147180559945286227e-01
final double LG2_H = 0x1.62e43p-1; // 6.93147182464599609375e-01
final double LG2_L = -0x1.05c6_10ca_86c39p-29; // -1.90465429995776804525e-09
i = j & 0x7fffffff;
k = (i >> 20) - 0x3ff;
n = 0;
if (i > 0x3fe00000) { // if |z| > 0.5, set n = [z + 0.5]
n = j + (0x00100000 >> (k + 1));
k = ((n & 0x7fffffff) >> 20) - 0x3ff; // new k for n
t = 0.0;
t = __HI(t, (n & ~(0x000fffff >> k)) );
n = ((n & 0x000fffff) | 0x00100000) >> (20 - k);
if (j < 0)
n = -n;
p_h -= t;
}
t = p_l + p_h;
t = __LO(t, 0);
u = t * LG2_H;
v = (p_l - (t - p_h)) * LG2 + t * LG2_L;
z = u + v;
w = v - (z - u);
t = z * z;
t1 = z - t * (P1 + t * (P2 + t * (P3 + t * (P4 + t * P5))));
r = (z * t1)/(t1 - 2.0) - (w + z * w);
z = 1.0 - (r - z);
j = __HI(z);
j += (n << 20);
if ((j >> 20) <= 0)
z = Math.scalb(z, n); // subnormal output
else {
int z_hi = __HI(z);
z_hi += (n << 20);
z = __HI(z, z_hi);
}
return s * z;
}
}
}

@ -76,7 +76,7 @@ public final class Integer extends Number implements Comparable<Integer> {
/**
* All possible chars for representing a number as a String
*/
final static char[] digits = {
static final char[] digits = {
'0' , '1' , '2' , '3' , '4' , '5' ,
'6' , '7' , '8' , '9' , 'a' , 'b' ,
'c' , 'd' , 'e' , 'f' , 'g' , 'h' ,
@ -344,7 +344,7 @@ public final class Integer extends Number implements Comparable<Integer> {
} while (charPos > offset);
}
final static char [] DigitTens = {
static final char [] DigitTens = {
'0', '0', '0', '0', '0', '0', '0', '0', '0', '0',
'1', '1', '1', '1', '1', '1', '1', '1', '1', '1',
'2', '2', '2', '2', '2', '2', '2', '2', '2', '2',
@ -357,7 +357,7 @@ public final class Integer extends Number implements Comparable<Integer> {
'9', '9', '9', '9', '9', '9', '9', '9', '9', '9',
} ;
final static char [] DigitOnes = {
static final char [] DigitOnes = {
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
@ -467,7 +467,7 @@ public final class Integer extends Number implements Comparable<Integer> {
}
}
final static int [] sizeTable = { 9, 99, 999, 9999, 99999, 999999, 9999999,
static final int [] sizeTable = { 9, 99, 999, 9999, 99999, 999999, 9999999,
99999999, 999999999, Integer.MAX_VALUE };
// Requires positive x

@ -656,6 +656,6 @@ public class Package implements java.lang.reflect.AnnotatedElement {
private final String implVersion;
private final String implVendor;
private final URL sealBase;
private transient final ClassLoader loader;
private final transient ClassLoader loader;
private transient Class<?> packageInfo;
}

@ -458,7 +458,7 @@ public final class ProcessBuilder
*
* @since 1.7
*/
public static abstract class Redirect {
public abstract static class Redirect {
/**
* The type of a {@link Redirect}.
*/

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -643,7 +643,9 @@ public final class StrictMath {
* @param b the exponent.
* @return the value {@code a}<sup>{@code b}</sup>.
*/
public static native double pow(double a, double b);
public static double pow(double a, double b) {
return FdLibm.Pow.compute(a, b);
}
/**
* Returns the closest {@code int} to the argument, with ties

@ -52,9 +52,9 @@ class StringCoding {
private StringCoding() { }
/** The cached coders for each thread */
private final static ThreadLocal<SoftReference<StringDecoder>> decoder =
private static final ThreadLocal<SoftReference<StringDecoder>> decoder =
new ThreadLocal<>();
private final static ThreadLocal<SoftReference<StringEncoder>> encoder =
private static final ThreadLocal<SoftReference<StringEncoder>> encoder =
new ThreadLocal<>();
private static boolean warnUnsupportedCharset = true;

@ -81,7 +81,7 @@ public final class System {
* corresponds to keyboard input or another input source specified by
* the host environment or user.
*/
public final static InputStream in = null;
public static final InputStream in = null;
/**
* The "standard" output stream. This stream is already
@ -108,7 +108,7 @@ public final class System {
* @see java.io.PrintStream#println(java.lang.Object)
* @see java.io.PrintStream#println(java.lang.String)
*/
public final static PrintStream out = null;
public static final PrintStream out = null;
/**
* The "standard" error output stream. This stream is already
@ -122,7 +122,7 @@ public final class System {
* variable <code>out</code>, has been redirected to a file or other
* destination that is typically not continuously monitored.
*/
public final static PrintStream err = null;
public static final PrintStream err = null;
/* The security manager for the system.
*/

@ -244,17 +244,17 @@ class Thread implements Runnable {
/**
* The minimum priority that a thread can have.
*/
public final static int MIN_PRIORITY = 1;
public static final int MIN_PRIORITY = 1;
/**
* The default priority that is assigned to a thread.
*/
public final static int NORM_PRIORITY = 5;
public static final int NORM_PRIORITY = 5;
/**
* The maximum priority that a thread can have.
*/
public final static int MAX_PRIORITY = 10;
public static final int MAX_PRIORITY = 10;
/**
* Returns a reference to the currently executing thread object.
@ -1688,8 +1688,8 @@ class Thread implements Runnable {
return result.booleanValue();
}
private native static StackTraceElement[][] dumpThreads(Thread[] threads);
private native static Thread[] getThreads();
private static native StackTraceElement[][] dumpThreads(Thread[] threads);
private static native Thread[] getThreads();
/**
* Returns the identifier of this Thread. The thread ID is a positive

@ -33,7 +33,7 @@ package java.lang;
* @author Frank Yellin
* @since 1.0
*/
abstract public class VirtualMachineError extends Error {
public abstract class VirtualMachineError extends Error {
private static final long serialVersionUID = 4161983926571568670L;
/**

@ -49,7 +49,7 @@ abstract class DelegatingMethodHandle extends MethodHandle {
}
/** Define this to extract the delegated target which supplies the invocation behavior. */
abstract protected MethodHandle getTarget();
protected abstract MethodHandle getTarget();
@Override
abstract MethodHandle asTypeUncached(MethodType newType);

@ -445,9 +445,9 @@ class DirectMethodHandle extends MethodHandle {
/** This subclass handles static field references. */
static class StaticAccessor extends DirectMethodHandle {
final private Class<?> fieldType;
final private Object staticBase;
final private long staticOffset;
private final Class<?> fieldType;
private final Object staticBase;
private final long staticOffset;
private StaticAccessor(MethodType mtype, LambdaForm form, MemberName member,
Object staticBase, long staticOffset) {

@ -140,9 +140,9 @@ class InvokerBytecodeGenerator {
/** instance counters for dumped classes */
private final static HashMap<String,Integer> DUMP_CLASS_FILES_COUNTERS;
private static final HashMap<String,Integer> DUMP_CLASS_FILES_COUNTERS;
/** debugging flag for saving generated class files */
private final static File DUMP_CLASS_FILES_DIR;
private static final File DUMP_CLASS_FILES_DIR;
static {
if (DUMP_CLASS_FILES) {
@ -771,7 +771,7 @@ class InvokerBytecodeGenerator {
mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, MH, "invokeBasic", type.basicType().toMethodDescriptorString(), false);
}
static private Class<?>[] STATICALLY_INVOCABLE_PACKAGES = {
private static Class<?>[] STATICALLY_INVOCABLE_PACKAGES = {
// Sample classes from each package we are willing to bind to statically:
java.lang.Object.class,
java.util.Arrays.class,

@ -440,7 +440,7 @@ class MethodHandleNatives {
* Use best possible cause for err.initCause(), substituting the
* cause for err itself if the cause has the same (or better) type.
*/
static private Error initCauseFrom(Error err, Exception ex) {
private static Error initCauseFrom(Error err, Exception ex) {
Throwable th = ex.getCause();
if (err.getClass().isInstance(th))
return (Error) th;

@ -147,7 +147,7 @@ public class MethodHandles {
return lookup.revealDirect(target).reflectAs(expected, lookup);
}
// Copied from AccessibleObject, as used by Method.setAccessible, etc.:
static final private java.security.Permission ACCESS_PERMISSION =
private static final java.security.Permission ACCESS_PERMISSION =
new ReflectPermission("suppressAccessChecks");
/**
@ -1884,7 +1884,7 @@ return invoker;
* or if the resulting method handle's type would have
* <a href="MethodHandle.html#maxarity">too many parameters</a>
*/
static public
public static
MethodHandle spreadInvoker(MethodType type, int leadingArgCount) {
if (leadingArgCount < 0 || leadingArgCount > type.parameterCount())
throw newIllegalArgumentException("bad argument count", leadingArgCount);
@ -1927,7 +1927,7 @@ return invoker;
* @throws IllegalArgumentException if the resulting method handle's type would have
* <a href="MethodHandle.html#maxarity">too many parameters</a>
*/
static public
public static
MethodHandle exactInvoker(MethodType type) {
return type.invokers().exactInvoker();
}
@ -1966,7 +1966,7 @@ return invoker;
* @throws IllegalArgumentException if the resulting method handle's type would have
* <a href="MethodHandle.html#maxarity">too many parameters</a>
*/
static public
public static
MethodHandle invoker(MethodType type) {
return type.invokers().genericInvoker();
}
@ -2322,7 +2322,7 @@ assert((int)twice.invokeExact(21) == 42);
return MethodHandleImpl.makeIntrinsic(mtype, lform, Intrinsic.ZERO);
}
synchronized private static MethodHandle setCachedMethodHandle(MethodHandle[] cache, int pos, MethodHandle value) {
private static synchronized MethodHandle setCachedMethodHandle(MethodHandle[] cache, int pos, MethodHandle value) {
// Simulate a CAS, to avoid racy duplication of results.
MethodHandle prev = cache[pos];
if (prev != null) return prev;

@ -111,7 +111,7 @@ final class MethodTypeForm {
return (entry != null) ? entry.get() : null;
}
synchronized public MethodHandle setCachedMethodHandle(int which, MethodHandle mh) {
public synchronized MethodHandle setCachedMethodHandle(int which, MethodHandle mh) {
// Simulate a CAS, to avoid racy duplication of results.
SoftReference<MethodHandle> entry = methodHandles[which];
if (entry != null) {
@ -130,7 +130,7 @@ final class MethodTypeForm {
return (entry != null) ? entry.get() : null;
}
synchronized public LambdaForm setCachedLambdaForm(int which, LambdaForm form) {
public synchronized LambdaForm setCachedLambdaForm(int which, LambdaForm form) {
// Simulate a CAS, to avoid racy duplication of results.
SoftReference<LambdaForm> entry = lambdaForms[which];
if (entry != null) {

@ -107,7 +107,7 @@ public abstract class Reference<T> {
* pending: next element in the pending list (or null if last)
* otherwise: NULL
*/
transient private Reference<T> discovered; /* used by VM */
private transient Reference<T> discovered; /* used by VM */
/* Object used to synchronize with the garbage collector. The collector
@ -115,7 +115,7 @@ public abstract class Reference<T> {
* therefore critical that any code holding this lock complete as quickly
* as possible, allocate no new objects, and avoid calling user code.
*/
static private class Lock { }
private static class Lock { }
private static Lock lock = new Lock();

@ -51,7 +51,7 @@ public class ReferenceQueue<T> {
static ReferenceQueue<Object> NULL = new Null<>();
static ReferenceQueue<Object> ENQUEUED = new Null<>();
static private class Lock { };
private static class Lock { };
private Lock lock = new Lock();
private volatile Reference<? extends T> head = null;
private long queueLength = 0;

@ -66,7 +66,7 @@ public class SoftReference<T> extends Reference<T> {
/**
* Timestamp clock, updated by the garbage collector
*/
static private long clock;
private static long clock;
/**
* Timestamp updated by each invocation of the get method. The VM may use

@ -61,7 +61,7 @@ public class AccessibleObject implements AnnotatedElement {
* has sufficient privilege to defeat Java language access
* control checks.
*/
static final private java.security.Permission ACCESS_PERMISSION =
private static final java.security.Permission ACCESS_PERMISSION =
new ReflectPermission("suppressAccessChecks");
/**

@ -2268,14 +2268,14 @@ public class BigDecimal extends Number implements Comparable<BigDecimal> {
* digit prior to a nonzero discarded fraction. Note that this rounding
* mode never decreases the magnitude of the calculated value.
*/
public final static int ROUND_UP = 0;
public static final int ROUND_UP = 0;
/**
* Rounding mode to round towards zero. Never increments the digit
* prior to a discarded fraction (i.e., truncates). Note that this
* rounding mode never increases the magnitude of the calculated value.
*/
public final static int ROUND_DOWN = 1;
public static final int ROUND_DOWN = 1;
/**
* Rounding mode to round towards positive infinity. If the
@ -2284,7 +2284,7 @@ public class BigDecimal extends Number implements Comparable<BigDecimal> {
* {@code ROUND_DOWN}. Note that this rounding mode never
* decreases the calculated value.
*/
public final static int ROUND_CEILING = 2;
public static final int ROUND_CEILING = 2;
/**
* Rounding mode to round towards negative infinity. If the
@ -2293,7 +2293,7 @@ public class BigDecimal extends Number implements Comparable<BigDecimal> {
* {@code ROUND_UP}. Note that this rounding mode never
* increases the calculated value.
*/
public final static int ROUND_FLOOR = 3;
public static final int ROUND_FLOOR = 3;
/**
* Rounding mode to round towards {@literal "nearest neighbor"}
@ -2303,7 +2303,7 @@ public class BigDecimal extends Number implements Comparable<BigDecimal> {
* that this is the rounding mode that most of us were taught in
* grade school.
*/
public final static int ROUND_HALF_UP = 4;
public static final int ROUND_HALF_UP = 4;
/**
* Rounding mode to round towards {@literal "nearest neighbor"}
@ -2312,7 +2312,7 @@ public class BigDecimal extends Number implements Comparable<BigDecimal> {
* fraction is {@literal >} 0.5; otherwise, behaves as for
* {@code ROUND_DOWN}.
*/
public final static int ROUND_HALF_DOWN = 5;
public static final int ROUND_HALF_DOWN = 5;
/**
* Rounding mode to round towards the {@literal "nearest neighbor"}
@ -2324,7 +2324,7 @@ public class BigDecimal extends Number implements Comparable<BigDecimal> {
* rounding mode that minimizes cumulative error when applied
* repeatedly over a sequence of calculations.
*/
public final static int ROUND_HALF_EVEN = 6;
public static final int ROUND_HALF_EVEN = 6;
/**
* Rounding mode to assert that the requested operation has an exact
@ -2332,7 +2332,7 @@ public class BigDecimal extends Number implements Comparable<BigDecimal> {
* specified on an operation that yields an inexact result, an
* {@code ArithmeticException} is thrown.
*/
public final static int ROUND_UNNECESSARY = 7;
public static final int ROUND_UNNECESSARY = 7;
// Scaling/Rounding Operations
@ -3398,7 +3398,7 @@ public class BigDecimal extends Number implements Comparable<BigDecimal> {
return charPos;
}
final static char[] DIGIT_TENS = {
static final char[] DIGIT_TENS = {
'0', '0', '0', '0', '0', '0', '0', '0', '0', '0',
'1', '1', '1', '1', '1', '1', '1', '1', '1', '1',
'2', '2', '2', '2', '2', '2', '2', '2', '2', '2',
@ -3411,7 +3411,7 @@ public class BigDecimal extends Number implements Comparable<BigDecimal> {
'9', '9', '9', '9', '9', '9', '9', '9', '9', '9',
};
final static char[] DIGIT_ONES = {
static final char[] DIGIT_ONES = {
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9',

@ -184,7 +184,7 @@ public class BigInteger extends Number implements Comparable<BigInteger> {
/**
* This mask is used to obtain the value of an int as if it were unsigned.
*/
final static long LONG_MASK = 0xffffffffL;
static final long LONG_MASK = 0xffffffffL;
/**
* This constant limits {@code mag.length} of BigIntegers to the supported
@ -1212,7 +1212,7 @@ public class BigInteger extends Number implements Comparable<BigInteger> {
/**
* Initialize static constant array when class is loaded.
*/
private final static int MAX_CONSTANT = 16;
private static final int MAX_CONSTANT = 16;
private static BigInteger posConst[] = new BigInteger[MAX_CONSTANT+1];
private static BigInteger negConst[] = new BigInteger[MAX_CONSTANT+1];

@ -55,7 +55,7 @@ abstract class AbstractPlainDatagramSocketImpl extends DatagramSocketImpl
/**
* flag set if the native connect() call not to be used
*/
private final static boolean connectDisabled = os.contains("OS X");
private static final boolean connectDisabled = os.contains("OS X");
/**
* Load net library into runtime.

@ -721,6 +721,6 @@ abstract class AbstractPlainSocketImpl extends SocketImpl
abstract void socketSendUrgentData(int data)
throws IOException;
public final static int SHUT_RD = 0;
public final static int SHUT_WR = 1;
public static final int SHUT_RD = 0;
public static final int SHUT_WR = 1;
}

@ -119,7 +119,7 @@ class Authenticator {
* @see SecurityManager#checkPermission
* @see java.net.NetPermission
*/
public synchronized static void setDefault(Authenticator a) {
public static synchronized void setDefault(Authenticator a) {
SecurityManager sm = System.getSecurityManager();
if (sm != null) {
NetPermission setDefaultPermission

@ -81,7 +81,7 @@ import java.io.IOException;
* @see java.net.URLConnection#setContentHandlerFactory(java.net.ContentHandlerFactory)
* @since 1.0
*/
abstract public class ContentHandler {
public abstract class ContentHandler {
/**
* Given a URL connect stream positioned at the beginning of the
@ -92,7 +92,7 @@ abstract public class ContentHandler {
* @return the object read by the {@code ContentHandler}.
* @exception IOException if an I/O error occurs while reading the object.
*/
abstract public Object getContent(URLConnection urlc) throws IOException;
public abstract Object getContent(URLConnection urlc) throws IOException;
/**
* Given a URL connect stream positioned at the beginning of the

@ -69,7 +69,7 @@ public abstract class CookieHandler {
* {@link NetPermission}{@code ("getCookieHandler")}
* @see #setDefault(CookieHandler)
*/
public synchronized static CookieHandler getDefault() {
public static synchronized CookieHandler getDefault() {
SecurityManager sm = System.getSecurityManager();
if (sm != null) {
sm.checkPermission(SecurityConstants.GET_COOKIEHANDLER_PERMISSION);
@ -89,7 +89,7 @@ public abstract class CookieHandler {
* {@link NetPermission}{@code ("setCookieHandler")}
* @see #getDefault()
*/
public synchronized static void setDefault(CookieHandler cHandler) {
public static synchronized void setDefault(CookieHandler cHandler) {
SecurityManager sm = System.getSecurityManager();
if (sm != null) {
sm.checkPermission(SecurityConstants.SET_COOKIEHANDLER_PERMISSION);

@ -362,7 +362,7 @@ public class CookieManager extends CookieHandler
}
static private boolean isInPortList(String lst, int port) {
private static boolean isInPortList(String lst, int port) {
int i = lst.indexOf(',');
int val = -1;
while (i > 0) {

@ -384,5 +384,5 @@ class DatagramPacket {
/**
* Perform class load-time initializations.
*/
private native static void init();
private static native void init();
}

@ -225,9 +225,9 @@ class HostPortrange {
}
// these shouldn't leak outside the implementation
final static int[] HTTP_PORT = {80, 80};
final static int[] HTTPS_PORT = {443, 443};
final static int[] NO_PORT = {-1, -1};
static final int[] HTTP_PORT = {80, 80};
static final int[] HTTPS_PORT = {443, 443};
static final int[] NO_PORT = {-1, -1};
int[] defaultPort() {
if (scheme.equals("http")) {

@ -84,11 +84,11 @@ public final class HttpCookie implements Cloneable {
// Since the positive and zero max-age have their meanings,
// this value serves as a hint as 'not specify max-age'
private final static long MAX_AGE_UNSPECIFIED = -1;
private static final long MAX_AGE_UNSPECIFIED = -1;
// date formats used by Netscape's cookie draft
// as well as formats seen on various sites
private final static String[] COOKIE_DATE_FORMATS = {
private static final String[] COOKIE_DATE_FORMATS = {
"EEE',' dd-MMM-yyyy HH:mm:ss 'GMT'",
"EEE',' dd MMM yyyy HH:mm:ss 'GMT'",
"EEE MMM dd yyyy HH:mm:ss 'GMT'Z",
@ -98,8 +98,8 @@ public final class HttpCookie implements Cloneable {
};
// constant strings represent set-cookie header token
private final static String SET_COOKIE = "set-cookie:";
private final static String SET_COOKIE2 = "set-cookie2:";
private static final String SET_COOKIE = "set-cookie:";
private static final String SET_COOKIE2 = "set-cookie2:";
// ---------------- Ctors --------------

@ -66,7 +66,7 @@ import java.util.Date;
* @see java.net.HttpURLConnection#disconnect()
* @since 1.1
*/
abstract public class HttpURLConnection extends URLConnection {
public abstract class HttpURLConnection extends URLConnection {
/* instance variables */
/**

@ -84,7 +84,7 @@ import java.io.ObjectStreamException;
public final
class Inet4Address extends InetAddress {
final static int INADDRSZ = 4;
static final int INADDRSZ = 4;
/** use serialVersionUID from InetAddress, but Inet4Address instance
* is always replaced by an InetAddress instance before being

@ -173,7 +173,7 @@ import java.util.Arrays;
public final
class Inet6Address extends InetAddress {
final static int INADDRSZ = 16;
static final int INADDRSZ = 16;
/*
* cached scope_id - for link-local address use only.
@ -922,7 +922,7 @@ class Inet6Address extends InetAddress {
}
// Utilities
private final static int INT16SZ = 2;
private static final int INT16SZ = 2;
/*
* Convert IPv6 binary address into presentation (printable) format.

@ -400,16 +400,16 @@ public final class NetworkInterface {
false);
}
private native static NetworkInterface[] getAll()
private static native NetworkInterface[] getAll()
throws SocketException;
private native static NetworkInterface getByName0(String name)
private static native NetworkInterface getByName0(String name)
throws SocketException;
private native static NetworkInterface getByIndex0(int index)
private static native NetworkInterface getByIndex0(int index)
throws SocketException;
private native static NetworkInterface getByInetAddress0(InetAddress addr)
private static native NetworkInterface getByInetAddress0(InetAddress addr)
throws SocketException;
/**
@ -525,12 +525,12 @@ public final class NetworkInterface {
return virtual;
}
private native static boolean isUp0(String name, int ind) throws SocketException;
private native static boolean isLoopback0(String name, int ind) throws SocketException;
private native static boolean supportsMulticast0(String name, int ind) throws SocketException;
private native static boolean isP2P0(String name, int ind) throws SocketException;
private native static byte[] getMacAddr0(byte[] inAddr, String name, int ind) throws SocketException;
private native static int getMTU0(String name, int ind) throws SocketException;
private static native boolean isUp0(String name, int ind) throws SocketException;
private static native boolean isLoopback0(String name, int ind) throws SocketException;
private static native boolean supportsMulticast0(String name, int ind) throws SocketException;
private static native boolean isP2P0(String name, int ind) throws SocketException;
private static native byte[] getMacAddr0(byte[] inAddr, String name, int ind) throws SocketException;
private static native int getMTU0(String name, int ind) throws SocketException;
/**
* Compares this object against the specified object.

@ -69,7 +69,7 @@ public class Proxy {
* {@code Socket s = new Socket(Proxy.NO_PROXY);}
*
*/
public final static Proxy NO_PROXY = new Proxy();
public static final Proxy NO_PROXY = new Proxy();
// Creates the proxy that represents a {@code DIRECT} connection.
private Proxy() {

@ -80,7 +80,7 @@ public abstract class ResponseCache {
* @return the system-wide {@code ResponseCache}
* @since 1.5
*/
public synchronized static ResponseCache getDefault() {
public static synchronized ResponseCache getDefault() {
SecurityManager sm = System.getSecurityManager();
if (sm != null) {
sm.checkPermission(SecurityConstants.GET_RESPONSECACHE_PERMISSION);
@ -103,7 +103,7 @@ public abstract class ResponseCache {
* @see #getDefault()
* @since 1.5
*/
public synchronized static void setDefault(ResponseCache responseCache) {
public static synchronized void setDefault(ResponseCache responseCache) {
SecurityManager sm = System.getSecurityManager();
if (sm != null) {
sm.checkPermission(SecurityConstants.SET_RESPONSECACHE_PERMISSION);

@ -287,5 +287,5 @@ class SocketInputStream extends FileInputStream
/**
* Perform class load-time initializations.
*/
private native static void init();
private static native void init();
}

@ -139,7 +139,7 @@ public interface SocketOptions {
* @see Socket#getTcpNoDelay
*/
@Native public final static int TCP_NODELAY = 0x0001;
@Native public static final int TCP_NODELAY = 0x0001;
/**
* Fetch the local address binding of a socket (this option cannot
@ -160,7 +160,7 @@ public interface SocketOptions {
* @see DatagramSocket#getLocalAddress
*/
@Native public final static int SO_BINDADDR = 0x000F;
@Native public static final int SO_BINDADDR = 0x000F;
/** Sets SO_REUSEADDR for a socket. This is used only for MulticastSockets
* in java, and it is set by default for MulticastSockets.
@ -168,7 +168,7 @@ public interface SocketOptions {
* Valid for: DatagramSocketImpl
*/
@Native public final static int SO_REUSEADDR = 0x04;
@Native public static final int SO_REUSEADDR = 0x04;
/**
* Sets SO_BROADCAST for a socket. This option enables and disables
@ -179,7 +179,7 @@ public interface SocketOptions {
* @since 1.4
*/
@Native public final static int SO_BROADCAST = 0x0020;
@Native public static final int SO_BROADCAST = 0x0020;
/** Set which outgoing interface on which to send multicast packets.
* Useful on hosts with multiple network interfaces, where applications
@ -191,7 +191,7 @@ public interface SocketOptions {
* @see MulticastSocket#getInterface()
*/
@Native public final static int IP_MULTICAST_IF = 0x10;
@Native public static final int IP_MULTICAST_IF = 0x10;
/** Same as above. This option is introduced so that the behaviour
* with IP_MULTICAST_IF will be kept the same as before, while
@ -203,7 +203,7 @@ public interface SocketOptions {
* @see MulticastSocket#getNetworkInterface()
* @since 1.4
*/
@Native public final static int IP_MULTICAST_IF2 = 0x1f;
@Native public static final int IP_MULTICAST_IF2 = 0x1f;
/**
* This option enables or disables local loopback of multicast datagrams.
@ -211,7 +211,7 @@ public interface SocketOptions {
* @since 1.4
*/
@Native public final static int IP_MULTICAST_LOOP = 0x12;
@Native public static final int IP_MULTICAST_LOOP = 0x12;
/**
* This option sets the type-of-service or traffic class field
@ -219,7 +219,7 @@ public interface SocketOptions {
* @since 1.4
*/
@Native public final static int IP_TOS = 0x3;
@Native public static final int IP_TOS = 0x3;
/**
* Specify a linger-on-close timeout. This option disables/enables
@ -237,7 +237,7 @@ public interface SocketOptions {
* @see Socket#setSoLinger
* @see Socket#getSoLinger
*/
@Native public final static int SO_LINGER = 0x0080;
@Native public static final int SO_LINGER = 0x0080;
/** Set a timeout on blocking Socket operations:
* <PRE>
@ -258,7 +258,7 @@ public interface SocketOptions {
* @see ServerSocket#setSoTimeout
* @see DatagramSocket#setSoTimeout
*/
@Native public final static int SO_TIMEOUT = 0x1006;
@Native public static final int SO_TIMEOUT = 0x1006;
/**
* Set a hint the size of the underlying buffers used by the
@ -275,7 +275,7 @@ public interface SocketOptions {
* @see DatagramSocket#setSendBufferSize
* @see DatagramSocket#getSendBufferSize
*/
@Native public final static int SO_SNDBUF = 0x1001;
@Native public static final int SO_SNDBUF = 0x1001;
/**
* Set a hint the size of the underlying buffers used by the
@ -293,7 +293,7 @@ public interface SocketOptions {
* @see DatagramSocket#setReceiveBufferSize
* @see DatagramSocket#getReceiveBufferSize
*/
@Native public final static int SO_RCVBUF = 0x1002;
@Native public static final int SO_RCVBUF = 0x1002;
/**
* When the keepalive option is set for a TCP socket and no data
@ -316,7 +316,7 @@ public interface SocketOptions {
* @see Socket#setKeepAlive
* @see Socket#getKeepAlive
*/
@Native public final static int SO_KEEPALIVE = 0x0008;
@Native public static final int SO_KEEPALIVE = 0x0008;
/**
* When the OOBINLINE option is set, any TCP urgent data received on
@ -327,5 +327,5 @@ public interface SocketOptions {
* @see Socket#setOOBInline
* @see Socket#getOOBInline
*/
@Native public final static int SO_OOBINLINE = 0x1003;
@Native public static final int SO_OOBINLINE = 0x1003;
}

@ -178,6 +178,6 @@ class SocketOutputStream extends FileOutputStream
/**
* Perform class load-time initializations.
*/
private native static void init();
private static native void init();
}

@ -154,32 +154,32 @@ public final class SocketPermission extends Permission
/**
* Connect to host:port
*/
private final static int CONNECT = 0x1;
private static final int CONNECT = 0x1;
/**
* Listen on host:port
*/
private final static int LISTEN = 0x2;
private static final int LISTEN = 0x2;
/**
* Accept a connection from host:port
*/
private final static int ACCEPT = 0x4;
private static final int ACCEPT = 0x4;
/**
* Resolve DNS queries
*/
private final static int RESOLVE = 0x8;
private static final int RESOLVE = 0x8;
/**
* No actions
*/
private final static int NONE = 0x0;
private static final int NONE = 0x0;
/**
* All actions
*/
private final static int ALL = CONNECT|LISTEN|ACCEPT|RESOLVE;
private static final int ALL = CONNECT|LISTEN|ACCEPT|RESOLVE;
// various port constants
private static final int PORT_MIN = 0;

@ -492,15 +492,15 @@ public final class URI
// The remaining fields may be computed on demand
private volatile transient String schemeSpecificPart;
private volatile transient int hash; // Zero ==> undefined
private transient volatile String schemeSpecificPart;
private transient volatile int hash; // Zero ==> undefined
private volatile transient String decodedUserInfo = null;
private volatile transient String decodedAuthority = null;
private volatile transient String decodedPath = null;
private volatile transient String decodedQuery = null;
private volatile transient String decodedFragment = null;
private volatile transient String decodedSchemeSpecificPart = null;
private transient volatile String decodedUserInfo = null;
private transient volatile String decodedAuthority = null;
private transient volatile String decodedPath = null;
private transient volatile String decodedQuery = null;
private transient volatile String decodedFragment = null;
private transient volatile String decodedSchemeSpecificPart = null;
/**
* The string form of this URI.
@ -2175,7 +2175,7 @@ public final class URI
// This method takes a string argument rather than a char array so that
// this test can be performed without invoking path.toCharArray().
//
static private int needsNormalization(String path) {
private static int needsNormalization(String path) {
boolean normal = true;
int ns = 0; // Number of segments
int end = path.length() - 1; // Index of last char in path
@ -2232,7 +2232,7 @@ public final class URI
// All slashes in path replaced by '\0'
// segs[i] == Index of first char in segment i (0 <= i < segs.length)
//
static private void split(char[] path, int[] segs) {
private static void split(char[] path, int[] segs) {
int end = path.length - 1; // Index of last char in path
int p = 0; // Index of next char in path
int i = 0; // Index of current segment
@ -2281,7 +2281,7 @@ public final class URI
// Postconditions:
// path[0] .. path[return value] == Resulting path
//
static private int join(char[] path, int[] segs) {
private static int join(char[] path, int[] segs) {
int ns = segs.length; // Number of segments
int end = path.length - 1; // Index of last char in path
int p = 0; // Index of next path char to write
@ -2645,7 +2645,7 @@ public final class URI
// -- Escaping and encoding --
private final static char[] hexDigits = {
private static final char[] hexDigits = {
'0', '1', '2', '3', '4', '5', '6', '7',
'8', '9', 'A', 'B', 'C', 'D', 'E', 'F'
};

@ -365,7 +365,7 @@ public abstract class URLConnection {
* @see #getConnectTimeout()
* @see #setConnectTimeout(int)
*/
abstract public void connect() throws IOException;
public abstract void connect() throws IOException;
/**
* Sets a specified timeout value, in milliseconds, to be used
@ -1440,7 +1440,7 @@ public abstract class URLConnection {
* @see java.io.InputStream#markSupported()
* @see java.net.URLConnection#getContentType()
*/
static public String guessContentTypeFromStream(InputStream is)
public static String guessContentTypeFromStream(InputStream is)
throws IOException {
// If we can't read ahead safely, just give up on guessing
if (!is.markSupported())
@ -1605,7 +1605,7 @@ public abstract class URLConnection {
* method, the stream should have already been checked to be sure it
* contains Microsoft Structured Storage data.
*/
static private boolean checkfpx(InputStream is) throws IOException {
private static boolean checkfpx(InputStream is) throws IOException {
/* Test for FlashPix image data in Microsoft Structured Storage format.
* In general, should do this with calls to an SS implementation.
@ -1766,7 +1766,7 @@ public abstract class URLConnection {
* Returns -1, If EOF is reached before len bytes are read, returns 0
* otherwise
*/
static private int readBytes(int c[], int len, InputStream is)
private static int readBytes(int c[], int len, InputStream is)
throws IOException {
byte buf[] = new byte[len];
@ -1787,7 +1787,7 @@ public abstract class URLConnection {
* until either EOF is reached, or the specified
* number of bytes have been skipped
*/
static private long skipForward(InputStream is, long toSkip)
private static long skipForward(InputStream is, long toSkip)
throws IOException {
long eachSkip = 0;

@ -68,7 +68,7 @@ public abstract class URLStreamHandler {
* @exception IOException if an I/O error occurs while opening the
* connection.
*/
abstract protected URLConnection openConnection(URL u) throws IOException;
protected abstract URLConnection openConnection(URL u) throws IOException;
/**
* Same as openConnection(URL), except that the connection will be

@ -64,7 +64,7 @@ class Bits { // package-private
// -- get/put char --
static private char makeChar(byte b1, byte b0) {
private static char makeChar(byte b1, byte b0) {
return (char)((b1 << 8) | (b0 & 0xff));
}
@ -136,7 +136,7 @@ class Bits { // package-private
// -- get/put short --
static private short makeShort(byte b1, byte b0) {
private static short makeShort(byte b1, byte b0) {
return (short)((b1 << 8) | (b0 & 0xff));
}
@ -208,7 +208,7 @@ class Bits { // package-private
// -- get/put int --
static private int makeInt(byte b3, byte b2, byte b1, byte b0) {
private static int makeInt(byte b3, byte b2, byte b1, byte b0) {
return (((b3 ) << 24) |
((b2 & 0xff) << 16) |
((b1 & 0xff) << 8) |
@ -301,7 +301,7 @@ class Bits { // package-private
// -- get/put long --
static private long makeLong(byte b7, byte b6, byte b5, byte b4,
private static long makeLong(byte b7, byte b6, byte b5, byte b4,
byte b3, byte b2, byte b1, byte b0)
{
return ((((long)b7 ) << 56) |

@ -56,7 +56,7 @@ public abstract class Pipe {
*
* @since 1.4
*/
public static abstract class SourceChannel
public abstract static class SourceChannel
extends AbstractSelectableChannel
implements ReadableByteChannel, ScatteringByteChannel
{
@ -90,7 +90,7 @@ public abstract class Pipe {
*
* @since 1.4
*/
public static abstract class SinkChannel
public abstract static class SinkChannel
extends AbstractSelectableChannel
implements WritableByteChannel, GatheringByteChannel
{

@ -191,7 +191,7 @@ public class CoderResult {
public static final CoderResult OVERFLOW
= new CoderResult(CR_OVERFLOW, 0);
private static abstract class Cache {
private abstract static class Cache {
private Map<Integer,WeakReference<CoderResult>> cache = null;

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -70,8 +70,8 @@ import java.security.spec.AlgorithmParameterSpec;
* following standard {@code AlgorithmParameterGenerator} algorithms and
* keysizes in parentheses:
* <ul>
* <li>{@code DiffieHellman} (1024)</li>
* <li>{@code DSA} (1024)</li>
* <li>{@code DiffieHellman} (1024, 2048, 4096)</li>
* <li>{@code DSA} (1024, 2048)</li>
* </ul>
* These algorithms are described in the <a href=
* "{@docRoot}/../technotes/guides/security/StandardNames.html#AlgorithmParameterGenerator">

Some files were not shown because too many files have changed in this diff Show More