提交 514a887a 编写于 作者: A asaha

Merge

......@@ -399,3 +399,14 @@ c669323bd55ac59ad26c7ee4f47a6daefc82af8e jdk8u45-b11
6a8f9512afa687632f0a0d881bbdb446d984a74c jdk8u45-b12
55a75b0db87693e1e186752f553c337cb035a38e jdk8u45-b13
20e6cadfac43717a81d99daff5e769de695992cd jdk8u45-b14
5c31204d19e5976f025026db3d5c17331e8c44db jdk8u60-b00
c46daef6edb5385d11876ed40f292a4b62e96867 jdk8u60-b01
c10fd784956cc7099657181029ac3e790267b678 jdk8u60-b02
87c95759b92b9c2933e439f0f7e4897635af16e0 jdk8u60-b03
81e87652146b74c4ffeb1862e3e0eb3ace2374e4 jdk8u60-b04
433942aab113e7eeecbe086b346219536738b0b6 jdk8u60-b05
3a8ecea921f65bc1aef108b657c718348e152b9a jdk8u60-b06
e48ca20d8943854c878e3b8d86d6d5387b047996 jdk8u60-b07
478602cc17e212571cd0bec8979d5adc6d5c456e jdk8u60-b08
fc3f69854e7d28416168eee07859c06fe90fa6f5 jdk8u60-b09
ae448eca6b545670656c505bdc830b6dabaf1be3 jdk8u60-b10
#
# Copyright (c) 2011, 2013, 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
......@@ -64,7 +64,10 @@ ifndef OPENJDK
# This gets built on unix platforms implicitly in the old build even though
# it's excluded in the closed build.
EXCLUDES += sun/java2d/pisces
endif
endif
ifeq ($(OPENJDK_TARGET_OS), windows)
# AccessBridge is compiled separately below.
EXFILES += AccessBridge.java \
AccessBridgeLoader.java \
......@@ -73,8 +76,6 @@ ifndef OPENJDK
EXCLUDES += com/sun/java/accessibility/extensions
endif
endif
ifneq ($(OPENJDK_TARGET_OS), solaris)
# Exclude Solaris nio and two security related files in src/share/classes
EXFILES += SolarisAclFileAttributeView.java \
......@@ -272,7 +273,7 @@ include CopyIntoClasses.gmk
ifndef OPENJDK
CLOSED_SRC_DIRS := $(JDK_TOPDIR)/src/closed/share/classes \
$(JDK_TOPDIR)/src/closed/$(OPENJDK_TARGET_OS_API_DIR)/classes
$(wildcard $(JDK_TOPDIR)/src/closed/$(OPENJDK_TARGET_OS_API_DIR)/classes)
endif
MACOSX_SRC_DIRS :=
......@@ -379,7 +380,6 @@ $(JDK_OUTPUTDIR)/classes/META-INF/services/com.sun.tools.xjc.Plugin:
##########################################################################################
ifndef OPENJDK
ifeq ($(OPENJDK_TARGET_OS), windows)
ifeq ($(OPENJDK_TARGET_CPU_BITS), 32)
$(eval $(call SetupJavaCompilation,BUILD_ACCESSBRIDGE_32, \
......@@ -413,7 +413,6 @@ ifndef OPENJDK
endif
endif
endif
##########################################################################################
......
#
# 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
......@@ -659,11 +659,10 @@ endif
##########################################################################################
# jabswitch
ifndef OPENJDK
ifeq ($(OPENJDK_TARGET_OS), windows)
$(eval $(call SetupNativeCompilation,BUILD_JABSWITCH, \
SRC := $(JDK_TOPDIR)/src/closed/windows/native/sun/bridge, \
SRC := $(JDK_TOPDIR)/src/windows/native/sun/bridge, \
INCLUDE_FILES := jabswitch.cpp, \
LANG := C++, \
CFLAGS := $(filter-out -Zc:wchar_t-, $(CFLAGS_JDKEXE)) -Zc:wchar_t \
......@@ -675,17 +674,16 @@ ifndef OPENJDK
OUTPUT_DIR := $(JDK_OUTPUTDIR)/bin, \
PROGRAM := jabswitch, \
DEBUG_SYMBOLS := true, \
VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/closed/windows/native/sun/bridge/AccessBridgeStatusWindow.rc, \
VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/native/sun/bridge/AccessBridgeStatusWindow.rc, \
RC_FLAGS := $(RC_FLAGS) \
-D "JDK_FNAME=jabswitch.exe" \
-D "JDK_INTERNAL_NAME=jabswitch" \
-D "JDK_FTYPE=0x01L", \
MANIFEST := $(JDK_TOPDIR)/src/closed/windows/native/sun/bridge/jabswitch.manifest))
MANIFEST := $(JDK_TOPDIR)/src/windows/native/sun/bridge/jabswitch.manifest))
BUILD_LAUNCHERS += $(BUILD_JABSWITCH)
endif
endif
##########################################################################################
......
#
# Copyright (c) 2011, 2013, 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
......@@ -55,7 +55,6 @@ COPY_FILES = $(H_TARGET_FILES)
##########################################################################################
ifndef OPENJDK
ifeq ($(OPENJDK_TARGET_OS), windows)
COPY_FILES += $(OPENJDK_TARGET_OS_INCLUDE)/bridge/AccessBridgeCallbacks.h \
$(OPENJDK_TARGET_OS_INCLUDE)/bridge/AccessBridgeCalls.h \
......@@ -64,14 +63,12 @@ ifndef OPENJDK
$(JDK_OUTPUTDIR)/lib/accessibility.properties
$(OPENJDK_TARGET_OS_INCLUDE)/bridge/%: \
$(JDK_TOPDIR)/src/closed/windows/native/sun/bridge/%
$(JDK_TOPDIR)/src/windows/native/sun/bridge/%
$(install-file)
$(JDK_OUTPUTDIR)/lib/accessibility.properties: \
$(JDK_TOPDIR)/src/closed/windows/native/sun/bridge/accessibility.properties
$(JDK_TOPDIR)/src/windows/native/sun/bridge/accessibility.properties
$(install-file)
endif
endif
##########################################################################################
......@@ -285,7 +282,10 @@ endif
ifeq ($(OPENJDK_TARGET_OS), macosx)
JVMCFG_SRC := $(JDK_TOPDIR)/src/macosx/bin/$(JVMCFG_ARCH)/jvm.cfg
else
JVMCFG_SRC := $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/bin/$(JVMCFG_ARCH)/jvm.cfg
JVMCFG_BASE := $(OPENJDK_TARGET_OS_API_DIR)/bin/$(JVMCFG_ARCH)/jvm.cfg
ALT_JVMCFG_SRC := $(JDK_TOPDIR)/src/closed/$(JVMCFG_BASE)
# Use the ALT file if it exists
JVMCFG_SRC := $(if $(wildcard $(ALT_JVMCFG_SRC)),$(ALT_JVMCFG_SRC),$(JDK_TOPDIR)/src/$(JVMCFG_BASE))
endif
JVMCFG_DIR := $(JDK_OUTPUTDIR)/lib$(OPENJDK_TARGET_CPU_LIBDIR)
JVMCFG := $(JVMCFG_DIR)/jvm.cfg
......
#
# Copyright (c) 2011, 2013, 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
......@@ -267,10 +267,12 @@ $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.rt.jar.contents: $(IMAGES_OUTPUTDIR)/lib$
$(RM) $@ $@.tmp
$(GREP) -e '\.class$$' $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.jars.contents > $@.tmp
ifneq ($(PROFILE), )
# # Add back classes from excluded packages (fixing the $ substitution in the process)
for type in $(subst \$$,\, $(RT_JAR_INCLUDE_TYPES)) ; do \
$(ECHO) $$type >> $@.tmp ; \
done
ifneq ($(strip $(RT_JAR_INCLUDE_TYPES)), )
# Add back classes from excluded packages (fixing the $ substitution in the process)
for type in $(subst \$$,\, $(RT_JAR_INCLUDE_TYPES)) ; do \
$(ECHO) $$type >> $@.tmp ; \
done
endif
endif
$(MV) $@.tmp $@
......@@ -281,15 +283,15 @@ $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.resources.jar.contents: $(IMAGES_OUTPUTDI
-e '/_the\.*' -e '^_the\.*' -e '\\_the\.*' -e 'javac_state' \
$(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.jars.contents > $@.tmp
ifneq ($(PROFILE), )
# # Strip out all META-INF/services/ entries
$(GREP) -v -e 'META-INF/services/' $@.tmp > $@.tmp2
# # Add back the required services
# # FIXME: On Solaris if PROFILE_INCLUDE_METAINF_SERVICES is not defined
# # we get a syntax error from sh. That doesn't happen on linux
for service in $(PROFILE_INCLUDE_METAINF_SERVICES) ; do \
$(ECHO) $$service >> $@.tmp2; \
done
$(MV) $@.tmp2 $@.tmp
ifneq ($(strip $(PROFILE_INCLUDE_METAINF_SERVICES)), )
# Strip out all META-INF/services/ entries
$(GREP) -v -e 'META-INF/services/' $@.tmp > $@.tmp2
# Add back the required services
for service in $(PROFILE_INCLUDE_METAINF_SERVICES) ; do \
$(ECHO) $$service >> $@.tmp2; \
done
$(MV) $@.tmp2 $@.tmp
endif
endif
$(MV) $@.tmp $@
......@@ -309,6 +311,15 @@ $(BEANLESS_CLASSES)/%: $(JDK_OUTPUTDIR)/classes/%
$(MKDIR) -p $(@D)
$(TOOL_REMOVEMETHODS) '$<' $@ addPropertyChangeListener removePropertyChangeListener
# Code these targets explicitly because the target "%" expansion does
# not work with the inline "$" in the file name.
$(BEANLESS_CLASSES)/java/util/jar/Pack200\$$Packer.class: $(JDK_OUTPUTDIR)/classes/java/util/jar/Pack200$$Packer.class
$(MKDIR) -p $(@D)
$(TOOL_REMOVEMETHODS) '$<' $@ addPropertyChangeListener removePropertyChangeListener
$(BEANLESS_CLASSES)/java/util/jar/Pack200\$$Unpacker.class: $(JDK_OUTPUTDIR)/classes/java/util/jar/Pack200$$Unpacker.class
$(MKDIR) -p $(@D)
$(TOOL_REMOVEMETHODS) '$<' $@ addPropertyChangeListener removePropertyChangeListener
CLASSES_TO_DEBEAN = \
java/util/logging/LogManager.class \
java/util/jar/Pack200\$$Packer.class \
......@@ -639,7 +650,6 @@ $(eval $(call SetupZipArchive,BUILD_SRC_ZIP, \
##########################################################################################
ifndef OPENJDK
ifeq ($(OPENJDK_TARGET_OS), windows)
$(eval $(call SetupArchive,BUILD_JACCESS_JAR, , \
......@@ -675,7 +685,6 @@ ifndef OPENJDK
JARS += $(IMAGES_OUTPUTDIR)/lib/ext/access-bridge-64.jar
endif
endif
endif
##########################################################################################
......
#
# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
......@@ -161,11 +161,13 @@ JRE_BIN_LIST := $(filter-out $(addprefix %, $(WINDOWS_JDKJRE_BIN_FILES)), $(JDKJ
ifeq ($(OPENJDK_TARGET_OS), windows)
JDK_BIN_LIST := $(filter $(addprefix %, $(WINDOWS_JDK_BIN_FILES)), $(ALL_BIN_LIST))
# On windows x86, the server jvm is filtered out from the j2re image. This could possibly
# be handled by profiles in the future. If no client jvm is built, leave server in.
# On windows x86, the server jvm is filtered out from the j2re image. This is historical
# and is not applied to compact profiles. If no client jvm is built, leave server in.
ifeq ($(OPENJDK_TARGET_CPU), x86)
ifeq ($(JVM_VARIANT_CLIENT), true)
JRE_BIN_LIST := $(filter-out $(JDK_OUTPUTDIR)/bin/server/%, $(JRE_BIN_LIST))
ifeq ($(PROFILE), )
JRE_BIN_LIST := $(filter-out $(JDK_OUTPUTDIR)/bin/server/%, $(JRE_BIN_LIST))
endif
endif
endif
else
......
#
# Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
......@@ -116,6 +116,12 @@ endef
#
HOTSPOT_IMPORT_FILES := $(addprefix $(LIBRARY_PREFIX), jvm.* saproc.* jsig.* sawindbg.* jvm_db.* jvm_dtrace.*) \
Xusage.txt sa-jdi.jar
ifeq ($(OPENJDK_TARGET_OS), macosx)
# additional debug file
HOTSPOT_IMPORT_FILES += Info.plist
endif
$(eval $(call CopyDir,HOTSPOT0, $(HOTSPOT_LIB_DIR), $(INSTALL_LIBRARIES_HERE), $(HOTSPOT_IMPORT_FILES)))
$(eval $(call CopyDir,HOTSPOT1, $(HOTSPOT_DIST)/lib, $(JDK_OUTPUTDIR)/lib, $(HOTSPOT_IMPORT_FILES)))
......
......@@ -47,7 +47,6 @@ include profile-includes.txt
# Note that some jars may be optional depending on the type of build (jdk vs.
# openjdk) and the platform.
#
# WARNING: incoming lists are currently validated for linux only!
###############################################################################
# These are jar files for which the contents vary depending on the profile
......
......@@ -124,11 +124,11 @@ TOOL_CLDRCONVERTER = $(JAVA_SMALL) -cp $(JDK_OUTPUTDIR)/btclasses \
build.tools.cldrconverter.CLDRConverter
TOOL_REMOVEMETHODS = $(JAVA_SMALL) -Xbootclasspath/p:$(LANGTOOLS_OUTPUTDIR)/dist/bootstrap/lib/javac.jar \
-cp $(JDK_OUTPUTDIR)/btclasses:$(JDK_OUTPUTDIR) \
-cp '$(JDK_OUTPUTDIR)/btclasses$(PATH_SEP)$(JDK_OUTPUTDIR)' \
build.tools.classfile.RemoveMethods
TOOL_CHECKDEPS = $(JAVA_SMALL) -Xbootclasspath/p:$(LANGTOOLS_OUTPUTDIR)/dist/bootstrap/lib/javac.jar \
-cp $(JDK_OUTPUTDIR)/btclasses:$(JDK_OUTPUTDIR) \
-cp '$(JDK_OUTPUTDIR)/btclasses$(PATH_SEP)$(JDK_OUTPUTDIR)' \
build.tools.deps.CheckDeps
TOOL_ADDTORESTRICTEDPKGS=$(JAVA_SMALL) -cp $(JDK_OUTPUTDIR)/btclasses \
......
0x00 U+0000
0x01 U+0001
0x02 U+0002
0x03 U+0003
0x04 U+009c
0x05 U+0009
0x06 U+0086
0x07 U+007f
0x08 U+0097
0x09 U+008d
0x0a U+008e
0x0b U+000b
0x0c U+000c
0x0d U+000d
0x0e U+000e
0x0f U+000f
0x10 U+0010
0x11 U+0011
0x12 U+0012
0x13 U+0013
0x14 U+009d
0x15 U+000a
0x16 U+0008
0x17 U+0087
0x18 U+0018
0x19 U+0019
0x1a U+0092
0x1b U+008f
0x1c U+001c
0x1d U+001d
0x1e U+001e
0x1f U+001f
0x20 U+0080
0x21 U+0081
0x22 U+0082
0x23 U+0083
0x24 U+0084
0x25 U+000a
0x26 U+0017
0x27 U+001b
0x28 U+0088
0x29 U+0089
0x2a U+008a
0x2b U+008b
0x2c U+008c
0x2d U+0005
0x2e U+0006
0x2f U+0007
0x30 U+0090
0x31 U+0091
0x32 U+0016
0x33 U+0093
0x34 U+0094
0x35 U+0095
0x36 U+0096
0x37 U+0004
0x38 U+0098
0x39 U+0099
0x3a U+009a
0x3b U+009b
0x3c U+0014
0x3d U+0015
0x3e U+009e
0x3f U+001a
0x40 U+0020
0x41 U+00a0
0x42 U+04d9
0x43 U+0493
0x44 U+0451
0x45 U+0454
0x46 U+0455
0x47 U+0456
0x48 U+049b
0x49 U+0458
0x4a U+005b
0x4b U+002e
0x4c U+003c
0x4d U+0028
0x4e U+002b
0x4f U+0021
0x50 U+0026
0x51 U+04a3
0x52 U+04e9
0x53 U+04b1
0x54 U+04af
0x55 U+045e
0x56 U+04bb
0x57 U+042a
0x58 U+2116
0x59 U+04d8
0x5a U+005d
0x5b U+0024
0x5c U+002a
0x5d U+0029
0x5e U+003b
0x5f U+005e
0x60 U+002d
0x61 U+002f
0x62 U+0492
0x63 U+0401
0x64 U+0404
0x65 U+0405
0x66 U+0406
0x67 U+049a
0x68 U+0408
0x69 U+04a2
0x6a U+007c
0x6b U+002c
0x6c U+0025
0x6d U+005f
0x6e U+003e
0x6f U+003f
0x70 U+04e8
0x71 U+04b0
0x72 U+04ae
0x73 U+00ad
0x74 U+040e
0x75 U+04ba
0x76 U+044e
0x77 U+0430
0x78 U+0431
0x79 U+0060
0x7a U+003a
0x7b U+0023
0x7c U+0040
0x7d U+0027
0x7e U+003d
0x7f U+0022
0x80 U+0446
0x81 U+0061
0x82 U+0062
0x83 U+0063
0x84 U+0064
0x85 U+0065
0x86 U+0066
0x87 U+0067
0x88 U+0068
0x89 U+0069
0x8a U+0434
0x8b U+0435
0x8c U+0444
0x8d U+0433
0x8e U+0445
0x8f U+0438
0x90 U+0439
0x91 U+006a
0x92 U+006b
0x93 U+006c
0x94 U+006d
0x95 U+006e
0x96 U+006f
0x97 U+0070
0x98 U+0071
0x99 U+0072
0x9a U+043a
0x9b U+043b
0x9c U+043c
0x9d U+043d
0x9e U+043e
0x9f U+043f
0xa0 U+044f
0xa1 U+007e
0xa2 U+0073
0xa3 U+0074
0xa4 U+0075
0xa5 U+0076
0xa6 U+0077
0xa7 U+0078
0xa8 U+0079
0xa9 U+007a
0xaa U+0440
0xab U+0441
0xac U+0442
0xad U+0443
0xae U+0436
0xaf U+0432
0xb0 U+044c
0xb1 U+044b
0xb2 U+0437
0xb3 U+0448
0xb4 U+044d
0xb5 U+0449
0xb6 U+0447
0xb7 U+044a
0xb8 U+042e
0xb9 U+0410
0xba U+0411
0xbb U+0426
0xbc U+0414
0xbd U+0415
0xbe U+0424
0xbf U+0413
0xc0 U+007b
0xc1 U+0041
0xc2 U+0042
0xc3 U+0043
0xc4 U+0044
0xc5 U+0045
0xc6 U+0046
0xc7 U+0047
0xc8 U+0048
0xc9 U+0049
0xca U+0425
0xcb U+0418
0xcc U+0419
0xcd U+041a
0xce U+041b
0xcf U+041c
0xd0 U+007d
0xd1 U+004a
0xd2 U+004b
0xd3 U+004c
0xd4 U+004d
0xd5 U+004e
0xd6 U+004f
0xd7 U+0050
0xd8 U+0051
0xd9 U+0052
0xda U+041d
0xdb U+041e
0xdc U+041f
0xdd U+042f
0xde U+0420
0xdf U+0421
0xe0 U+005c
0xe1 U+20ac
0xe2 U+0053
0xe3 U+0054
0xe4 U+0055
0xe5 U+0056
0xe6 U+0057
0xe7 U+0058
0xe8 U+0059
0xe9 U+005a
0xea U+0422
0xeb U+0423
0xec U+0416
0xed U+0412
0xee U+042c
0xef U+042b
0xf0 U+0030
0xf1 U+0031
0xf2 U+0032
0xf3 U+0033
0xf4 U+0034
0xf5 U+0035
0xf6 U+0036
0xf7 U+0037
0xf8 U+0038
0xf9 U+0039
0xfa U+0417
0xfb U+0428
0xfc U+042d
0xfd U+0429
0xfe U+0427
0xff U+009f
......@@ -22,6 +22,7 @@ IBM1146 IBM01146 Cp1146 false sun.nio.cs.ext
IBM1147 IBM01147 Cp1147 false sun.nio.cs.ext
IBM1148 IBM01148 Cp1148 false sun.nio.cs.ext
IBM1149 IBM01149 Cp1149 false sun.nio.cs.ext
IBM1166 x-IBM1166 Cp1166 false sun.nio.cs.ext
IBM273 IBM273 Cp273 false sun.nio.cs.ext
IBM277 IBM277 Cp277 false sun.nio.cs.ext
IBM278 IBM278 Cp278 false sun.nio.cs.ext
......
#
# Copyright (c) 2011, 2013, 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
......@@ -174,11 +174,10 @@ endif
##########################################################################################
ifndef OPENJDK
ifeq ($(OPENJDK_TARGET_OS), windows)
AB_GENSRC_DIR := $(JDK_OUTPUTDIR)/gensrc_ab
AB_SRC_DIR := $(JDK_TOPDIR)/src/closed/windows/classes/com/sun/java/accessibility
AB_SRC_DIR := $(JDK_TOPDIR)/src/windows/classes/com/sun/java/accessibility
ifeq ($(OPENJDK_TARGET_CPU_BITS), 32)
$(AB_GENSRC_DIR)/32bit/com/sun/java/accessibility/AccessBridgeLoader.java: \
......@@ -216,6 +215,5 @@ ifndef OPENJDK
endif
endif
endif
##########################################################################################
......@@ -319,7 +319,6 @@ endif
ifeq ($(OPENJDK_TARGET_OS), macosx)
LIBAWT_FILES += awt_LoadLibrary.c
LIBAWT_CFLAGS += -F/System/Library/Frameworks/JavaVM.framework/Frameworks
endif
ifeq ($(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_ARCH), solaris-sparc)
......@@ -485,7 +484,6 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBAWT, \
LDFLAGS_SUFFIX_macosx := -lmlib_image -ljvm $(LIBM) \
-framework Cocoa \
-framework OpenGL \
-F/System/Library/Frameworks/JavaVM.framework/Frameworks \
-framework JavaNativeFoundation \
-framework JavaRuntimeSupport \
-framework ApplicationServices \
......@@ -827,8 +825,8 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBFONTMANAGER, \
$(call SET_SHARED_LIBRARY_ORIGIN), \
LDFLAGS_SUFFIX := $(BUILD_LIBFONTMANAGER_FONTLIB), \
LDFLAGS_SUFFIX_linux := -lawt $(LIBM) $(LIBCXX) -ljava -ljvm -lc, \
LDFLAGS_SUFFIX_solaris := -lawt -lawt_xawt -lc $(LIBM) $(LIBCXX) -ljava -ljvm, \
LDFLAGS_SUFFIX_aix := -lawt -lawt_xawt $(LIBM) $(LIBCXX) -ljava -ljvm,\
LDFLAGS_SUFFIX_solaris := -lawt -lawt_headless -lc $(LIBM) $(LIBCXX) -ljava -ljvm, \
LDFLAGS_SUFFIX_aix := -lawt -lawt_headless $(LIBM) $(LIBCXX) -ljava -ljvm,\
LDFLAGS_SUFFIX_macosx := -lawt $(LIBM) $(LIBCXX) -undefined dynamic_lookup \
-ljava -ljvm, \
LDFLAGS_SUFFIX_windows := $(WIN_JAVA_LIB) advapi32.lib user32.lib gdi32.lib \
......@@ -1120,12 +1118,6 @@ ifeq ($(BUILD_HEADLESS), true)
-I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/jdga \
$(foreach dir, $(LIBAWT_HEADLESS_DIRS), -I$(dir))
ifeq ($(OPENJDK_TARGET_OS), macosx)
LIBAWT_HEADLESS_CFLAGS += \
-F/System/Library/Frameworks/JavaVM.framework/Frameworks \
-F/System/Library/Frameworks/ApplicationServices.framework/Frameworks
endif
LIBAWT_HEADLESS_FILES := \
awt_Font.c \
HeadlessToolkit.c \
......@@ -1217,8 +1209,7 @@ ifndef BUILD_HEADLESS_ONLY
ifeq ($(OPENJDK_TARGET_OS), macosx)
LIBSPLASHSCREEN_CFLAGS := -I$(JDK_TOPDIR)/src/macosx/native/sun/awt/splashscreen \
$(LIBSPLASHSCREEN_CFLAGS) \
-F/System/Library/Frameworks/JavaVM.framework/Frameworks
$(LIBSPLASHSCREEN_CFLAGS)
LIBSPLASHSCREEN_CFLAGS += -DWITH_MACOSX
LIBSPLASHSCREEN_CFLAGS += -I$(JDK_TOPDIR)/src/macosx/native/sun/osxapp
......@@ -1250,7 +1241,6 @@ ifndef BUILD_HEADLESS_ONLY
-framework ApplicationServices \
-framework Foundation \
-framework Cocoa \
-F/System/Library/Frameworks/JavaVM.framework/Frameworks \
-framework JavaNativeFoundation
else ifeq ($(OPENJDK_TARGET_OS), windows)
LIBSPLASHSCREEN_LDFLAGS_SUFFIX += kernel32.lib user32.lib gdi32.lib delayimp.lib -DELAYLOAD:user32.dll
......@@ -1436,9 +1426,7 @@ ifeq ($(OPENJDK_TARGET_OS), macosx)
-I$(JDK_TOPDIR)/src/share/native/sun/awt/image/cvutils \
-I$(JDK_TOPDIR)/src/share/native/sun/java2d/loops \
-I$(JDK_TOPDIR)/src/share/native/sun/java2d/pipe \
-I$(JDK_TOPDIR)/src/share/native/sun/awt/debug \
-F/System/Library/Frameworks/JavaVM.framework/Frameworks \
-F/System/Library/Frameworks/ApplicationServices.framework/Frameworks, \
-I$(JDK_TOPDIR)/src/share/native/sun/awt/debug, \
LDFLAGS := $(LDFLAGS_JDKLIB) \
$(call SET_SHARED_LIBRARY_ORIGIN), \
LDFLAGS_SUFFIX_macosx := -lawt -lmlib_image -losxapp -ljvm $(LIBM) \
......@@ -1449,7 +1437,6 @@ ifeq ($(OPENJDK_TARGET_OS), macosx)
-framework Cocoa \
-framework Security \
-framework ExceptionHandling \
-F/System/Library/Frameworks/JavaVM.framework/Frameworks \
-framework JavaNativeFoundation \
-framework JavaRuntimeSupport \
-framework OpenGL \
......@@ -1482,8 +1469,7 @@ ifeq ($(OPENJDK_TARGET_OS), macosx)
CFLAGS := $(CFLAGS_JDKLIB) \
-I$(JDK_TOPDIR)/src/macosx/native/com/apple/laf \
-I$(JDK_TOPDIR)/src/macosx/native/sun/osxapp \
-I$(JDK_TOPDIR)/src/macosx/native/sun/awt \
-F/System/Library/Frameworks/JavaVM.framework/Frameworks, \
-I$(JDK_TOPDIR)/src/macosx/native/sun/awt, \
LDFLAGS := $(LDFLAGS_JDKLIB) \
$(call SET_SHARED_LIBRARY_ORIGIN) \
-Xlinker -rpath -Xlinker @loader_path, \
......@@ -1491,7 +1477,6 @@ ifeq ($(OPENJDK_TARGET_OS), macosx)
-framework Cocoa \
-framework Carbon \
-framework ApplicationServices \
-F/System/Library/Frameworks/JavaVM.framework/Frameworks \
-framework JavaNativeFoundation \
-framework JavaRuntimeSupport \
-ljava -ljvm, \
......
#
# 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,14 +32,11 @@ ifeq ($(OPENJDK_TARGET_OS), macosx)
LANG := C, \
OPTIMIZATION := LOW, \
CFLAGS := $(CFLAGS_JDKLIB) \
-I$(JDK_TOPDIR)/src/macosx/native/apple/applescript \
-F/System/Library/Frameworks/JavaVM.framework/Frameworks \
-F/System/Library/Frameworks/ApplicationServices.framework/Frameworks, \
-I$(JDK_TOPDIR)/src/macosx/native/apple/applescript, \
LDFLAGS := $(LDFLAGS_JDKLIB) \
$(call SET_SHARED_LIBRARY_ORIGIN), \
LDFLAGS_SUFFIX := -framework Cocoa \
-framework Carbon \
-F/System/Library/Frameworks/JavaVM.framework/Frameworks \
-framework JavaNativeFoundation \
$(LDFLAGS_JDKLIB_SUFFIX), \
OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libAppleScriptEngine, \
......@@ -63,9 +60,7 @@ ifeq ($(OPENJDK_TARGET_OS), macosx)
OPTIMIZATION := LOW, \
CFLAGS := $(CFLAGS_JDKLIB) \
-I$(JDK_TOPDIR)/src/macosx/native/sun/osxapp \
-I$(JDK_OUTPUTDIR)/gensrc/sun/osxapp \
-F/System/Library/Frameworks/JavaVM.framework/Frameworks \
-F/System/Library/Frameworks/ApplicationServices.framework/Frameworks, \
-I$(JDK_OUTPUTDIR)/gensrc/sun/osxapp, \
LDFLAGS := $(LDFLAGS_JDKLIB) \
$(call SET_SHARED_LIBRARY_ORIGIN), \
LDFLAGS_SUFFIX_macosx := \
......@@ -76,7 +71,6 @@ ifeq ($(OPENJDK_TARGET_OS), macosx)
-framework Cocoa \
-framework Security \
-framework ExceptionHandling \
-F/System/Library/Frameworks/JavaVM.framework/Frameworks \
-framework JavaNativeFoundation \
-framework JavaRuntimeSupport \
-framework OpenGL \
......@@ -108,16 +102,13 @@ ifeq ($(OPENJDK_TARGET_OS), macosx)
OPTIMIZATION := LOW, \
CFLAGS := $(CFLAGS_JDKLIB) \
$(foreach dir, $(LIBOSX_DIRS), -I$(dir)) \
-I$(JDK_TOPDIR)/src/macosx/native/sun/osxapp \
-F/System/Library/Frameworks/JavaVM.framework/Frameworks \
-F/System/Library/Frameworks/ApplicationServices.framework/Frameworks, \
-I$(JDK_TOPDIR)/src/macosx/native/sun/osxapp, \
LDFLAGS := $(LDFLAGS_JDKLIB) \
$(call SET_SHARED_LIBRARY_ORIGIN), \
LDFLAGS_SUFFIX_macosx := \
-losxapp \
-framework Cocoa \
-framework ApplicationServices \
-F/System/Library/Frameworks/JavaVM.framework/Frameworks \
-framework JavaNativeFoundation \
-framework JavaRuntimeSupport \
-framework Security \
......@@ -136,10 +127,9 @@ endif
##########################################################################################
ifndef OPENJDK
ifeq ($(OPENJDK_TARGET_OS), windows)
ACCESSBRIDGE_SRCDIR := $(JDK_TOPDIR)/src/closed/windows/native/sun/bridge
ACCESSBRIDGE_SRCDIR := $(JDK_TOPDIR)/src/windows/native/sun/bridge
define SetupAccessBridge
# Parameter 1 Suffix
......@@ -158,8 +148,7 @@ ifndef OPENJDK
LDFLAGS := $(LDFLAGS_JDKLIB) kernel32.lib user32.lib gdi32.lib \
winspool.lib jawt.lib comdlg32.lib advapi32.lib shell32.lib \
ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib \
-subsystem:windows -machine:$2 \
-def:$(ACCESSBRIDGE_SRCDIR)/JAWTAccessBridge.DEF, \
-subsystem:windows -machine:$2, \
VERSIONINFO_RESOURCE := $(ACCESSBRIDGE_SRCDIR)/AccessBridgeStatusWindow.rc, \
RC_FLAGS := $(RC_FLAGS) \
-D "JDK_FNAME=JAWTAccessBridge$1.dll" \
......@@ -168,7 +157,8 @@ ifndef OPENJDK
OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjawtaccessbridge$1, \
DEBUG_SYMBOLS := true)
$$(BUILD_JAWTACCESSBRIDGE$1): $(JDK_OUTPUTDIR)/lib/$(LIBRARY_PREFIX)jawt$(STATIC_LIBRARY_SUFFIX)
$$(BUILD_JAWTACCESSBRIDGE$1): \
$(JDK_OUTPUTDIR)/lib/$(LIBRARY_PREFIX)jawt$(STATIC_LIBRARY_SUFFIX)
$(call SetupNativeCompilation,BUILD_JAVAACCESSBRIDGE$1, \
LIBRARY = JavaAccessBridge$1, \
......@@ -184,8 +174,7 @@ ifndef OPENJDK
LDFLAGS := $(LDFLAGS_JDKLIB) kernel32.lib user32.lib gdi32.lib \
winspool.lib comdlg32.lib advapi32.lib shell32.lib \
ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib \
-subsystem:windows -machine:$2 \
-def:$(ACCESSBRIDGE_SRCDIR)/JavaAccessBridge.DEF, \
-subsystem:windows -machine:$2, \
VERSIONINFO_RESOURCE := $(ACCESSBRIDGE_SRCDIR)/AccessBridgeStatusWindow.rc, \
RC_FLAGS := $(RC_FLAGS) \
-D "JDK_FNAME=JavaAccessBridge$1.dll" \
......@@ -230,5 +219,5 @@ ifndef OPENJDK
else
$(eval $(call SetupAccessBridge,-64,X64,64))
endif
endif
endif
......@@ -110,6 +110,8 @@ SUNWprivate_1.1 {
NET_Bind;
NET_MapSocketOption;
NET_Wait;
NET_EnableFastTcpLoopback;
NET_ThrowNew;
ipv6_available;
local:
......
#
# Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
......@@ -22,38 +22,150 @@
# or visit www.oracle.com if you need additional information or have any
# questions.
#
# These lists define where a file belongs if it exists. It is perfectly fine
# if a file does not exist on some platforms - we do not have to produce exact
# per-platform lists. However, for clarity, platform-unique files are handled
# in platform-specific conditionals.
# On different platforms the libraries are placed into different locations in the
# JRE:
ifeq (, $(findstring $(OPENJDK_TARGET_OS), windows macosx))
# On non-windows/OSX libraries go into jre/lib/<arch>
LIBS_PREFIX := $(OPENJDK_TARGET_CPU_LEGACY_LIB)/
else
# On OSX they go into jre/lib/ - on Windows they go into jre/bin/ and we won't use this
LIBS_PREFIX :=
endif
# Debug info files are tricky to deal with due to all the different platform variants
# and because they can be zipped.
ifeq ($(ZIP_DEBUGINFO_FILES), true)
# Common case and 'just works' on all platforms
DEBUG_SUFFIX := .diz
else
# It gets complicated ...
ifeq ($(OPENJDK_TARGET_OS), macosx)
# This is a directory, not a simple file, so
# it needs expanding explicitly later on
DEBUG_SUFFIX := $(SHARED_LIBRARY_SUFFIX).dSYM
else
ifeq ($(OPENJDK_TARGET_OS), windows)
DEBUG_SUFFIX := .map .pdb
else
DEBUG_SUFFIX := .debuginfo
endif
endif
endif
# Expand the contents of the .dSYM directories on macosx.
# Param 1 - debug files list eg libFoo.dylib.dSYM or libFoo.diz (if zipped)
# Param 2 - libraries list eg Foo
# On macosx if not zipping debuginfo files we expand the contents of the .dSYM directories,
# else we return the original list of .diz files.
# On other OS we return the original list of debuginfo files (whether zipped or not)
#
define expand-debuginfo
$(if $(and $(filter-out true, $(ZIP_DEBUGINFO_FILES)), $(filter macosx, $(OPENJDK_TARGET_OS))), \
$(foreach i, $1, $(addsuffix /Contents/Info.plist, $i)) \
$(foreach i, $2, $(addsuffix /Contents/Resources/DWARF/$i, $(filter $i.%, $1))), \
$1)
endef
# Common executable files
PROFILE_1_JRE_BIN_FILES := \
java$(EXE_SUFFIX) \
keytool$(EXE_SUFFIX)
PROFILE_1_JRE_LIB_FILES := \
$(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)j2pkcs11$(SHARED_LIBRARY_SUFFIX) \
$(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)java$(SHARED_LIBRARY_SUFFIX) \
$(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)jsig$(SHARED_LIBRARY_SUFFIX) \
$(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)jsig.diz \
$(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)net$(SHARED_LIBRARY_SUFFIX) \
$(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)nio$(SHARED_LIBRARY_SUFFIX) \
$(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)sunec$(SHARED_LIBRARY_SUFFIX) \
$(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)verify$(SHARED_LIBRARY_SUFFIX) \
$(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)verify.diz \
$(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)zip$(SHARED_LIBRARY_SUFFIX) \
$(OPENJDK_TARGET_CPU_LEGACY_LIB)/client/$(LIBRARY_PREFIX)jsig$(SHARED_LIBRARY_SUFFIX) \
$(OPENJDK_TARGET_CPU_LEGACY_LIB)/client/$(LIBRARY_PREFIX)jsig.diz \
$(OPENJDK_TARGET_CPU_LEGACY_LIB)/client/$(LIBRARY_PREFIX)jvm$(SHARED_LIBRARY_SUFFIX) \
$(OPENJDK_TARGET_CPU_LEGACY_LIB)/client/$(LIBRARY_PREFIX)jvm.diz \
$(OPENJDK_TARGET_CPU_LEGACY_LIB)/client/Xusage.txt \
$(OPENJDK_TARGET_CPU_LEGACY_LIB)/jli/$(LIBRARY_PREFIX)jli$(SHARED_LIBRARY_SUFFIX) \
$(OPENJDK_TARGET_CPU_LEGACY_LIB)/jvm.cfg \
$(OPENJDK_TARGET_CPU_LEGACY_LIB)/minimal/$(LIBRARY_PREFIX)jsig$(SHARED_LIBRARY_SUFFIX) \
$(OPENJDK_TARGET_CPU_LEGACY_LIB)/minimal/$(LIBRARY_PREFIX)jsig.diz \
$(OPENJDK_TARGET_CPU_LEGACY_LIB)/minimal/$(LIBRARY_PREFIX)jvm$(SHARED_LIBRARY_SUFFIX) \
$(OPENJDK_TARGET_CPU_LEGACY_LIB)/minimal/$(LIBRARY_PREFIX)jvm.diz \
$(OPENJDK_TARGET_CPU_LEGACY_LIB)/minimal/Xusage.txt \
$(OPENJDK_TARGET_CPU_LEGACY_LIB)/server/$(LIBRARY_PREFIX)jsig$(SHARED_LIBRARY_SUFFIX) \
$(OPENJDK_TARGET_CPU_LEGACY_LIB)/server/$(LIBRARY_PREFIX)jsig.diz \
$(OPENJDK_TARGET_CPU_LEGACY_LIB)/server/$(LIBRARY_PREFIX)jvm$(SHARED_LIBRARY_SUFFIX) \
$(OPENJDK_TARGET_CPU_LEGACY_LIB)/server/$(LIBRARY_PREFIX)jvm.diz \
$(OPENJDK_TARGET_CPU_LEGACY_LIB)/server/Xusage.txt \
ifeq ($(OPENJDK_TARGET_OS), windows)
PROFILE_1_JRE_BIN_FILES += javaw$(EXE_SUFFIX)
endif
PROFILE_1_LIBRARIES := \
j2pkcs11 \
java \
jsig \
net \
nio \
sunec \
verify \
zip
ifeq ($(OPENJDK_TARGET_OS), windows)
PROFILE_1_LIBRARIES += msvcrt100
endif
PROFILE_1_LIBRARIES := $(addprefix $(LIBRARY_PREFIX), $(PROFILE_1_LIBRARIES))
PROFILE_1_DEBUG_FILES := $(foreach i, $(DEBUG_SUFFIX), $(addsuffix $i, $(PROFILE_1_LIBRARIES)))
PROFILE_1_LIBRARIES := $(addsuffix $(SHARED_LIBRARY_SUFFIX), $(PROFILE_1_LIBRARIES))
PROFILE_1_DEBUG_FILES := $(call expand-debuginfo, $(PROFILE_1_DEBUG_FILES), $(PROFILE_1_LIBRARIES))
PROFILE_1_LIBRARIES += $(PROFILE_1_DEBUG_FILES)
# Note: libjsig exists as both the real file and a symlink in the VM directory
# so we have to treat it with care when looking for the debuginfo files
VM_LIBRARIES := \
jvm
ifeq ($(OPENJDK_TARGET_OS), solaris)
VM_LIBRARIES += jvm_db jvm_dtrace
endif
VM_SYMLINKS := \
jsig
VM_LIBRARIES := $(addprefix $(LIBRARY_PREFIX), $(VM_LIBRARIES))
VM_DEBUG_FILES := $(foreach i, $(DEBUG_SUFFIX), $(addsuffix $i, $(VM_LIBRARIES)))
VM_SYMLINKS := $(addprefix $(LIBRARY_PREFIX), $(VM_SYMLINKS))
VM_LIBRARIES := $(addsuffix $(SHARED_LIBRARY_SUFFIX), $(VM_LIBRARIES))
VM_DEBUG_FILES := $(call expand-debuginfo, $(VM_DEBUG_FILES), $(VM_LIBRARIES))
VM_DEBUG_FILES += $(foreach i, $(DEBUG_SUFFIX), $(addsuffix $i, $(VM_SYMLINKS)))
VM_SYMLINKS := $(addsuffix $(SHARED_LIBRARY_SUFFIX), $(VM_SYMLINKS))
VM_LIBRARIES += $(VM_SYMLINKS)
VM_FILES := \
Xusage.txt
VM_DIRS := client server minimal
VM_FILES := $(foreach i, $(VM_DIRS), $(addprefix $i/, $(VM_LIBRARIES) $(VM_FILES) $(VM_DEBUG_FILES)))
JLI_LIBRARIES := \
jli
ifneq ($(OPENJDK_TARGET_OS), windows)
JLI_SUBDIR := jli/
else
JLI_SUBDIR :=
endif
JLI_LIBRARIES := $(addprefix $(JLI_SUBDIR)$(LIBRARY_PREFIX), $(JLI_LIBRARIES))
JLI_DEBUG_FILES := $(foreach i, $(DEBUG_SUFFIX), $(addsuffix $i, $(JLI_LIBRARIES)))
JLI_LIBRARIES := $(addsuffix $(SHARED_LIBRARY_SUFFIX), $(JLI_LIBRARIES))
JLI_DEBUG_FILES := $(call expand-debuginfo, $(JLI_DEBUG_FILES), $(JLI_LIBRARIES))
JLI_LIBRARIES += $(JLI_DEBUG_FILES)
ifneq ($(OPENJDK_TARGET_OS), windows)
PROFILE_1_JRE_LIB_FILES := \
$(addprefix $(LIBS_PREFIX), $(PROFILE_1_LIBRARIES) $(VM_FILES) $(JLI_LIBRARIES))
else
# On windows libraries go into jre/bin
PROFILE_1_JRE_BIN_FILES += $(PROFILE_1_LIBRARIES) $(VM_FILES) $(JLI_LIBRARIES)
endif
# Remaining jre/lib contents
# OSX doesn't use <arch> directory
#
ifeq ($(OPENJDK_TARGET_OS), macosx)
PROFILE_1_JRE_LIB_FILES += \
jvm.cfg \
jspawnhelper
else
PROFILE_1_JRE_LIB_FILES += \
$(OPENJDK_TARGET_CPU_LEGACY_LIB)/jvm.cfg \
$(OPENJDK_TARGET_CPU_LEGACY_LIB)/jspawnhelper
endif
PROFILE_1_JRE_LIB_FILES += \
calendars.properties \
classlist \
content-types.properties \
......@@ -81,6 +193,14 @@ PROFILE_1_JRE_LIB_FILES := \
security/trusted.libraries \
tzdb.dat
ifeq ($(OPENJDK_TARGET_OS), windows)
PROFILE_1_JRE_LIB_FILES += tzmappings
else
ifeq ($(OPENJDK_TARGET_OS), solaris)
PROFILE_1_JRE_LIB_FILES += sdp/sdp.conf
endif
endif
PROFILE_1_JRE_OTHER_FILES := \
COPYRIGHT \
LICENSE \
......@@ -106,32 +226,63 @@ PROFILE_2_JRE_BIN_FILES := \
rmid$(EXE_SUFFIX) \
rmiregistry$(EXE_SUFFIX)
ifeq ($(OPENJDK_TARGET_OS), windows)
PROFILE_2_JRE_BIN_FILES += java-rmi$(EXE_SUFFIX)
endif
# If you add libraries here, make sure you use the same techniques
# as used for the other profile's libraries regarding debug files etc
PROFILE_2_JRE_LIB_FILES :=
PROFILE_2_JRE_OTHER_FILES :=
PROFILE_2_JRE_JAR_FILES :=
ifeq ($(OPENJDK_TARGET_OS), windows)
PROFILE_3_JRE_BIN_FILES := \
kinit$(EXE_SUFFIX) \
klist$(EXE_SUFFIX) \
ktab$(EXE_SUFFIX)
else
PROFILE_3_JRE_BIN_FILES :=
endif
PROFILE_3_JRE_BIN_FILES :=
PROFILE_3_JRE_LIB_FILES := \
$(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)hprof$(SHARED_LIBRARY_SUFFIX) \
$(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)hprof.diz \
$(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)instrument$(SHARED_LIBRARY_SUFFIX) \
$(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)instrument.diz \
$(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)j2gss$(SHARED_LIBRARY_SUFFIX) \
$(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)j2pcsc$(SHARED_LIBRARY_SUFFIX) \
$(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)jaas_unix$(SHARED_LIBRARY_SUFFIX) \
$(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)java_crw_demo$(SHARED_LIBRARY_SUFFIX) \
$(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)java_crw_demo.diz \
$(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)jsdt$(SHARED_LIBRARY_SUFFIX) \
$(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)jsdt.diz \
$(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)management$(SHARED_LIBRARY_SUFFIX) \
$(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)management.diz \
$(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)npt$(SHARED_LIBRARY_SUFFIX) \
$(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)npt.diz \
$(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)sctp$(SHARED_LIBRARY_SUFFIX) \
PROFILE_3_LIBRARIES := \
hprof \
instrument \
j2gss \
j2pcsc \
jaas_unix \
jaas_nt \
java_crw_demo \
jsdt \
management \
npt \
sctp
ifeq ($(OPENJDK_TARGET_OS), windows)
PROFILE_3_LIBRARIES += w2k_lsa_auth
else
ifeq ($(OPENJDK_TARGET_OS), macosx)
PROFILE_3_LIBRARIES += osxkrb5
endif
endif
PROFILE_3_LIBRARIES := $(addprefix $(LIBRARY_PREFIX), $(PROFILE_3_LIBRARIES))
PROFILE_3_DEBUG_FILES := $(foreach i, $(DEBUG_SUFFIX), $(addsuffix $i, $(PROFILE_3_LIBRARIES)))
PROFILE_3_LIBRARIES := $(addsuffix $(SHARED_LIBRARY_SUFFIX), $(PROFILE_3_LIBRARIES))
PROFILE_3_DEBUG_FILES := $(call expand-debuginfo, $(PROFILE_3_DEBUG_FILES), $(PROFILE_3_LIBRARIES))
PROFILE_3_LIBRARIES += $(PROFILE_3_DEBUG_FILES)
ifneq ($(OPENJDK_TARGET_OS), windows)
PROFILE_3_JRE_LIB_FILES := \
$(addprefix $(LIBS_PREFIX), $(PROFILE_3_LIBRARIES))
else
# On windows libraries go into jre/bin
PROFILE_3_JRE_BIN_FILES += $(PROFILE_3_LIBRARIES)
endif
PROFILE_3_JRE_LIB_FILES += \
jvm.hprof.txt \
management-agent.jar \
management/jmxremote.access \
......@@ -153,25 +304,40 @@ FULL_JRE_BIN_FILES := \
tnameserv$(EXE_SUFFIX) \
unpack200$(EXE_SUFFIX)
FULL_JRE_LIB_FILES := \
$(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)awt$(SHARED_LIBRARY_SUFFIX) \
$(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)awt_headless$(SHARED_LIBRARY_SUFFIX) \
$(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)awt_xawt$(SHARED_LIBRARY_SUFFIX) \
$(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)dcpr$(SHARED_LIBRARY_SUFFIX) \
$(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)dt_socket$(SHARED_LIBRARY_SUFFIX) \
$(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)dt_socket.diz \
$(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)fontmanager$(SHARED_LIBRARY_SUFFIX) \
$(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)jawt$(SHARED_LIBRARY_SUFFIX) \
$(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)jdwp$(SHARED_LIBRARY_SUFFIX) \
$(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)jfr$(SHARED_LIBRARY_SUFFIX) \
$(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)jpeg$(SHARED_LIBRARY_SUFFIX) \
$(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)jsound$(SHARED_LIBRARY_SUFFIX) \
$(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)jsoundalsa$(SHARED_LIBRARY_SUFFIX) \
$(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)kcms$(SHARED_LIBRARY_SUFFIX) \
$(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)mlib_image$(SHARED_LIBRARY_SUFFIX) \
$(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)splashscreen$(SHARED_LIBRARY_SUFFIX) \
$(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)t2k$(SHARED_LIBRARY_SUFFIX) \
$(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)unpack$(SHARED_LIBRARY_SUFFIX) \
JRE_LIBRARIES := \
awt \
awt_headless \
awt_xawt \
dcpr \
dt_socket \
fontmanager \
jawt \
jdwp \
jfr \
jpeg \
jsound \
jsoundalsa \
kcms \
mlib_image \
splashscreen \
t2k \
unpack
JRE_LIBRARIES := $(addprefix $(LIBRARY_PREFIX), $(JRE_LIBRARIES))
JRE_DEBUG_FILES := $(foreach i, $(DEBUG_SUFFIX), $(addsuffix $i, $(JRE_LIBRARIES)))
JRE_LIBRARIES := $(addsuffix $(SHARED_LIBRARY_SUFFIX), $(JRE_LIBRARIES))
JRE_DEBUG_FILES := $(call expand-debuginfo, $(JRE_DEBUG_FILES), $(JRE_LIBRARIES))
JRE_LIBRARIES += $(JRE_DEBUG_FILES)
ifneq ($(OPENJDK_TARGET_OS), windows)
FULL_JRE_LIB_FILES := \
$(addprefix $(LIBS_PREFIX), $(JRE_LIBRARIES))
else
# On windows libraries go into jre/bin
FULL_JRE_BIN_FILES += $(JRE_LIBRARIES)
endif
FULL_JRE_LIB_FILES += \
charsets.jar \
cmm/CIEXYZ.pf \
cmm/GRAY.pf \
......@@ -254,3 +420,4 @@ FULL_JRE_JAR_FILES := \
ext/nashorn.jar \
ext/zipfs.jar \
jfr.jar
......@@ -162,6 +162,8 @@ PROFILE_3_RTJAR_EXCLUDE_TYPES := \
javax/management/remote/rmi/_RMIServer_Stub.class
FULL_JRE_RTJAR_INCLUDE_PACKAGES := \
apple \
com/apple \
com/oracle \
com/sun/accessibility/internal/resources \
com/sun/activation/registries \
......@@ -213,6 +215,7 @@ FULL_JRE_RTJAR_INCLUDE_PACKAGES := \
sun/dc \
sun/font \
sun/java2d \
sun/lwawt \
sun/net/ftp \
sun/net/smtp \
sun/net/www/content/audio \
......
......@@ -491,10 +491,10 @@ public class ZoneRulesBuilder {
TZRule rule = new TZRule(year, month, dayOfMonthIndicator, dayOfWeek, time, timeEndOfDay, timeDefinition, savingAmountSecs);
if (lastRule) {
lastRuleList.add(rule);
maxLastRuleStartYear = Math.max(startYear, maxLastRuleStartYear);
} else {
ruleList.add(rule);
}
maxLastRuleStartYear = Math.max(startYear, maxLastRuleStartYear);
year++;
}
}
......
......@@ -43,7 +43,7 @@ class AixNativeDispatcher extends UnixNativeDispatcher {
static native UnixMountEntry[] getmntctl() throws UnixException;
// initialize
private static native int init();
private static native void init();
static {
AccessController.doPrivileged(new PrivilegedAction<Void>() {
......
/*
* Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright 2013 SAP AG. All rights reserved.
* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright 2015 SAP AG. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -25,14 +25,14 @@
*/
package sun.tools.attach;
import com.sun.tools.attach.VirtualMachine;
import com.sun.tools.attach.AttachOperationFailedException;
import com.sun.tools.attach.AgentLoadException;
import com.sun.tools.attach.AttachNotSupportedException;
import com.sun.tools.attach.spi.AttachProvider;
import java.io.InputStream;
import java.io.IOException;
import java.io.File;
import java.util.Properties;
// Based on 'LinuxVirtualMachine.java'. All occurrences of the string
// "Linux" have been textually replaced by "Aix" to avoid confusion.
......@@ -192,6 +192,8 @@ public class AixVirtualMachine extends HotSpotVirtualMachine {
}
if (completionStatus != 0) {
// read from the stream and use that as the error message
String message = readErrorMessage(sis);
sis.close();
// In the event of a protocol mismatch then the target VM
......@@ -206,7 +208,11 @@ public class AixVirtualMachine extends HotSpotVirtualMachine {
if (cmd.equals("load")) {
throw new AgentLoadException("Failed to load agent library");
} else {
throw new IOException("Command failed in target VM");
if (message == null) {
throw new AttachOperationFailedException("Command failed in target VM");
} else {
throw new AttachOperationFailedException(message);
}
}
}
......
......@@ -56,23 +56,26 @@ static void throwUnixException(JNIEnv* env, int errnum) {
/**
* Initialization
*/
JNIEXPORT jint JNICALL
JNIEXPORT void JNICALL
Java_sun_nio_fs_AixNativeDispatcher_init(JNIEnv* env, jclass this)
{
jint flags = 0;
jclass clazz;
clazz = (*env)->FindClass(env, "sun/nio/fs/UnixMountEntry");
if (clazz == NULL) {
return 0;
}
CHECK_NULL(clazz);
entry_name = (*env)->GetFieldID(env, clazz, "name", "[B");
CHECK_NULL(entry_name);
entry_dir = (*env)->GetFieldID(env, clazz, "dir", "[B");
CHECK_NULL(entry_dir);
entry_fstype = (*env)->GetFieldID(env, clazz, "fstype", "[B");
CHECK_NULL(entry_fstype);
entry_options = (*env)->GetFieldID(env, clazz, "opts", "[B");
CHECK_NULL(entry_options);
entry_cls = (*env)->NewGlobalRef(env, clazz);
return 0;
if (entry_cls == NULL) {
JNU_ThrowOutOfMemoryError(env, NULL);
return;
}
}
/**
......
/*
* Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright 2013 SAP AG. All rights reserved.
* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright 2015 SAP AG. 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
......@@ -238,14 +238,14 @@ JNIEXPORT jint JNICALL Java_sun_tools_attach_AixVirtualMachine_read
len = remaining;
}
RESTARTABLE(read(fd, buf+off, len), n);
RESTARTABLE(read(fd, buf, len), n);
if (n == -1) {
JNU_ThrowIOExceptionWithLastError(env, "read");
} else {
if (n == 0) {
n = -1; // EOF
} else {
(*env)->SetByteArrayRegion(env, ba, off, (jint)n, (jbyte *)(buf+off));
(*env)->SetByteArrayRegion(env, ba, off, (jint)n, (jbyte *)(buf));
}
}
return n;
......
......@@ -273,7 +273,7 @@ public class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable {
actionMap.put("aquaSelectNext", highlightNextAction);
actionMap.put("aquaSelectPrevious", highlightPreviousAction);
actionMap.put("aquaEnterPressed", triggerSelectionAction);
actionMap.put("enterPressed", triggerSelectionAction);
actionMap.put("aquaSpacePressed", toggleSelectionAction);
actionMap.put("aquaSelectHome", highlightFirstAction);
......
......@@ -195,7 +195,7 @@ public class AquaIcon {
AquaPainter.create(JRSUIState.getInstance());
initIconPainter(painter);
g.setClip(new Rectangle(x, y, width, height));
g.clipRect(x, y, width, height);
painter.paint(g, c, x, y, width, height);
g.dispose();
}
......
......@@ -214,7 +214,7 @@ public class AquaKeyBindings {
"PAGE_DOWN", "aquaSelectPageDown",
"HOME", "aquaSelectHome",
"END", "aquaSelectEnd",
"ENTER", "aquaEnterPressed",
"ENTER", "enterPressed",
"UP", "aquaSelectPrevious",
"KP_UP", "aquaSelectPrevious",
"DOWN", "aquaSelectNext",
......
......@@ -148,11 +148,15 @@ public class AquaMenuUI extends BasicMenuUI implements AquaMenuPainter.Client {
// In Aqua, we always have a menu delay, regardless of where the menu is.
if (!(selectedPath.length > 0 && selectedPath[selectedPath.length - 1] == menu.getPopupMenu())) {
if (menu.getDelay() == 0) {
appendPath(getPath(), menu.getPopupMenu());
} else {
manager.setSelectedPath(getPath());
setupPostTimer(menu);
// the condition below prevents from activating menu in other frame
if (!menu.isTopLevelMenu() || (selectedPath.length > 0 &&
selectedPath[0] == menu.getParent())) {
if (menu.getDelay() == 0) {
appendPath(getPath(), menu.getPopupMenu());
} else {
manager.setSelectedPath(getPath());
setupPostTimer(menu);
}
}
}
}
......
......@@ -29,6 +29,7 @@ import java.awt.event.*;
import javax.swing.*;
import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.basic.BasicScrollPaneUI;
public class AquaScrollPaneUI extends javax.swing.plaf.basic.BasicScrollPaneUI {
public static ComponentUI createUI(final JComponent x) {
......@@ -39,28 +40,9 @@ public class AquaScrollPaneUI extends javax.swing.plaf.basic.BasicScrollPaneUI {
return new XYMouseWheelHandler();
}
// This is a grody hack to trick BasicScrollPaneUI into scrolling horizontally
// when we notice that the shift key is down. This should be removed when AWT/Swing
// becomes aware of of multi-axis scroll wheels.
protected class XYMouseWheelHandler extends javax.swing.plaf.basic.BasicScrollPaneUI.MouseWheelHandler {
protected class XYMouseWheelHandler extends BasicScrollPaneUI.MouseWheelHandler {
public void mouseWheelMoved(final MouseWheelEvent e) {
JScrollBar vScrollBar = null;
boolean wasVisible = false;
if (e.isShiftDown()) {
vScrollBar = scrollpane.getVerticalScrollBar();
if (vScrollBar != null) {
wasVisible = vScrollBar.isVisible();
vScrollBar.setVisible(false);
}
}
super.mouseWheelMoved(e);
if (wasVisible) {
vScrollBar.setVisible(true);
}
// Consume the event even when the scrollBar is invisible
// see #7124320
e.consume();
......
......@@ -43,7 +43,6 @@ public final class CGraphicsDevice extends GraphicsDevice
* therefore methods, which is using this id should be ready to it.
*/
private volatile int displayID;
private volatile Insets screenInsets;
private volatile double xResolution;
private volatile double yResolution;
private volatile int scale;
......@@ -120,7 +119,13 @@ public final class CGraphicsDevice extends GraphicsDevice
}
public Insets getScreenInsets() {
return screenInsets;
// the insets are queried synchronously and are not cached
// since there are no Quartz or Cocoa means to receive notifications
// on insets changes (e.g. when the Dock is resized):
// the existing CGDisplayReconfigurationCallBack is not notified
// as well as the NSApplicationDidChangeScreenParametersNotification
// is fired on the Dock location changes only
return nativeGetScreenInsets(displayID);
}
public int getScaleFactor() {
......@@ -135,7 +140,6 @@ public final class CGraphicsDevice extends GraphicsDevice
public void displayChanged() {
xResolution = nativeGetXResolution(displayID);
yResolution = nativeGetYResolution(displayID);
screenInsets = nativeGetScreenInsets(displayID);
scale = (int) nativeGetScaleFactor(displayID);
//TODO configs/fullscreenWindow/modes?
}
......
......@@ -1295,6 +1295,12 @@ public class LWWindowPeer
}
KeyboardFocusManagerPeer kfmPeer = LWKeyboardFocusManagerPeer.getInstance();
if (!becomesFocused && kfmPeer.getCurrentFocusedWindow() != getTarget()) {
// late window focus lost event - ingoring
return;
}
kfmPeer.setCurrentFocusedWindow(becomesFocused ? getTarget() : null);
int eventID = becomesFocused ? WindowEvent.WINDOW_GAINED_FOCUS : WindowEvent.WINDOW_LOST_FOCUS;
......
......@@ -56,6 +56,18 @@ final class CClipboard extends SunClipboard {
// Leaving Empty, as WClipboard.clearNativeContext is empty as well.
}
@Override
public synchronized Transferable getContents(Object requestor) {
checkPasteboardAndNotify();
return super.getContents(requestor);
}
@Override
protected synchronized Transferable getContextContents() {
checkPasteboardAndNotify();
return super.getContextContents();
}
@Override
protected void setContentsNative(Transferable contents) {
FlavorTable flavorMap = getDefaultFlavorTable();
......@@ -116,13 +128,20 @@ final class CClipboard extends SunClipboard {
private native void declareTypes(long[] formats, SunClipboard newOwner);
private native void setData(byte[] data, long format);
void checkPasteboardAndNotify() {
if (checkPasteboardWithoutNotification()) {
notifyChanged();
lostOwnershipNow(null);
}
}
/**
* Invokes native check whether a change count on the general pasteboard is different
* than when we set it. The different count value means the current owner lost
* pasteboard ownership and someone else put data on the clipboard.
* @since 1.7
*/
native void checkPasteboard();
native boolean checkPasteboardWithoutNotification();
/*** Native Callbacks ***/
private void notifyLostOwnership() {
......
......@@ -120,7 +120,7 @@ public class CEmbeddedFrame extends EmbeddedFrame {
// it won't be invoced if focuse is moved to a html element
// on the same page.
CClipboard clipboard = (CClipboard) Toolkit.getDefaultToolkit().getSystemClipboard();
clipboard.checkPasteboard();
clipboard.checkPasteboardAndNotify();
}
if (parentWindowActive) {
responder.handleWindowFocusEvent(focused, null);
......@@ -161,7 +161,7 @@ public class CEmbeddedFrame extends EmbeddedFrame {
}
// ignore focus "lost" native request as it may mistakenly
// deactivate active window (see 8001161)
if (globalFocusedWindow == this && parentWindowActive) {
if (globalFocusedWindow == this) {
responder.handleWindowFocusEvent(parentWindowActive, null);
}
}
......
......@@ -488,6 +488,9 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo
} else {
deliverZoom(true);
// We need an up to date size of the peer, so we flush the native events
// to be sure that there are no setBounds requests in the queue.
LWCToolkit.flushNativeSelectors();
this.normalBounds = peer.getBounds();
GraphicsConfiguration config = getPeer().getGraphicsConfiguration();
......
......@@ -833,7 +833,7 @@ public final class LWCToolkit extends LWToolkit {
/**
* Just spin a single empty block synchronously.
*/
private static native void flushNativeSelectors();
static native void flushNativeSelectors();
@Override
public Clipboard createPlatformClipboard() {
......
......@@ -310,7 +310,10 @@ AWT_ASSERT_APPKIT_THREAD;
}
- (BOOL) performKeyEquivalent: (NSEvent *) event {
[self deliverJavaKeyEventHelper: event];
// if IM is active key events should be ignored
if (![self hasMarkedText] && !fInPressAndHold) {
[self deliverJavaKeyEventHelper: event];
}
// Workaround for 8020209: special case for "Cmd =" and "Cmd ."
// because Cocoa calls performKeyEquivalent twice for these keystrokes
......@@ -889,9 +892,9 @@ JNF_CLASS_CACHE(jc_CInputMethod, "sun/lwawt/macosx/CInputMethod");
// text, or 'text in progress'. We also need to send the event if we get an insert text out of the blue!
// (i.e., when the user uses the Character palette or Inkwell), or when the string to insert is a complex
// Unicode value.
NSUInteger utf8Length = [aString lengthOfBytesUsingEncoding:NSUTF8StringEncoding];
NSUInteger utf16Length = [aString lengthOfBytesUsingEncoding:NSUTF16StringEncoding];
if ([self hasMarkedText] || !fProcessingKeystroke || (utf8Length > 1)) {
if ([self hasMarkedText] || !fProcessingKeystroke || (utf16Length > 2)) {
JNIEnv *env = [ThreadUtilities getJNIEnv];
static JNF_MEMBER_CACHE(jm_selectPreviousGlyph, jc_CInputMethod, "selectPreviousGlyph", "()V");
......
......@@ -171,6 +171,8 @@ static CClipboard *sClipboard = nil;
else [args removeLastObject];
}
- (void) checkPasteboard:(id)application {
AWT_ASSERT_APPKIT_THREAD;
......@@ -202,6 +204,19 @@ static CClipboard *sClipboard = nil;
}
}
- (BOOL) checkPasteboardWithoutNotification:(id)application {
AWT_ASSERT_APPKIT_THREAD;
NSInteger newChangeCount = [[NSPasteboard generalPasteboard] changeCount];
if (fChangeCount != newChangeCount) {
fChangeCount = newChangeCount;
return YES;
} else {
return NO;
}
}
@end
/*
......@@ -348,16 +363,17 @@ JNF_COCOA_EXIT(env);
* Method: checkPasteboard
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CClipboard_checkPasteboard
(JNIEnv *env, jobject inObject )
JNIEXPORT jboolean JNICALL Java_sun_lwawt_macosx_CClipboard_checkPasteboardWithoutNotification
(JNIEnv *env, jobject inObject)
{
__block BOOL ret = NO;
JNF_COCOA_ENTER(env);
[ThreadUtilities performOnMainThreadWaiting:YES block:^(){
[[CClipboard sharedClipboard] checkPasteboard:nil];
ret = [[CClipboard sharedClipboard] checkPasteboardWithoutNotification:nil];
}];
JNF_COCOA_EXIT(env);
return ret;
}
......@@ -30,6 +30,7 @@
#import <JavaNativeFoundation/JavaNativeFoundation.h>
#import <JavaRuntimeSupport/JavaRuntimeSupport.h>
#import "jni_util.h"
#import "NSApplicationAWT.h"
#import "PropertiesUtilities.h"
#import "ThreadUtilities.h"
......@@ -436,8 +437,11 @@ JNF_COCOA_ENTER(env);
}
JNIEnv* env = [ThreadUtilities getJNIEnvUncached];
jclass jc_ThreadGroupUtils = (*env)->FindClass(env, "sun/misc/ThreadGroupUtils");
CHECK_NULL_RETURN(jc_ThreadGroupUtils, JNI_VERSION_1_4);
jmethodID sjm_getRootThreadGroup = (*env)->GetStaticMethodID(env, jc_ThreadGroupUtils, "getRootThreadGroup", "()Ljava/lang/ThreadGroup;");
CHECK_NULL_RETURN(sjm_getRootThreadGroup, JNI_VERSION_1_4);
jobject rootThreadGroup = (*env)->CallStaticObjectMethod(env, jc_ThreadGroupUtils, sjm_getRootThreadGroup);
CHECK_NULL_RETURN(rootThreadGroup, JNI_VERSION_1_4);
[ThreadUtilities setAppkitThreadGroup:(*env)->NewGlobalRef(env, rootThreadGroup)];
// The current thread was attached in getJNIEnvUnchached.
// Detach it back. It will be reattached later if needed with a proper TG
......
......@@ -126,12 +126,30 @@ done:
return buf;
}
BOOL isSWTRunning() {
char envVar[80];
// If this property is present we are running SWT
snprintf(envVar, sizeof(envVar), "JAVA_STARTED_ON_FIRST_THREAD_%d", getpid());
return getenv(envVar) != NULL;
}
char* SplashGetScaledImageName(const char* jar, const char* file,
float *scaleFactor) {
NSAutoreleasePool *pool = [NSAutoreleasePool new];
*scaleFactor = 1;
if(isSWTRunning()){
return nil;
}
NSAutoreleasePool *pool = [NSAutoreleasePool new];
char* scaledFile = nil;
float screenScaleFactor = 1;
__block float screenScaleFactor = 1;
[ThreadUtilities performOnMainThreadWaiting:YES block:^(){
// initialize NSApplication and AWT stuff
[NSApplicationAWT sharedApplication];
screenScaleFactor = [SplashNSScreen() backingScaleFactor];
}];
if (screenScaleFactor > 1) {
NSString *fileName = [NSString stringWithUTF8String: file];
......@@ -176,9 +194,12 @@ SplashInitPlatform(Splash * splash) {
splash->screenFormat.byteOrder = 1 ? BYTE_ORDER_LSBFIRST : BYTE_ORDER_MSBFIRST;
splash->screenFormat.depthBytes = 4;
[JNFRunLoop performOnMainThreadWaiting:NO withBlock:^() {
[NSApplicationAWT runAWTLoopWithApp:[NSApplicationAWT sharedApplication]];
}];
// If we are running SWT we should not start a runLoop
if (!isSWTRunning()) {
[JNFRunLoop performOnMainThreadWaiting:NO withBlock:^() {
[NSApplicationAWT runAWTLoopWithApp:[NSApplicationAWT sharedApplication]];
}];
}
}
void
......
/*
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -28,9 +29,7 @@
package com.sun.crypto.provider;
import java.util.Arrays;
import java.security.*;
import static com.sun.crypto.provider.AESConstants.AES_BLOCK_SIZE;
import java.security.ProviderException;
/**
* This class represents the GHASH function defined in NIST 800-38D
......@@ -44,62 +43,90 @@ import static com.sun.crypto.provider.AESConstants.AES_BLOCK_SIZE;
*/
final class GHASH {
private static final byte P128 = (byte) 0xe1; //reduction polynomial
private static boolean getBit(byte[] b, int pos) {
int p = pos / 8;
pos %= 8;
int i = (b[p] >>> (7 - pos)) & 1;
return i != 0;
private static long getLong(byte[] buffer, int offset) {
long result = 0;
int end = offset + 8;
for (int i = offset; i < end; ++i) {
result = (result << 8) + (buffer[i] & 0xFF);
}
return result;
}
private static void shift(byte[] b) {
byte temp, temp2;
temp2 = 0;
for (int i = 0; i < b.length; i++) {
temp = (byte) ((b[i] & 0x01) << 7);
b[i] = (byte) ((b[i] & 0xff) >>> 1);
b[i] = (byte) (b[i] | temp2);
temp2 = temp;
private static void putLong(byte[] buffer, int offset, long value) {
int end = offset + 8;
for (int i = end - 1; i >= offset; --i) {
buffer[i] = (byte) value;
value >>= 8;
}
}
// Given block X and Y, returns the muliplication of X * Y
private static byte[] blockMult(byte[] x, byte[] y) {
if (x.length != AES_BLOCK_SIZE || y.length != AES_BLOCK_SIZE) {
throw new RuntimeException("illegal input sizes");
private static final int AES_BLOCK_SIZE = 16;
// Multiplies state0, state1 by V0, V1.
private void blockMult(long V0, long V1) {
long Z0 = 0;
long Z1 = 0;
long X;
// Separate loops for processing state0 and state1.
X = state0;
for (int i = 0; i < 64; i++) {
// Zi+1 = Zi if bit i of x is 0
long mask = X >> 63;
Z0 ^= V0 & mask;
Z1 ^= V1 & mask;
// Save mask for conditional reduction below.
mask = (V1 << 63) >> 63;
// V = rightshift(V)
long carry = V0 & 1;
V0 = V0 >>> 1;
V1 = (V1 >>> 1) | (carry << 63);
// Conditional reduction modulo P128.
V0 ^= 0xe100000000000000L & mask;
X <<= 1;
}
byte[] z = new byte[AES_BLOCK_SIZE];
byte[] v = y.clone();
// calculate Z1-Z127 and V1-V127
for (int i = 0; i < 127; i++) {
X = state1;
for (int i = 64; i < 127; i++) {
// Zi+1 = Zi if bit i of x is 0
if (getBit(x, i)) {
for (int n = 0; n < z.length; n++) {
z[n] ^= v[n];
}
}
boolean lastBitOfV = getBit(v, 127);
shift(v);
if (lastBitOfV) v[0] ^= P128;
long mask = X >> 63;
Z0 ^= V0 & mask;
Z1 ^= V1 & mask;
// Save mask for conditional reduction below.
mask = (V1 << 63) >> 63;
// V = rightshift(V)
long carry = V0 & 1;
V0 = V0 >>> 1;
V1 = (V1 >>> 1) | (carry << 63);
// Conditional reduction.
V0 ^= 0xe100000000000000L & mask;
X <<= 1;
}
// calculate Z128
if (getBit(x, 127)) {
for (int n = 0; n < z.length; n++) {
z[n] ^= v[n];
}
}
return z;
long mask = X >> 63;
Z0 ^= V0 & mask;
Z1 ^= V1 & mask;
// Save result.
state0 = Z0;
state1 = Z1;
}
// hash subkey H; should not change after the object has been constructed
private final byte[] subkeyH;
private final long subkeyH0, subkeyH1;
// buffer for storing hash
private byte[] state;
private long state0, state1;
// variables for save/restore calls
private byte[] stateSave = null;
private long stateSave0, stateSave1;
/**
* Initializes the cipher in the specified mode with the given key
......@@ -114,8 +141,8 @@ final class GHASH {
if ((subkeyH == null) || subkeyH.length != AES_BLOCK_SIZE) {
throw new ProviderException("Internal error");
}
this.subkeyH = subkeyH;
this.state = new byte[AES_BLOCK_SIZE];
this.subkeyH0 = getLong(subkeyH, 0);
this.subkeyH1 = getLong(subkeyH, 8);
}
/**
......@@ -124,31 +151,33 @@ final class GHASH {
* this object for different data w/ the same H.
*/
void reset() {
Arrays.fill(state, (byte) 0);
state0 = 0;
state1 = 0;
}
/**
* Save the current snapshot of this GHASH object.
*/
void save() {
stateSave = state.clone();
stateSave0 = state0;
stateSave1 = state1;
}
/**
* Restores this object using the saved snapshot.
*/
void restore() {
state = stateSave;
state0 = stateSave0;
state1 = stateSave1;
}
private void processBlock(byte[] data, int ofs) {
if (data.length - ofs < AES_BLOCK_SIZE) {
throw new RuntimeException("need complete block");
}
for (int n = 0; n < state.length; n++) {
state[n] ^= data[ofs + n];
}
state = blockMult(state, subkeyH);
state0 ^= getLong(data, ofs);
state1 ^= getLong(data, ofs + 8);
blockMult(subkeyH0, subkeyH1);
}
void update(byte[] in) {
......@@ -169,10 +198,10 @@ final class GHASH {
}
byte[] digest() {
try {
return state.clone();
} finally {
reset();
}
byte[] result = new byte[AES_BLOCK_SIZE];
putLong(result, 0, state0);
putLong(result, 8, state1);
reset();
return result;
}
}
/*
* Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -107,7 +107,7 @@ public final class JceKeyStore extends KeyStoreSpi {
{
Key key = null;
Object entry = entries.get(alias.toLowerCase());
Object entry = entries.get(alias.toLowerCase(Locale.ENGLISH));
if (!((entry instanceof PrivateKeyEntry) ||
(entry instanceof SecretKeyEntry))) {
......@@ -150,7 +150,7 @@ public final class JceKeyStore extends KeyStoreSpi {
{
Certificate[] chain = null;
Object entry = entries.get(alias.toLowerCase());
Object entry = entries.get(alias.toLowerCase(Locale.ENGLISH));
if ((entry instanceof PrivateKeyEntry)
&& (((PrivateKeyEntry)entry).chain != null)) {
......@@ -178,7 +178,7 @@ public final class JceKeyStore extends KeyStoreSpi {
public Certificate engineGetCertificate(String alias) {
Certificate cert = null;
Object entry = entries.get(alias.toLowerCase());
Object entry = entries.get(alias.toLowerCase(Locale.ENGLISH));
if (entry != null) {
if (entry instanceof TrustedCertEntry) {
......@@ -203,7 +203,7 @@ public final class JceKeyStore extends KeyStoreSpi {
public Date engineGetCreationDate(String alias) {
Date date = null;
Object entry = entries.get(alias.toLowerCase());
Object entry = entries.get(alias.toLowerCase(Locale.ENGLISH));
if (entry != null) {
// We have to create a new instance of java.util.Date because
......@@ -266,7 +266,7 @@ public final class JceKeyStore extends KeyStoreSpi {
}
// store the entry
entries.put(alias.toLowerCase(), entry);
entries.put(alias.toLowerCase(Locale.ENGLISH), entry);
} else {
SecretKeyEntry entry = new SecretKeyEntry();
......@@ -274,7 +274,7 @@ public final class JceKeyStore extends KeyStoreSpi {
// seal and store the key
entry.sealedKey = keyProtector.seal(key);
entries.put(alias.toLowerCase(), entry);
entries.put(alias.toLowerCase(Locale.ENGLISH), entry);
}
} catch (Exception e) {
......@@ -322,7 +322,7 @@ public final class JceKeyStore extends KeyStoreSpi {
entry.chain = null;
}
entries.put(alias.toLowerCase(), entry);
entries.put(alias.toLowerCase(Locale.ENGLISH), entry);
}
}
......@@ -345,7 +345,7 @@ public final class JceKeyStore extends KeyStoreSpi {
{
synchronized(entries) {
Object entry = entries.get(alias.toLowerCase());
Object entry = entries.get(alias.toLowerCase(Locale.ENGLISH));
if (entry != null) {
if (entry instanceof PrivateKeyEntry) {
throw new KeyStoreException("Cannot overwrite own "
......@@ -358,7 +358,7 @@ public final class JceKeyStore extends KeyStoreSpi {
TrustedCertEntry trustedCertEntry = new TrustedCertEntry();
trustedCertEntry.cert = cert;
trustedCertEntry.date = new Date();
entries.put(alias.toLowerCase(), trustedCertEntry);
entries.put(alias.toLowerCase(Locale.ENGLISH), trustedCertEntry);
}
}
......@@ -373,7 +373,7 @@ public final class JceKeyStore extends KeyStoreSpi {
throws KeyStoreException
{
synchronized(entries) {
entries.remove(alias.toLowerCase());
entries.remove(alias.toLowerCase(Locale.ENGLISH));
}
}
......@@ -394,7 +394,7 @@ public final class JceKeyStore extends KeyStoreSpi {
* @return true if the alias exists, false otherwise
*/
public boolean engineContainsAlias(String alias) {
return entries.containsKey(alias.toLowerCase());
return entries.containsKey(alias.toLowerCase(Locale.ENGLISH));
}
/**
......@@ -416,7 +416,7 @@ public final class JceKeyStore extends KeyStoreSpi {
public boolean engineIsKeyEntry(String alias) {
boolean isKey = false;
Object entry = entries.get(alias.toLowerCase());
Object entry = entries.get(alias.toLowerCase(Locale.ENGLISH));
if ((entry instanceof PrivateKeyEntry)
|| (entry instanceof SecretKeyEntry)) {
isKey = true;
......@@ -434,7 +434,7 @@ public final class JceKeyStore extends KeyStoreSpi {
*/
public boolean engineIsCertificateEntry(String alias) {
boolean isCert = false;
Object entry = entries.get(alias.toLowerCase());
Object entry = entries.get(alias.toLowerCase(Locale.ENGLISH));
if (entry instanceof TrustedCertEntry) {
isCert = true;
}
......
/*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -27,6 +27,7 @@ package com.sun.crypto.provider;
import java.security.KeyRep;
import java.security.spec.InvalidKeySpecException;
import java.util.Locale;
import javax.crypto.SecretKey;
import javax.crypto.spec.PBEKeySpec;
......@@ -91,7 +92,7 @@ final class PBEKey implements SecretKey {
for (int i = 1; i < this.key.length; i++) {
retval += this.key[i] * i;
}
return(retval ^= getAlgorithm().toLowerCase().hashCode());
return(retval ^= getAlgorithm().toLowerCase(Locale.ENGLISH).hashCode());
}
public boolean equals(Object obj) {
......
/*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -32,6 +32,7 @@ import javax.crypto.SecretKey;
import javax.crypto.SecretKeyFactorySpi;
import javax.crypto.spec.PBEKeySpec;
import java.util.HashSet;
import java.util.Locale;
/**
* This class implements a key factory for PBE keys according to PKCS#5,
......@@ -56,24 +57,24 @@ abstract class PBEKeyFactory extends SecretKeyFactorySpi {
static {
validTypes = new HashSet<String>(17);
validTypes.add("PBEWithMD5AndDES".toUpperCase());
validTypes.add("PBEWithSHA1AndDESede".toUpperCase());
validTypes.add("PBEWithSHA1AndRC2_40".toUpperCase());
validTypes.add("PBEWithSHA1AndRC2_128".toUpperCase());
validTypes.add("PBEWithSHA1AndRC4_40".toUpperCase());
validTypes.add("PBEWithSHA1AndRC4_128".toUpperCase());
validTypes.add("PBEWithMD5AndDES".toUpperCase(Locale.ENGLISH));
validTypes.add("PBEWithSHA1AndDESede".toUpperCase(Locale.ENGLISH));
validTypes.add("PBEWithSHA1AndRC2_40".toUpperCase(Locale.ENGLISH));
validTypes.add("PBEWithSHA1AndRC2_128".toUpperCase(Locale.ENGLISH));
validTypes.add("PBEWithSHA1AndRC4_40".toUpperCase(Locale.ENGLISH));
validTypes.add("PBEWithSHA1AndRC4_128".toUpperCase(Locale.ENGLISH));
// Proprietary algorithm.
validTypes.add("PBEWithMD5AndTripleDES".toUpperCase());
validTypes.add("PBEWithHmacSHA1AndAES_128".toUpperCase());
validTypes.add("PBEWithHmacSHA224AndAES_128".toUpperCase());
validTypes.add("PBEWithHmacSHA256AndAES_128".toUpperCase());
validTypes.add("PBEWithHmacSHA384AndAES_128".toUpperCase());
validTypes.add("PBEWithHmacSHA512AndAES_128".toUpperCase());
validTypes.add("PBEWithHmacSHA1AndAES_256".toUpperCase());
validTypes.add("PBEWithHmacSHA224AndAES_256".toUpperCase());
validTypes.add("PBEWithHmacSHA256AndAES_256".toUpperCase());
validTypes.add("PBEWithHmacSHA384AndAES_256".toUpperCase());
validTypes.add("PBEWithHmacSHA512AndAES_256".toUpperCase());
validTypes.add("PBEWithMD5AndTripleDES".toUpperCase(Locale.ENGLISH));
validTypes.add("PBEWithHmacSHA1AndAES_128".toUpperCase(Locale.ENGLISH));
validTypes.add("PBEWithHmacSHA224AndAES_128".toUpperCase(Locale.ENGLISH));
validTypes.add("PBEWithHmacSHA256AndAES_128".toUpperCase(Locale.ENGLISH));
validTypes.add("PBEWithHmacSHA384AndAES_128".toUpperCase(Locale.ENGLISH));
validTypes.add("PBEWithHmacSHA512AndAES_128".toUpperCase(Locale.ENGLISH));
validTypes.add("PBEWithHmacSHA1AndAES_256".toUpperCase(Locale.ENGLISH));
validTypes.add("PBEWithHmacSHA224AndAES_256".toUpperCase(Locale.ENGLISH));
validTypes.add("PBEWithHmacSHA256AndAES_256".toUpperCase(Locale.ENGLISH));
validTypes.add("PBEWithHmacSHA384AndAES_256".toUpperCase(Locale.ENGLISH));
validTypes.add("PBEWithHmacSHA512AndAES_256".toUpperCase(Locale.ENGLISH));
}
public static final class PBEWithMD5AndDES
......@@ -237,7 +238,7 @@ abstract class PBEKeyFactory extends SecretKeyFactorySpi {
protected KeySpec engineGetKeySpec(SecretKey key, Class<?> keySpecCl)
throws InvalidKeySpecException {
if ((key instanceof SecretKey)
&& (validTypes.contains(key.getAlgorithm().toUpperCase()))
&& (validTypes.contains(key.getAlgorithm().toUpperCase(Locale.ENGLISH)))
&& (key.getFormat().equalsIgnoreCase("RAW"))) {
// Check if requested key spec is amongst the valid ones
......@@ -279,7 +280,7 @@ abstract class PBEKeyFactory extends SecretKeyFactorySpi {
{
try {
if ((key != null) &&
(validTypes.contains(key.getAlgorithm().toUpperCase())) &&
(validTypes.contains(key.getAlgorithm().toUpperCase(Locale.ENGLISH))) &&
(key.getFormat().equalsIgnoreCase("RAW"))) {
// Check if key originates from this factory
......
/*
* Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -30,6 +30,7 @@ import java.nio.ByteBuffer;
import java.nio.CharBuffer;
import java.nio.charset.Charset;
import java.util.Arrays;
import java.util.Locale;
import java.security.KeyRep;
import java.security.GeneralSecurityException;
import java.security.NoSuchAlgorithmException;
......@@ -143,7 +144,7 @@ final class PBKDF2KeyImpl implements javax.crypto.interfaces.PBEKey {
@Override
public int hashCode() {
return Arrays.hashCode(password) * 41 +
prf.getAlgorithm().toLowerCase().hashCode();
prf.getAlgorithm().toLowerCase(Locale.ENGLISH).hashCode();
}
@Override
public boolean equals(Object obj) {
......@@ -221,7 +222,7 @@ final class PBKDF2KeyImpl implements javax.crypto.interfaces.PBEKey {
for (int i = 1; i < this.key.length; i++) {
retval += this.key[i] * i;
}
return(retval ^= getAlgorithm().toLowerCase().hashCode());
return(retval ^= getAlgorithm().toLowerCase(Locale.ENGLISH).hashCode());
}
public boolean equals(Object obj) {
......
/*
* Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -538,6 +538,13 @@ public abstract class ClientNotifForwarder {
currentFetchThread = null;
}
if (nr == null) {
if (logger.traceOn()) {
logger.trace("NotifFetcher-run",
"Recieved null object as notifs, stops fetching because the "
+ "notification server is terminated.");
}
}
if (nr == null || shouldStop()) {
// tell that the thread is REALLY stopped
setState(STOPPED);
......@@ -657,7 +664,7 @@ public abstract class ClientNotifForwarder {
return null;
}
if (shouldStop())
if (shouldStop() || nr == null)
return null;
startSequenceNumber = nr.getNextSequenceNumber();
......
/*
* Copyright (c) 1998, 2011, 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
......@@ -311,7 +311,7 @@ public class ObjectReferenceImpl extends ValueImpl
/*
* For nonvirtual invokes, method must have a body
*/
if ((options & INVOKE_NONVIRTUAL) != 0) {
if (isNonVirtual(options)) {
if (method.isAbstract()) {
throw new IllegalArgumentException("Abstract method");
}
......@@ -323,7 +323,7 @@ public class ObjectReferenceImpl extends ValueImpl
* method argument types.
*/
ClassTypeImpl invokedClass;
if ((options & INVOKE_NONVIRTUAL) != 0) {
if (isNonVirtual(options)) {
// No overrides in non-virtual invokes
invokedClass = clazz;
} else {
......@@ -348,7 +348,7 @@ public class ObjectReferenceImpl extends ValueImpl
/*
* Only default methods allowed for nonvirtual invokes
*/
if (!method.isDefault()) {
if (isNonVirtual(options) && !method.isDefault()) {
throw new IllegalArgumentException("Not a default method");
}
}
......@@ -624,4 +624,8 @@ public class ObjectReferenceImpl extends ValueImpl
byte typeValueKey() {
return JDWP.Tag.OBJECT;
}
private static boolean isNonVirtual(int options) {
return (options & INVOKE_NONVIRTUAL) != 0;
}
}
/*
* Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -1669,15 +1669,6 @@ public abstract class Component implements ImageObserver, MenuContainer,
/* do nothing */
}
/*
* Delete references from LightweithDispatcher of a heavyweight parent
*/
void clearLightweightDispatcherOnRemove(Component removedComponent) {
if (parent != null) {
parent.clearLightweightDispatcherOnRemove(removedComponent);
}
}
/**
* @deprecated As of JDK version 1.1,
* replaced by <code>setVisible(boolean)</code>.
......@@ -6180,7 +6171,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
/**
* Indicates whether a class or its superclasses override coalesceEvents.
* Must be called with lock on coalesceMap and privileged.
* @see checkCoalsecing
* @see checkCoalescing
*/
private static boolean isCoalesceEventsOverriden(Class<?> clazz) {
assert Thread.holdsLock(coalesceMap);
......@@ -6986,8 +6977,6 @@ public abstract class Component implements ImageObserver, MenuContainer,
}
synchronized (getTreeLock()) {
clearLightweightDispatcherOnRemove(this);
if (isFocusOwner() && KeyboardFocusManager.isAutoFocusTransferEnabledFor(this)) {
transferFocus(true);
}
......
/*
* Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -41,6 +41,7 @@ import java.io.ObjectStreamField;
import java.io.PrintStream;
import java.io.PrintWriter;
import java.lang.ref.WeakReference;
import java.security.AccessController;
import java.util.EventListener;
......@@ -3310,16 +3311,6 @@ public class Container extends Component {
}
}
@Override
void clearLightweightDispatcherOnRemove(Component removedComponent) {
if (dispatcher != null) {
dispatcher.removeReferences(removedComponent);
} else {
//It is a Lightweight Container, should clear parent`s Dispatcher
super.clearLightweightDispatcherOnRemove(removedComponent);
}
}
final Container getTraversalRoot() {
if (isFocusCycleRoot()) {
return findTraversalRoot();
......@@ -4413,7 +4404,9 @@ class LightweightDispatcher implements java.io.Serializable, AWTEventListener {
LightweightDispatcher(Container nativeContainer) {
this.nativeContainer = nativeContainer;
mouseEventTarget = null;
mouseEventTarget = new WeakReference<>(null);
targetLastEntered = new WeakReference<>(null);
targetLastEnteredDT = new WeakReference<>(null);
eventMask = 0;
}
......@@ -4424,9 +4417,9 @@ class LightweightDispatcher implements java.io.Serializable, AWTEventListener {
void dispose() {
//System.out.println("Disposing lw dispatcher");
stopListeningForOtherDrags();
mouseEventTarget = null;
targetLastEntered = null;
targetLastEnteredDT = null;
mouseEventTarget.clear();
targetLastEntered.clear();
targetLastEnteredDT.clear();
}
/**
......@@ -4513,65 +4506,62 @@ class LightweightDispatcher implements java.io.Serializable, AWTEventListener {
trackMouseEnterExit(mouseOver, e);
// 4508327 : MOUSE_CLICKED should only go to the recipient of
// the accompanying MOUSE_PRESSED, so don't reset mouseEventTarget on a
// MOUSE_CLICKED.
if (!isMouseGrab(e) && id != MouseEvent.MOUSE_CLICKED) {
mouseEventTarget = (mouseOver != nativeContainer) ? mouseOver: null;
isCleaned = false;
Component met = mouseEventTarget.get();
// 4508327 : MOUSE_CLICKED should only go to the recipient of
// the accompanying MOUSE_PRESSED, so don't reset mouseEventTarget on a
// MOUSE_CLICKED.
if (!isMouseGrab(e) && id != MouseEvent.MOUSE_CLICKED) {
met = (mouseOver != nativeContainer) ? mouseOver : null;
mouseEventTarget = new WeakReference<>(met);
}
if (mouseEventTarget != null) {
if (met != null) {
switch (id) {
case MouseEvent.MOUSE_ENTERED:
case MouseEvent.MOUSE_EXITED:
break;
case MouseEvent.MOUSE_PRESSED:
retargetMouseEvent(mouseEventTarget, id, e);
break;
case MouseEvent.MOUSE_RELEASED:
retargetMouseEvent(mouseEventTarget, id, e);
break;
case MouseEvent.MOUSE_CLICKED:
// 4508327: MOUSE_CLICKED should never be dispatched to a Component
// other than that which received the MOUSE_PRESSED event. If the
// mouse is now over a different Component, don't dispatch the event.
// The previous fix for a similar problem was associated with bug
// 4155217.
if (mouseOver == mouseEventTarget) {
retargetMouseEvent(mouseOver, id, e);
}
break;
case MouseEvent.MOUSE_MOVED:
retargetMouseEvent(mouseEventTarget, id, e);
break;
case MouseEvent.MOUSE_DRAGGED:
if (isMouseGrab(e)) {
retargetMouseEvent(mouseEventTarget, id, e);
}
break;
case MouseEvent.MOUSE_WHEEL:
// This may send it somewhere that doesn't have MouseWheelEvents
// enabled. In this case, Component.dispatchEventImpl() will
// retarget the event to a parent that DOES have the events enabled.
if (eventLog.isLoggable(PlatformLogger.Level.FINEST) && (mouseOver != null)) {
eventLog.finest("retargeting mouse wheel to " +
case MouseEvent.MOUSE_ENTERED:
case MouseEvent.MOUSE_EXITED:
break;
case MouseEvent.MOUSE_PRESSED:
retargetMouseEvent(met, id, e);
break;
case MouseEvent.MOUSE_RELEASED:
retargetMouseEvent(met, id, e);
break;
case MouseEvent.MOUSE_CLICKED:
// 4508327: MOUSE_CLICKED should never be dispatched to a Component
// other than that which received the MOUSE_PRESSED event. If the
// mouse is now over a different Component, don't dispatch the event.
// The previous fix for a similar problem was associated with bug
// 4155217.
if (mouseOver == met) {
retargetMouseEvent(mouseOver, id, e);
}
break;
case MouseEvent.MOUSE_MOVED:
retargetMouseEvent(met, id, e);
break;
case MouseEvent.MOUSE_DRAGGED:
if (isMouseGrab(e)) {
retargetMouseEvent(met, id, e);
}
break;
case MouseEvent.MOUSE_WHEEL:
// This may send it somewhere that doesn't have MouseWheelEvents
// enabled. In this case, Component.dispatchEventImpl() will
// retarget the event to a parent that DOES have the events enabled.
if (eventLog.isLoggable(PlatformLogger.Level.FINEST) && (mouseOver != null)) {
eventLog.finest("retargeting mouse wheel to " +
mouseOver.getName() + ", " +
mouseOver.getClass());
}
retargetMouseEvent(mouseOver, id, e);
break;
}
retargetMouseEvent(mouseOver, id, e);
break;
//Consuming of wheel events is implemented in "retargetMouseEvent".
if (id != MouseEvent.MOUSE_WHEEL) {
e.consume();
}
//Consuming of wheel events is implemented in "retargetMouseEvent".
if (id != MouseEvent.MOUSE_WHEEL) {
e.consume();
}
} else if (isCleaned && id != MouseEvent.MOUSE_WHEEL) {
//After mouseEventTarget was removed and cleaned should consume all events
//until new mouseEventTarget is found
e.consume();
}
return e.isConsumed();
return e.isConsumed();
}
private boolean processDropTargetEvent(SunDropTargetEvent e) {
......@@ -4628,15 +4618,16 @@ class LightweightDispatcher implements java.io.Serializable, AWTEventListener {
// drag has an associated drop target. MOUSE_ENTERED comes when the
// mouse is in the native container already. To propagate this event
// properly we should null out targetLastEntered.
targetLastEnteredDT = null;
targetLastEnteredDT.clear();
} else if (id == MouseEvent.MOUSE_ENTERED) {
isMouseDTInNativeContainer = true;
} else if (id == MouseEvent.MOUSE_EXITED) {
isMouseDTInNativeContainer = false;
}
targetLastEnteredDT = retargetMouseEnterExit(targetOver, e,
targetLastEnteredDT,
Component tle = retargetMouseEnterExit(targetOver, e,
targetLastEnteredDT.get(),
isMouseDTInNativeContainer);
targetLastEnteredDT = new WeakReference<>(tle);
}
/*
......@@ -4662,9 +4653,10 @@ class LightweightDispatcher implements java.io.Serializable, AWTEventListener {
isMouseInNativeContainer = false;
stopListeningForOtherDrags();
}
targetLastEntered = retargetMouseEnterExit(targetOver, e,
targetLastEntered,
Component tle = retargetMouseEnterExit(targetOver, e,
targetLastEntered.get(),
isMouseInNativeContainer);
targetLastEntered = new WeakReference<>(tle);
}
private Component retargetMouseEnterExit(Component targetOver, MouseEvent e,
......@@ -4926,22 +4918,17 @@ class LightweightDispatcher implements java.io.Serializable, AWTEventListener {
* is null, there are currently no events being forwarded to
* a subcomponent.
*/
private transient Component mouseEventTarget;
private transient WeakReference<Component> mouseEventTarget;
/**
* The last component entered by the {@code MouseEvent}.
*/
private transient Component targetLastEntered;
private transient WeakReference<Component> targetLastEntered;
/**
* The last component entered by the {@code SunDropTargetEvent}.
*/
private transient Component targetLastEnteredDT;
/**
* Indicates whether {@code mouseEventTarget} was removed and nulled
*/
private transient boolean isCleaned;
private transient WeakReference<Component> targetLastEnteredDT;
/**
* Is the mouse over the native container.
......@@ -4982,17 +4969,4 @@ class LightweightDispatcher implements java.io.Serializable, AWTEventListener {
AWTEvent.MOUSE_EVENT_MASK |
AWTEvent.MOUSE_MOTION_EVENT_MASK |
AWTEvent.MOUSE_WHEEL_EVENT_MASK;
void removeReferences(Component removedComponent) {
if (mouseEventTarget == removedComponent) {
isCleaned = true;
mouseEventTarget = null;
}
if (targetLastEntered == removedComponent) {
targetLastEntered = null;
}
if (targetLastEnteredDT == removedComponent) {
targetLastEnteredDT = null;
}
}
}
......@@ -181,7 +181,8 @@ public abstract class GraphicsEnvironment {
"SunOS".equals(osName) ||
"FreeBSD".equals(osName) ||
"NetBSD".equals(osName) ||
"OpenBSD".equals(osName)) &&
"OpenBSD".equals(osName) ||
"AIX".equals(osName)) &&
(System.getenv("DISPLAY") == null));
}
}
......
......@@ -453,7 +453,7 @@ public class Object {
"nanosecond timeout value out of range");
}
if (nanos >= 500000 || (nanos != 0 && timeout == 0)) {
if (nanos > 0) {
timeout++;
}
......
......@@ -135,7 +135,7 @@ public final class String
* unnecessary since Strings are immutable.
*/
public String() {
this.value = new char[0];
this.value = "".value;
}
/**
......@@ -191,8 +191,14 @@ public final class String
if (offset < 0) {
throw new StringIndexOutOfBoundsException(offset);
}
if (count < 0) {
throw new StringIndexOutOfBoundsException(count);
if (count <= 0) {
if (count < 0) {
throw new StringIndexOutOfBoundsException(count);
}
if (offset <= value.length) {
this.value = "".value;
return;
}
}
// Note: offset or count might be near -1>>>1.
if (offset > value.length - count) {
......@@ -233,8 +239,14 @@ public final class String
if (offset < 0) {
throw new StringIndexOutOfBoundsException(offset);
}
if (count < 0) {
throw new StringIndexOutOfBoundsException(count);
if (count <= 0) {
if (count < 0) {
throw new StringIndexOutOfBoundsException(count);
}
if (offset <= codePoints.length) {
this.value = "".value;
return;
}
}
// Note: offset or count might be near -1>>>1.
if (offset > codePoints.length - count) {
......@@ -782,7 +794,7 @@ public final class String
* subarray of {@code dst} starting at index {@code dstBegin}
* and ending at index:
* <blockquote><pre>
* dstbegin + (srcEnd-srcBegin) - 1
* dstBegin + (srcEnd-srcBegin) - 1
* </pre></blockquote>
*
* @param srcBegin index of the first character in the string
......@@ -827,7 +839,7 @@ public final class String
* dst} starting at index {@code dstBegin} and ending at index:
*
* <blockquote><pre>
* dstbegin + (srcEnd-srcBegin) - 1
* dstBegin + (srcEnd-srcBegin) - 1
* </pre></blockquote>
*
* @deprecated This method does not properly convert characters into
......
......@@ -285,6 +285,7 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*;
// Forward the SAM method
MethodVisitor mv = cw.visitMethod(ACC_PUBLIC, samMethodName,
samMethodType.toMethodDescriptorString(), null, null);
mv.visitAnnotation("Ljava/lang/invoke/LambdaForm$Hidden;", true);
new ForwardingMethodGenerator(mv).generate(samMethodType);
// Forward the bridges
......@@ -292,6 +293,7 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*;
for (MethodType mt : additionalBridges) {
mv = cw.visitMethod(ACC_PUBLIC|ACC_BRIDGE, samMethodName,
mt.toMethodDescriptorString(), null, null);
mv.visitAnnotation("Ljava/lang/invoke/LambdaForm$Hidden;", true);
new ForwardingMethodGenerator(mv).generate(mt);
}
}
......
......@@ -4801,41 +4801,61 @@ public class BigDecimal extends Number implements Comparable<BigDecimal> {
if (dividendHi >= divisor) {
return null;
}
final int shift = Long.numberOfLeadingZeros(divisor);
divisor <<= shift;
final long v1 = divisor >>> 32;
final long v0 = divisor & LONG_MASK;
long q1, q0;
long r_tmp;
long tmp = dividendLo << shift;
long u1 = tmp >>> 32;
long u0 = tmp & LONG_MASK;
tmp = (dividendHi << shift) | (dividendLo >>> 64 - shift);
long u2 = tmp & LONG_MASK;
tmp = divWord(tmp,v1);
q1 = tmp & LONG_MASK;
r_tmp = tmp >>> 32;
long q1, r_tmp;
if (v1 == 1) {
q1 = tmp;
r_tmp = 0;
} else if (tmp >= 0) {
q1 = tmp / v1;
r_tmp = tmp - q1 * v1;
} else {
long[] rq = divRemNegativeLong(tmp, v1);
q1 = rq[1];
r_tmp = rq[0];
}
while(q1 >= DIV_NUM_BASE || unsignedLongCompare(q1*v0, make64(r_tmp, u1))) {
q1--;
r_tmp += v1;
if (r_tmp >= DIV_NUM_BASE)
break;
}
tmp = mulsub(u2,u1,v1,v0,q1);
u1 = tmp & LONG_MASK;
tmp = divWord(tmp,v1);
q0 = tmp & LONG_MASK;
r_tmp = tmp >>> 32;
long q0;
if (v1 == 1) {
q0 = tmp;
r_tmp = 0;
} else if (tmp >= 0) {
q0 = tmp / v1;
r_tmp = tmp - q0 * v1;
} else {
long[] rq = divRemNegativeLong(tmp, v1);
q0 = rq[1];
r_tmp = rq[0];
}
while(q0 >= DIV_NUM_BASE || unsignedLongCompare(q0*v0,make64(r_tmp,u0))) {
q0--;
r_tmp += v1;
if (r_tmp >= DIV_NUM_BASE)
break;
}
if((int)q1 < 0) {
// result (which is positive and unsigned here)
// can't fit into long due to sign bit is used for value
......@@ -4858,10 +4878,13 @@ public class BigDecimal extends Number implements Comparable<BigDecimal> {
}
}
}
long q = make64(q1,q0);
q*=sign;
if (roundingMode == ROUND_DOWN && scale == preferredScale)
return valueOf(q, scale);
long r = mulsub(u1, u0, v1, v0, q0) >>> shift;
if (r != 0) {
boolean increment = needIncrement(divisor >>> shift, roundingMode, sign, q, r);
......@@ -4904,28 +4927,35 @@ public class BigDecimal extends Number implements Comparable<BigDecimal> {
}
}
private static long divWord(long n, long dLong) {
long r;
long q;
if (dLong == 1) {
q = (int)n;
return (q & LONG_MASK);
}
/**
* Calculate the quotient and remainder of dividing a negative long by
* another long.
*
* @param n the numerator; must be negative
* @param d the denominator; must not be unity
* @return a two-element {@long} array with the remainder and quotient in
* the initial and final elements, respectively
*/
private static long[] divRemNegativeLong(long n, long d) {
assert n < 0 : "Non-negative numerator " + n;
assert d != 1 : "Unity denominator";
// Approximate the quotient and remainder
q = (n >>> 1) / (dLong >>> 1);
r = n - q*dLong;
long q = (n >>> 1) / (d >>> 1);
long r = n - q * d;
// Correct the approximation
while (r < 0) {
r += dLong;
r += d;
q--;
}
while (r >= dLong) {
r -= dLong;
while (r >= d) {
r -= d;
q++;
}
// n - q*dlong == r && 0 <= r <dLong, hence we're done.
return (r << 32) | (q & LONG_MASK);
// n - q*d == r && 0 <= r < d, hence we're done.
return new long[] {r, q};
}
private static long make64(long hi, long lo) {
......
/*
* 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
......@@ -172,9 +172,24 @@ public final class AccessControlContext {
public AccessControlContext(AccessControlContext acc,
DomainCombiner combiner) {
SecurityManager sm = System.getSecurityManager();
if (sm != null) {
sm.checkPermission(SecurityConstants.CREATE_ACC_PERMISSION);
this(acc, combiner, false);
}
/**
* package private to allow calls from ProtectionDomain without performing
* the security check for {@linkplain SecurityConstants.CREATE_ACC_PERMISSION}
* permission
*/
AccessControlContext(AccessControlContext acc,
DomainCombiner combiner,
boolean preauthorized) {
if (!preauthorized) {
SecurityManager sm = System.getSecurityManager();
if (sm != null) {
sm.checkPermission(SecurityConstants.CREATE_ACC_PERMISSION);
this.isAuthorized = true;
}
} else {
this.isAuthorized = true;
}
......
/*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -25,6 +25,7 @@
package java.security;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Enumeration;
......@@ -59,35 +60,44 @@ import sun.misc.SharedSecrets;
*/
public class ProtectionDomain {
private static class JavaSecurityAccessImpl implements JavaSecurityAccess {
static {
// Set up JavaSecurityAccess in SharedSecrets
SharedSecrets.setJavaSecurityAccess(
new JavaSecurityAccess() {
public <T> T doIntersectionPrivilege(
PrivilegedAction<T> action,
final AccessControlContext stack,
final AccessControlContext context)
{
if (action == null) {
throw new NullPointerException();
}
return AccessController.doPrivileged(
action,
new AccessControlContext(
stack.getContext(), context).optimize()
);
}
private JavaSecurityAccessImpl() {
}
public <T> T doIntersectionPrivilege(
PrivilegedAction<T> action,
AccessControlContext context)
{
return doIntersectionPrivilege(action,
AccessController.getContext(), context);
}
@Override
public <T> T doIntersectionPrivilege(
PrivilegedAction<T> action,
final AccessControlContext stack,
final AccessControlContext context) {
if (action == null) {
throw new NullPointerException();
}
);
return AccessController.doPrivileged(
action,
getCombinedACC(context, stack)
);
}
@Override
public <T> T doIntersectionPrivilege(
PrivilegedAction<T> action,
AccessControlContext context) {
return doIntersectionPrivilege(action,
AccessController.getContext(), context);
}
private static AccessControlContext getCombinedACC(AccessControlContext context, AccessControlContext stack) {
AccessControlContext acc = new AccessControlContext(context, stack.getCombiner(), true);
return new AccessControlContext(stack.getContext(), acc).optimize();
}
}
static {
// Set up JavaSecurityAccess in SharedSecrets
SharedSecrets.setJavaSecurityAccess(new JavaSecurityAccessImpl());
}
/* CodeSource */
......@@ -447,24 +457,37 @@ public class ProtectionDomain {
/**
* Used for storing ProtectionDomains as keys in a Map.
*/
final class Key {}
final static class Key {}
// A cache of ProtectionDomains and their Permissions
private static class PDCache implements ProtectionDomainCache {
// We must wrap the PermissionCollection in a WeakReference as there
// are some PermissionCollections which contain strong references
// back to a ProtectionDomain and otherwise would never be removed
// from the WeakHashMap
private final Map<Key, WeakReference<PermissionCollection>>
map = new WeakHashMap<>();
@Override
public synchronized void put(ProtectionDomain pd,
PermissionCollection pc) {
map.put(pd == null ? null : pd.key, new WeakReference<>(pc));
}
@Override
public synchronized PermissionCollection get(ProtectionDomain pd) {
WeakReference<PermissionCollection> ref =
map.get(pd == null ? null : pd.key);
return ref == null ? null : ref.get();
}
}
static {
SharedSecrets.setJavaSecurityProtectionDomainAccess(
new JavaSecurityProtectionDomainAccess() {
@Override
public ProtectionDomainCache getProtectionDomainCache() {
return new ProtectionDomainCache() {
private final Map<Key, PermissionCollection> map =
Collections.synchronizedMap
(new WeakHashMap<Key, PermissionCollection>());
public void put(ProtectionDomain pd,
PermissionCollection pc) {
map.put((pd == null ? null : pd.key), pc);
}
public PermissionCollection get(ProtectionDomain pd) {
return pd == null ? map.get(null) : map.get(pd.key);
}
};
return new PDCache();
}
});
}
......
......@@ -2574,8 +2574,10 @@ public class X509CertSelector implements CertSelector {
} else {
if (maxPathLen < basicConstraints) {
if (debug != null) {
debug.println("X509CertSelector.match: maxPathLen too small ("
+ maxPathLen + " < " + basicConstraints + ")");
debug.println("X509CertSelector.match: cert's maxPathLen " +
"is less than the min maxPathLen set by " +
"basicConstraints. " +
"(" + maxPathLen + " < " + basicConstraints + ")");
}
return false;
}
......
......@@ -2083,17 +2083,33 @@ public abstract class Calendar implements Serializable, Cloneable, Comparable<Ca
return null;
}
String calendarType = getCalendarType();
int fieldValue = get(field);
// the standalone and narrow styles are supported only through CalendarDataProviders.
if (isStandaloneStyle(style) || isNarrowStyle(style)) {
return CalendarDataUtility.retrieveFieldValueName(getCalendarType(),
field, get(field),
style, locale);
if (isStandaloneStyle(style) || isNarrowFormatStyle(style)) {
String val = CalendarDataUtility.retrieveFieldValueName(calendarType,
field, fieldValue,
style, locale);
// Perform fallback here to follow the CLDR rules
if (val == null) {
if (isNarrowFormatStyle(style)) {
val = CalendarDataUtility.retrieveFieldValueName(calendarType,
field, fieldValue,
toStandaloneStyle(style),
locale);
} else if (isStandaloneStyle(style)) {
val = CalendarDataUtility.retrieveFieldValueName(calendarType,
field, fieldValue,
getBaseStyle(style),
locale);
}
}
return val;
}
DateFormatSymbols symbols = DateFormatSymbols.getInstance(locale);
String[] strings = getFieldStrings(field, style, symbols);
if (strings != null) {
int fieldValue = get(field);
if (fieldValue < strings.length) {
return strings[fieldValue];
}
......@@ -2155,10 +2171,26 @@ public abstract class Calendar implements Serializable, Cloneable, Comparable<Ca
ERA_MASK|MONTH_MASK|DAY_OF_WEEK_MASK|AM_PM_MASK)) {
return null;
}
if (style == ALL_STYLES || isStandaloneStyle(style)) {
return CalendarDataUtility.retrieveFieldValueNames(getCalendarType(), field, style, locale);
String calendarType = getCalendarType();
if (style == ALL_STYLES || isStandaloneStyle(style) || isNarrowFormatStyle(style)) {
Map<String, Integer> map;
map = CalendarDataUtility.retrieveFieldValueNames(calendarType, field, style, locale);
// Perform fallback here to follow the CLDR rules
if (map == null) {
if (isNarrowFormatStyle(style)) {
map = CalendarDataUtility.retrieveFieldValueNames(calendarType, field,
toStandaloneStyle(style), locale);
} else if (style != ALL_STYLES) {
map = CalendarDataUtility.retrieveFieldValueNames(calendarType, field,
getBaseStyle(style), locale);
}
}
return map;
}
// SHORT, LONG, or NARROW
// SHORT or LONG
return getDisplayNamesImpl(field, style, locale);
}
......@@ -2544,14 +2576,22 @@ public abstract class Calendar implements Serializable, Cloneable, Comparable<Ca
return style & ~STANDALONE_MASK;
}
boolean isStandaloneStyle(int style) {
private int toStandaloneStyle(int style) {
return style | STANDALONE_MASK;
}
private boolean isStandaloneStyle(int style) {
return (style & STANDALONE_MASK) != 0;
}
boolean isNarrowStyle(int style) {
private boolean isNarrowStyle(int style) {
return style == NARROW_FORMAT || style == NARROW_STANDALONE;
}
private boolean isNarrowFormatStyle(int style) {
return style == NARROW_FORMAT;
}
/**
* Returns the pseudo-time-stamp for two fields, given their
* individual pseudo-time-stamps. If either of the fields
......
......@@ -144,10 +144,14 @@ class ComparableTimSort {
* large) stack lengths for smaller arrays. The "magic numbers" in the
* computation below must be changed if MIN_MERGE is decreased. See
* the MIN_MERGE declaration above for more information.
* The maximum value of 49 allows for an array up to length
* Integer.MAX_VALUE-4, if array is filled by the worst case stack size
* increasing scenario. More explanations are given in section 4 of:
* http://envisage-project.eu/wp-content/uploads/2015/02/sorting.pdf
*/
int stackLen = (len < 120 ? 5 :
len < 1542 ? 10 :
len < 119151 ? 24 : 40);
len < 119151 ? 24 : 49);
runBase = new int[stackLen];
runLen = new int[stackLen];
}
......
......@@ -174,10 +174,14 @@ class TimSort<T> {
* large) stack lengths for smaller arrays. The "magic numbers" in the
* computation below must be changed if MIN_MERGE is decreased. See
* the MIN_MERGE declaration above for more information.
* The maximum value of 49 allows for an array up to length
* Integer.MAX_VALUE-4, if array is filled by the worst case stack size
* increasing scenario. More explanations are given in section 4 of:
* http://envisage-project.eu/wp-content/uploads/2015/02/sorting.pdf
*/
int stackLen = (len < 120 ? 5 :
len < 1542 ? 10 :
len < 119151 ? 24 : 40);
len < 119151 ? 24 : 49);
runBase = new int[stackLen];
runLen = new int[stackLen];
}
......
......@@ -978,7 +978,15 @@ public class CompletableFuture<T> implements Future<T>, CompletionStage<T> {
}
try {
@SuppressWarnings("unchecked") T t = (T) r;
return f.apply(t).toCompletableFuture();
CompletableFuture<V> g = f.apply(t).toCompletableFuture();
Object s = g.result;
if (s != null)
return new CompletableFuture<V>(encodeRelay(s));
CompletableFuture<V> d = new CompletableFuture<V>();
UniRelay<V> copy = new UniRelay<V>(d, g);
g.push(copy);
copy.tryFire(SYNC);
return d;
} catch (Throwable ex) {
return new CompletableFuture<V>(encodeThrowable(ex));
}
......
/*
* Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -41,7 +41,9 @@ public
class ZipEntry implements ZipConstants, Cloneable {
String name; // entry name
long time = -1; // last modification time
long xdostime = -1; // last modification time (in extended DOS time,
// where milliseconds lost in conversion might
// be encoded into the upper half)
FileTime mtime; // last modification time, from extra field data
FileTime atime; // last access time, from extra field data
FileTime ctime; // creation time, from extra field data
......@@ -63,6 +65,28 @@ class ZipEntry implements ZipConstants, Cloneable {
*/
public static final int DEFLATED = 8;
/**
* DOS time constant for representing timestamps before 1980.
*/
static final long DOSTIME_BEFORE_1980 = (1 << 21) | (1 << 16);
/**
* Approximately 128 years, in milliseconds (ignoring leap years etc).
*
* This establish an approximate high-bound value for DOS times in
* milliseconds since epoch, used to enable an efficient but
* sufficient bounds check to avoid generating extended last modified
* time entries.
*
* Calculating the exact number is locale dependent, would require loading
* TimeZone data eagerly, and would make little practical sense. Since DOS
* times theoretically go to 2107 - with compatibility not guaranteed
* after 2099 - setting this to a time that is before but near 2099
* should be sufficient.
*/
private static final long UPPER_DOSTIME_BOUND =
128L * 365 * 24 * 60 * 60 * 1000;
/**
* Creates a new zip entry with the specified name.
*
......@@ -93,7 +117,7 @@ class ZipEntry implements ZipConstants, Cloneable {
public ZipEntry(ZipEntry e) {
Objects.requireNonNull(e, "entry");
name = e.name;
time = e.time;
xdostime = e.xdostime;
mtime = e.mtime;
atime = e.atime;
ctime = e.ctime;
......@@ -137,8 +161,14 @@ class ZipEntry implements ZipConstants, Cloneable {
* @see #getLastModifiedTime()
*/
public void setTime(long time) {
this.time = time;
this.mtime = null;
this.xdostime = javaToExtendedDosTime(time);
// Avoid setting the mtime field if time is in the valid
// range for a DOS time
if (xdostime != DOSTIME_BEFORE_1980 && time <= UPPER_DOSTIME_BOUND) {
this.mtime = null;
} else {
this.mtime = FileTime.from(time, TimeUnit.MILLISECONDS);
}
}
/**
......@@ -158,7 +188,10 @@ class ZipEntry implements ZipConstants, Cloneable {
* @see #setLastModifiedTime(FileTime)
*/
public long getTime() {
return time;
if (mtime != null) {
return mtime.toMillis();
}
return (xdostime != -1) ? extendedDosToJavaTime(xdostime) : -1;
}
/**
......@@ -180,9 +213,8 @@ class ZipEntry implements ZipConstants, Cloneable {
* @since 1.8
*/
public ZipEntry setLastModifiedTime(FileTime time) {
Objects.requireNonNull(name, "time");
this.mtime = time;
this.time = time.to(TimeUnit.MILLISECONDS);
this.mtime = Objects.requireNonNull(time, "lastModifiedTime");
this.xdostime = javaToExtendedDosTime(time.to(TimeUnit.MILLISECONDS));
return this;
}
......@@ -205,9 +237,9 @@ class ZipEntry implements ZipConstants, Cloneable {
public FileTime getLastModifiedTime() {
if (mtime != null)
return mtime;
if (time == -1)
if (xdostime == -1)
return null;
return FileTime.from(time, TimeUnit.MILLISECONDS);
return FileTime.from(getTime(), TimeUnit.MILLISECONDS);
}
/**
......@@ -227,8 +259,7 @@ class ZipEntry implements ZipConstants, Cloneable {
* @since 1.8
*/
public ZipEntry setLastAccessTime(FileTime time) {
Objects.requireNonNull(name, "time");
this.atime = time;
this.atime = Objects.requireNonNull(time, "lastAccessTime");
return this;
}
......@@ -265,8 +296,7 @@ class ZipEntry implements ZipConstants, Cloneable {
* @since 1.8
*/
public ZipEntry setCreationTime(FileTime time) {
Objects.requireNonNull(name, "time");
this.ctime = time;
this.ctime = Objects.requireNonNull(time, "creationTime");
return this;
}
......
/*
* Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -46,7 +46,6 @@ import java.util.stream.Stream;
import java.util.stream.StreamSupport;
import static java.util.zip.ZipConstants64.*;
import static java.util.zip.ZipUtils.*;
/**
* This class is used to read entries from a zip file.
......@@ -567,7 +566,7 @@ class ZipFile implements ZipConstants, Closeable {
e.name = zc.toString(bname, bname.length);
}
}
e.time = dosToJavaTime(getEntryTime(jzentry));
e.xdostime = getEntryTime(jzentry);
e.crc = getEntryCrc(jzentry);
e.size = getEntrySize(jzentry);
e.csize = getEntryCSize(jzentry);
......
/*
* Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -303,7 +303,7 @@ class ZipInputStream extends InflaterInputStream implements ZipConstants {
throw new ZipException("encrypted ZIP entry not supported");
}
e.method = get16(tmpbuf, LOCHOW);
e.time = dosToJavaTime(get32(tmpbuf, LOCTIM));
e.xdostime = get32(tmpbuf, LOCTIM);
if ((flag & 8) == 8) {
/* "Data Descriptor" present */
if (e.method != DEFLATED) {
......
/*
* Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -61,7 +61,6 @@ class ZipOutputStream extends DeflaterOutputStream implements ZipConstants {
private static class XEntry {
final ZipEntry entry;
final long offset;
long dostime; // last modification time in msdos format
public XEntry(ZipEntry entry, long offset) {
this.entry = entry;
this.offset = offset;
......@@ -192,7 +191,7 @@ class ZipOutputStream extends DeflaterOutputStream implements ZipConstants {
if (current != null) {
closeEntry(); // close previous entry
}
if (e.time == -1) {
if (e.xdostime == -1) {
// by default, do NOT use extended timestamps in extra
// data, for now.
e.setTime(System.currentTimeMillis());
......@@ -389,18 +388,12 @@ class ZipOutputStream extends DeflaterOutputStream implements ZipConstants {
boolean hasZip64 = false;
int elen = getExtraLen(e.extra);
// keep a copy of dostime for writeCEN(), otherwise the tz
// sensitive local time entries in loc and cen might be
// different if the default tz get changed during writeLOC()
// and writeCEN()
xentry.dostime = javaToDosTime(e.time);
writeInt(LOCSIG); // LOC header signature
if ((flag & 8) == 8) {
writeShort(version(e)); // version needed to extract
writeShort(flag); // general purpose bit flag
writeShort(e.method); // compression method
writeInt(xentry.dostime); // last modification time
writeInt(e.xdostime); // last modification time
// store size, uncompressed size, and crc-32 in data descriptor
// immediately following compressed entry data
writeInt(0);
......@@ -415,7 +408,7 @@ class ZipOutputStream extends DeflaterOutputStream implements ZipConstants {
}
writeShort(flag); // general purpose bit flag
writeShort(e.method); // compression method
writeInt(xentry.dostime); // last modification time
writeInt(e.xdostime); // last modification time
writeInt(e.crc); // crc-32
if (hasZip64) {
writeInt(ZIP64_MAGICVAL);
......@@ -522,9 +515,7 @@ class ZipOutputStream extends DeflaterOutputStream implements ZipConstants {
}
writeShort(flag); // general purpose bit flag
writeShort(e.method); // compression method
// use the copy in xentry, which has been converted
// from e.time in writeLOC()
writeInt(xentry.dostime); // last modification time
writeInt(e.xdostime); // last modification time
writeInt(e.crc); // crc-32
writeInt(csize); // compressed size
writeInt(size); // uncompressed size
......
/*
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 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
......@@ -29,9 +29,6 @@ import java.nio.file.attribute.FileTime;
import java.util.Date;
import java.util.concurrent.TimeUnit;
import static java.util.zip.ZipConstants.*;
import static java.util.zip.ZipConstants64.*;
class ZipUtils {
// used to adjust values between Windows and java epoch
......@@ -69,7 +66,7 @@ class ZipUtils {
/**
* Converts DOS time to Java time (number of milliseconds since epoch).
*/
public static long dosToJavaTime(long dtime) {
private static long dosToJavaTime(long dtime) {
@SuppressWarnings("deprecation") // Use of date constructor.
Date d = new Date((int)(((dtime >> 25) & 0x7f) + 80),
(int)(((dtime >> 21) & 0x0f) - 1),
......@@ -80,21 +77,50 @@ class ZipUtils {
return d.getTime();
}
/**
* Converts extended DOS time to Java time, where up to 1999 milliseconds
* might be encoded into the upper half of the returned long.
*
* @param xdostime the extended DOS time value
* @return milliseconds since epoch
*/
public static long extendedDosToJavaTime(long xdostime) {
long time = dosToJavaTime(xdostime);
return time + (xdostime >> 32);
}
/**
* Converts Java time to DOS time.
*/
@SuppressWarnings("deprecation") // Use of date methods
public static long javaToDosTime(long time) {
private static long javaToDosTime(long time) {
Date d = new Date(time);
int year = d.getYear() + 1900;
if (year < 1980) {
return (1 << 21) | (1 << 16);
return ZipEntry.DOSTIME_BEFORE_1980;
}
return (year - 1980) << 25 | (d.getMonth() + 1) << 21 |
d.getDate() << 16 | d.getHours() << 11 | d.getMinutes() << 5 |
d.getSeconds() >> 1;
}
/**
* Converts Java time to DOS time, encoding any milliseconds lost
* in the conversion into the upper half of the returned long.
*
* @param time milliseconds since epoch
* @return DOS time with 2s remainder encoded into upper half
*/
public static long javaToExtendedDosTime(long time) {
if (time < 0) {
return ZipEntry.DOSTIME_BEFORE_1980;
}
long dostime = javaToDosTime(time);
return (dostime != ZipEntry.DOSTIME_BEFORE_1980)
? dostime + ((time % 2000) << 32)
: ZipEntry.DOSTIME_BEFORE_1980;
}
/**
* Fetches unsigned 16-bit value from byte array at specified offset.
* The bytes are assumed to be in Intel (little-endian) byte order.
......
/*
* Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -26,6 +26,7 @@
package javax.crypto.spec;
import java.security.spec.KeySpec;
import java.util.Locale;
import javax.crypto.SecretKey;
/**
......@@ -194,7 +195,8 @@ public class SecretKeySpec implements KeySpec, SecretKey {
if (this.algorithm.equalsIgnoreCase("TripleDES"))
return (retval ^= "desede".hashCode());
else
return (retval ^= this.algorithm.toLowerCase().hashCode());
return (retval ^=
this.algorithm.toLowerCase(Locale.ENGLISH).hashCode());
}
/**
......
......@@ -225,7 +225,7 @@ public abstract class ImageInputStreamImpl implements ImageInputStream {
}
public short readShort() throws IOException {
if (read(byteBuf, 0, 2) < 0) {
if (read(byteBuf, 0, 2) != 2) {
throw new EOFException();
}
......@@ -247,7 +247,7 @@ public abstract class ImageInputStreamImpl implements ImageInputStream {
}
public int readInt() throws IOException {
if (read(byteBuf, 0, 4) < 0) {
if (read(byteBuf, 0, 4) != 4) {
throw new EOFException();
}
......
......@@ -1254,10 +1254,11 @@ public class RMIConnectionImpl implements RMIConnection, Unreferenced {
if (serverTerminated) {
// we must not call fetchNotifs() if the server is
// terminated (timeout elapsed).
//
return new NotificationResult(0L, 0L,
new TargetedNotification[0]);
// returns null to force the client to stop fetching
if (logger.debugOn()) logger.debug("fetchNotifications",
"The notification server has been closed, "
+ "returns null to force the client to stop fetching");
return null;
}
final long csn = clientSequenceNumber;
final int mn = maxNotifications;
......
......@@ -85,7 +85,7 @@ public interface ScriptEngineFactory {
public List<String> getNames();
/**
* Returns the name of the scripting langauge supported by this
* Returns the name of the scripting language supported by this
* <code>ScriptEngine</code>.
* @return The name of the supported language.
*/
......@@ -104,14 +104,15 @@ public interface ScriptEngineFactory {
* <ul>
* <li>ScriptEngine.ENGINE</li>
* <li>ScriptEngine.ENGINE_VERSION</li>
* <li>ScriptEngine.NAME</li>
* <li>ScriptEngine.LANGUAGE</li>
* <li>ScriptEngine.LANGUAGE_VERSION</li>
* <li>ScriptEngine.NAME</li>
* </ul>
* <p>
* The values for these keys are the Strings returned by <code>getEngineName</code>,
* <code>getEngineVersion</code>, <code>getName</code>, <code>getLanguageName</code> and
* <code>getLanguageVersion</code> respectively.<br><br>
* <code>getEngineVersion</code>, <code>getLanguageName</code>,
* <code>getLanguageVersion</code> for the first four keys respectively. For NAME, one of the Strings
* returned by <code>getNames</code> is returned.<br><br>
* A reserved key, <code><b>THREADING</b></code>, whose value describes the behavior of the engine
* with respect to concurrent execution of scripts and maintenance of state is also defined.
* These values for the <code><b>THREADING</b></code> key are:<br><br>
......
......@@ -3738,12 +3738,6 @@ public abstract class JComponent extends Container implements Serializable,
* @param listener the PropertyChangeListener to be added
*/
public void addPropertyChangeListener(PropertyChangeListener listener) {
if (accessibleContainerHandler == null) {
accessibleContainerHandler = new AccessibleContainerHandler();
}
if (propertyListenersCount++ == 0) {
JComponent.this.addContainerListener(accessibleContainerHandler);
}
super.addPropertyChangeListener(listener);
}
......@@ -3755,9 +3749,6 @@ public abstract class JComponent extends Container implements Serializable,
* @param listener the PropertyChangeListener to be removed
*/
public void removePropertyChangeListener(PropertyChangeListener listener) {
if (--propertyListenersCount == 0) {
JComponent.this.removeContainerListener(accessibleContainerHandler);
}
super.removePropertyChangeListener(listener);
}
......
......@@ -475,7 +475,8 @@ public class JMenu extends JMenuItem implements Accessible,MenuElement
}
// Then the y:
y = s.height + yOffset; // Prefer dropping down
if (position.y + y + pmSize.height >= screenBounds.height &&
if (position.y + y + pmSize.height >= screenBounds.height
+ screenBounds.y &&
// popup doesn't fit - place it wherever there's more room
screenBounds.height - s.height < 2*(position.y
- screenBounds.y)) {
......
/*
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -872,9 +872,10 @@ public class JTree extends JComponent implements Scrollable, Accessible
if(treeModelListener != null)
treeModel.addTreeModelListener(treeModelListener);
// Mark the root as expanded, if it isn't a leaf.
if(treeModel.getRoot() != null &&
!treeModel.isLeaf(treeModel.getRoot())) {
expandedState.put(new TreePath(treeModel.getRoot()),
Object treeRoot = treeModel.getRoot();
if(treeRoot != null &&
!treeModel.isLeaf(treeRoot)) {
expandedState.put(new TreePath(treeRoot),
Boolean.TRUE);
}
}
......@@ -3223,6 +3224,9 @@ public class JTree extends JComponent implements Scrollable, Accessible
int count = indexs.length;
Object parent = model.getRoot();
if (parent == null)
return null;
TreePath parentPath = new TreePath(parent);
for(int counter = 0; counter < count; counter++) {
......@@ -3798,8 +3802,9 @@ public class JTree extends JComponent implements Scrollable, Accessible
if (parent.getPathCount() == 1) {
// New root, remove everything!
clearToggledPaths();
if(treeModel.getRoot() != null &&
!treeModel.isLeaf(treeModel.getRoot())) {
Object treeRoot = treeModel.getRoot();
if(treeRoot != null &&
!treeModel.isLeaf(treeRoot)) {
// Mark the root as expanded, if it isn't a leaf.
expandedState.put(parent, Boolean.TRUE);
}
......@@ -4283,7 +4288,11 @@ public class JTree extends JComponent implements Scrollable, Accessible
if (model == null) {
return null;
}
TreePath path = new TreePath(model.getRoot());
Object treeRoot = model.getRoot();
if (treeRoot == null)
return null;
TreePath path = new TreePath(treeRoot);
if (JTree.this.isVisible(path)) {
TreeCellRenderer r = JTree.this.getCellRenderer();
TreeUI ui = JTree.this.getUI();
......@@ -4296,8 +4305,8 @@ public class JTree extends JComponent implements Scrollable, Accessible
boolean expanded = JTree.this.isExpanded(path);
return r.getTreeCellRendererComponent(JTree.this,
model.getRoot(), selected, expanded,
model.isLeaf(model.getRoot()), row, hasFocus);
treeRoot, selected, expanded,
model.isLeaf(treeRoot), row, hasFocus);
}
}
return null;
......@@ -4350,8 +4359,11 @@ public class JTree extends JComponent implements Scrollable, Accessible
return 1; // the root node
}
Object treeRoot = model.getRoot();
if (treeRoot == null)
return 0;
// return the root's first set of children count
return model.getChildCount(model.getRoot());
return model.getChildCount(treeRoot);
}
/**
......@@ -4365,9 +4377,17 @@ public class JTree extends JComponent implements Scrollable, Accessible
if (model == null) {
return null;
}
Object treeRoot = model.getRoot();
if (treeRoot == null) {
return null;
}
if (isRootVisible()) {
if (i == 0) { // return the root node Accessible
Object[] objPath = { model.getRoot() };
Object[] objPath = { treeRoot };
if (objPath[0] == null)
return null;
TreePath path = new TreePath(objPath);
return new AccessibleJTreeNode(JTree.this, path, JTree.this);
} else {
......@@ -4376,12 +4396,14 @@ public class JTree extends JComponent implements Scrollable, Accessible
}
// return Accessible for one of root's child nodes
int count = model.getChildCount(model.getRoot());
int count = model.getChildCount(treeRoot);
if (i < 0 || i >= count) {
return null;
}
Object obj = model.getChild(model.getRoot(), i);
Object[] objPath = { model.getRoot(), obj };
Object obj = model.getChild(treeRoot, i);
if (obj == null)
return null;
Object[] objPath = { treeRoot, obj };
TreePath path = new TreePath(objPath);
return new AccessibleJTreeNode(JTree.this, path, JTree.this);
}
......@@ -4420,6 +4442,9 @@ public class JTree extends JComponent implements Scrollable, Accessible
public int getAccessibleSelectionCount() {
Object[] rootPath = new Object[1];
rootPath[0] = treeModel.getRoot();
if (rootPath[0] == null)
return 0;
TreePath childPath = new TreePath(rootPath);
if (JTree.this.isPathSelected(childPath)) {
return 1;
......@@ -4442,6 +4467,8 @@ public class JTree extends JComponent implements Scrollable, Accessible
if (i == 0) {
Object[] rootPath = new Object[1];
rootPath[0] = treeModel.getRoot();
if (rootPath[0] == null)
return null;
TreePath childPath = new TreePath(rootPath);
if (JTree.this.isPathSelected(childPath)) {
return new AccessibleJTreeNode(JTree.this, childPath, JTree.this);
......@@ -4461,6 +4488,8 @@ public class JTree extends JComponent implements Scrollable, Accessible
if (i == 0) {
Object[] rootPath = new Object[1];
rootPath[0] = treeModel.getRoot();
if (rootPath[0] == null)
return false;
TreePath childPath = new TreePath(rootPath);
return JTree.this.isPathSelected(childPath);
} else {
......@@ -4482,6 +4511,8 @@ public class JTree extends JComponent implements Scrollable, Accessible
if (model != null) {
if (i == 0) {
Object[] objPath = {model.getRoot()};
if (objPath[0] == null)
return;
TreePath path = new TreePath(objPath);
JTree.this.addSelectionPath(path);
}
......@@ -4500,6 +4531,8 @@ public class JTree extends JComponent implements Scrollable, Accessible
if (model != null) {
if (i == 0) {
Object[] objPath = {model.getRoot()};
if (objPath[0] == null)
return;
TreePath path = new TreePath(objPath);
JTree.this.removeSelectionPath(path);
}
......@@ -4525,6 +4558,8 @@ public class JTree extends JComponent implements Scrollable, Accessible
TreeModel model = JTree.this.getModel();
if (model != null) {
Object[] objPath = {model.getRoot()};
if (objPath[0] == null)
return;
TreePath path = new TreePath(objPath);
JTree.this.addSelectionPath(path);
}
......
......@@ -876,6 +876,12 @@ public class BasicScrollPaneUI
return;
}
orientation = SwingConstants.HORIZONTAL;
} else if(e.isShiftDown()){
JScrollBar hScroll = scrollpane.getHorizontalScrollBar();
if (hScroll != null && hScroll.isVisible()) {
toScroll = hScroll;
orientation = SwingConstants.HORIZONTAL;
}
}
e.consume();
......
/*
* Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -682,7 +682,12 @@ abstract class AppletPanel extends Panel implements AppletStub, Runnable {
if (toFocus != null) {
if (parent instanceof EmbeddedFrame) {
((EmbeddedFrame)parent).synthesizeWindowActivation(true);
// JDK-8056915: Try to request focus to the embedder first and
// activate the embedded frame through it
if (!((EmbeddedFrame) parent).requestFocusToEmbedder()) {
// Otherwise activate the embedded frame directly
((EmbeddedFrame) parent).synthesizeWindowActivation(true);
}
}
// EmbeddedFrame might have focus before the applet was added.
// Thus after its activation the most recent focus owner will be
......
/*
* Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -360,6 +360,15 @@ public abstract class EmbeddedFrame extends Frame
*/
public void synthesizeWindowActivation(boolean doActivate) {}
/**
* Requests the focus to the embedder.
*
* @return {@code true} if focus request was successful, and {@code false} otherwise.
*/
public boolean requestFocusToEmbedder() {
return false;
}
/**
* Moves this embedded frame to a new location. The top-left corner of
* the new location is specified by the <code>x</code> and <code>y</code>
......
......@@ -150,7 +150,7 @@ public abstract class SunClipboard extends Clipboard
* AppContext as it is currently retrieved or null otherwise
* @since 1.5
*/
private synchronized Transferable getContextContents() {
protected synchronized Transferable getContextContents() {
AppContext context = AppContext.getAppContext();
return (context == contentsContext) ? contents : null;
}
......@@ -281,42 +281,41 @@ public abstract class SunClipboard extends Clipboard
return;
}
final Runnable runnable = new Runnable() {
public void run() {
final SunClipboard sunClipboard = SunClipboard.this;
ClipboardOwner owner = null;
Transferable contents = null;
synchronized (sunClipboard) {
final AppContext context = sunClipboard.contentsContext;
if (context == null) {
return;
}
if (disposedContext == null || context == disposedContext) {
owner = sunClipboard.owner;
contents = sunClipboard.contents;
sunClipboard.contentsContext = null;
sunClipboard.owner = null;
sunClipboard.contents = null;
sunClipboard.clearNativeContext();
context.removePropertyChangeListener
(AppContext.DISPOSED_PROPERTY_NAME, sunClipboard);
} else {
return;
}
}
if (owner != null) {
owner.lostOwnership(sunClipboard, contents);
}
}
};
SunToolkit.postEvent(context, new PeerEvent(this, runnable,
SunToolkit.postEvent(context, new PeerEvent(this, () -> lostOwnershipNow(disposedContext),
PeerEvent.PRIORITY_EVENT));
}
protected void lostOwnershipNow(final AppContext disposedContext) {
final SunClipboard sunClipboard = SunClipboard.this;
ClipboardOwner owner = null;
Transferable contents = null;
synchronized (sunClipboard) {
final AppContext context = sunClipboard.contentsContext;
if (context == null) {
return;
}
if (disposedContext == null || context == disposedContext) {
owner = sunClipboard.owner;
contents = sunClipboard.contents;
sunClipboard.contentsContext = null;
sunClipboard.owner = null;
sunClipboard.contents = null;
sunClipboard.clearNativeContext();
context.removePropertyChangeListener
(AppContext.DISPOSED_PROPERTY_NAME, sunClipboard);
} else {
return;
}
}
if (owner != null) {
owner.lostOwnership(sunClipboard, contents);
}
}
protected abstract void clearNativeContext();
protected abstract void setContentsNative(Transferable contents);
......
......@@ -47,9 +47,13 @@ java.launcher.opt.footer =\ -cp <class search path of directories and zip
\ enable verbose output\n\
\ -version print product version and exit\n\
\ -version:<value>\n\
\ Warning: this feature is deprecated and will be removed\n\
\ in a future release.\n\
\ require the specified version to run\n\
\ -showversion print product version and continue\n\
\ -jre-restrict-search | -no-jre-restrict-search\n\
\ Warning: this feature is deprecated and will be removed\n\
\ in a future release.\n\
\ include/exclude user private JREs in the version search\n\
\ -? -help print this help message\n\
\ -X print help on non-standard options\n\
......
......@@ -767,7 +767,7 @@ public final class ConnectorBootstrap {
JMXConnectorServerFactory.newJMXConnectorServer(url, env, mbs);
connServer.start();
} catch (IOException e) {
if (connServer == null) {
if (connServer == null || connServer.getAddress() == null) {
throw new AgentConfigurationError(CONNECTOR_SERVER_IO_ERROR,
e, url.toString());
} else {
......
......@@ -846,12 +846,14 @@ public final class Unsafe {
throws InstantiationException;
/** Lock the object. It must get unlocked via {@link #monitorExit}. */
@Deprecated
public native void monitorEnter(Object o);
/**
* Unlock the object. It must have been locked via {@link
* #monitorEnter}.
*/
@Deprecated
public native void monitorExit(Object o);
/**
......@@ -859,6 +861,7 @@ public final class Unsafe {
* whether the lock succeeded. If it did, the object must be
* unlocked via {@link #monitorExit}.
*/
@Deprecated
public native boolean tryMonitorEnter(Object o);
/** Throw the exception without telling the verifier. */
......
......@@ -103,7 +103,7 @@ class Code {
case HTTP_UNAVAILABLE: return " Service Unavailable";
case HTTP_GATEWAY_TIMEOUT: return " Gateway Timeout";
case HTTP_VERSION: return " HTTP Version Not Supported";
default: return "";
default: return " ";
}
}
}
......@@ -192,22 +192,6 @@ final class HttpsClient extends HttpClient
return userAgent;
}
// should remove once HttpClient.newHttpProxy is putback
private static Proxy newHttpProxy(String proxyHost, int proxyPort) {
InetSocketAddress saddr = null;
final String phost = proxyHost;
final int pport = proxyPort < 0 ? httpsPortNumber : proxyPort;
try {
saddr = java.security.AccessController.doPrivileged(new
java.security.PrivilegedExceptionAction<InetSocketAddress>() {
public InetSocketAddress run() {
return new InetSocketAddress(phost, pport);
}});
} catch (java.security.PrivilegedActionException pae) {
}
return new Proxy(Proxy.Type.HTTP, saddr);
}
// CONSTRUCTOR, FACTORY
......@@ -251,7 +235,7 @@ final class HttpsClient extends HttpClient
throws IOException {
this(sf, url,
(proxyHost == null? null:
HttpsClient.newHttpProxy(proxyHost, proxyPort)),
HttpClient.newHttpProxy(proxyHost, proxyPort, "https")),
connectTimeout);
}
......@@ -261,6 +245,11 @@ final class HttpsClient extends HttpClient
HttpsClient(SSLSocketFactory sf, URL url, Proxy proxy,
int connectTimeout)
throws IOException {
PlatformLogger logger = HttpURLConnection.getHttpLogger();
if (logger.isLoggable(PlatformLogger.Level.FINEST)) {
logger.finest("Creating new HttpsClient with url:" + url + " and proxy:" + proxy +
" with connect timeout:" + connectTimeout);
}
this.proxy = proxy;
setSSLSocketFactory(sf);
this.proxyDisabled = true;
......@@ -317,7 +306,7 @@ final class HttpsClient extends HttpClient
return HttpsClient.New(sf, url, hv,
(proxyHost == null? null :
HttpsClient.newHttpProxy(proxyHost, proxyPort)),
HttpClient.newHttpProxy(proxyHost, proxyPort, "https")),
useCache, connectTimeout, httpuc);
}
......@@ -329,6 +318,11 @@ final class HttpsClient extends HttpClient
if (p == null) {
p = Proxy.NO_PROXY;
}
PlatformLogger logger = HttpURLConnection.getHttpLogger();
if (logger.isLoggable(PlatformLogger.Level.FINEST)) {
logger.finest("Looking for HttpClient for URL " + url +
" and proxy value of " + p);
}
HttpsClient ret = null;
if (useCache) {
/* see if one's already around */
......@@ -342,14 +336,13 @@ final class HttpsClient extends HttpClient
if (ret != null) {
if ((ret.proxy != null && ret.proxy.equals(p)) ||
(ret.proxy == null && p == null)) {
(ret.proxy == null && p == Proxy.NO_PROXY)) {
synchronized (ret) {
ret.cachedHttpClient = true;
assert ret.inCache;
ret.inCache = false;
if (httpuc != null && ret.needsTunneling())
httpuc.setTunnelState(TUNNELING);
PlatformLogger logger = HttpURLConnection.getHttpLogger();
if (logger.isLoggable(PlatformLogger.Level.FINEST)) {
logger.finest("KeepAlive stream retrieved from the cache, " + ret);
}
......@@ -360,6 +353,9 @@ final class HttpsClient extends HttpClient
// This should be fine as it is very rare that a connection
// to the same host will not use the same proxy.
synchronized(ret) {
if (logger.isLoggable(PlatformLogger.Level.FINEST)) {
logger.finest("Not returning this connection to cache: " + ret);
}
ret.inCache = false;
ret.closeServer();
}
......
......@@ -38,6 +38,7 @@ import java.nio.channels.NonReadableChannelException;
import java.nio.channels.NonWritableChannelException;
import java.nio.channels.OverlappingFileLockException;
import java.nio.channels.ReadableByteChannel;
import java.nio.channels.SelectableChannel;
import java.nio.channels.WritableByteChannel;
import java.security.AccessController;
import java.util.ArrayList;
......@@ -407,30 +408,13 @@ public class FileChannelImpl
//
private static volatile boolean fileSupported = true;
private long transferToDirectly(long position, int icount,
WritableByteChannel target)
private long transferToDirectlyInternal(long position, int icount,
WritableByteChannel target,
FileDescriptor targetFD)
throws IOException
{
if (!transferSupported)
return IOStatus.UNSUPPORTED;
FileDescriptor targetFD = null;
if (target instanceof FileChannelImpl) {
if (!fileSupported)
return IOStatus.UNSUPPORTED_CASE;
targetFD = ((FileChannelImpl)target).fd;
} else if (target instanceof SelChImpl) {
// Direct transfer to pipe causes EINVAL on some configurations
if ((target instanceof SinkChannelImpl) && !pipeSupported)
return IOStatus.UNSUPPORTED_CASE;
targetFD = ((SelChImpl)target).getFD();
}
if (targetFD == null)
return IOStatus.UNSUPPORTED;
int thisFDVal = IOUtil.fdVal(fd);
int targetFDVal = IOUtil.fdVal(targetFD);
if (thisFDVal == targetFDVal) // Not supported on some configurations
return IOStatus.UNSUPPORTED;
assert !nd.transferToDirectlyNeedsPositionLock() ||
Thread.holdsLock(positionLock);
long n = -1;
int ti = -1;
......@@ -440,7 +424,7 @@ public class FileChannelImpl
if (!isOpen())
return -1;
do {
n = transferTo0(thisFDVal, position, icount, targetFDVal);
n = transferTo0(fd, position, icount, targetFD);
} while ((n == IOStatus.INTERRUPTED) && isOpen());
if (n == IOStatus.UNSUPPORTED_CASE) {
if (target instanceof SinkChannelImpl)
......@@ -461,6 +445,54 @@ public class FileChannelImpl
}
}
private long transferToDirectly(long position, int icount,
WritableByteChannel target)
throws IOException
{
if (!transferSupported)
return IOStatus.UNSUPPORTED;
FileDescriptor targetFD = null;
if (target instanceof FileChannelImpl) {
if (!fileSupported)
return IOStatus.UNSUPPORTED_CASE;
targetFD = ((FileChannelImpl)target).fd;
} else if (target instanceof SelChImpl) {
// Direct transfer to pipe causes EINVAL on some configurations
if ((target instanceof SinkChannelImpl) && !pipeSupported)
return IOStatus.UNSUPPORTED_CASE;
// Platform-specific restrictions. Now there is only one:
// Direct transfer to non-blocking channel could be forbidden
SelectableChannel sc = (SelectableChannel)target;
if (!nd.canTransferToDirectly(sc))
return IOStatus.UNSUPPORTED_CASE;
targetFD = ((SelChImpl)target).getFD();
}
if (targetFD == null)
return IOStatus.UNSUPPORTED;
int thisFDVal = IOUtil.fdVal(fd);
int targetFDVal = IOUtil.fdVal(targetFD);
if (thisFDVal == targetFDVal) // Not supported on some configurations
return IOStatus.UNSUPPORTED;
if (nd.transferToDirectlyNeedsPositionLock()) {
synchronized (positionLock) {
long pos = position();
try {
return transferToDirectlyInternal(position, icount,
target, targetFD);
} finally {
position(pos);
}
}
} else {
return transferToDirectlyInternal(position, icount, target, targetFD);
}
}
// Maximum size to map when using a mapped buffer
private static final long MAPPED_TRANSFER_SIZE = 8L*1024L*1024L;
......@@ -1176,7 +1208,8 @@ public class FileChannelImpl
private static native int unmap0(long address, long length);
// Transfers from src to dst, or returns -2 if kernel can't do that
private native long transferTo0(int src, long position, long count, int dst);
private native long transferTo0(FileDescriptor src, long position,
long count, FileDescriptor dst);
// Sets or reports this file's position
// If offset is -1, the current position is returned
......
......@@ -25,7 +25,9 @@
package sun.nio.ch;
import java.io.*;
import java.io.FileDescriptor;
import java.io.IOException;
import java.nio.channels.SelectableChannel;
abstract class FileDispatcher extends NativeDispatcher {
......@@ -53,4 +55,8 @@ abstract class FileDispatcher extends NativeDispatcher {
*/
abstract FileDescriptor duplicateForMapping(FileDescriptor fd)
throws IOException;
abstract boolean canTransferToDirectly(SelectableChannel sc);
abstract boolean transferToDirectlyNeedsPositionLock();
}
......@@ -50,30 +50,8 @@ public class Net {
// set to true if exclusive binding is on for Windows
private static final boolean exclusiveBind;
static {
int availLevel = isExclusiveBindAvailable();
if (availLevel >= 0) {
String exclBindProp =
java.security.AccessController.doPrivileged(
new PrivilegedAction<String>() {
@Override
public String run() {
return System.getProperty(
"sun.net.useExclusiveBind");
}
});
if (exclBindProp != null) {
exclusiveBind = exclBindProp.length() == 0 ?
true : Boolean.parseBoolean(exclBindProp);
} else if (availLevel == 1) {
exclusiveBind = true;
} else {
exclusiveBind = false;
}
} else {
exclusiveBind = false;
}
}
// set to true if the fast tcp loopback should be enabled on Windows
private static final boolean fastLoopback;
// -- Miscellaneous utilities --
......@@ -391,6 +369,23 @@ public class Net {
}
}
public static boolean isFastTcpLoopbackRequested() {
String loopbackProp = java.security.AccessController.doPrivileged(
new PrivilegedAction<String>() {
@Override
public String run() {
return System.getProperty("jdk.net.useFastTcpLoopback");
}
});
boolean enable;
if ("".equals(loopbackProp)) {
enable = true;
} else {
enable = Boolean.parseBoolean(loopbackProp);
}
return enable;
}
// -- Socket operations --
private static native boolean isIPv6Available0();
......@@ -413,15 +408,16 @@ public class Net {
throws IOException {
boolean preferIPv6 = isIPv6Available() &&
(family != StandardProtocolFamily.INET);
return IOUtil.newFD(socket0(preferIPv6, stream, false));
return IOUtil.newFD(socket0(preferIPv6, stream, false, fastLoopback));
}
static FileDescriptor serverSocket(boolean stream) {
return IOUtil.newFD(socket0(isIPv6Available(), stream, true));
return IOUtil.newFD(socket0(isIPv6Available(), stream, true, fastLoopback));
}
// Due to oddities SO_REUSEADDR on windows reuse is ignored
private static native int socket0(boolean preferIPv6, boolean stream, boolean reuse);
private static native int socket0(boolean preferIPv6, boolean stream, boolean reuse,
boolean fastLoopback);
public static void bind(FileDescriptor fd, InetAddress addr, int port)
throws IOException
......@@ -634,4 +630,30 @@ public class Net {
POLLCONN = pollconnValue();
}
static {
int availLevel = isExclusiveBindAvailable();
if (availLevel >= 0) {
String exclBindProp =
java.security.AccessController.doPrivileged(
new PrivilegedAction<String>() {
@Override
public String run() {
return System.getProperty(
"sun.net.useExclusiveBind");
}
});
if (exclBindProp != null) {
exclusiveBind = exclBindProp.length() == 0 ?
true : Boolean.parseBoolean(exclBindProp);
} else if (availLevel == 1) {
exclusiveBind = true;
} else {
exclusiveBind = false;
}
} else {
exclusiveBind = false;
}
fastLoopback = isFastTcpLoopbackRequested();
}
}
/*
* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -321,12 +321,9 @@ public class SocketAdaptor
}
public void sendUrgentData(int data) throws IOException {
synchronized (sc.blockingLock()) {
if (!sc.isBlocking())
throw new IllegalBlockingModeException();
int n = sc.sendOutOfBandData((byte)data);
assert n == 1;
}
int n = sc.sendOutOfBandData((byte) data);
if (n == 0)
throw new IOException("Socket buffer full");
}
public void setOOBInline(boolean on) throws SocketException {
......
......@@ -1031,6 +1031,14 @@ public class ExtendedCharsets
"ebcdic-s-871+euro"
});
charset("x-IBM1166", "IBM1166",
new String[] {
"cp1166", // JDK historical
"ibm1166",
"ibm-1166",
"1166"
});
charset("IBM290", "IBM290",
new String[] {
"cp290",
......
......@@ -42,8 +42,11 @@ public class ClassRepository extends GenericDeclRepository<ClassSignature> {
public static final ClassRepository NONE = ClassRepository.make("Ljava/lang/Object;", null);
private volatile Type superclass; // caches the generic superclass info
private volatile Type[] superInterfaces; // caches the generic superinterface info
/** The generic superclass info. Lazily initialized. */
private volatile Type superclass;
/** The generic superinterface info. Lazily initialized. */
private volatile Type[] superInterfaces;
// private, to enforce use of static factory
private ClassRepository(String rawSig, GenericsFactory f) {
......@@ -79,7 +82,7 @@ public class ClassRepository extends GenericDeclRepository<ClassSignature> {
* with which the repository was created.
*/
public Type getSuperclass(){
public Type getSuperclass() {
Type superclass = this.superclass;
if (superclass == null) { // lazily initialize superclass
Reifier r = getReifier(); // obtain visitor
......@@ -88,25 +91,24 @@ public class ClassRepository extends GenericDeclRepository<ClassSignature> {
// extract result from visitor and cache it
superclass = r.getResult();
this.superclass = superclass;
}
}
return superclass; // return cached result
}
public Type[] getSuperInterfaces(){
public Type[] getSuperInterfaces() {
Type[] superInterfaces = this.superInterfaces;
if (superInterfaces == null) { // lazily initialize super interfaces
// first, extract super interface subtree(s) from AST
TypeTree[] ts = getTree().getSuperInterfaces();
// create array to store reified subtree(s)
Type[] sis = new Type[ts.length];
superInterfaces = new Type[ts.length];
// reify all subtrees
for (int i = 0; i < ts.length; i++) {
Reifier r = getReifier(); // obtain visitor
ts[i].accept(r);// reify subtree
// extract result from visitor and store it
sis[i] = r.getResult();
superInterfaces[i] = r.getResult();
}
superInterfaces = sis; // cache overall result
this.superInterfaces = superInterfaces;
}
return superInterfaces.clone(); // return cached result
......
......@@ -42,7 +42,8 @@ import sun.reflect.generics.visitor.Reifier;
public abstract class GenericDeclRepository<S extends Signature>
extends AbstractRepository<S> {
private volatile TypeVariable<?>[] typeParams; // caches the formal type parameters
/** The formal type parameters. Lazily initialized. */
private volatile TypeVariable<?>[] typeParams;
protected GenericDeclRepository(String rawSig, GenericsFactory f) {
super(rawSig, f);
......@@ -55,8 +56,7 @@ public abstract class GenericDeclRepository<S extends Signature>
* If the corresponding field is non-null, it is returned.
* If not, it is created lazily. This is done by selecting the appropriate
* part of the tree and transforming it into a reflective object
* using a visitor.
* a visitor, which is created by feeding it the factory
* using a visitor, which is created by feeding it the factory
* with which the repository was created.
*/
......@@ -64,22 +64,21 @@ public abstract class GenericDeclRepository<S extends Signature>
* Return the formal type parameters of this generic declaration.
* @return the formal type parameters of this generic declaration
*/
public TypeVariable<?>[] getTypeParameters(){
TypeVariable[] typeParams = this.typeParams;
public TypeVariable<?>[] getTypeParameters() {
TypeVariable<?>[] typeParams = this.typeParams;
if (typeParams == null) { // lazily initialize type parameters
// first, extract type parameter subtree(s) from AST
FormalTypeParameter[] ftps = getTree().getFormalTypeParameters();
// create array to store reified subtree(s)
TypeVariable<?>[] tps = new TypeVariable<?>[ftps.length];
typeParams = new TypeVariable<?>[ftps.length];
// reify all subtrees
for (int i = 0; i < ftps.length; i++) {
Reifier r = getReifier(); // obtain visitor
ftps[i].accept(r); // reify subtree
// extract result from visitor and store it
tps[i] = (TypeVariable<?>) r.getResult();
typeParams[i] = (TypeVariable<?>) r.getResult();
}
typeParams = tps; // cache overall result
this.typeParams = typeParams;
this.typeParams = typeParams; // cache overall result
}
return typeParams.clone(); // return cached result
}
......
......@@ -42,7 +42,9 @@ public abstract class AbstractScope<D extends GenericDeclaration>
implements Scope {
private final D recvr; // the declaration whose scope this instance represents
private volatile Scope enclosingScope; // the enclosing scope of this scope
/** The enclosing scope of this scope. Lazily initialized. */
private volatile Scope enclosingScope;
/**
* Constructor. Takes a reflective object whose scope the newly
......
......@@ -60,22 +60,12 @@ public class KrbApReq {
private static boolean DEBUG = Krb5.DEBUG;
private static final char[] hexConst = "0123456789ABCDEF".toCharArray();
private static final MessageDigest md;
static {
try {
md = MessageDigest.getInstance("MD5");
} catch (NoSuchAlgorithmException ex) {
throw new RuntimeException("Impossible");
}
}
/**
* Constructs an AP-REQ message to send to the peer.
* @param tgsCred the <code>Credentials</code> to be used to construct the
* AP Request protocol message.
* @param mutualRequired Whether mutual authentication is required
* @param useSubkey Whether the subkey is to be used to protect this
* @param useSubKey Whether the subkey is to be used to protect this
* specific application session. If this is not set then the
* session key from the ticket will be used.
* @throws KrbException for any Kerberos protocol specific error
......@@ -99,10 +89,10 @@ public class KrbApReq {
* @param tgsCred the <code>Credentials</code> to be used to construct the
* AP Request protocol message.
* @param mutualRequired Whether mutual authentication is required
* @param useSubkey Whether the subkey is to be used to protect this
* @param useSubKey Whether the subkey is to be used to protect this
* specific application session. If this is not set then the
* session key from the ticket will be used.
* @param checksum checksum of the the application data that accompanies
* @param cksum checksum of the the application data that accompanies
* the KRB_AP_REQ.
* @throws KrbException for any Kerberos protocol specific error
* @throws IOException for any IO related errors
......@@ -142,8 +132,8 @@ public class KrbApReq {
* Constructs an AP-REQ message from the bytes received from the
* peer.
* @param message The message received from the peer
* @param keys <code>EncrtyptionKey</code>s to decrypt the message;
* key selected will depend on etype used to encrypte data
* @param cred <code>KrbAcceptCredential</code> containing keys to decrypt
* the message; key selected will depend on etype used to encrypt data
* @throws KrbException for any Kerberos protocol specific error
* @throws IOException for any IO related errors
* (e.g. socket operations)
......@@ -311,7 +301,14 @@ public class KrbApReq {
if (!authenticator.ctime.inClockSkew())
throw new KrbApErrException(Krb5.KRB_AP_ERR_SKEW);
byte[] hash = md.digest(apReqMessg.authenticator.cipher);
byte[] hash;
try {
hash = MessageDigest.getInstance("MD5")
.digest(apReqMessg.authenticator.cipher);
} catch (NoSuchAlgorithmException ex) {
throw new AssertionError("Impossible");
}
char[] h = new char[hash.length * 2];
for (int i=0; i<hash.length; i++) {
h[2*i] = hexConst[(hash[i]&0xff)>>4];
......
......@@ -584,16 +584,24 @@ final class Config {
}
private String parseLine() throws IOException {
String s = parseWord();
// allow quoted string as part of line
String s = null;
while (true) {
int token = nextToken();
if ((token == TT_EOL) || (token == TT_EOF)) {
break;
}
if (token != TT_WORD) {
if (token != TT_WORD && token != '\"') {
throw excToken("Unexpected value");
}
s = s + " " + st.sval;
if (s == null) {
s = st.sval;
} else {
s = s + " " + st.sval;
}
}
if (s == null) {
throw excToken("Unexpected empty line");
}
return s;
}
......@@ -653,7 +661,9 @@ final class Config {
//
private String parseLibrary(String keyword) throws IOException {
String lib = parseStringEntry(keyword);
checkDup(keyword);
parseEquals();
String lib = parseLine();
lib = expand(lib);
int i = lib.indexOf("/$ISA/");
if (i != -1) {
......
/*
* Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -905,7 +905,7 @@ public final class PKCS12KeyStore extends KeyStoreSpi {
private static ObjectIdentifier mapPBEAlgorithmToOID(String algorithm)
throws NoSuchAlgorithmException {
// Check for PBES2 algorithms
if (algorithm.toLowerCase().startsWith("pbewithhmacsha")) {
if (algorithm.toLowerCase(Locale.ENGLISH).startsWith("pbewithhmacsha")) {
return pbes2_OID;
}
return AlgorithmId.get(algorithm).getOID();
......
/*
* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -451,7 +451,7 @@ public final class ConfigFile extends Configuration {
// controlFlag (required, optional, etc)
LoginModuleControlFlag controlFlag;
String sflag = match("controlFlag").toUpperCase();
String sflag = match("controlFlag").toUpperCase(Locale.ENGLISH);
switch (sflag) {
case "REQUIRED":
controlFlag = LoginModuleControlFlag.REQUIRED;
......
/*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -707,7 +707,7 @@ public class PolicyParser {
} catch (PropertyExpander.ExpandException peee) {
throw new IOException(peee.getLocalizedMessage());
}
properties.put(key.toLowerCase(), value);
properties.put(key.toLowerCase(Locale.ENGLISH), value);
}
return properties;
......
/*
* 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
......@@ -224,7 +224,8 @@ class AdaptableX509CertSelector extends X509CertSelector {
if (extVal == null) {
if (debug != null) {
debug.println("AdaptableX509CertSelector.match: "
+ "no subject key ID extension");
+ "no subject key ID extension. Subject: "
+ xcert.getSubjectX500Principal());
}
return true;
}
......@@ -234,7 +235,9 @@ class AdaptableX509CertSelector extends X509CertSelector {
!Arrays.equals(ski, certSubjectKeyID)) {
if (debug != null) {
debug.println("AdaptableX509CertSelector.match: "
+ "subject key IDs don't match");
+ "subject key IDs don't match. "
+ "Expected: " + Arrays.toString(ski) + " "
+ "Cert's: " + Arrays.toString(certSubjectKeyID));
}
return false;
}
......
/*
* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -435,7 +435,12 @@ public abstract class Builder {
if (selector.match(targetCert) && !X509CertImpl.isSelfSigned
(targetCert, buildParams.sigProvider())) {
if (debug != null) {
debug.println("Builder.addMatchingCerts: adding target cert");
debug.println("Builder.addMatchingCerts: " +
"adding target cert" +
"\n SN: " + Debug.toHexString(
targetCert.getSerialNumber()) +
"\n Subject: " + targetCert.getSubjectX500Principal() +
"\n Issuer: " + targetCert.getIssuerX500Principal());
}
return resultCerts.add(targetCert);
}
......
/*
* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -145,8 +145,8 @@ class ConstraintsChecker extends PKIXCertPathChecker {
if (prevNC != null && ((i == certPathLength) ||
!X509CertImpl.isSelfIssued(currCert))) {
if (debug != null) {
debug.println("prevNC = " + prevNC);
debug.println("currDN = " + currCert.getSubjectX500Principal());
debug.println("prevNC = " + prevNC +
", currDN = " + currCert.getSubjectX500Principal());
}
try {
......@@ -184,8 +184,8 @@ class ConstraintsChecker extends PKIXCertPathChecker {
currCertImpl.getNameConstraintsExtension();
if (debug != null) {
debug.println("prevNC = " + prevNC);
debug.println("newNC = " + String.valueOf(newConstraints));
debug.println("prevNC = " + prevNC +
", newNC = " + String.valueOf(newConstraints));
}
// if there are no previous name constraints, we just return the
......@@ -225,8 +225,8 @@ class ConstraintsChecker extends PKIXCertPathChecker {
String msg = "basic constraints";
if (debug != null) {
debug.println("---checking " + msg + "...");
debug.println("i = " + i);
debug.println("maxPathLength = " + maxPathLength);
debug.println("i = " + i +
", maxPathLength = " + maxPathLength);
}
/* check if intermediate cert */
......
......@@ -320,6 +320,14 @@ public class DistributionPointFetcher {
Set<TrustAnchor> trustAnchors, List<CertStore> certStores,
Date validity) throws CRLException, IOException {
if (debug != null) {
debug.println("DistributionPointFetcher.verifyCRL: " +
"checking revocation status for" +
"\n SN: " + Debug.toHexString(certImpl.getSerialNumber()) +
"\n Subject: " + certImpl.getSubjectX500Principal() +
"\n Issuer: " + certImpl.getIssuerX500Principal());
}
boolean indirectCRL = false;
X509CRLImpl crlImpl = X509CRLImpl.toImpl(crl);
IssuingDistributionPointExtension idpExt =
......@@ -363,7 +371,9 @@ public class DistributionPointFetcher {
}
} else if (crlIssuer.equals(certIssuer) == false) {
if (debug != null) {
debug.println("crl issuer does not equal cert issuer");
debug.println("crl issuer does not equal cert issuer.\n" +
"crl issuer: " + crlIssuer + "\n" +
"cert issuer: " + certIssuer);
}
return false;
} else {
......
/*
* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -209,7 +209,8 @@ class ForwardBuilder extends Builder {
* getMatchingEECerts
*/
if (debug != null) {
debug.println("ForwardBuilder.getMatchingCACerts(): ca is target");
debug.println("ForwardBuilder.getMatchingCACerts(): " +
"the target is a CA");
}
if (caTargetSelector == null) {
......@@ -291,8 +292,14 @@ class ForwardBuilder extends Builder {
for (X509Certificate trustedCert : trustedCerts) {
if (sel.match(trustedCert)) {
if (debug != null) {
debug.println("ForwardBuilder.getMatchingCACerts: "
+ "found matching trust anchor");
debug.println("ForwardBuilder.getMatchingCACerts: " +
"found matching trust anchor." +
"\n SN: " +
Debug.toHexString(trustedCert.getSerialNumber()) +
"\n Subject: " +
trustedCert.getSubjectX500Principal() +
"\n Issuer: " +
trustedCert.getIssuerX500Principal());
}
if (caCerts.add(trustedCert) && !searchAllCertStores) {
return;
......
/*
* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -30,6 +30,7 @@ import sun.security.util.Debug;
import java.util.Collections;
import java.util.List;
import java.util.Set;
import java.util.StringJoiner;
import java.security.cert.CertPath;
import java.security.cert.CertPathValidatorException;
import java.security.cert.PKIXCertPathChecker;
......@@ -88,20 +89,25 @@ class PKIXMasterCertPathValidator {
* current certificate of this loop to be the previous certificate
* of the next loop. The state is initialized during first loop.
*/
if (debug != null)
debug.println("Checking cert" + (i+1) + " ...");
X509Certificate currCert = reversedCertList.get(i);
if (debug != null) {
debug.println("Checking cert" + (i+1) + " - Subject: " +
currCert.getSubjectX500Principal());
}
Set<String> unresCritExts = currCert.getCriticalExtensionOIDs();
if (unresCritExts == null) {
unresCritExts = Collections.<String>emptySet();
}
if (debug != null && !unresCritExts.isEmpty()) {
debug.println("Set of critical extensions:");
StringJoiner joiner = new StringJoiner(", ", "{", "}");
for (String oid : unresCritExts) {
debug.println(oid);
joiner.add(oid);
}
debug.println("Set of critical extensions: " +
joiner.toString());
}
for (int j = 0; j < certPathCheckers.size(); j++) {
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册