提交 f85d0b50 编写于 作者: C chegar

Merge

...@@ -211,3 +211,4 @@ ac519af51769e92c51b597a730974e8607357709 jdk8-b83 ...@@ -211,3 +211,4 @@ ac519af51769e92c51b597a730974e8607357709 jdk8-b83
d5228e624826a10ccc5b05f30ad8d839b58fe48d jdk8-b87 d5228e624826a10ccc5b05f30ad8d839b58fe48d jdk8-b87
8dbb4b159e04de3c447c9242c70505e71f8624c7 jdk8-b88 8dbb4b159e04de3c447c9242c70505e71f8624c7 jdk8-b88
845025546e35519fbb8970e79fc2a834063a5e19 jdk8-b89 845025546e35519fbb8970e79fc2a834063a5e19 jdk8-b89
c63eda8f63008a4398d2c22ac8d72f7fef6f9238 jdk8-b90
...@@ -31,13 +31,6 @@ BUILDDIR = ../.. ...@@ -31,13 +31,6 @@ BUILDDIR = ../..
PRODUCT = sun PRODUCT = sun
include $(BUILDDIR)/common/Defs.gmk include $(BUILDDIR)/common/Defs.gmk
ifndef OPENJDK
ORG_EXISTS := $(call DirExists,$(CLOSED_SRC)/share/classes/sun/org,,)
ifneq ("$(ORG_EXISTS)", "")
SCRIPT_SUBDIR = script
endif
endif
# jarsigner is part of JRE # jarsigner is part of JRE
SUBDIRS = java security net/ssl jarsigner SUBDIRS = java security net/ssl jarsigner
......
#
# Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation. Oracle designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#
BUILDDIR = ../../..
PACKAGE = com.sun.script
PRODUCT = sun
include $(BUILDDIR)/common/Defs.gmk
AUTO_FILES_JAVA_DIRS = com/sun/script
#
# Files that need to be copied
#
SERVICEDIR = $(CLASSBINDIR)/META-INF/services
FILES_copy = \
$(SERVICEDIR)/javax.script.ScriptEngineFactory
include $(BUILDDIR)/common/Classes.gmk
all: classes copy-files
#
# Copy the service provider configuration file into the resource
# directory.
#
copy-files: $(FILES_copy)
$(SERVICEDIR)/%: $(SHARE_SRC)/classes/com/sun/script/javascript/META-INF/services/%
$(install-file)
.PHONY: copy-files
clean::
$(RM) -r $(CLASSDESTDIR)/com/sun/script/javascript
$(RM) $(FILES_copy)
...@@ -969,26 +969,35 @@ else ...@@ -969,26 +969,35 @@ else
# Create the list of db *.zip files to bundle with jdk # Create the list of db *.zip files to bundle with jdk
ABS_DB_PATH :=$(call FullPath,$(CLOSED_SHARE_SRC)/db) ABS_DB_PATH :=$(call FullPath,$(CLOSED_SHARE_SRC)/db)
DB_ZIP_LIST = $(shell $(LS) $(ABS_DB_PATH)/*.zip 2>/dev/null) DB_BINARY_BUNDLE = $(shell $(LS) $(ABS_DB_PATH)/db-derby-*-bin.zip 2>/dev/null)
# Java DB image. Move the Java DB demo directory into the JDK's demo # Java DB image. Move the Java DB demo directory into the JDK's demo
# dir and in the process, rename it to db. Also remove index.html, # dir and in the process, rename it to db. Also remove index.html,
# since it presumes docs are co-located. Also remove register.html (no # since it presumes docs are co-located, javadoc, docs and tests and
# longer relevant). # update the copyright year of the JDK READMEs to that of the release.
initial-image-jdk-db: $(DB_ZIP_LIST) initial-image-jdk-db: $(DB_BINARY_BUNDLE)
$(MKDIR) -p $(JDK_IMAGE_DIR)/db $(MKDIR) -p $(JDK_IMAGE_DIR)/db
for d in $(DB_ZIP_LIST); do \ $(CD) $(JDK_IMAGE_DIR)/db && $(UNZIP) -o $(DB_BINARY_BUNDLE)
($(CD) $(JDK_IMAGE_DIR)/db && $(UNZIP) -o $$d); \ $(CD) $(JDK_IMAGE_DIR)/db && $(MV) db-derby-*-bin/* .
done $(CD) $(JDK_IMAGE_DIR)/db && $(RM) -r db-derby-*-bin
$(CP) $(ABS_DB_PATH)/README-JDK.html $(JDK_IMAGE_DIR)/db $(CAT) $(ABS_DB_PATH)/README-JDK.html | \
$(SED) "s/XXXX/$(shell cat $(JDK_TOPDIR)/src/closed/share/db/COPYRIGHTYEAR)/" > \
$(JDK_IMAGE_DIR)/db/README-JDK.html
$(CAT) $(ABS_DB_PATH)/3RDPARTY | \
$(SED) "s/XXXX/$(shell cat $(JDK_TOPDIR)/src/closed/share/db/COPYRIGHTYEAR)/" > \
$(JDK_IMAGE_DIR)/db/3RDPARTY
ifndef NO_DEMOS ifndef NO_DEMOS
$(RM) -rf $(DEMODIR)/db $(RM) -r $(DEMODIR)/db
$(MV) $(JDK_IMAGE_DIR)/db/demo $(DEMODIR)/db $(MV) $(JDK_IMAGE_DIR)/db/demo $(DEMODIR)/db
$(CP) $(ABS_DB_PATH)/README-JDK-DEMOS.html $(DEMODIR)/db/ $(CAT) $(ABS_DB_PATH)/README-JDK-DEMOS.html | \
$(SED) "s/XXXX/$(shell cat $(JDK_TOPDIR)/src/closed/share/db/COPYRIGHTYEAR)/" > \
$(DEMODIR)/db/README-JDK-DEMOS.html
else else
$(RM) -rf $(JDK_IMAGE_DIR)/db/demo $(RM) -r $(JDK_IMAGE_DIR)/db/demo
endif endif
$(RM) $(JDK_IMAGE_DIR)/db/index.html $(JDK_IMAGE_DIR)/db/register.html @# remove stuff from original distro we don't want
$(RM) $(JDK_IMAGE_DIR)/db/index.html $(JDK_IMAGE_DIR)/db/KEYS
$(RM) -r $(JDK_IMAGE_DIR)/db/{docs,javadoc,test}
endif endif
# The launcher source files we need for src.zip # The launcher source files we need for src.zip
......
...@@ -31,12 +31,6 @@ BUILDDIR = .. ...@@ -31,12 +31,6 @@ BUILDDIR = ..
PRODUCT = sun PRODUCT = sun
include $(BUILDDIR)/common/Defs.gmk include $(BUILDDIR)/common/Defs.gmk
# Rhino/Mozilla java sources
ORG_EXISTS := $(call DirExists,$(CLOSED_SRC)/share/classes/sun/org,,)
ifneq ("$(ORG_EXISTS)", "")
ORG_SUBDIR = org
endif
# Non windows subdirs # Non windows subdirs
ifneq ($(PLATFORM), windows) ifneq ($(PLATFORM), windows)
ifndef OPENJDK ifndef OPENJDK
...@@ -83,7 +77,7 @@ SUBDIRS_desktop = audio $(RENDER_SUBDIR) image \ ...@@ -83,7 +77,7 @@ SUBDIRS_desktop = audio $(RENDER_SUBDIR) image \
$(LWAWT_PRE_SUBDIR) $(DISPLAY_LIBS) $(DGA_SUBDIR) $(LWAWT_SUBDIR) \ $(LWAWT_PRE_SUBDIR) $(DISPLAY_LIBS) $(DGA_SUBDIR) $(LWAWT_SUBDIR) \
jawt font jpeg cmm $(DISPLAY_TOOLS) jawt font jpeg cmm $(DISPLAY_TOOLS)
SUBDIRS_management = management SUBDIRS_management = management
SUBDIRS_misc = $(ORG_SUBDIR) rmi tracing SUBDIRS_misc = rmi tracing
SUBDIRS_tools = native2ascii serialver tools jconsole SUBDIRS_tools = native2ascii serialver tools jconsole
ifndef OPENJDK ifndef OPENJDK
......
...@@ -87,6 +87,7 @@ SUNWprivate_1.1 { ...@@ -87,6 +87,7 @@ SUNWprivate_1.1 {
Java_sun_java2d_pipe_ShapeSpanIterator_skipDownTo; Java_sun_java2d_pipe_ShapeSpanIterator_skipDownTo;
Java_java_awt_Dimension_initIDs; Java_java_awt_Dimension_initIDs;
Java_java_awt_Choice_initIDs;
Java_java_awt_event_MouseEvent_initIDs; Java_java_awt_event_MouseEvent_initIDs;
Java_java_awt_image_DataBufferInt_initIDs; Java_java_awt_image_DataBufferInt_initIDs;
Java_java_awt_image_SinglePixelPackedSampleModel_initIDs; Java_java_awt_image_SinglePixelPackedSampleModel_initIDs;
......
...@@ -87,6 +87,7 @@ SUNWprivate_1.1 { ...@@ -87,6 +87,7 @@ SUNWprivate_1.1 {
Java_sun_java2d_pipe_ShapeSpanIterator_skipDownTo; Java_sun_java2d_pipe_ShapeSpanIterator_skipDownTo;
Java_java_awt_Dimension_initIDs; Java_java_awt_Dimension_initIDs;
Java_java_awt_Choice_initIDs;
Java_java_awt_event_MouseEvent_initIDs; Java_java_awt_event_MouseEvent_initIDs;
Java_java_awt_image_DataBufferInt_initIDs; Java_java_awt_image_DataBufferInt_initIDs;
Java_java_awt_image_SinglePixelPackedSampleModel_initIDs; Java_java_awt_image_SinglePixelPackedSampleModel_initIDs;
......
...@@ -87,6 +87,7 @@ SUNWprivate_1.1 { ...@@ -87,6 +87,7 @@ SUNWprivate_1.1 {
Java_sun_java2d_pipe_ShapeSpanIterator_skipDownTo; Java_sun_java2d_pipe_ShapeSpanIterator_skipDownTo;
Java_java_awt_Dimension_initIDs; Java_java_awt_Dimension_initIDs;
Java_java_awt_Choice_initIDs;
Java_java_awt_event_MouseEvent_initIDs; Java_java_awt_event_MouseEvent_initIDs;
Java_java_awt_image_DataBufferInt_initIDs; Java_java_awt_image_DataBufferInt_initIDs;
Java_java_awt_image_SinglePixelPackedSampleModel_initIDs; Java_java_awt_image_SinglePixelPackedSampleModel_initIDs;
......
...@@ -21,4 +21,4 @@ ...@@ -21,4 +21,4 @@
# or visit www.oracle.com if you need additional information or have any # or visit www.oracle.com if you need additional information or have any
# questions. # questions.
# #
tzdata2012i tzdata2013c
...@@ -27,9 +27,9 @@ ...@@ -27,9 +27,9 @@
# This data is by no means authoritative; if you think you know better, # This data is by no means authoritative; if you think you know better,
# go ahead and edit the file (and please send any changes to # go ahead and edit the file (and please send any changes to
# tz@elsie.nci.nih.gov for general use in the future). # tz@iana.org for general use in the future).
# From Paul Eggert (2006-03-22): # From Paul Eggert (2013-02-21):
# #
# A good source for time zone historical data outside the U.S. is # A good source for time zone historical data outside the U.S. is
# Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition), # Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition),
...@@ -48,6 +48,10 @@ ...@@ -48,6 +48,10 @@
# Whitman Publishing Co, 2 Niagara Av, Ealing, London (undated), which # Whitman Publishing Co, 2 Niagara Av, Ealing, London (undated), which
# I found in the UCLA library. # I found in the UCLA library.
# #
# For data circa 1899, a common source is:
# Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94
# <http://www.jstor.org/stable/1774359>.
#
# A reliable and entertaining source about time zones is # A reliable and entertaining source about time zones is
# Derek Howse, Greenwich time and longitude, Philip Wilson Publishers (1997). # Derek Howse, Greenwich time and longitude, Philip Wilson Publishers (1997).
# #
...@@ -139,8 +143,12 @@ Zone Africa/Porto-Novo 0:10:28 - LMT 1912 ...@@ -139,8 +143,12 @@ Zone Africa/Porto-Novo 0:10:28 - LMT 1912
1:00 - WAT 1:00 - WAT
# Botswana # Botswana
# From Paul Eggert (2013-02-21):
# Milne says they were regulated by the Cape Town Signal in 1899;
# assume they switched to 2:00 when Cape Town did.
# Zone NAME GMTOFF RULES FORMAT [UNTIL] # Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Africa/Gaborone 1:43:40 - LMT 1885 Zone Africa/Gaborone 1:43:40 - LMT 1885
1:30 - SAST 1903 Mar
2:00 - CAT 1943 Sep 19 2:00 2:00 - CAT 1943 Sep 19 2:00
2:00 1:00 CAST 1944 Mar 19 2:00 2:00 1:00 CAST 1944 Mar 19 2:00
2:00 - CAT 2:00 - CAT
...@@ -212,6 +220,11 @@ Zone Africa/Djibouti 2:52:36 - LMT 1911 Jul ...@@ -212,6 +220,11 @@ Zone Africa/Djibouti 2:52:36 - LMT 1911 Jul
# Egypt # Egypt
# Milne says Cairo used 2:05:08.9, the local mean time of the Abbasizeh
# observatory; round to nearest. Milne also says that the official time for
# Egypt was mean noon at the Great Pyramid, 2:04:30.5, but apparently this
# did not apply to Cairo, Alexandria, or Port Said.
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule Egypt 1940 only - Jul 15 0:00 1:00 S Rule Egypt 1940 only - Jul 15 0:00 1:00 S
Rule Egypt 1940 only - Oct 1 0:00 0 - Rule Egypt 1940 only - Oct 1 0:00 0 -
...@@ -352,7 +365,7 @@ Rule Egypt 2010 only - Sep 10 0:00 1:00 S ...@@ -352,7 +365,7 @@ Rule Egypt 2010 only - Sep 10 0:00 1:00 S
Rule Egypt 2010 only - Sep lastThu 23:00s 0 - Rule Egypt 2010 only - Sep lastThu 23:00s 0 -
# Zone NAME GMTOFF RULES FORMAT [UNTIL] # Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Africa/Cairo 2:05:00 - LMT 1900 Oct Zone Africa/Cairo 2:05:09 - LMT 1900 Oct
2:00 Egypt EE%sT 2:00 Egypt EE%sT
# Equatorial Guinea # Equatorial Guinea
...@@ -447,6 +460,20 @@ Zone Africa/Monrovia -0:43:08 - LMT 1882 ...@@ -447,6 +460,20 @@ Zone Africa/Monrovia -0:43:08 - LMT 1882
# Libya # Libya
# From Even Scharning (2012-11-10):
# Libya set their time one hour back at 02:00 on Saturday November 10.
# http://www.libyaherald.com/2012/11/04/clocks-to-go-back-an-hour-on-saturday/
# Here is an official source [in Arabic]: http://ls.ly/fb6Yc
#
# Steffen Thorsen forwarded a translation (2012-11-10) in
# http://mm.icann.org/pipermail/tz/2012-November/018451.html
#
# From Tim Parenti (2012-11-11):
# Treat the 2012-11-10 change as a zone change from UTC+2 to UTC+1.
# The DST rules planned for 2013 and onward roughly mirror those of Europe
# (either two days before them or five days after them, so as to fall on
# lastFri instead of lastSun).
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule Libya 1951 only - Oct 14 2:00 1:00 S Rule Libya 1951 only - Oct 14 2:00 1:00 S
Rule Libya 1952 only - Jan 1 0:00 0 - Rule Libya 1952 only - Jan 1 0:00 0 -
...@@ -461,17 +488,21 @@ Rule Libya 1986 only - Apr 4 0:00 1:00 S ...@@ -461,17 +488,21 @@ Rule Libya 1986 only - Apr 4 0:00 1:00 S
Rule Libya 1986 only - Oct 3 0:00 0 - Rule Libya 1986 only - Oct 3 0:00 0 -
Rule Libya 1987 1989 - Apr 1 0:00 1:00 S Rule Libya 1987 1989 - Apr 1 0:00 1:00 S
Rule Libya 1987 1989 - Oct 1 0:00 0 - Rule Libya 1987 1989 - Oct 1 0:00 0 -
Rule Libya 1997 only - Apr 4 0:00 1:00 S
Rule Libya 1997 only - Oct 4 0:00 0 -
Rule Libya 2013 max - Mar lastFri 1:00 1:00 S
Rule Libya 2013 max - Oct lastFri 2:00 0 -
# Zone NAME GMTOFF RULES FORMAT [UNTIL] # Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Africa/Tripoli 0:52:44 - LMT 1920 Zone Africa/Tripoli 0:52:44 - LMT 1920
1:00 Libya CE%sT 1959 1:00 Libya CE%sT 1959
2:00 - EET 1982 2:00 - EET 1982
1:00 Libya CE%sT 1990 May 4 1:00 Libya CE%sT 1990 May 4
# The following entries are from Shanks & Pottenger; # The 1996 and 1997 entries are from Shanks & Pottenger;
# the IATA SSIM data contain some obvious errors. # the IATA SSIM data contain some obvious errors.
2:00 - EET 1996 Sep 30 2:00 - EET 1996 Sep 30
1:00 - CET 1997 Apr 4 1:00 Libya CE%sT 1997 Oct 4
1:00 1:00 CEST 1997 Oct 4 2:00 - EET 2012 Nov 10 2:00
2:00 - EET 1:00 Libya CE%sT
# Madagascar # Madagascar
# Zone NAME GMTOFF RULES FORMAT [UNTIL] # Zone NAME GMTOFF RULES FORMAT [UNTIL]
...@@ -838,6 +869,41 @@ Zone Indian/Mayotte 3:00:56 - LMT 1911 Jul # Mamoutzou ...@@ -838,6 +869,41 @@ Zone Indian/Mayotte 3:00:56 - LMT 1911 Jul # Mamoutzou
# 3:00 am Friday, July 20, 2012 and will again be advanced by 60 minutes # 3:00 am Friday, July 20, 2012 and will again be advanced by 60 minutes
# August 20, 2012 from 2:00 am. # August 20, 2012 from 2:00 am.
# From Paul Eggert (2013-03-06):
# Morocco's daylight-saving transitions due to Ramadan seem to be
# announced a bit in advance. On 2012-07-11 the Moroccan government
# announced that year's Ramadan daylight-saving transitions would be
# 2012-07-20 and 2012-08-20; see
# <http://www.mmsp.gov.ma/fr/actualites.aspx?id=288>.
#
# To estimate what the Moroccan government will do in future years,
# transition dates for 2013 through 2021 were determined by running
# the following program under GNU Emacs 24.3:
#
# (let ((islamic-year 1434))
# (while (< islamic-year 1444)
# (let ((a
# (calendar-gregorian-from-absolute
# (calendar-islamic-to-absolute (list 9 1 islamic-year))))
# (b
# (calendar-gregorian-from-absolute
# (calendar-islamic-to-absolute (list 10 1 islamic-year)))))
# (insert
# (format
# (concat "Rule\tMorocco\t%d\tonly\t-\t%s\t %2d\t 3:00\t0\t-\n"
# "Rule\tMorocco\t%d\tonly\t-\t%s\t %2d\t 2:00\t1:00\tS\n")
# (car (cdr (cdr a))) (calendar-month-name (car a) t) (car (cdr a))
# (car (cdr (cdr b))) (calendar-month-name (car b) t) (car (cdr b)))))
# (setq islamic-year (+ 1 islamic-year))))
#
# with the results hand-edited for 2020-2022, when the normal spring-forward
# date falls during the estimated Ramadan.
#
# From 2023 through 2038 Ramadan is not predicted to overlap with
# daylight saving time. Starting in 2039 there will be overlap again,
# but 32-bit time_t values roll around in 2038 so for now do not worry
# about dates after 2038.
# RULE NAME FROM TO TYPE IN ON AT SAVE LETTER/S # RULE NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule Morocco 1939 only - Sep 12 0:00 1:00 S Rule Morocco 1939 only - Sep 12 0:00 1:00 S
...@@ -863,10 +929,28 @@ Rule Morocco 2010 only - May 2 0:00 1:00 S ...@@ -863,10 +929,28 @@ Rule Morocco 2010 only - May 2 0:00 1:00 S
Rule Morocco 2010 only - Aug 8 0:00 0 - Rule Morocco 2010 only - Aug 8 0:00 0 -
Rule Morocco 2011 only - Apr 3 0:00 1:00 S Rule Morocco 2011 only - Apr 3 0:00 1:00 S
Rule Morocco 2011 only - Jul 31 0 0 - Rule Morocco 2011 only - Jul 31 0 0 -
Rule Morocco 2012 max - Apr lastSun 2:00 1:00 S Rule Morocco 2012 2019 - Apr lastSun 2:00 1:00 S
Rule Morocco 2012 max - Sep lastSun 3:00 0 - Rule Morocco 2012 max - Sep lastSun 3:00 0 -
Rule Morocco 2012 only - Jul 20 3:00 0 - Rule Morocco 2012 only - Jul 20 3:00 0 -
Rule Morocco 2012 only - Aug 20 2:00 1:00 S Rule Morocco 2012 only - Aug 20 2:00 1:00 S
Rule Morocco 2013 only - Jul 9 3:00 0 -
Rule Morocco 2013 only - Aug 8 2:00 1:00 S
Rule Morocco 2014 only - Jun 29 3:00 0 -
Rule Morocco 2014 only - Jul 29 2:00 1:00 S
Rule Morocco 2015 only - Jun 18 3:00 0 -
Rule Morocco 2015 only - Jul 18 2:00 1:00 S
Rule Morocco 2016 only - Jun 7 3:00 0 -
Rule Morocco 2016 only - Jul 7 2:00 1:00 S
Rule Morocco 2017 only - May 27 3:00 0 -
Rule Morocco 2017 only - Jun 26 2:00 1:00 S
Rule Morocco 2018 only - May 16 3:00 0 -
Rule Morocco 2018 only - Jun 15 2:00 1:00 S
Rule Morocco 2019 only - May 6 3:00 0 -
Rule Morocco 2019 only - Jun 5 2:00 1:00 S
Rule Morocco 2020 only - May 24 2:00 1:00 S
Rule Morocco 2021 only - May 13 2:00 1:00 S
Rule Morocco 2022 only - May 3 2:00 1:00 S
Rule Morocco 2023 max - Apr lastSun 2:00 1:00 S
# Zone NAME GMTOFF RULES FORMAT [UNTIL] # Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Africa/Casablanca -0:30:20 - LMT 1913 Oct 26 Zone Africa/Casablanca -0:30:20 - LMT 1913 Oct 26
......
...@@ -73,38 +73,8 @@ Rule ChileAQ 2009 only - Mar Sun>=9 3:00u 0 - ...@@ -73,38 +73,8 @@ Rule ChileAQ 2009 only - Mar Sun>=9 3:00u 0 -
Rule ChileAQ 2010 only - Apr Sun>=1 3:00u 0 - Rule ChileAQ 2010 only - Apr Sun>=1 3:00u 0 -
Rule ChileAQ 2011 only - May Sun>=2 3:00u 0 - Rule ChileAQ 2011 only - May Sun>=2 3:00u 0 -
Rule ChileAQ 2011 only - Aug Sun>=16 4:00u 1:00 S Rule ChileAQ 2011 only - Aug Sun>=16 4:00u 1:00 S
Rule ChileAQ 2012 only - Apr Sun>=23 3:00u 0 - Rule ChileAQ 2012 max - Apr Sun>=23 3:00u 0 -
Rule ChileAQ 2012 only - Sep Sun>=2 4:00u 1:00 S Rule ChileAQ 2012 max - Sep Sun>=2 4:00u 1:00 S
Rule ChileAQ 2013 max - Mar Sun>=9 3:00u 0 -
Rule ChileAQ 2013 max - Oct Sun>=9 4:00u 1:00 S
# These rules are stolen from the `australasia' file.
Rule AusAQ 1917 only - Jan 1 0:01 1:00 -
Rule AusAQ 1917 only - Mar 25 2:00 0 -
Rule AusAQ 1942 only - Jan 1 2:00 1:00 -
Rule AusAQ 1942 only - Mar 29 2:00 0 -
Rule AusAQ 1942 only - Sep 27 2:00 1:00 -
Rule AusAQ 1943 1944 - Mar lastSun 2:00 0 -
Rule AusAQ 1943 only - Oct 3 2:00 1:00 -
Rule ATAQ 1967 only - Oct Sun>=1 2:00s 1:00 -
Rule ATAQ 1968 only - Mar lastSun 2:00s 0 -
Rule ATAQ 1968 1985 - Oct lastSun 2:00s 1:00 -
Rule ATAQ 1969 1971 - Mar Sun>=8 2:00s 0 -
Rule ATAQ 1972 only - Feb lastSun 2:00s 0 -
Rule ATAQ 1973 1981 - Mar Sun>=1 2:00s 0 -
Rule ATAQ 1982 1983 - Mar lastSun 2:00s 0 -
Rule ATAQ 1984 1986 - Mar Sun>=1 2:00s 0 -
Rule ATAQ 1986 only - Oct Sun>=15 2:00s 1:00 -
Rule ATAQ 1987 1990 - Mar Sun>=15 2:00s 0 -
Rule ATAQ 1987 only - Oct Sun>=22 2:00s 1:00 -
Rule ATAQ 1988 1990 - Oct lastSun 2:00s 1:00 -
Rule ATAQ 1991 1999 - Oct Sun>=1 2:00s 1:00 -
Rule ATAQ 1991 2005 - Mar lastSun 2:00s 0 -
Rule ATAQ 2000 only - Aug lastSun 2:00s 1:00 -
Rule ATAQ 2001 max - Oct Sun>=1 2:00s 1:00 -
Rule ATAQ 2006 only - Apr Sun>=1 2:00s 0 -
Rule ATAQ 2007 only - Mar lastSun 2:00s 0 -
Rule ATAQ 2008 max - Apr Sun>=1 2:00s 0 -
# Argentina - year-round bases # Argentina - year-round bases
# Belgrano II, Confin Coast, -770227-0343737, since 1972-02-05 # Belgrano II, Confin Coast, -770227-0343737, since 1972-02-05
...@@ -147,10 +117,7 @@ Rule ATAQ 2008 max - Apr Sun>=1 2:00s 0 - ...@@ -147,10 +117,7 @@ Rule ATAQ 2008 max - Apr Sun>=1 2:00s 0 -
# </a> # </a>
# From Steffen Thorsen (2010-03-10): # From Steffen Thorsen (2010-03-10):
# We got these changes from the Australian Antarctic Division: # We got these changes from the Australian Antarctic Division: ...
# - Macquarie Island will stay on UTC+11 for winter and therefore not
# switch back from daylight savings time when other parts of Australia do
# on 4 April.
# #
# - Casey station reverted to its normal time of UTC+8 on 5 March 2010. # - Casey station reverted to its normal time of UTC+8 on 5 March 2010.
# The change to UTC+11 is being considered as a regular summer thing but # The change to UTC+11 is being considered as a regular summer thing but
...@@ -161,9 +128,6 @@ Rule ATAQ 2008 max - Apr Sun>=1 2:00s 0 - ...@@ -161,9 +128,6 @@ Rule ATAQ 2008 max - Apr Sun>=1 2:00s 0 -
# #
# - Mawson station stays on UTC+5. # - Mawson station stays on UTC+5.
# #
# In addition to the Rule changes for Casey/Davis, it means that Macquarie
# will no longer be like Hobart and will have to have its own Zone created.
#
# Background: # Background:
# <a href="http://www.timeanddate.com/news/time/antartica-time-changes-2010.html"> # <a href="http://www.timeanddate.com/news/time/antartica-time-changes-2010.html">
# http://www.timeanddate.com/news/time/antartica-time-changes-2010.html # http://www.timeanddate.com/news/time/antartica-time-changes-2010.html
...@@ -190,12 +154,6 @@ Zone Antarctica/Mawson 0 - zzz 1954 Feb 13 ...@@ -190,12 +154,6 @@ Zone Antarctica/Mawson 0 - zzz 1954 Feb 13
6:00 - MAWT 2009 Oct 18 2:00 6:00 - MAWT 2009 Oct 18 2:00
# Mawson Time # Mawson Time
5:00 - MAWT 5:00 - MAWT
Zone Antarctica/Macquarie 0 - zzz 1911
10:00 - EST 1916 Oct 1 2:00
10:00 1:00 EST 1917 Feb
10:00 AusAQ EST 1967
10:00 ATAQ EST 2010 Apr 4 3:00
11:00 - MIST # Macquarie Island Time
# References: # References:
# <a href="http://www.antdiv.gov.au/aad/exop/sfo/casey/casey_aws.html"> # <a href="http://www.antdiv.gov.au/aad/exop/sfo/casey/casey_aws.html">
# Casey Weather (1998-02-26) # Casey Weather (1998-02-26)
......
...@@ -27,9 +27,9 @@ ...@@ -27,9 +27,9 @@
# This data is by no means authoritative; if you think you know better, # This data is by no means authoritative; if you think you know better,
# go ahead and edit the file (and please send any changes to # go ahead and edit the file (and please send any changes to
# tz@elsie.nci.nih.gov for general use in the future). # tz@iana.org for general use in the future).
# From Paul Eggert (2006-03-22): # From Paul Eggert (2013-02-21):
# #
# A good source for time zone historical data outside the U.S. is # A good source for time zone historical data outside the U.S. is
# Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition), # Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition),
...@@ -48,6 +48,10 @@ ...@@ -48,6 +48,10 @@
# Whitman Publishing Co, 2 Niagara Av, Ealing, London (undated), which # Whitman Publishing Co, 2 Niagara Av, Ealing, London (undated), which
# I found in the UCLA library. # I found in the UCLA library.
# #
# For data circa 1899, a common source is:
# Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94
# <http://www.jstor.org/stable/1774359>.
#
# A reliable and entertaining source about time zones is # A reliable and entertaining source about time zones is
# Derek Howse, Greenwich time and longitude, Philip Wilson Publishers (1997). # Derek Howse, Greenwich time and longitude, Philip Wilson Publishers (1997).
# #
...@@ -302,9 +306,12 @@ Zone Asia/Brunei 7:39:40 - LMT 1926 Mar # Bandar Seri Begawan ...@@ -302,9 +306,12 @@ Zone Asia/Brunei 7:39:40 - LMT 1926 Mar # Bandar Seri Begawan
8:00 - BNT 8:00 - BNT
# Burma / Myanmar # Burma / Myanmar
# Milne says 6:24:40 was the meridian of the time ball observatory at Rangoon.
# Zone NAME GMTOFF RULES FORMAT [UNTIL] # Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Asia/Rangoon 6:24:40 - LMT 1880 # or Yangon Zone Asia/Rangoon 6:24:40 - LMT 1880 # or Yangon
6:24:36 - RMT 1920 # Rangoon Mean Time? 6:24:40 - RMT 1920 # Rangoon Mean Time?
6:30 - BURT 1942 May # Burma Time 6:30 - BURT 1942 May # Burma Time
9:00 - JST 1945 May 3 9:00 - JST 1945 May 3
6:30 - MMT # Myanmar Time 6:30 - MMT # Myanmar Time
...@@ -407,7 +414,8 @@ Zone Asia/Harbin 8:26:44 - LMT 1928 # or Haerbin ...@@ -407,7 +414,8 @@ Zone Asia/Harbin 8:26:44 - LMT 1928 # or Haerbin
8:00 PRC C%sT 8:00 PRC C%sT
# Zhongyuan Time ("Central plain Time") # Zhongyuan Time ("Central plain Time")
# most of China # most of China
Zone Asia/Shanghai 8:05:52 - LMT 1928 # Milne gives 8:05:56.7; round to nearest.
Zone Asia/Shanghai 8:05:57 - LMT 1928
8:00 Shang C%sT 1949 8:00 Shang C%sT 1949
8:00 PRC C%sT 8:00 PRC C%sT
# Long-shu Time (probably due to Long and Shu being two names of that area) # Long-shu Time (probably due to Long and Shu being two names of that area)
...@@ -504,6 +512,10 @@ Zone Asia/Kashgar 5:03:56 - LMT 1928 # or Kashi or Kaxgar ...@@ -504,6 +512,10 @@ Zone Asia/Kashgar 5:03:56 - LMT 1928 # or Kashi or Kaxgar
8:00 PRC C%sT 8:00 PRC C%sT
# Hong Kong (Xianggang)
# Milne gives 7:36:41.7; round this.
# From Lee Yiu Chung (2009-10-24): # From Lee Yiu Chung (2009-10-24):
# I found there are some mistakes for the...DST rule for Hong # I found there are some mistakes for the...DST rule for Hong
# Kong. [According] to the DST record from Hong Kong Observatory (actually, # Kong. [According] to the DST record from Hong Kong Observatory (actually,
...@@ -570,7 +582,6 @@ Zone Asia/Kashgar 5:03:56 - LMT 1928 # or Kashi or Kaxgar ...@@ -570,7 +582,6 @@ Zone Asia/Kashgar 5:03:56 - LMT 1928 # or Kashi or Kaxgar
# The Japanese surrender of Hong Kong was signed 1945-09-15. # The Japanese surrender of Hong Kong was signed 1945-09-15.
# For lack of anything better, use start of those days as the transition times. # For lack of anything better, use start of those days as the transition times.
# Hong Kong (Xianggang)
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule HK 1941 only - Apr 1 3:30 1:00 S Rule HK 1941 only - Apr 1 3:30 1:00 S
Rule HK 1941 only - Sep 30 3:30 0 - Rule HK 1941 only - Sep 30 3:30 0 -
...@@ -592,7 +603,7 @@ Rule HK 1973 only - Dec 30 3:30 1:00 S ...@@ -592,7 +603,7 @@ Rule HK 1973 only - Dec 30 3:30 1:00 S
Rule HK 1979 only - May Sun>=8 3:30 1:00 S Rule HK 1979 only - May Sun>=8 3:30 1:00 S
Rule HK 1979 only - Oct Sun>=16 3:30 0 - Rule HK 1979 only - Oct Sun>=16 3:30 0 -
# Zone NAME GMTOFF RULES FORMAT [UNTIL] # Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Asia/Hong_Kong 7:36:36 - LMT 1904 Oct 30 Zone Asia/Hong_Kong 7:36:42 - LMT 1904 Oct 30
8:00 HK HK%sT 1941 Dec 25 8:00 HK HK%sT 1941 Dec 25
9:00 - JST 1945 Sep 15 9:00 - JST 1945 Sep 15
8:00 HK HK%sT 8:00 HK HK%sT
...@@ -669,6 +680,9 @@ Zone Asia/Macau 7:34:20 - LMT 1912 ...@@ -669,6 +680,9 @@ Zone Asia/Macau 7:34:20 - LMT 1912
############################################################################### ###############################################################################
# Cyprus # Cyprus
#
# Milne says the Eastern Telegraph Company used 2:14:00. Stick with LMT.
#
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule Cyprus 1975 only - Apr 13 0:00 1:00 S Rule Cyprus 1975 only - Apr 13 0:00 1:00 S
Rule Cyprus 1975 only - Oct 12 0:00 0 - Rule Cyprus 1975 only - Oct 12 0:00 0 -
...@@ -1222,7 +1236,6 @@ Rule Zion 2012 only - Mar Fri>=26 2:00 1:00 D ...@@ -1222,7 +1236,6 @@ Rule Zion 2012 only - Mar Fri>=26 2:00 1:00 D
Rule Zion 2012 only - Sep 23 2:00 0 S Rule Zion 2012 only - Sep 23 2:00 0 S
# From Ephraim Silverberg (2012-10-18): # From Ephraim Silverberg (2012-10-18):
# Yesterday, the Interior Ministry Committee, after more than a year # Yesterday, the Interior Ministry Committee, after more than a year
# past, approved sending the proposed June 2011 changes to the Time # past, approved sending the proposed June 2011 changes to the Time
# Decree Law back to the Knesset for second and third (final) votes # Decree Law back to the Knesset for second and third (final) votes
...@@ -1235,6 +1248,10 @@ Rule Zion 2012 only - Sep 23 2:00 0 S ...@@ -1235,6 +1248,10 @@ Rule Zion 2012 only - Sep 23 2:00 0 S
# later (i.e. at 02:00 the first Monday after October 2). # later (i.e. at 02:00 the first Monday after October 2).
# [Rosh Hashana holidays are factored in until 2100.] # [Rosh Hashana holidays are factored in until 2100.]
# From Ephraim Silverberg (2012-11-05):
# The Knesset passed today (in second and final readings) the amendment to the
# Time Decree Law making the changes ... law.
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule Zion 2013 max - Mar Fri>=23 2:00 1:00 D Rule Zion 2013 max - Mar Fri>=23 2:00 1:00 D
Rule Zion 2013 2026 - Oct Sun>=2 2:00 0 S Rule Zion 2013 2026 - Oct Sun>=2 2:00 0 S
...@@ -1824,8 +1841,11 @@ Zone Asia/Kathmandu 5:41:16 - LMT 1920 ...@@ -1824,8 +1841,11 @@ Zone Asia/Kathmandu 5:41:16 - LMT 1920
5:45 - NPT # Nepal Time 5:45 - NPT # Nepal Time
# Oman # Oman
# Milne says 3:54:24 was the meridian of the Muscat Tidal Observatory.
# Zone NAME GMTOFF RULES FORMAT [UNTIL] # Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Asia/Muscat 3:54:20 - LMT 1920 Zone Asia/Muscat 3:54:24 - LMT 1920
4:00 - GST 4:00 - GST
# Pakistan # Pakistan
...@@ -2072,8 +2092,7 @@ Zone Asia/Karachi 4:28:12 - LMT 1907 ...@@ -2072,8 +2092,7 @@ Zone Asia/Karachi 4:28:12 - LMT 1907
# occurred before our cutoff date of 1970. # occurred before our cutoff date of 1970.
# However, as we get more information, we may need to add entries # However, as we get more information, we may need to add entries
# for parts of the West Bank as they transitioned from Israel's rules # for parts of the West Bank as they transitioned from Israel's rules
# to Palestine's rules. If you have more info about this, please # to Palestine's rules.
# send it to tz@elsie.nci.nih.gov for incorporation into future editions.
# From IINS News Service - Israel - 1998-03-23 10:38:07 Israel time, # From IINS News Service - Israel - 1998-03-23 10:38:07 Israel time,
# forwarded by Ephraim Silverberg: # forwarded by Ephraim Silverberg:
...@@ -2295,11 +2314,20 @@ Zone Asia/Karachi 4:28:12 - LMT 1907 ...@@ -2295,11 +2314,20 @@ Zone Asia/Karachi 4:28:12 - LMT 1907
# http://www.timeanddate.com/news/time/gaza-west-bank-dst-2012.html # http://www.timeanddate.com/news/time/gaza-west-bank-dst-2012.html
# </a> # </a>
# From Arthur David Olson (2012-03-27): # From Steffen Thorsen (2013-03-26):
# The timeanddate article for 2012 says that "the end date has not yet been # The following news sources tells that Palestine will "start daylight saving
# announced" and that "Last year, both...paused daylight saving time during... # time from midnight on Friday, March 29, 2013" (translated).
# Ramadan. It is not yet known [for] 2012." # [These are in Arabic and are for Gaza and for Ramallah, respectively.]
# For now, assume both switch back on the last Friday in September. XXX # http://www.samanews.com/index.php?act=Show&id=154120
# http://safa.ps/details/news/99844/%D8%B1%D8%A7%D9%85-%D8%A7%D9%84%D9%84%D9%87-%D8%A8%D8%AF%D8%A1-%D8%A7%D9%84%D8%AA%D9%88%D9%82%D9%8A%D8%AA-%D8%A7%D9%84%D8%B5%D9%8A%D9%81%D9%8A-29-%D8%A7%D9%84%D8%AC%D8%A7%D8%B1%D9%8A.html
# From Paul Eggert (2013-04-15):
# For future dates, guess the last Thursday in March at 24:00 through
# the first Friday on or after September 21 at 01:00. This is consistent with
# the predictions in today's editions of the following URLs,
# which are for Gaza and Hebron respectively:
# http://www.timeanddate.com/worldclock/timezone.html?n=702
# http://www.timeanddate.com/worldclock/timezone.html?n=2364
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule EgyptAsia 1957 only - May 10 0:00 1:00 S Rule EgyptAsia 1957 only - May 10 0:00 1:00 S
...@@ -2313,19 +2341,20 @@ Rule Palestine 1999 2005 - Apr Fri>=15 0:00 1:00 S ...@@ -2313,19 +2341,20 @@ Rule Palestine 1999 2005 - Apr Fri>=15 0:00 1:00 S
Rule Palestine 1999 2003 - Oct Fri>=15 0:00 0 - Rule Palestine 1999 2003 - Oct Fri>=15 0:00 0 -
Rule Palestine 2004 only - Oct 1 1:00 0 - Rule Palestine 2004 only - Oct 1 1:00 0 -
Rule Palestine 2005 only - Oct 4 2:00 0 - Rule Palestine 2005 only - Oct 4 2:00 0 -
Rule Palestine 2006 2008 - Apr 1 0:00 1:00 S Rule Palestine 2006 2007 - Apr 1 0:00 1:00 S
Rule Palestine 2006 only - Sep 22 0:00 0 - Rule Palestine 2006 only - Sep 22 0:00 0 -
Rule Palestine 2007 only - Sep Thu>=8 2:00 0 - Rule Palestine 2007 only - Sep Thu>=8 2:00 0 -
Rule Palestine 2008 only - Aug lastFri 0:00 0 - Rule Palestine 2008 2009 - Mar lastFri 0:00 1:00 S
Rule Palestine 2009 only - Mar lastFri 0:00 1:00 S Rule Palestine 2008 only - Sep 1 0:00 0 -
Rule Palestine 2009 only - Sep Fri>=1 2:00 0 - Rule Palestine 2009 only - Sep Fri>=1 1:00 0 -
Rule Palestine 2010 only - Mar lastSat 0:01 1:00 S Rule Palestine 2010 only - Mar 26 0:00 1:00 S
Rule Palestine 2010 only - Aug 11 0:00 0 - Rule Palestine 2010 only - Aug 11 0:00 0 -
Rule Palestine 2011 only - Apr 1 0:01 1:00 S
# From Arthur David Olson (2011-09-20): Rule Palestine 2011 only - Aug 1 0:00 0 -
# 2011 transitions per http://www.timeanddate.com as of 2011-09-20. Rule Palestine 2011 only - Aug 30 0:00 1:00 S
# From Paul Eggert (2012-10-12): Rule Palestine 2011 only - Sep 30 0:00 0 -
# 2012 transitions per http://www.timeanddate.com as of 2012-10-12. Rule Palestine 2012 max - Mar lastThu 24:00 1:00 S
Rule Palestine 2012 max - Sep Fri>=21 1:00 0 -
# Zone NAME GMTOFF RULES FORMAT [UNTIL] # Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Asia/Gaza 2:17:52 - LMT 1900 Oct Zone Asia/Gaza 2:17:52 - LMT 1900 Oct
...@@ -2333,26 +2362,20 @@ Zone Asia/Gaza 2:17:52 - LMT 1900 Oct ...@@ -2333,26 +2362,20 @@ Zone Asia/Gaza 2:17:52 - LMT 1900 Oct
2:00 EgyptAsia EE%sT 1967 Jun 5 2:00 EgyptAsia EE%sT 1967 Jun 5
2:00 Zion I%sT 1996 2:00 Zion I%sT 1996
2:00 Jordan EE%sT 1999 2:00 Jordan EE%sT 1999
2:00 Palestine EE%sT 2011 Apr 2 12:01 2:00 Palestine EE%sT 2008 Aug 29 0:00
2:00 1:00 EEST 2011 Aug 1 2:00 - EET 2008 Sep
2:00 - EET 2012 Mar 30 2:00 Palestine EE%sT 2010
2:00 1:00 EEST 2012 Sep 21 1:00 2:00 - EET 2010 Mar 27 0:01
2:00 - EET 2:00 Palestine EE%sT 2011 Aug 1
2:00 - EET 2012
2:00 Palestine EE%sT
Zone Asia/Hebron 2:20:23 - LMT 1900 Oct Zone Asia/Hebron 2:20:23 - LMT 1900 Oct
2:00 Zion EET 1948 May 15 2:00 Zion EET 1948 May 15
2:00 EgyptAsia EE%sT 1967 Jun 5 2:00 EgyptAsia EE%sT 1967 Jun 5
2:00 Zion I%sT 1996 2:00 Zion I%sT 1996
2:00 Jordan EE%sT 1999 2:00 Jordan EE%sT 1999
2:00 Palestine EE%sT 2008 Aug 2:00 Palestine EE%sT
2:00 1:00 EEST 2008 Sep
2:00 Palestine EE%sT 2011 Apr 1 12:01
2:00 1:00 EEST 2011 Aug 1
2:00 - EET 2011 Aug 30
2:00 1:00 EEST 2011 Sep 30 3:00
2:00 - EET 2012 Mar 30
2:00 1:00 EEST 2012 Sep 21 1:00
2:00 - EET
# Paracel Is # Paracel Is
# no information # no information
...@@ -2421,6 +2444,13 @@ Zone Asia/Singapore 6:55:25 - LMT 1901 Jan 1 ...@@ -2421,6 +2444,13 @@ Zone Asia/Singapore 6:55:25 - LMT 1901 Jan 1
# no information # no information
# Sri Lanka # Sri Lanka
# From Paul Eggert (2013-02-21):
# Milne says "Madras mean time use from May 1, 1898. Prior to this Colombo
# mean time, 5h. 4m. 21.9s. F., was used." But 5:04:21.9 differs considerably
# from Colombo's meridian 5:19:24, so for now ignore Milne and stick with
# Shanks and Pottenger.
# From Paul Eggert (1996-09-03): # From Paul Eggert (1996-09-03):
# "Sri Lanka advances clock by an hour to avoid blackout" # "Sri Lanka advances clock by an hour to avoid blackout"
# (www.virtual-pc.com/lankaweb/news/items/240596-2.html, 1996-05-24, # (www.virtual-pc.com/lankaweb/news/items/240596-2.html, 1996-05-24,
...@@ -2720,6 +2750,12 @@ Zone Asia/Tashkent 4:37:12 - LMT 1924 May 2 ...@@ -2720,6 +2750,12 @@ Zone Asia/Tashkent 4:37:12 - LMT 1924 May 2
# Vietnam # Vietnam
# From Paul Eggert (2013-02-21):
# Milne gives 7:16:56 for the meridian of Saigon in 1899, as being
# used in Lower Laos, Cambodia, and Annam. But this is quite a ways
# from Saigon's location. For now, ignore this and stick with Shanks
# and Pottenger.
# From Arthur David Olson (2008-03-18): # From Arthur David Olson (2008-03-18):
# The English-language name of Vietnam's most populous city is "Ho Chi Min City"; # The English-language name of Vietnam's most populous city is "Ho Chi Min City";
# we use Ho_Chi_Minh below to avoid a name of more than 14 characters. # we use Ho_Chi_Minh below to avoid a name of more than 14 characters.
...@@ -2733,6 +2769,10 @@ Zone Asia/Ho_Chi_Minh 7:06:40 - LMT 1906 Jun 9 ...@@ -2733,6 +2769,10 @@ Zone Asia/Ho_Chi_Minh 7:06:40 - LMT 1906 Jun 9
7:00 - ICT 7:00 - ICT
# Yemen # Yemen
# Milne says 2:59:54 was the meridian of the saluting battery at Aden,
# and that Yemen was at 1:55:56, the meridian of the Hagia Sophia.
# Zone NAME GMTOFF RULES FORMAT [UNTIL] # Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Asia/Aden 3:00:48 - LMT 1950 Zone Asia/Aden 2:59:54 - LMT 1950
3:00 - AST 3:00 - AST
...@@ -241,9 +241,26 @@ Zone Australia/Lord_Howe 10:36:20 - LMT 1895 Feb ...@@ -241,9 +241,26 @@ Zone Australia/Lord_Howe 10:36:20 - LMT 1895 Feb
# no times are set # no times are set
# #
# Macquarie # Macquarie
# permanent occupation (scientific station) since 1948; # Permanent occupation (scientific station) 1911-1915 and since 25 March 1948;
# sealing and penguin oil station operated 1888/1917 # sealing and penguin oil station operated Nov 1899 to Apr 1919. See the
# like Australia/Hobart # Tasmania Parks & Wildlife Service history of sealing at Macquarie Island
# <http://www.parks.tas.gov.au/index.aspx?base=1828>
# <http://www.parks.tas.gov.au/index.aspx?base=1831>.
# Guess that it was like Australia/Hobart while inhabited before 2010.
#
# From Steffen Thorsen (2010-03-10):
# We got these changes from the Australian Antarctic Division:
# - Macquarie Island will stay on UTC+11 for winter and therefore not
# switch back from daylight savings time when other parts of Australia do
# on 4 April.
Zone Antarctica/Macquarie 0 - zzz 1899 Nov
10:00 - EST 1916 Oct 1 2:00
10:00 1:00 EST 1917 Feb
10:00 Aus EST 1919 Apr
0 - zzz 1948 Mar 25
10:00 Aus EST 1967
10:00 AT EST 2010 Apr 4 3:00
11:00 - MIST # Macquarie I Standard Time
# Christmas # Christmas
# Zone NAME GMTOFF RULES FORMAT [UNTIL] # Zone NAME GMTOFF RULES FORMAT [UNTIL]
...@@ -269,6 +286,9 @@ Zone Indian/Cocos 6:27:40 - LMT 1900 ...@@ -269,6 +286,9 @@ Zone Indian/Cocos 6:27:40 - LMT 1900
6:30 - CCT # Cocos Islands Time 6:30 - CCT # Cocos Islands Time
# Fiji # Fiji
# Milne gives 11:55:44 for Suva.
# From Alexander Krivenyshev (2009-11-10): # From Alexander Krivenyshev (2009-11-10):
# According to Fiji Broadcasting Corporation, Fiji plans to re-introduce DST # According to Fiji Broadcasting Corporation, Fiji plans to re-introduce DST
# from November 29th 2009 to April 25th 2010. # from November 29th 2009 to April 25th 2010.
...@@ -362,7 +382,7 @@ Rule Fiji 2010 max - Oct Sun>=18 2:00 1:00 S ...@@ -362,7 +382,7 @@ Rule Fiji 2010 max - Oct Sun>=18 2:00 1:00 S
Rule Fiji 2011 only - Mar Sun>=1 3:00 0 - Rule Fiji 2011 only - Mar Sun>=1 3:00 0 -
Rule Fiji 2012 max - Jan Sun>=18 3:00 0 - Rule Fiji 2012 max - Jan Sun>=18 3:00 0 -
# Zone NAME GMTOFF RULES FORMAT [UNTIL] # Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Pacific/Fiji 11:53:40 - LMT 1915 Oct 26 # Suva Zone Pacific/Fiji 11:55:44 - LMT 1915 Oct 26 # Suva
12:00 Fiji FJ%sT # Fiji Time 12:00 Fiji FJ%sT # Fiji Time
# French Polynesia # French Polynesia
...@@ -803,9 +823,9 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901 ...@@ -803,9 +823,9 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901
# This data is by no means authoritative; if you think you know better, # This data is by no means authoritative; if you think you know better,
# go ahead and edit the file (and please send any changes to # go ahead and edit the file (and please send any changes to
# tz@elsie.nci.nih.gov for general use in the future). # tz@iana.org for general use in the future).
# From Paul Eggert (2006-03-22): # From Paul Eggert (2013-02-21):
# A good source for time zone historical data outside the U.S. is # A good source for time zone historical data outside the U.S. is
# Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition), # Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition),
# San Diego: ACS Publications, Inc. (2003). # San Diego: ACS Publications, Inc. (2003).
...@@ -823,6 +843,10 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901 ...@@ -823,6 +843,10 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901
# Whitman Publishing Co, 2 Niagara Av, Ealing, London (undated), which # Whitman Publishing Co, 2 Niagara Av, Ealing, London (undated), which
# I found in the UCLA library. # I found in the UCLA library.
# #
# For data circa 1899, a common source is:
# Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94
# <http://www.jstor.org/stable/1774359>.
#
# A reliable and entertaining source about time zones is # A reliable and entertaining source about time zones is
# Derek Howse, Greenwich time and longitude, Philip Wilson Publishers (1997). # Derek Howse, Greenwich time and longitude, Philip Wilson Publishers (1997).
# #
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
# This data is by no means authoritative; if you think you know better, # This data is by no means authoritative; if you think you know better,
# go ahead and edit the file (and please send any changes to # go ahead and edit the file (and please send any changes to
# tz@elsie.nci.nih.gov for general use in the future). # tz@iana.org for general use in the future).
# From Paul Eggert (2006-03-22): # From Paul Eggert (2006-03-22):
# A good source for time zone historical data outside the U.S. is # A good source for time zone historical data outside the U.S. is
...@@ -53,6 +53,12 @@ ...@@ -53,6 +53,12 @@
# William Willett, The Waste of Daylight, 19th edition # William Willett, The Waste of Daylight, 19th edition
# </a> (1914-03) # </a> (1914-03)
# #
# Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94
# <http://www.jstor.org/stable/1774359>. He writes:
# "It is requested that corrections and additions to these tables
# may be sent to Mr. John Milne, Royal Geographical Society,
# Savile Row, London." Nowadays please email them to tz@iana.org.
#
# Brazil's Departamento Servico da Hora (DSH), # Brazil's Departamento Servico da Hora (DSH),
# <a href="http://pcdsh01.on.br/HISTHV.htm"> # <a href="http://pcdsh01.on.br/HISTHV.htm">
# History of Summer Time # History of Summer Time
...@@ -689,6 +695,8 @@ Zone Europe/Andorra 0:06:04 - LMT 1901 ...@@ -689,6 +695,8 @@ Zone Europe/Andorra 0:06:04 - LMT 1901
# Austria # Austria
# Milne says Vienna time was 1:05:21.
# From Paul Eggert (2006-03-22): Shanks & Pottenger give 1918-06-16 and # From Paul Eggert (2006-03-22): Shanks & Pottenger give 1918-06-16 and
# 1945-11-18, but the Austrian Federal Office of Metrology and # 1945-11-18, but the Austrian Federal Office of Metrology and
# Surveying (BEV) gives 1918-09-16 and for Vienna gives the "alleged" # Surveying (BEV) gives 1918-09-16 and for Vienna gives the "alleged"
...@@ -706,7 +714,7 @@ Rule Austria 1948 only - Apr 18 2:00s 1:00 S ...@@ -706,7 +714,7 @@ Rule Austria 1948 only - Apr 18 2:00s 1:00 S
Rule Austria 1980 only - Apr 6 0:00 1:00 S Rule Austria 1980 only - Apr 6 0:00 1:00 S
Rule Austria 1980 only - Sep 28 0:00 0 - Rule Austria 1980 only - Sep 28 0:00 0 -
# Zone NAME GMTOFF RULES FORMAT [UNTIL] # Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Europe/Vienna 1:05:20 - LMT 1893 Apr Zone Europe/Vienna 1:05:21 - LMT 1893 Apr
1:00 C-Eur CE%sT 1920 1:00 C-Eur CE%sT 1920
1:00 Austria CE%sT 1940 Apr 1 2:00s 1:00 Austria CE%sT 1940 Apr 1 2:00s
1:00 C-Eur CE%sT 1945 Apr 2 2:00s 1:00 C-Eur CE%sT 1945 Apr 2 2:00s
...@@ -1262,6 +1270,21 @@ Zone Europe/Berlin 0:53:28 - LMT 1893 Apr ...@@ -1262,6 +1270,21 @@ Zone Europe/Berlin 0:53:28 - LMT 1893 Apr
1:00 Germany CE%sT 1980 1:00 Germany CE%sT 1980
1:00 EU CE%sT 1:00 EU CE%sT
# From Tobias Conradi (2011-09-12):
# Busingen <http://www.buesingen.de>, surrounded by the Swiss canton
# Schaffhausen, did not start observing DST in 1980 as the rest of DE
# (West Germany at that time) and DD (East Germany at that time) did.
# DD merged into DE, the area is currently covered by code DE in ISO 3166-1,
# which in turn is covered by the zone Europe/Berlin.
#
# Source for the time in Busingen 1980:
# http://www.srf.ch/player/video?id=c012c029-03b7-4c2b-9164-aa5902cd58d3
# From Arthur David Olson (2012-03-03):
# Busingen and Zurich have shared clocks since 1970.
Link Europe/Zurich Europe/Busingen
# Georgia # Georgia
# Please see the "asia" file for Asia/Tbilisi. # Please see the "asia" file for Asia/Tbilisi.
# Herodotus (Histories, IV.45) says Georgia north of the Phasis (now Rioni) # Herodotus (Histories, IV.45) says Georgia north of the Phasis (now Rioni)
...@@ -2066,6 +2089,70 @@ Zone Europe/Bucharest 1:44:24 - LMT 1891 Oct ...@@ -2066,6 +2089,70 @@ Zone Europe/Bucharest 1:44:24 - LMT 1891 Oct
# Russia # Russia
# From Alexander Krivenyshev (2011-09-15):
# Based on last Russian Government Decree # 725 on August 31, 2011
# (Government document
# <a href="http://www.government.ru/gov/results/16355/print/">
# http://www.government.ru/gov/results/16355/print/
# </a>
# in Russian)
# there are few corrections have to be made for some Russian time zones...
# All updated Russian Time Zones were placed in table and translated to English
# by WorldTimeZone.com at the link below:
# <a href="http://www.worldtimezone.com/dst_news/dst_news_russia36.htm">
# http://www.worldtimezone.com/dst_news/dst_news_russia36.htm
# </a>
# From Sanjeev Gupta (2011-09-27):
# Scans of [Decree #23 of January 8, 1992] are available at:
# <a href="http://government.consultant.ru/page.aspx?1223966">
# http://government.consultant.ru/page.aspx?1223966
# They are in Cyrillic letters (presumably Russian).
# From Arthur David Olson (2012-05-09):
# Regarding the instant when clocks in time-zone-shifting parts of Russia
# changed in September 2011:
#
# One source is
# < a href="http://government.ru/gov/results/16355/>
# http://government.ru/gov/results/16355/
# </a>
# which, according to translate.google.com, begins "Decree of August 31,
# 2011 No 725" and contains no other dates or "effective date" information.
#
# Another source is
# <a href="http://www.rg.ru/2011/09/06/chas-zona-dok.html">
# http://www.rg.ru/2011/09/06/chas-zona-dok.html
# </a>
# which, according to translate.google.com, begins "Resolution of the
# Government of the Russian Federation on August 31, 2011 N 725" and also
# contains "Date first official publication: September 6, 2011 Posted on:
# in the 'RG' - Federal Issue number 5573 September 6, 2011" but which
# does not contain any "effective date" information.
#
# Another source is
# <a href="http://en.wikipedia.org/wiki/Oymyakonsky_District#cite_note-RuTime-7">
# http://en.wikipedia.org/wiki/Oymyakonsky_District#cite_note-RuTime-7
# </a>
# which, in note 8, contains "Resolution #725 of August 31, 2011...
# Effective as of after 7 days following the day of the official publication"
# but which does not contain any reference to September 6, 2011.
#
# The Wikipedia article refers to
# <a href="http://base.consultant.ru/cons/cgi/online.cgi?req=doc;base=LAW;n=118896">
# http://base.consultant.ru/cons/cgi/online.cgi?req=doc;base=LAW;n=118896
# </a>
# which seems to copy the text of the government.ru page.
#
# Tobias Conradi combines Wikipedia's
# "as of after 7 days following the day of the official publication"
# with www.rg.ru's "Date of first official publication: September 6, 2011" to get
# September 13, 2011 as the cutover date (unusually, a Tuesday, as Tobias Conradi notes).
#
# None of the sources indicates a time of day for changing clocks.
#
# Go with 2011-09-13 0:00s.
# From Paul Eggert (2006-03-22): # From Paul Eggert (2006-03-22):
# Except for Moscow after 1919-07-01, I invented the time zone abbreviations. # Except for Moscow after 1919-07-01, I invented the time zone abbreviations.
# Moscow time zone abbreviations after 1919-07-01, and Moscow rules after 1991, # Moscow time zone abbreviations after 1919-07-01, and Moscow rules after 1991,
...@@ -2293,14 +2380,32 @@ Zone Asia/Yakutsk 8:38:40 - LMT 1919 Dec 15 ...@@ -2293,14 +2380,32 @@ Zone Asia/Yakutsk 8:38:40 - LMT 1919 Dec 15
# [parts of] Respublika Sakha (Yakutiya). # [parts of] Respublika Sakha (Yakutiya).
# From Oscar van Vlijmen (2009-11-29): # From Oscar van Vlijmen (2009-11-29):
# The Sakha districts are: Bulunskij, Verkhoyanskij, Tomponskij, Ust'-Majskij, # The Sakha districts are: Bulunskij, Verkhoyanskij, ... Ust'-Yanskij.
# Ust'-Yanskij.
Zone Asia/Vladivostok 8:47:44 - LMT 1922 Nov 15 Zone Asia/Vladivostok 8:47:44 - LMT 1922 Nov 15
9:00 - VLAT 1930 Jun 21 # Vladivostok Time 9:00 - VLAT 1930 Jun 21 # Vladivostok Time
10:00 Russia VLA%sT 1991 Mar 31 2:00s 10:00 Russia VLA%sT 1991 Mar 31 2:00s
9:00 Russia VLA%sST 1992 Jan 19 2:00s 9:00 Russia VLA%sST 1992 Jan 19 2:00s
10:00 Russia VLA%sT 2011 Mar 27 2:00s 10:00 Russia VLA%sT 2011 Mar 27 2:00s
11:00 - VLAT 11:00 - VLAT
# From Arthur David Olson (2012-05-09):
# Tomponskij and Ust'-Majskij switched from Vladivostok time to Yakutsk time
# in 2011.
#
# From Paul Eggert (2012-11-25):
# Shanks and Pottenger (2003) has Khandyga on Yakutsk time.
# Make a wild guess that it switched to Vladivostok time in 2004.
# This transition is no doubt wrong, but we have no better info.
#
Zone Asia/Khandyga 9:02:13 - LMT 1919 Dec 15
8:00 - YAKT 1930 Jun 21 # Yakutsk Time
9:00 Russia YAK%sT 1991 Mar 31 2:00s
8:00 Russia YAK%sT 1992 Jan 19 2:00s
9:00 Russia YAK%sT 2004
10:00 Russia VLA%sT 2011 Mar 27 2:00s
11:00 - VLAT 2011 Sep 13 0:00s # Decree 725?
10:00 - YAKT
# #
# Sakhalinskaya oblast'. # Sakhalinskaya oblast'.
# The Zone name should be Yuzhno-Sakhalinsk, but that's too long. # The Zone name should be Yuzhno-Sakhalinsk, but that's too long.
...@@ -2319,14 +2424,26 @@ Zone Asia/Sakhalin 9:30:48 - LMT 1905 Aug 23 ...@@ -2319,14 +2424,26 @@ Zone Asia/Sakhalin 9:30:48 - LMT 1905 Aug 23
# From Oscar van Vlijmen (2009-11-29): # From Oscar van Vlijmen (2009-11-29):
# The Sakha districts are: Abyjskij, Allaikhovskij, Verkhhhnekolymskij, Momskij, # The Sakha districts are: Abyjskij, Allaikhovskij, Verkhhhnekolymskij, Momskij,
# Nizhnekolymskij, Ojmyakonskij, Srednekolymskij. # Nizhnekolymskij, ... Srednekolymskij.
Zone Asia/Magadan 10:03:12 - LMT 1924 May 2 Zone Asia/Magadan 10:03:12 - LMT 1924 May 2
10:00 - MAGT 1930 Jun 21 # Magadan Time 10:00 - MAGT 1930 Jun 21 # Magadan Time
11:00 Russia MAG%sT 1991 Mar 31 2:00s 11:00 Russia MAG%sT 1991 Mar 31 2:00s
10:00 Russia MAG%sT 1992 Jan 19 2:00s 10:00 Russia MAG%sT 1992 Jan 19 2:00s
11:00 Russia MAG%sT 2011 Mar 27 2:00s 11:00 Russia MAG%sT 2011 Mar 27 2:00s
12:00 - MAGT 12:00 - MAGT
#
# From Arthur David Olson (2012-05-09):
# Ojmyakonskij and the Kuril Islands switched from
# Magadan time to Vladivostok time in 2011.
Zone Asia/Ust-Nera 9:32:54 - LMT 1919 Dec 15
8:00 - YAKT 1930 Jun 21 # Yakutsk Time
9:00 Russia YAKT 1981 Apr 1
11:00 Russia MAG%sT 1991 Mar 31 2:00s
10:00 Russia MAG%sT 1992 Jan 19 2:00s
11:00 Russia MAG%sT 2011 Mar 27 2:00s
12:00 - MAGT 2011 Sep 13 0:00s # Decree 725?
11:00 - VLAT
# From Oscar van Vlijmen (2001-08-25): [This region consists of] # From Oscar van Vlijmen (2001-08-25): [This region consists of]
# Kamchatskaya oblast', Koryakskij avtonomnyj okrug. # Kamchatskaya oblast', Koryakskij avtonomnyj okrug.
# #
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
# This data is by no means authoritative; if you think you know better, # This data is by no means authoritative; if you think you know better,
# go ahead and edit the file (and please send any changes to # go ahead and edit the file (and please send any changes to
# tz@elsie.nci.nih.gov for general use in the future). # tz@iana.org for general use in the future).
# From Paul Eggert (1999-03-22): # From Paul Eggert (1999-03-22):
# A reliable and entertaining source about time zones is # A reliable and entertaining source about time zones is
...@@ -1042,6 +1042,9 @@ Zone America/Menominee -5:50:27 - LMT 1885 Sep 18 12:00 ...@@ -1042,6 +1042,9 @@ Zone America/Menominee -5:50:27 - LMT 1885 Sep 18 12:00
# William Willett, The Waste of Daylight, 19th edition # William Willett, The Waste of Daylight, 19th edition
# </a> (1914-03) # </a> (1914-03)
# #
# Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94
# <http://www.jstor.org/stable/1774359>.
#
# See the `europe' file for Greenland. # See the `europe' file for Greenland.
# Canada # Canada
...@@ -2577,6 +2580,8 @@ Zone America/Antigua -4:07:12 - LMT 1912 Mar 2 ...@@ -2577,6 +2580,8 @@ Zone America/Antigua -4:07:12 - LMT 1912 Mar 2
# Bahamas # Bahamas
# #
# For 1899 Milne gives -5:09:29.5; round that.
#
# From Sue Williams (2006-12-07): # From Sue Williams (2006-12-07):
# The Bahamas announced about a month ago that they plan to change their DST # The Bahamas announced about a month ago that they plan to change their DST
# rules to sync with the U.S. starting in 2007.... # rules to sync with the U.S. starting in 2007....
...@@ -2586,11 +2591,14 @@ Zone America/Antigua -4:07:12 - LMT 1912 Mar 2 ...@@ -2586,11 +2591,14 @@ Zone America/Antigua -4:07:12 - LMT 1912 Mar 2
Rule Bahamas 1964 1975 - Oct lastSun 2:00 0 S Rule Bahamas 1964 1975 - Oct lastSun 2:00 0 S
Rule Bahamas 1964 1975 - Apr lastSun 2:00 1:00 D Rule Bahamas 1964 1975 - Apr lastSun 2:00 1:00 D
# Zone NAME GMTOFF RULES FORMAT [UNTIL] # Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone America/Nassau -5:09:24 - LMT 1912 Mar 2 Zone America/Nassau -5:09:30 - LMT 1912 Mar 2
-5:00 Bahamas E%sT 1976 -5:00 Bahamas E%sT 1976
-5:00 US E%sT -5:00 US E%sT
# Barbados # Barbados
# For 1899 Milne gives -3:58:29.2; round that.
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule Barb 1977 only - Jun 12 2:00 1:00 D Rule Barb 1977 only - Jun 12 2:00 1:00 D
Rule Barb 1977 1978 - Oct Sun>=1 2:00 0 S Rule Barb 1977 1978 - Oct Sun>=1 2:00 0 S
...@@ -2598,8 +2606,8 @@ Rule Barb 1978 1980 - Apr Sun>=15 2:00 1:00 D ...@@ -2598,8 +2606,8 @@ Rule Barb 1978 1980 - Apr Sun>=15 2:00 1:00 D
Rule Barb 1979 only - Sep 30 2:00 0 S Rule Barb 1979 only - Sep 30 2:00 0 S
Rule Barb 1980 only - Sep 25 2:00 0 S Rule Barb 1980 only - Sep 25 2:00 0 S
# Zone NAME GMTOFF RULES FORMAT [UNTIL] # Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone America/Barbados -3:58:28 - LMT 1924 # Bridgetown Zone America/Barbados -3:58:29 - LMT 1924 # Bridgetown
-3:58:28 - BMT 1932 # Bridgetown Mean Time -3:58:29 - BMT 1932 # Bridgetown Mean Time
-4:00 Barb A%sT -4:00 Barb A%sT
# Belize # Belize
...@@ -2617,6 +2625,9 @@ Zone America/Belize -5:52:48 - LMT 1912 Apr ...@@ -2617,6 +2625,9 @@ Zone America/Belize -5:52:48 - LMT 1912 Apr
# Bermuda # Bermuda
# For 1899 Milne gives -4:19:18.3 as the meridian of the clock tower,
# Bermuda dockyard, Ireland I; round that.
# From Dan Jones, reporting in The Royal Gazette (2006-06-26): # From Dan Jones, reporting in The Royal Gazette (2006-06-26):
# Next year, however, clocks in the US will go forward on the second Sunday # Next year, however, clocks in the US will go forward on the second Sunday
...@@ -2626,7 +2637,7 @@ Zone America/Belize -5:52:48 - LMT 1912 Apr ...@@ -2626,7 +2637,7 @@ Zone America/Belize -5:52:48 - LMT 1912 Apr
# http://www.theroyalgazette.com/apps/pbcs.dll/article?AID=/20060529/NEWS/105290135 # http://www.theroyalgazette.com/apps/pbcs.dll/article?AID=/20060529/NEWS/105290135
# Zone NAME GMTOFF RULES FORMAT [UNTIL] # Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Atlantic/Bermuda -4:19:04 - LMT 1930 Jan 1 2:00 # Hamilton Zone Atlantic/Bermuda -4:19:18 - LMT 1930 Jan 1 2:00 # Hamilton
-4:00 - AST 1974 Apr 28 2:00 -4:00 - AST 1974 Apr 28 2:00
-4:00 Bahamas A%sT 1976 -4:00 Bahamas A%sT 1976
-4:00 US A%sT -4:00 US A%sT
...@@ -2638,6 +2649,9 @@ Zone America/Cayman -5:25:32 - LMT 1890 # Georgetown ...@@ -2638,6 +2649,9 @@ Zone America/Cayman -5:25:32 - LMT 1890 # Georgetown
-5:00 - EST -5:00 - EST
# Costa Rica # Costa Rica
# Milne gives -5:36:13.3 as San Jose mean time; round to nearest.
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule CR 1979 1980 - Feb lastSun 0:00 1:00 D Rule CR 1979 1980 - Feb lastSun 0:00 1:00 D
Rule CR 1979 1980 - Jun Sun>=1 0:00 0 S Rule CR 1979 1980 - Jun Sun>=1 0:00 0 S
...@@ -2648,14 +2662,19 @@ Rule CR 1991 only - Jul 1 0:00 0 S ...@@ -2648,14 +2662,19 @@ Rule CR 1991 only - Jul 1 0:00 0 S
Rule CR 1992 only - Mar 15 0:00 0 S Rule CR 1992 only - Mar 15 0:00 0 S
# There are too many San Joses elsewhere, so we'll use `Costa Rica'. # There are too many San Joses elsewhere, so we'll use `Costa Rica'.
# Zone NAME GMTOFF RULES FORMAT [UNTIL] # Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone America/Costa_Rica -5:36:20 - LMT 1890 # San Jose Zone America/Costa_Rica -5:36:13 - LMT 1890 # San Jose
-5:36:20 - SJMT 1921 Jan 15 # San Jose Mean Time -5:36:13 - SJMT 1921 Jan 15 # San Jose Mean Time
-6:00 CR C%sT -6:00 CR C%sT
# Coco # Coco
# no information; probably like America/Costa_Rica # no information; probably like America/Costa_Rica
# Cuba # Cuba
# From Paul Eggert (2013-02-21):
# Milne gives -5:28:50.45 for the observatory at Havana, -5:29:23.57
# for the port, and -5:30 for meteorological observations.
# For now, stick with Shanks & Pottenger.
# From Arthur David Olson (1999-03-29): # From Arthur David Olson (1999-03-29):
# The 1999-03-28 exhibition baseball game held in Havana, Cuba, between # The 1999-03-28 exhibition baseball game held in Havana, Cuba, between
# the Cuban National Team and the Baltimore Orioles was carried live on # the Cuban National Team and the Baltimore Orioles was carried live on
...@@ -3004,24 +3023,21 @@ Zone America/Guatemala -6:02:04 - LMT 1918 Oct 5 ...@@ -3004,24 +3023,21 @@ Zone America/Guatemala -6:02:04 - LMT 1918 Oct 5
# apparently using the same start and end date as USA/Canada. # apparently using the same start and end date as USA/Canada.
# So this means they have already changed their time. # So this means they have already changed their time.
# #
# (Sources in French):
# <a href="http://www.alterpresse.org/spip.php?article12510">
# http://www.alterpresse.org/spip.php?article12510 # http://www.alterpresse.org/spip.php?article12510
# </a>
# <a href="http://radiovision2000haiti.net/home/?p=13253">
# http://radiovision2000haiti.net/home/?p=13253 # http://radiovision2000haiti.net/home/?p=13253
# </a>
# #
# Our coverage:
# <a href="http://www.timeanddate.com/news/time/haiti-dst-2012.html">
# http://www.timeanddate.com/news/time/haiti-dst-2012.html
# </a>
# From Arthur David Olson (2012-03-11): # From Arthur David Olson (2012-03-11):
# The alterpresse.org source seems to show a US-style leap from 2:00 a.m. to # The alterpresse.org source seems to show a US-style leap from 2:00 a.m. to
# 3:00 a.m. rather than the traditional Haitian jump at midnight. # 3:00 a.m. rather than the traditional Haitian jump at midnight.
# Assume a US-style fall back as well XXX. # Assume a US-style fall back as well.
# Do not yet assume that the change carries forward past 2012 XXX.
# From Steffen Thorsen (2013-03-10):
# It appears that Haiti is observing DST this year as well, same rules
# as US/Canada. They did it last year as well, and it looks like they
# are going to observe DST every year now...
#
# http://radiovision2000haiti.net/public/haiti-avis-changement-dheure-dimanche/
# http://www.canalplushaiti.net/?p=6714
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule Haiti 1983 only - May 8 0:00 1:00 D Rule Haiti 1983 only - May 8 0:00 1:00 D
...@@ -3033,8 +3049,8 @@ Rule Haiti 1988 1997 - Apr Sun>=1 1:00s 1:00 D ...@@ -3033,8 +3049,8 @@ Rule Haiti 1988 1997 - Apr Sun>=1 1:00s 1:00 D
Rule Haiti 1988 1997 - Oct lastSun 1:00s 0 S Rule Haiti 1988 1997 - Oct lastSun 1:00s 0 S
Rule Haiti 2005 2006 - Apr Sun>=1 0:00 1:00 D Rule Haiti 2005 2006 - Apr Sun>=1 0:00 1:00 D
Rule Haiti 2005 2006 - Oct lastSun 0:00 0 S Rule Haiti 2005 2006 - Oct lastSun 0:00 0 S
Rule Haiti 2012 only - Mar Sun>=8 2:00 1:00 D Rule Haiti 2012 max - Mar Sun>=8 2:00 1:00 D
Rule Haiti 2012 only - Nov Sun>=1 2:00 0 S Rule Haiti 2012 max - Nov Sun>=1 2:00 0 S
# Zone NAME GMTOFF RULES FORMAT [UNTIL] # Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone America/Port-au-Prince -4:49:20 - LMT 1890 Zone America/Port-au-Prince -4:49:20 - LMT 1890
-4:49 - PPMT 1917 Jan 24 12:00 # P-a-P MT -4:49 - PPMT 1917 Jan 24 12:00 # P-a-P MT
......
...@@ -27,13 +27,17 @@ ...@@ -27,13 +27,17 @@
# This data is by no means authoritative; if you think you know better, # This data is by no means authoritative; if you think you know better,
# go ahead and edit the file (and please send any changes to # go ahead and edit the file (and please send any changes to
# tz@elsie.nci.nih.gov for general use in the future). # tz@iana.org for general use in the future).
# From Paul Eggert (2006-03-22): # From Paul Eggert (2006-03-22):
# A good source for time zone historical data outside the U.S. is # A good source for time zone historical data outside the U.S. is
# Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition), # Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition),
# San Diego: ACS Publications, Inc. (2003). # San Diego: ACS Publications, Inc. (2003).
# #
# For data circa 1899, a common source is:
# Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94
# <http://www.jstor.org/stable/1774359>.
#
# Gwillim Law writes that a good source # Gwillim Law writes that a good source
# for recent time zone data is the International Air Transport # for recent time zone data is the International Air Transport
# Association's Standard Schedules Information Manual (IATA SSIM), # Association's Standard Schedules Information Manual (IATA SSIM),
...@@ -404,21 +408,11 @@ Rule Arg 2008 only - Oct Sun>=15 0:00 1:00 S ...@@ -404,21 +408,11 @@ Rule Arg 2008 only - Oct Sun>=15 0:00 1:00 S
# <a/> # <a/>
# is the official page for the Province Government). # is the official page for the Province Government).
# #
# There's also a note in only one of the major national papers (La Nación) at # There's also a note in only one of the major national papers ...
# <a href="http://www.lanacion.com.ar/nota.asp?nota_id=1107912">
# http://www.lanacion.com.ar/nota.asp?nota_id=1107912 # http://www.lanacion.com.ar/nota.asp?nota_id=1107912
# </a>
#
# The press release says:
# (...) anunció que el próximo domingo a las 00:00 los puntanos deberán
# atrasar una hora sus relojes.
# #
# A partir de entonces, San Luis establecerá el huso horario propio de # The press release says [quick and dirty translation]:
# la Provincia. De esta manera, durante el periodo del calendario anual # ... announced that next Sunday, at 00:00, Puntanos (the San Luis
# 2009, el cambio horario quedará comprendido entre las 00:00 del tercer
# domingo de marzo y las 24:00 del segundo sábado de octubre.
# Quick&dirty translation
# (...) announced that next Sunday, at 00:00, Puntanos (the San Luis
# inhabitants) will have to turn back one hour their clocks # inhabitants) will have to turn back one hour their clocks
# #
# Since then, San Luis will establish its own Province timezone. Thus, # Since then, San Luis will establish its own Province timezone. Thus,
...@@ -480,6 +474,9 @@ Rule Arg 2008 only - Oct Sun>=15 0:00 1:00 S ...@@ -480,6 +474,9 @@ Rule Arg 2008 only - Oct Sun>=15 0:00 1:00 S
# rules...San Luis is still using "Western ARgentina Time" and it got # rules...San Luis is still using "Western ARgentina Time" and it got
# stuck on Summer daylight savings time even though the summer is over. # stuck on Summer daylight savings time even though the summer is over.
# From Paul Eggert (2013-02-21):
# Milne says Cordoba time was -4:16:48.2. Round to the nearest second.
# Zone NAME GMTOFF RULES FORMAT [UNTIL] # Zone NAME GMTOFF RULES FORMAT [UNTIL]
# #
# Buenos Aires (BA), Capital Federal (CF), # Buenos Aires (BA), Capital Federal (CF),
...@@ -835,9 +832,9 @@ Zone America/La_Paz -4:32:36 - LMT 1890 ...@@ -835,9 +832,9 @@ Zone America/La_Paz -4:32:36 - LMT 1890
# From Guilherme Bernardes Rodrigues (2011-10-07): # From Guilherme Bernardes Rodrigues (2011-10-07):
# There is news in the media, however there is still no decree about it. # There is news in the media, however there is still no decree about it.
# I just send a e-mail to Zulmira Brandão at # I just send a e-mail to Zulmira Brandao at
# <a href="http://pcdsh01.on.br/">http://pcdsh01.on.br/</a> the # <a href="http://pcdsh01.on.br/">http://pcdsh01.on.br/</a> the
# oficial agency about time in Brazil, and she confirmed that the old rule is # official agency about time in Brazil, and she confirmed that the old rule is
# still in force. # still in force.
# From Guilherme Bernardes Rodrigues (2011-10-14) # From Guilherme Bernardes Rodrigues (2011-10-14)
...@@ -1266,9 +1263,13 @@ Zone America/Rio_Branco -4:31:12 - LMT 1914 ...@@ -1266,9 +1263,13 @@ Zone America/Rio_Branco -4:31:12 - LMT 1914
# b. Saturday, September 1, 2012, clocks should go forward 60 minutes; that is, # b. Saturday, September 1, 2012, clocks should go forward 60 minutes; that is,
# at 23:59:59, instead of passing to 0:00, the time should be adjusted to be # at 23:59:59, instead of passing to 0:00, the time should be adjusted to be
# 01:00 on September 2. # 01:00 on September 2.
#
# Note that...this is yet another "temporary" change that will be reevaluated # From Steffen Thorsen (2013-02-15):
# AGAIN in 2013. # According to several news sources, Chile has extended DST this year,
# they will end DST later and start DST earlier than planned. They
# hope to save energy. The new end date is 2013-04-28 00:00 and new
# start date is 2013-09-08 00:00....
# http://www.gob.cl/informa/2013/02/15/gobierno-anuncia-fechas-de-cambio-de-hora-para-el-ano-2013.htm
# NOTE: ChileAQ rules for Antarctic bases are stored separately in the # NOTE: ChileAQ rules for Antarctic bases are stored separately in the
# 'antarctica' file. # 'antarctica' file.
...@@ -1311,10 +1312,8 @@ Rule Chile 2009 only - Mar Sun>=9 3:00u 0 - ...@@ -1311,10 +1312,8 @@ Rule Chile 2009 only - Mar Sun>=9 3:00u 0 -
Rule Chile 2010 only - Apr Sun>=1 3:00u 0 - Rule Chile 2010 only - Apr Sun>=1 3:00u 0 -
Rule Chile 2011 only - May Sun>=2 3:00u 0 - Rule Chile 2011 only - May Sun>=2 3:00u 0 -
Rule Chile 2011 only - Aug Sun>=16 4:00u 1:00 S Rule Chile 2011 only - Aug Sun>=16 4:00u 1:00 S
Rule Chile 2012 only - Apr Sun>=23 3:00u 0 - Rule Chile 2012 max - Apr Sun>=23 3:00u 0 -
Rule Chile 2012 only - Sep Sun>=2 4:00u 1:00 S Rule Chile 2012 max - Sep Sun>=2 4:00u 1:00 S
Rule Chile 2013 max - Mar Sun>=9 3:00u 0 -
Rule Chile 2013 max - Oct Sun>=9 4:00u 1:00 S
# IATA SSIM anomalies: (1992-02) says 1992-03-14; # IATA SSIM anomalies: (1992-02) says 1992-03-14;
# (1996-09) says 1998-03-08. Ignore these. # (1996-09) says 1998-03-08. Ignore these.
# Zone NAME GMTOFF RULES FORMAT [UNTIL] # Zone NAME GMTOFF RULES FORMAT [UNTIL]
...@@ -1336,17 +1335,23 @@ Zone Pacific/Easter -7:17:44 - LMT 1890 ...@@ -1336,17 +1335,23 @@ Zone Pacific/Easter -7:17:44 - LMT 1890
# San Felix, and Antarctic bases, are like America/Santiago. # San Felix, and Antarctic bases, are like America/Santiago.
# Colombia # Colombia
# Milne gives 4:56:16.4 for Bogota time in 1899; round to nearest. He writes,
# "A variation of fifteen minutes in the public clocks of Bogota is not rare."
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule CO 1992 only - May 3 0:00 1:00 S Rule CO 1992 only - May 3 0:00 1:00 S
Rule CO 1993 only - Apr 4 0:00 0 - Rule CO 1993 only - Apr 4 0:00 0 -
# Zone NAME GMTOFF RULES FORMAT [UNTIL] # Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone America/Bogota -4:56:20 - LMT 1884 Mar 13 Zone America/Bogota -4:56:16 - LMT 1884 Mar 13
-4:56:20 - BMT 1914 Nov 23 # Bogota Mean Time -4:56:16 - BMT 1914 Nov 23 # Bogota Mean Time
-5:00 CO CO%sT # Colombia Time -5:00 CO CO%sT # Colombia Time
# Malpelo, Providencia, San Andres # Malpelo, Providencia, San Andres
# no information; probably like America/Bogota # no information; probably like America/Bogota
# Curacao # Curacao
# Milne gives 4:35:46.9 for Curacao mean time; round to nearest.
# #
# From Paul Eggert (2006-03-22): # From Paul Eggert (2006-03-22):
# Shanks & Pottenger say that The Bottom and Philipsburg have been at # Shanks & Pottenger say that The Bottom and Philipsburg have been at
...@@ -1363,7 +1368,7 @@ Zone America/Bogota -4:56:20 - LMT 1884 Mar 13 ...@@ -1363,7 +1368,7 @@ Zone America/Bogota -4:56:20 - LMT 1884 Mar 13
# though, as far as we know. # though, as far as we know.
# #
# Zone NAME GMTOFF RULES FORMAT [UNTIL] # Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone America/Curacao -4:35:44 - LMT 1912 Feb 12 # Willemstad Zone America/Curacao -4:35:47 - LMT 1912 Feb 12 # Willemstad
-4:30 - ANT 1965 # Netherlands Antilles Time -4:30 - ANT 1965 # Netherlands Antilles Time
-4:00 - AST -4:00 - AST
...@@ -1377,6 +1382,8 @@ Link America/Curacao America/Kralendijk # Bonaire, Sint Estatius and Saba ...@@ -1377,6 +1382,8 @@ Link America/Curacao America/Kralendijk # Bonaire, Sint Estatius and Saba
# Ecuador # Ecuador
# #
# Milne says the Sentral and South American Telegraph Company used -5:24:15.
#
# From Paul Eggert (2007-03-04): # From Paul Eggert (2007-03-04):
# Apparently Ecuador had a failed experiment with DST in 1992. # Apparently Ecuador had a failed experiment with DST in 1992.
# <http://midena.gov.ec/content/view/1261/208/> (2007-02-27) and # <http://midena.gov.ec/content/view/1261/208/> (2007-02-27) and
...@@ -1582,7 +1589,16 @@ Rule Para 2005 2009 - Mar Sun>=8 0:00 0 - ...@@ -1582,7 +1589,16 @@ Rule Para 2005 2009 - Mar Sun>=8 0:00 0 -
# forward 60 minutes, in all the territory of the Paraguayan Republic. # forward 60 minutes, in all the territory of the Paraguayan Republic.
# ... # ...
Rule Para 2010 max - Oct Sun>=1 0:00 1:00 S Rule Para 2010 max - Oct Sun>=1 0:00 1:00 S
Rule Para 2010 max - Apr Sun>=8 0:00 0 - Rule Para 2010 2012 - Apr Sun>=8 0:00 0 -
#
# From Steffen Thorsen (2013-03-07):
# Paraguay will end DST on 2013-03-24 00:00....
# http://www.ande.gov.py/interna.php?id=1075
#
# From Carlos Raul Perasso (2013-03-15):
# The change in Paraguay is now final. Decree number 10780
# http://www.presidencia.gov.py/uploads/pdf/presidencia-3b86ff4b691c79d4f5927ca964922ec74772ce857c02ca054a52a37b49afc7fb.pdf
Rule Para 2013 max - Mar Sun>=22 0:00 0 -
# Zone NAME GMTOFF RULES FORMAT [UNTIL] # Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone America/Asuncion -3:50:40 - LMT 1890 Zone America/Asuncion -3:50:40 - LMT 1890
......
...@@ -65,7 +65,6 @@ AQ -6617+11031 Antarctica/Casey Casey Station, Bailey Peninsula ...@@ -65,7 +65,6 @@ AQ -6617+11031 Antarctica/Casey Casey Station, Bailey Peninsula
AQ -7824+10654 Antarctica/Vostok Vostok Station, Lake Vostok AQ -7824+10654 Antarctica/Vostok Vostok Station, Lake Vostok
AQ -6640+14001 Antarctica/DumontDUrville Dumont-d'Urville Station, Terre Adelie AQ -6640+14001 Antarctica/DumontDUrville Dumont-d'Urville Station, Terre Adelie
AQ -690022+0393524 Antarctica/Syowa Syowa Station, E Ongul I AQ -690022+0393524 Antarctica/Syowa Syowa Station, E Ongul I
AQ -5430+15857 Antarctica/Macquarie Macquarie Island Station, Macquarie Island
AR -3436-05827 America/Argentina/Buenos_Aires Buenos Aires (BA, CF) AR -3436-05827 America/Argentina/Buenos_Aires Buenos Aires (BA, CF)
AR -3124-06411 America/Argentina/Cordoba most locations (CB, CC, CN, ER, FM, MN, SE, SF) AR -3124-06411 America/Argentina/Cordoba most locations (CB, CC, CN, ER, FM, MN, SE, SF)
AR -2447-06525 America/Argentina/Salta (SA, LP, NQ, RN) AR -2447-06525 America/Argentina/Salta (SA, LP, NQ, RN)
...@@ -81,6 +80,7 @@ AR -5448-06818 America/Argentina/Ushuaia Tierra del Fuego (TF) ...@@ -81,6 +80,7 @@ AR -5448-06818 America/Argentina/Ushuaia Tierra del Fuego (TF)
AS -1416-17042 Pacific/Pago_Pago AS -1416-17042 Pacific/Pago_Pago
AT +4813+01620 Europe/Vienna AT +4813+01620 Europe/Vienna
AU -3133+15905 Australia/Lord_Howe Lord Howe Island AU -3133+15905 Australia/Lord_Howe Lord Howe Island
AU -5430+15857 Antarctica/Macquarie Macquarie Island
AU -4253+14719 Australia/Hobart Tasmania - most locations AU -4253+14719 Australia/Hobart Tasmania - most locations
AU -3956+14352 Australia/Currie Tasmania - King Island AU -3956+14352 Australia/Currie Tasmania - King Island
AU -3749+14458 Australia/Melbourne Victoria AU -3749+14458 Australia/Melbourne Victoria
...@@ -182,7 +182,8 @@ CW +1211-06900 America/Curacao ...@@ -182,7 +182,8 @@ CW +1211-06900 America/Curacao
CX -1025+10543 Indian/Christmas CX -1025+10543 Indian/Christmas
CY +3510+03322 Asia/Nicosia CY +3510+03322 Asia/Nicosia
CZ +5005+01426 Europe/Prague CZ +5005+01426 Europe/Prague
DE +5230+01322 Europe/Berlin DE +5230+01322 Europe/Berlin most locations
DE +4742+00841 Europe/Busingen Busingen
DJ +1136+04309 Africa/Djibouti DJ +1136+04309 Africa/Djibouti
DK +5540+01235 Europe/Copenhagen DK +5540+01235 Europe/Copenhagen
DM +1518-06124 America/Dominica DM +1518-06124 America/Dominica
...@@ -364,8 +365,10 @@ RU +5345+08707 Asia/Novokuznetsk Moscow+03 - Novokuznetsk ...@@ -364,8 +365,10 @@ RU +5345+08707 Asia/Novokuznetsk Moscow+03 - Novokuznetsk
RU +5601+09250 Asia/Krasnoyarsk Moscow+04 - Yenisei River RU +5601+09250 Asia/Krasnoyarsk Moscow+04 - Yenisei River
RU +5216+10420 Asia/Irkutsk Moscow+05 - Lake Baikal RU +5216+10420 Asia/Irkutsk Moscow+05 - Lake Baikal
RU +6200+12940 Asia/Yakutsk Moscow+06 - Lena River RU +6200+12940 Asia/Yakutsk Moscow+06 - Lena River
RU +623923+1353314 Asia/Khandyga Moscow+06 - Tomponsky, Ust-Maysky
RU +4310+13156 Asia/Vladivostok Moscow+07 - Amur River RU +4310+13156 Asia/Vladivostok Moscow+07 - Amur River
RU +4658+14242 Asia/Sakhalin Moscow+07 - Sakhalin Island RU +4658+14242 Asia/Sakhalin Moscow+07 - Sakhalin Island
RU +643337+1431336 Asia/Ust-Nera Moscow+07 - Oymyakonsky
RU +5934+15048 Asia/Magadan Moscow+08 - Magadan RU +5934+15048 Asia/Magadan Moscow+08 - Magadan
RU +5301+15839 Asia/Kamchatka Moscow+08 - Kamchatka RU +5301+15839 Asia/Kamchatka Moscow+08 - Kamchatka
RU +6445+17729 Asia/Anadyr Moscow+08 - Bering Sea RU +6445+17729 Asia/Anadyr Moscow+08 - Bering Sea
......
...@@ -87,9 +87,6 @@ build: $(FILES_genout_extcs) $(CHARSETS_JAR) ...@@ -87,9 +87,6 @@ build: $(FILES_genout_extcs) $(CHARSETS_JAR)
# #
# Extra rules to build character converters. # Extra rules to build character converters.
SERVICE_DESCRIPTION = java.nio.charset.spi.CharsetProvider
SERVICE_DESCRIPTION_PATH = META-INF/services/$(SERVICE_DESCRIPTION)
GENCSDATASRC = $(BUILDDIR)/tools/CharsetMapping GENCSDATASRC = $(BUILDDIR)/tools/CharsetMapping
GENCSSRCDIR = $(BUILDDIR)/tools/src/build/tools/charsetmapping GENCSSRCDIR = $(BUILDDIR)/tools/src/build/tools/charsetmapping
GENCSEXT = $(GENSRCDIR)/sun/nio/cs/ext GENCSEXT = $(GENSRCDIR)/sun/nio/cs/ext
...@@ -118,10 +115,6 @@ $(FILES_genout_extcs): \ ...@@ -118,10 +115,6 @@ $(FILES_genout_extcs): \
$(GENCSSRCDIR)/HKSCS.java $(GENCSSRCDIR)/HKSCS.java
$(BOOT_JAVA_CMD) -jar $(CHARSETMAPPING_JARFILE) $(GENCSDATASRC) $(GENCSEXT) dbcs $(BOOT_JAVA_CMD) -jar $(CHARSETMAPPING_JARFILE) $(GENCSDATASRC) $(GENCSEXT) dbcs
$(CLASSDESTDIR)/$(SERVICE_DESCRIPTION_PATH): \
$(SHARE_SRC)/classes/sun/nio/cs/ext/$(SERVICE_DESCRIPTION_PATH)
$(install-file)
# no compression unless requested # no compression unless requested
ifndef COMPRESS_JARS ifndef COMPRESS_JARS
CREATE_JAR_OPTS_NOMANIFEST = cf0 CREATE_JAR_OPTS_NOMANIFEST = cf0
...@@ -129,10 +122,9 @@ else ...@@ -129,10 +122,9 @@ else
CREATE_JAR_OPTS_NOMANIFEST = cf CREATE_JAR_OPTS_NOMANIFEST = cf
endif endif
$(CHARSETS_JAR): $(FILES_class) $(CLASSDESTDIR)/$(SERVICE_DESCRIPTION_PATH) $(FILES_DAT) $(CHARSETS_JAR): $(FILES_class) $(FILES_DAT)
$(BOOT_JAR_CMD) $(CREATE_JAR_OPTS_NOMANIFEST) $(CHARSETS_JAR) \ $(BOOT_JAR_CMD) $(CREATE_JAR_OPTS_NOMANIFEST) $(CHARSETS_JAR) \
-C $(CLASSDESTDIR) sun \ -C $(CLASSDESTDIR) sun \
-C $(CLASSDESTDIR) $(SERVICE_DESCRIPTION_PATH) \
$(BOOT_JAR_JFLAGS) $(BOOT_JAR_JFLAGS)
@$(java-vm-cleanup) @$(java-vm-cleanup)
......
#
# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation. Oracle designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#
#
# Makefile for building Mozilla JavaScript modules
#
BUILDDIR = ../../..
PRODUCT = org
include $(BUILDDIR)/common/Defs.gmk
SUBDIRS = javascript
include $(BUILDDIR)/common/Subdirs.gmk
all build clean clobber::
$(SUBDIRS-loop)
#
# Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation. Oracle designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#
#
# Makefile for building all of sun.org.mozilla.javascript.internal.*
#
BUILDDIR = ../../../..
PACKAGE = sun.org.mozilla.javascript.internal
PRODUCT = sun
include $(BUILDDIR)/common/Defs.gmk
AUTO_FILES_JAVA_DIRS = sun/org/mozilla/javascript/internal
RESOURCEDIR = \
$(CLASSDESTDIR)/sun/org/mozilla/javascript/internal/resources
FILES_copy = \
$(RESOURCEDIR)/Messages.properties \
$(RESOURCEDIR)/Messages_fr.properties
#
# Rules
#
include $(BUILDDIR)/common/Classes.gmk
all: classes copy-files
#
# Copy resource messages file for Rhino JavaScript interpreter
#
copy-files: $(FILES_copy)
$(RESOURCEDIR)/%: $(CLOSED_SRC)/share/classes/sun/org/mozilla/javascript/internal/resources/%
$(install-file)
.PHONY: copy-files
clean clobber::
$(RM) -rf $(CLASSDESTDIR)/sun/org/mozilla/javascript
...@@ -38,12 +38,10 @@ SUBDIRS_MAKEFLAGS += JAVAC_MAX_WARNINGS=true ...@@ -38,12 +38,10 @@ SUBDIRS_MAKEFLAGS += JAVAC_MAX_WARNINGS=true
SUBDIRS_MAKEFLAGS += JAVAC_WARNINGS_FATAL=true SUBDIRS_MAKEFLAGS += JAVAC_WARNINGS_FATAL=true
include $(BUILDDIR)/common/Defs.gmk include $(BUILDDIR)/common/Defs.gmk
# build sun/security/jgss/wrapper on non-windows non-macosx platforms # build sun/security/jgss/wrapper on non-windows platforms
JGSS_WRAPPER = JGSS_WRAPPER =
ifneq ($(PLATFORM), windows) ifneq ($(PLATFORM), windows)
ifneq ($(PLATFORM), macosx) JGSS_WRAPPER = jgss/wrapper
JGSS_WRAPPER = jgss/wrapper
endif
endif endif
# Build PKCS#11 on all platforms # Build PKCS#11 on all platforms
......
...@@ -124,15 +124,6 @@ CLASSDESTDIR = $(TEMPDIR)/classes ...@@ -124,15 +124,6 @@ CLASSDESTDIR = $(TEMPDIR)/classes
# #
AUTO_FILES_JAVA_DIRS = $(PKGDIR) AUTO_FILES_JAVA_DIRS = $(PKGDIR)
#
# Exclude the sources that get built by ../other/Makefile
#
AUTO_JAVA_PRUNE = \
ECParameters.java \
ECPrivateKeyImpl.java \
ECPublicKeyImpl.java \
NamedCurve.java
# #
# Some licensees do not get the native ECC sources, but we still need to # Some licensees do not get the native ECC sources, but we still need to
# be able to build "all" for them. Check here to see if the sources are # be able to build "all" for them. Check here to see if the sources are
......
...@@ -49,15 +49,6 @@ AUTO_FILES_JAVA_DIRS = \ ...@@ -49,15 +49,6 @@ AUTO_FILES_JAVA_DIRS = \
sun/security/x509 \ sun/security/x509 \
com/sun/net/ssl/internal/ssl com/sun/net/ssl/internal/ssl
#
# EC classes used by the packages above
#
FILES_java += \
sun/security/ec/ECParameters.java \
sun/security/ec/ECPrivateKeyImpl.java \
sun/security/ec/ECPublicKeyImpl.java \
sun/security/ec/NamedCurve.java
# #
# Rules # Rules
# #
......
...@@ -34,6 +34,8 @@ import java.nio.file.Path; ...@@ -34,6 +34,8 @@ import java.nio.file.Path;
import java.util.*; import java.util.*;
import javax.xml.parsers.SAXParser; import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory; import javax.xml.parsers.SAXParserFactory;
import org.xml.sax.SAXNotRecognizedException;
import org.xml.sax.SAXNotSupportedException;
/** /**
...@@ -234,6 +236,17 @@ public class CLDRConverter { ...@@ -234,6 +236,17 @@ public class CLDRConverter {
} }
} }
/**
* Configure the parser to allow access to DTDs on the file system.
*/
private static void enableFileAccess(SAXParser parser) throws SAXNotSupportedException {
try {
parser.setProperty("http://javax.xml.XMLConstants/property/accessExternalDTD", "file");
} catch (SAXNotRecognizedException ignore) {
// property requires >= JAXP 1.5
}
}
private static List<Bundle> readBundleList() throws Exception { private static List<Bundle> readBundleList() throws Exception {
ResourceBundle.Control defCon = ResourceBundle.Control.getControl(ResourceBundle.Control.FORMAT_DEFAULT); ResourceBundle.Control defCon = ResourceBundle.Control.getControl(ResourceBundle.Control.FORMAT_DEFAULT);
List<Bundle> retList = new ArrayList<>(); List<Bundle> retList = new ArrayList<>();
...@@ -279,6 +292,7 @@ public class CLDRConverter { ...@@ -279,6 +292,7 @@ public class CLDRConverter {
SAXParserFactory factory = SAXParserFactory.newInstance(); SAXParserFactory factory = SAXParserFactory.newInstance();
factory.setValidating(true); factory.setValidating(true);
SAXParser parser = factory.newSAXParser(); SAXParser parser = factory.newSAXParser();
enableFileAccess(parser);
LDMLParseHandler handler = new LDMLParseHandler(id); LDMLParseHandler handler = new LDMLParseHandler(id);
File file = new File(SOURCE_FILE_DIR + File.separator + id + ".xml"); File file = new File(SOURCE_FILE_DIR + File.separator + id + ".xml");
if (!file.exists()) { if (!file.exists()) {
...@@ -314,6 +328,7 @@ public class CLDRConverter { ...@@ -314,6 +328,7 @@ public class CLDRConverter {
SAXParserFactory factorySuppl = SAXParserFactory.newInstance(); SAXParserFactory factorySuppl = SAXParserFactory.newInstance();
factorySuppl.setValidating(true); factorySuppl.setValidating(true);
SAXParser parserSuppl = factorySuppl.newSAXParser(); SAXParser parserSuppl = factorySuppl.newSAXParser();
enableFileAccess(parserSuppl);
handlerSuppl = new SupplementDataParseHandler(); handlerSuppl = new SupplementDataParseHandler();
File fileSupply = new File(SPPL_SOURCE_FILE); File fileSupply = new File(SPPL_SOURCE_FILE);
parserSuppl.parse(fileSupply, handlerSuppl); parserSuppl.parse(fileSupply, handlerSuppl);
...@@ -322,6 +337,7 @@ public class CLDRConverter { ...@@ -322,6 +337,7 @@ public class CLDRConverter {
SAXParserFactory numberingParser = SAXParserFactory.newInstance(); SAXParserFactory numberingParser = SAXParserFactory.newInstance();
numberingParser.setValidating(true); numberingParser.setValidating(true);
SAXParser parserNumbering = numberingParser.newSAXParser(); SAXParser parserNumbering = numberingParser.newSAXParser();
enableFileAccess(parserNumbering);
handlerNumbering = new NumberingSystemsParseHandler(); handlerNumbering = new NumberingSystemsParseHandler();
File fileNumbering = new File(NUMBERING_SOURCE_FILE); File fileNumbering = new File(NUMBERING_SOURCE_FILE);
parserNumbering.parse(fileNumbering, handlerNumbering); parserNumbering.parse(fileNumbering, handlerNumbering);
...@@ -330,6 +346,7 @@ public class CLDRConverter { ...@@ -330,6 +346,7 @@ public class CLDRConverter {
SAXParserFactory metazonesParser = SAXParserFactory.newInstance(); SAXParserFactory metazonesParser = SAXParserFactory.newInstance();
metazonesParser.setValidating(true); metazonesParser.setValidating(true);
SAXParser parserMetaZones = metazonesParser.newSAXParser(); SAXParser parserMetaZones = metazonesParser.newSAXParser();
enableFileAccess(parserMetaZones);
handlerMetaZones = new MetaZonesParseHandler(); handlerMetaZones = new MetaZonesParseHandler();
File fileMetaZones = new File(METAZONES_SOURCE_FILE); File fileMetaZones = new File(METAZONES_SOURCE_FILE);
parserNumbering.parse(fileMetaZones, handlerMetaZones); parserNumbering.parse(fileMetaZones, handlerMetaZones);
......
...@@ -30,7 +30,5 @@ sun.security.krb5.Realm=sun.security.ssl.krb5.KerberosClientKeyExchangeImpl,comp ...@@ -30,7 +30,5 @@ sun.security.krb5.Realm=sun.security.ssl.krb5.KerberosClientKeyExchangeImpl,comp
# Residual references to java.beans. # Residual references to java.beans.
# The RemoveMethods tool does not yet purge the constant pool. # The RemoveMethods tool does not yet purge the constant pool.
# Rhino is due to be replaced so not worth addressing this dependency now.
# #
java.beans.PropertyChangeListener=java.util.logging.LogManager,sun.org.mozilla.javascript.internal.Context,compact1,compact2,compact3 java.beans.PropertyChangeListener=java.util.logging.LogManager,compact1,compact2,compact3
java.beans.PropertyChangeEvent=sun.org.mozilla.javascript.internal.Context,compact3
# #
# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
...@@ -432,20 +433,22 @@ endif ...@@ -432,20 +433,22 @@ endif
################################################################################################## ##################################################################################################
ifndef OPENJDK ifndef OPENJDK
DB_DEMO_ZIPFILE := $(wildcard $(JDK_TOPDIR)/src/closed/share/db/*demo*.zip) DB_DEMO_ZIPFILE := $(wildcard $(JDK_TOPDIR)/src/closed/share/db/*.zip)
$(JDK_OUTPUTDIR)/demo/_the.db.unzipped: $(DB_DEMO_ZIPFILE) $(JDK_OUTPUTDIR)/demo/_the.db.unzipped: $(DB_DEMO_ZIPFILE)
$(MKDIR) -p $(@D) $(MKDIR) -p $(@D)
$(RM) -r $(JDK_OUTPUTDIR)/demo/db $(JDK_OUTPUTDIR)/demo/demo $(RM) -r $(JDK_OUTPUTDIR)/demo/db $(JDK_OUTPUTDIR)/demo/demo
$(CD) $(JDK_OUTPUTDIR)/demo && $(UNZIP) -q -o $< $(CD) $(JDK_OUTPUTDIR)/demo && $(UNZIP) -q -o $<
$(MV) $(JDK_OUTPUTDIR)/demo/demo $(JDK_OUTPUTDIR)/demo/db $(MV) $(JDK_OUTPUTDIR)/demo/db-derby-*-bin/demo $(JDK_OUTPUTDIR)/demo/db
$(CD) $(JDK_OUTPUTDIR)/demo && $(RM) -r db-derby-*-bin
$(TOUCH) $@ $(TOUCH) $@
# Copy this after the unzip above to avoid race with directory creation and mv command. # Copy this after the unzip above to avoid race with directory creation and mv command.
$(JDK_OUTPUTDIR)/demo/db/README-JDK-DEMOS.html: \ $(JDK_OUTPUTDIR)/demo/db/README-JDK-DEMOS.html: \
$(JDK_TOPDIR)/src/closed/share/db/README-JDK-DEMOS.html \ $(JDK_TOPDIR)/src/closed/share/db/README-JDK-DEMOS.html \
| $(JDK_OUTPUTDIR)/demo/_the.db.unzipped | $(JDK_OUTPUTDIR)/demo/_the.db.unzipped
$(call install-file) $(MKDIR) -p $(@D)
$(CAT) $< | $(SED) "s/XXXX/$(shell cat $(JDK_TOPDIR)/src/closed/share/db/COPYRIGHTYEAR)/" > $@
BUILD_DEMOS += $(JDK_OUTPUTDIR)/demo/_the.db.unzipped $(JDK_OUTPUTDIR)/demo/db/README-JDK-DEMOS.html BUILD_DEMOS += $(JDK_OUTPUTDIR)/demo/_the.db.unzipped $(JDK_OUTPUTDIR)/demo/db/README-JDK-DEMOS.html
endif endif
......
...@@ -472,6 +472,7 @@ $(eval $(call SetupNativeCompilation,BUILD_UNPACKEXE,\ ...@@ -472,6 +472,7 @@ $(eval $(call SetupNativeCompilation,BUILD_UNPACKEXE,\
-D "JDK_FNAME=unpack200.exe" \ -D "JDK_FNAME=unpack200.exe" \
-D "JDK_INTERNAL_NAME=unpack200" \ -D "JDK_INTERNAL_NAME=unpack200" \
-D "JDK_FTYPE=0x1L",\ -D "JDK_FTYPE=0x1L",\
DEBUG_SYMBOLS:=true,\
MANIFEST:=$(JDK_TOPDIR)/src/windows/resource/unpack200_proto.exe.manifest)) MANIFEST:=$(JDK_TOPDIR)/src/windows/resource/unpack200_proto.exe.manifest))
ifeq ($(OPENJDK_TARGET_OS),windows) ifeq ($(OPENJDK_TARGET_OS),windows)
...@@ -555,6 +556,7 @@ ifneq ($(BUILD_JEXEC_SRC),) ...@@ -555,6 +556,7 @@ ifneq ($(BUILD_JEXEC_SRC),)
$(call SET_SHARED_LIBRARY_NAME,$(LIBRARY_PREFIX)$(SHARED_LIBRARY_SUFFIX)), \ $(call SET_SHARED_LIBRARY_NAME,$(LIBRARY_PREFIX)$(SHARED_LIBRARY_SUFFIX)), \
OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/jexec_obj,\ OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/jexec_obj,\
OUTPUT_DIR:=$(BUILD_JEXEC_DST_DIR),\ OUTPUT_DIR:=$(BUILD_JEXEC_DST_DIR),\
DEBUG_SYMBOLS:=true,\
PROGRAM:=jexec)) PROGRAM:=jexec))
BUILD_LAUNCHERS += $(BUILD_JEXEC) BUILD_LAUNCHERS += $(BUILD_JEXEC)
......
...@@ -2560,7 +2560,6 @@ BUILD_LIBRARIES += $(BUILD_LIBJ2PCSC) ...@@ -2560,7 +2560,6 @@ BUILD_LIBRARIES += $(BUILD_LIBJ2PCSC)
########################################################################################## ##########################################################################################
ifneq ($(OPENJDK_TARGET_OS), windows) ifneq ($(OPENJDK_TARGET_OS), windows)
ifneq ($(OPENJDK_TARGET_OS), macosx)
$(eval $(call SetupNativeCompilation,BUILD_LIBJ2GSS,\ $(eval $(call SetupNativeCompilation,BUILD_LIBJ2GSS,\
LIBRARY:=j2gss,\ LIBRARY:=j2gss,\
OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\ OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
...@@ -2581,7 +2580,6 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBJ2GSS,\ ...@@ -2581,7 +2580,6 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBJ2GSS,\
BUILD_LIBRARIES += $(BUILD_LIBJ2GSS) BUILD_LIBRARIES += $(BUILD_LIBJ2GSS)
endif endif
endif
########################################################################################## ##########################################################################################
......
...@@ -458,24 +458,6 @@ endif # OPENJDK ...@@ -458,24 +458,6 @@ endif # OPENJDK
ifndef OPENJDK ifndef OPENJDK
JS_RESOURCES_FILES := Messages.properties Messages_fr.properties
JS_RESOURCES_SRC_DIR := $(JDK_TOPDIR)/src/closed/share/classes/sun/org/mozilla/javascript/internal/resources
JS_RESOURCES_DST_DIR := $(JDK_OUTPUTDIR)/classes/sun/org/mozilla/javascript/internal/resources
JS_RESOURCES_SRC := $(foreach F,$(JS_RESOURCES_FILES),$(JS_RESOURCES_SRC_DIR)/$(F))
JS_RESOURCES_DST := $(foreach F,$(JS_RESOURCES_FILES),$(JS_RESOURCES_DST_DIR)/$(F))
$(JS_RESOURCES_DST_DIR)/% : $(JS_RESOURCES_SRC_DIR)/%
$(call install-file)
COPY_FILES += $(JS_RESOURCES_DST)
endif
##########################################################################################
ifndef OPENJDK
# #
# Solaris X11 Direct Graphics Access library # Solaris X11 Direct Graphics Access library
# #
......
...@@ -172,10 +172,6 @@ ifneq ($(ALL_META-INF_DIRS_targetapi),) ...@@ -172,10 +172,6 @@ ifneq ($(ALL_META-INF_DIRS_targetapi),)
else else
ALL_META-INF_DIRS:=$(ALL_META-INF_DIRS_share) ALL_META-INF_DIRS:=$(ALL_META-INF_DIRS_share)
endif endif
# Filter out META-INF dirs that shouldn't be included
ifdef OPENJDK
ALL_META-INF_DIRS:=$(filter-out %com/sun/script/javascript/META-INF,$(ALL_META-INF_DIRS))
endif
ifndef OPENJDK ifndef OPENJDK
ALL_META-INF_DIRS += $(JDK_TOPDIR)/src/closed/share/classes/sun/java2d/cmm/kcms/META-INF ALL_META-INF_DIRS += $(JDK_TOPDIR)/src/closed/share/classes/sun/java2d/cmm/kcms/META-INF
......
...@@ -201,7 +201,6 @@ RT_JAR_EXCLUDES += \ ...@@ -201,7 +201,6 @@ RT_JAR_EXCLUDES += \
META-INF/services/com.sun.jdi.connect.spi.TransportService \ META-INF/services/com.sun.jdi.connect.spi.TransportService \
META-INF/services/com.sun.tools.attach.spi.AttachProvider \ META-INF/services/com.sun.tools.attach.spi.AttachProvider \
META-INF/services/com.sun.tools.xjc.Plugin \ META-INF/services/com.sun.tools.xjc.Plugin \
META-INF/services/java.nio.charset.spi.CharsetProvider \
META-INF/services/sun.net.spi.nameservice.NameServiceDescriptor \ META-INF/services/sun.net.spi.nameservice.NameServiceDescriptor \
org/relaxng/datatype \ org/relaxng/datatype \
sun/awt/HKSCS.class \ sun/awt/HKSCS.class \
...@@ -217,19 +216,7 @@ RT_JAR_EXCLUDES += \ ...@@ -217,19 +216,7 @@ RT_JAR_EXCLUDES += \
sun/net/spi/nameservice/dns \ sun/net/spi/nameservice/dns \
sun/nio/cs/ext \ sun/nio/cs/ext \
sun/rmi/rmic \ sun/rmi/rmic \
sun/security/ec/ECDHKeyAgreement.class \ sun/security/ec \
sun/security/ec/ECDSASignature.class \
sun/security/ec/ECDSASignature\$$$$Raw.class \
sun/security/ec/ECDSASignature\$$$$SHA1.class \
sun/security/ec/ECDSASignature\$$$$SHA224.class \
sun/security/ec/ECDSASignature\$$$$SHA256.class \
sun/security/ec/ECDSASignature\$$$$SHA384.class \
sun/security/ec/ECDSASignature\$$$$SHA512.class \
sun/security/ec/ECKeyFactory.class \
sun/security/ec/ECKeyPairGenerator.class \
sun/security/ec/SunEC\$$$$1.class \
sun/security/ec/SunEC.class \
sun/security/ec/SunECEntries.class \
sun/security/internal \ sun/security/internal \
sun/security/mscapi \ sun/security/mscapi \
sun/security/pkcs11 \ sun/security/pkcs11 \
...@@ -428,8 +415,7 @@ $(eval $(call SetupArchive,BUILD_CHARSETS_JAR,,\ ...@@ -428,8 +415,7 @@ $(eval $(call SetupArchive,BUILD_CHARSETS_JAR,,\
SUFFIXES:=.class .dat,\ SUFFIXES:=.class .dat,\
INCLUDES:=sun/nio/cs/ext,\ INCLUDES:=sun/nio/cs/ext,\
EXTRA_FILES := sun/awt/HKSCS.class \ EXTRA_FILES := sun/awt/HKSCS.class \
$(CHARSETS_EXTRA_FILES) \ $(CHARSETS_EXTRA_FILES), \
META-INF/services/java.nio.charset.spi.CharsetProvider, \
JAR:=$(IMAGES_OUTPUTDIR)/lib/charsets.jar, \ JAR:=$(IMAGES_OUTPUTDIR)/lib/charsets.jar, \
SKIP_METAINF := true, \ SKIP_METAINF := true, \
CHECK_COMPRESS_JAR:=true)) CHECK_COMPRESS_JAR:=true))
......
...@@ -68,10 +68,17 @@ BEANS_SRC = $(BEANS:%=$(JDK_TOPDIR)/src/share/classes/javax/swing/%.java) \ ...@@ -68,10 +68,17 @@ BEANS_SRC = $(BEANS:%=$(JDK_TOPDIR)/src/share/classes/javax/swing/%.java) \
# Dummy variable so far, in the old build system it was false by default # Dummy variable so far, in the old build system it was false by default
SWINGBEAN_DEBUG_FLAG = false SWINGBEAN_DEBUG_FLAG = false
# GenDocletBeanInfo is compiled in Tools.gmk and picks up from $(JDK_OUTPUTDIR)/btclasses # GenDocletBeanInfo is compiled in Tools.gmk and picks up from $(JDK_OUTPUTDIR)/btclasses
$(JDK_OUTPUTDIR)/gensrc_no_srczip/_the.generated_beaninfo: $(BEANS_SRC) $(JDK_OUTPUTDIR)/gensrc_no_srczip/javax/swing/SwingBeanInfoBase.java $(JDK_OUTPUTDIR)/gensrc/sun/swing/BeanInfoUtils.java $(BUILD_TOOLS) # LocaleDataMetaInfo needs to be generated before running this to avoid confusing errors
# in the build log.
$(JDK_OUTPUTDIR)/gensrc_no_srczip/_the.generated_beaninfo: $(BEANS_SRC) \
$(JDK_OUTPUTDIR)/gensrc_no_srczip/javax/swing/SwingBeanInfoBase.java \
$(JDK_OUTPUTDIR)/gensrc/sun/swing/BeanInfoUtils.java $(BUILD_TOOLS) \
| $(GENSRC_LOCALEDATAMETAINFO)
$(ECHO) Generating beaninfo $(ECHO) Generating beaninfo
$(MKDIR) -p $(JDK_OUTPUTDIR)/gensrc_no_srczip/javax/swing $(MKDIR) -p $(JDK_OUTPUTDIR)/gensrc_no_srczip/javax/swing
$(JAVA) -Djava.awt.headless=true $(NEW_JAVADOC) -doclet GenDocletBeanInfo \ $(JAVA) -Djava.awt.headless=true $(NEW_JAVADOC) \
-sourcepath "$(JDK_TOPDIR)/src/share/classes$(PATH_SEP)$(JDK_OUTPUTDIR)/gensrc" \
-doclet GenDocletBeanInfo \
-x $(SWINGBEAN_DEBUG_FLAG) -d $(JDK_OUTPUTDIR)/gensrc_no_srczip/javax/swing \ -x $(SWINGBEAN_DEBUG_FLAG) -d $(JDK_OUTPUTDIR)/gensrc_no_srczip/javax/swing \
-t $(DOCLETSRC_DIR)/SwingBeanInfo.template -docletpath $(JDK_OUTPUTDIR)/btclasses \ -t $(DOCLETSRC_DIR)/SwingBeanInfo.template -docletpath $(JDK_OUTPUTDIR)/btclasses \
-XDignore.symbol.file=true \ -XDignore.symbol.file=true \
......
...@@ -352,11 +352,8 @@ ifneq ($(OPENJDK_TARGET_OS),windows) ...@@ -352,11 +352,8 @@ ifneq ($(OPENJDK_TARGET_OS),windows)
JDK_MAN_PAGES += jvisualvm.1 JDK_MAN_PAGES += jvisualvm.1
endif endif
ifndef OPENJDK # This variable is potentially overridden in the closed makefile.
MAN_SRC_BASEDIR:=$(JDK_TOPDIR)/src/closed MAN_SRC_BASEDIR ?= $(JDK_TOPDIR)/src
else
MAN_SRC_BASEDIR:=$(JDK_TOPDIR)/src
endif
ifeq ($(OPENJDK_TARGET_OS), linux) ifeq ($(OPENJDK_TARGET_OS), linux)
MAN_SRC_DIR:=$(MAN_SRC_BASEDIR)/linux/doc MAN_SRC_DIR:=$(MAN_SRC_BASEDIR)/linux/doc
...@@ -532,17 +529,22 @@ ifndef OPENJDK ...@@ -532,17 +529,22 @@ ifndef OPENJDK
$(IMAGES_OUTPUTDIR)/_unzip/%.unzipped: $(JDK_TOPDIR)/src/closed/share/db/% $(IMAGES_OUTPUTDIR)/_unzip/%.unzipped: $(JDK_TOPDIR)/src/closed/share/db/%
$(ECHO) Unzipping $(patsubst $(SRC_ROOT)/%,%,$<) $(ECHO) Unzipping $(patsubst $(SRC_ROOT)/%,%,$<)
$(MKDIR) -p $(JDK_IMAGE_DIR)/db $(MKDIR) -p $(JDK_IMAGE_DIR)/db
cd $(JDK_IMAGE_DIR)/db && $(UNZIP) -q -o $< -x index.html 2> /dev/null cd $(JDK_IMAGE_DIR)/db && $(UNZIP) -q -o $< -x */index.html */KEYS */test/* *javadoc/* */docs/* */demo/* 2> /dev/null
cd $(JDK_IMAGE_DIR)/db && $(MV) db-derby-*-bin/* . && $(RM) -r db-derby-*-bin
$(MKDIR) -p $(@D) $(MKDIR) -p $(@D)
$(TOUCH) $@ $(TOUCH) $@
$(JDK_IMAGE_DIR)/db/README-JDK.html: $(JDK_TOPDIR)/src/closed/share/db/README-JDK.html $(JDK_IMAGE_DIR)/db/README-JDK.html: $(JDK_TOPDIR)/src/closed/share/db/README-JDK.html
$(ECHO) $(LOG_INFO) Copying '$(patsubst $(OUTPUT_ROOT)/%,%,$@)' $(ECHO) $(LOG_INFO) Copying '$(patsubst $(OUTPUT_ROOT)/%,%,$@)'
$(install-file) $(CAT) $< | $(SED) "s/XXXX/$(shell cat $(JDK_TOPDIR)/src/closed/share/db/COPYRIGHTYEAR)/" > $@
$(JDK_IMAGE_DIR)/db/3RDPARTY: $(JDK_TOPDIR)/src/closed/share/db/3RDPARTY
$(ECHO) $(LOG_INFO) Copying '$(patsubst $(OUTPUT_ROOT)/%,%,$@)'
$(CAT) $< | $(SED) "s/XXXX/$(shell cat $(JDK_TOPDIR)/src/closed/share/db/COPYRIGHTYEAR)/" > $@
JDK_DB_TARGETS := $(patsubst $(JDK_TOPDIR)/src/closed/share/db/%,$(IMAGES_OUTPUTDIR)/_unzip/%.unzipped,\ JDK_DB_TARGETS := $(patsubst $(JDK_TOPDIR)/src/closed/share/db/%,$(IMAGES_OUTPUTDIR)/_unzip/%.unzipped,\
$(call not-containing,demo,$(wildcard $(JDK_TOPDIR)/src/closed/share/db/*.zip))) \ $(wildcard $(JDK_TOPDIR)/src/closed/share/db/*.zip)) \
$(JDK_IMAGE_DIR)/db/README-JDK.html $(JDK_IMAGE_DIR)/db/README-JDK.html $(JDK_IMAGE_DIR)/db/3RDPARTY
endif endif
......
...@@ -86,6 +86,7 @@ SUNWprivate_1.1 { ...@@ -86,6 +86,7 @@ SUNWprivate_1.1 {
Java_sun_java2d_pipe_ShapeSpanIterator_setRule; Java_sun_java2d_pipe_ShapeSpanIterator_setRule;
Java_sun_java2d_pipe_ShapeSpanIterator_skipDownTo; Java_sun_java2d_pipe_ShapeSpanIterator_skipDownTo;
Java_java_awt_Choice_initIDs;
Java_java_awt_Dimension_initIDs; Java_java_awt_Dimension_initIDs;
Java_java_awt_event_MouseEvent_initIDs; Java_java_awt_event_MouseEvent_initIDs;
Java_java_awt_image_DataBufferInt_initIDs; Java_java_awt_image_DataBufferInt_initIDs;
......
...@@ -86,6 +86,7 @@ SUNWprivate_1.1 { ...@@ -86,6 +86,7 @@ SUNWprivate_1.1 {
Java_sun_java2d_pipe_ShapeSpanIterator_setRule; Java_sun_java2d_pipe_ShapeSpanIterator_setRule;
Java_sun_java2d_pipe_ShapeSpanIterator_skipDownTo; Java_sun_java2d_pipe_ShapeSpanIterator_skipDownTo;
Java_java_awt_Choice_initIDs;
Java_java_awt_Dimension_initIDs; Java_java_awt_Dimension_initIDs;
Java_java_awt_event_MouseEvent_initIDs; Java_java_awt_event_MouseEvent_initIDs;
Java_java_awt_image_DataBufferInt_initIDs; Java_java_awt_image_DataBufferInt_initIDs;
......
...@@ -57,6 +57,7 @@ PROFILE_1_RTJAR_INCLUDE_PACKAGES := \ ...@@ -57,6 +57,7 @@ PROFILE_1_RTJAR_INCLUDE_PACKAGES := \
java/time \ java/time \
java/util \ java/util \
javax/net \ javax/net \
javax/script \
javax/security \ javax/security \
jdk \ jdk \
sun/invoke \ sun/invoke \
...@@ -111,7 +112,6 @@ PROFILE_3_RTJAR_INCLUDE_PACKAGES := \ ...@@ -111,7 +112,6 @@ PROFILE_3_RTJAR_INCLUDE_PACKAGES := \
com/sun/nio/sctp \ com/sun/nio/sctp \
com/sun/org/apache/xml/internal/security \ com/sun/org/apache/xml/internal/security \
com/sun/rowset \ com/sun/rowset \
com/sun/script \
com/sun/security/auth \ com/sun/security/auth \
com/sun/security/jgss \ com/sun/security/jgss \
com/sun/security/ntlm \ com/sun/security/ntlm \
...@@ -125,7 +125,6 @@ PROFILE_3_RTJAR_INCLUDE_PACKAGES := \ ...@@ -125,7 +125,6 @@ PROFILE_3_RTJAR_INCLUDE_PACKAGES := \
javax/lang/model \ javax/lang/model \
javax/management \ javax/management \
javax/naming \ javax/naming \
javax/script \
javax/security/auth/kerberos \ javax/security/auth/kerberos \
javax/security/sasl \ javax/security/sasl \
javax/smartcardio \ javax/smartcardio \
...@@ -140,7 +139,6 @@ PROFILE_3_RTJAR_INCLUDE_PACKAGES := \ ...@@ -140,7 +139,6 @@ PROFILE_3_RTJAR_INCLUDE_PACKAGES := \
sun/net/www/protocol/http/ntlm \ sun/net/www/protocol/http/ntlm \
sun/net/www/protocol/http/spnego \ sun/net/www/protocol/http/spnego \
sun/nio/ch/sctp \ sun/nio/ch/sctp \
sun/org/mozilla \
sun/security/acl \ sun/security/acl \
sun/security/jgss \ sun/security/jgss \
sun/security/krb5 \ sun/security/krb5 \
...@@ -161,10 +159,6 @@ PROFILE_3_RTJAR_EXCLUDE_TYPES := \ ...@@ -161,10 +159,6 @@ PROFILE_3_RTJAR_EXCLUDE_TYPES := \
javax/management/remote/rmi/_RMIServerImpl_Tie.class \ javax/management/remote/rmi/_RMIServerImpl_Tie.class \
javax/management/remote/rmi/_RMIServer_Stub.class javax/management/remote/rmi/_RMIServer_Stub.class
PROFILE_3_INCLUDE_METAINF_SERVICES := \
META-INF/services/javax.script.ScriptEngineFactory
FULL_JRE_RTJAR_INCLUDE_PACKAGES := \ FULL_JRE_RTJAR_INCLUDE_PACKAGES := \
com/oracle \ com/oracle \
com/sun/accessibility/internal/resources \ com/sun/accessibility/internal/resources \
......
/* /*
* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -56,6 +56,8 @@ final class LWScrollBarPeer extends LWComponentPeer<Scrollbar, JScrollBar> ...@@ -56,6 +56,8 @@ final class LWScrollBarPeer extends LWComponentPeer<Scrollbar, JScrollBar>
void initializeImpl() { void initializeImpl() {
super.initializeImpl(); super.initializeImpl();
final Scrollbar target = getTarget(); final Scrollbar target = getTarget();
setLineIncrement(target.getUnitIncrement());
setPageIncrement(target.getBlockIncrement());
setValues(target.getValue(), target.getVisibleAmount(), setValues(target.getValue(), target.getVisibleAmount(),
target.getMinimum(), target.getMaximum()); target.getMinimum(), target.getMaximum());
......
...@@ -53,7 +53,12 @@ public abstract class LWToolkit extends SunToolkit implements Runnable { ...@@ -53,7 +53,12 @@ public abstract class LWToolkit extends SunToolkit implements Runnable {
private Clipboard clipboard; private Clipboard clipboard;
private MouseInfoPeer mouseInfoPeer; private MouseInfoPeer mouseInfoPeer;
public LWToolkit() { /**
* Dynamic Layout Resize client code setting.
*/
private volatile boolean dynamicLayoutSetting = true;
protected LWToolkit() {
} }
/* /*
...@@ -563,4 +568,37 @@ public abstract class LWToolkit extends SunToolkit implements Runnable { ...@@ -563,4 +568,37 @@ public abstract class LWToolkit extends SunToolkit implements Runnable {
((LWWindowPeer)w.getPeer()).ungrab(false); ((LWWindowPeer)w.getPeer()).ungrab(false);
} }
} }
@Override
protected final Object lazilyLoadDesktopProperty(final String name) {
if (name.equals("awt.dynamicLayoutSupported")) {
return isDynamicLayoutSupported();
}
return super.lazilyLoadDesktopProperty(name);
}
@Override
public final void setDynamicLayout(final boolean dynamic) {
dynamicLayoutSetting = dynamic;
}
@Override
protected final boolean isDynamicLayoutSet() {
return dynamicLayoutSetting;
}
@Override
public final boolean isDynamicLayoutActive() {
// "Live resizing" is active by default and user's data is ignored.
return isDynamicLayoutSupported();
}
/**
* Returns true if dynamic layout of Containers on resize is supported by
* the underlying operating system and/or window manager.
*/
protected final boolean isDynamicLayoutSupported() {
// "Live resizing" is supported by default.
return true;
}
} }
...@@ -35,6 +35,7 @@ import java.security.PrivilegedAction; ...@@ -35,6 +35,7 @@ import java.security.PrivilegedAction;
import javax.print.*; import javax.print.*;
import javax.print.attribute.PrintRequestAttributeSet; import javax.print.attribute.PrintRequestAttributeSet;
import javax.print.attribute.HashPrintRequestAttributeSet;
import sun.java2d.*; import sun.java2d.*;
import sun.print.*; import sun.print.*;
...@@ -96,6 +97,14 @@ public class CPrinterJob extends RasterPrinterJob { ...@@ -96,6 +97,14 @@ public class CPrinterJob extends RasterPrinterJob {
return false; return false;
} }
if (attributes == null) {
attributes = new HashPrintRequestAttributeSet();
}
if (getPrintService() instanceof StreamPrintService) {
return super.printDialog(attributes);
}
return jobSetup(getPageable(), checkAllowedToPrintToFile()); return jobSetup(getPageable(), checkAllowedToPrintToFile());
} }
...@@ -130,6 +139,10 @@ public class CPrinterJob extends RasterPrinterJob { ...@@ -130,6 +139,10 @@ public class CPrinterJob extends RasterPrinterJob {
return page; return page;
} }
if (getPrintService() instanceof StreamPrintService) {
return super.pageDialog(page);
}
PageFormat pageClone = (PageFormat) page.clone(); PageFormat pageClone = (PageFormat) page.clone();
boolean doIt = pageSetup(pageClone, null); boolean doIt = pageSetup(pageClone, null);
return doIt ? pageClone : page; return doIt ? pageClone : page;
......
/* /*
* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#import "LWCToolkit.h" #import "LWCToolkit.h"
#import <JavaNativeFoundation/JavaNativeFoundation.h> #import <JavaNativeFoundation/JavaNativeFoundation.h>
#import <QuartzCore/CATransaction.h>
@implementation AWTSurfaceLayers @implementation AWTSurfaceLayers
...@@ -74,14 +75,12 @@ ...@@ -74,14 +75,12 @@
} }
- (void) setBounds:(CGRect)rect { - (void) setBounds:(CGRect)rect {
layer.anchorPoint = CGPointMake(0, 0);
// translates values to the coordinate system of the "root" layer // translates values to the coordinate system of the "root" layer
CGFloat newY = windowLayer.bounds.size.height - rect.origin.y - rect.size.height; rect.origin.y = windowLayer.bounds.size.height - rect.origin.y - rect.size.height;
CGRect newRect = CGRectMake(rect.origin.x, newY, rect.size.width, rect.size.height); [CATransaction begin];
[CATransaction setDisableActions:YES];
layer.frame = newRect; layer.frame = rect;
[CATransaction commit];
[AWTSurfaceLayers repaintLayersRecursively:layer]; [AWTSurfaceLayers repaintLayersRecursively:layer];
} }
......
/* /*
* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -64,11 +64,13 @@ AWT_ASSERT_APPKIT_THREAD; ...@@ -64,11 +64,13 @@ AWT_ASSERT_APPKIT_THREAD;
//Disable CALayer's default animation //Disable CALayer's default animation
NSMutableDictionary * actions = [[NSMutableDictionary alloc] initWithObjectsAndKeys: NSMutableDictionary * actions = [[NSMutableDictionary alloc] initWithObjectsAndKeys:
[NSNull null], @"anchorPoint",
[NSNull null], @"bounds", [NSNull null], @"bounds",
[NSNull null], @"contents", [NSNull null], @"contents",
[NSNull null], @"contentsScale", [NSNull null], @"contentsScale",
[NSNull null], @"onOrderIn", [NSNull null], @"onOrderIn",
[NSNull null], @"onOrderOut", [NSNull null], @"onOrderOut",
[NSNull null], @"position",
[NSNull null], @"sublayers", [NSNull null], @"sublayers",
nil]; nil];
self.actions = actions; self.actions = actions;
......
/* /*
* Copyright (c) 1995, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -149,12 +149,15 @@ static int KnownVMIndex(const char* name); ...@@ -149,12 +149,15 @@ static int KnownVMIndex(const char* name);
static void FreeKnownVMs(); static void FreeKnownVMs();
static jboolean IsWildCardEnabled(); static jboolean IsWildCardEnabled();
#define ARG_CHECK(n, f, a) if (n < 1) { \ #define ARG_CHECK(AC_arg_count, AC_failure_message, AC_questionable_arg) \
JLI_ReportErrorMessage(f, a); \ do { \
printUsage = JNI_TRUE; \ if (AC_arg_count < 1) { \
*pret = 1; \ JLI_ReportErrorMessage(AC_failure_message, AC_questionable_arg); \
return JNI_TRUE; \ printUsage = JNI_TRUE; \
} *pret = 1; \
return JNI_TRUE; \
} \
} while (JNI_FALSE)
/* /*
* Running Java code in primordial thread caused many problems. We will * Running Java code in primordial thread caused many problems. We will
...@@ -310,29 +313,37 @@ JLI_Launch(int argc, char ** argv, /* main argc, argc */ ...@@ -310,29 +313,37 @@ JLI_Launch(int argc, char ** argv, /* main argc, argc */
* mainThread.isAlive() to work as expected. * mainThread.isAlive() to work as expected.
*/ */
#define LEAVE() \ #define LEAVE() \
if ((*vm)->DetachCurrentThread(vm) != 0) { \ do { \
JLI_ReportErrorMessage(JVM_ERROR2); \ if ((*vm)->DetachCurrentThread(vm) != JNI_OK) { \
ret = 1; \ JLI_ReportErrorMessage(JVM_ERROR2); \
} \ ret = 1; \
(*vm)->DestroyJavaVM(vm); \ } \
return ret \ if (JNI_TRUE) { \
(*vm)->DestroyJavaVM(vm); \
#define CHECK_EXCEPTION_NULL_LEAVE(e) \ return ret; \
if ((*env)->ExceptionOccurred(env)) { \ } \
JLI_ReportExceptionDescription(env); \ } while (JNI_FALSE)
LEAVE(); \
} \ #define CHECK_EXCEPTION_NULL_LEAVE(CENL_exception) \
if ((e) == NULL) { \ do { \
JLI_ReportErrorMessage(JNI_ERROR); \ if ((*env)->ExceptionOccurred(env)) { \
LEAVE(); \ JLI_ReportExceptionDescription(env); \
} LEAVE(); \
} \
#define CHECK_EXCEPTION_LEAVE(rv) \ if ((CENL_exception) == NULL) { \
if ((*env)->ExceptionOccurred(env)) { \ JLI_ReportErrorMessage(JNI_ERROR); \
JLI_ReportExceptionDescription(env); \ LEAVE(); \
ret = (rv); \ } \
LEAVE(); \ } while (JNI_FALSE)
}
#define CHECK_EXCEPTION_LEAVE(CEL_return_value) \
do { \
if ((*env)->ExceptionOccurred(env)) { \
JLI_ReportExceptionDescription(env); \
ret = (CEL_return_value); \
LEAVE(); \
} \
} while (JNI_FALSE)
int JNICALL int JNICALL
JavaMain(void * _args) JavaMain(void * _args)
...@@ -434,7 +445,7 @@ JavaMain(void * _args) ...@@ -434,7 +445,7 @@ JavaMain(void * _args)
* consistent in the UI we need to track and report the application main class. * consistent in the UI we need to track and report the application main class.
*/ */
appClass = GetApplicationClass(env); appClass = GetApplicationClass(env);
NULL_CHECK(appClass); NULL_CHECK_RETURN_VALUE(appClass, -1);
/* /*
* PostJVMInit uses the class name as the application name for GUI purposes, * PostJVMInit uses the class name as the application name for GUI purposes,
* for example, on OSX this sets the application name in the menu bar for * for example, on OSX this sets the application name in the menu bar for
......
/* /*
* Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -242,14 +242,18 @@ typedef struct { ...@@ -242,14 +242,18 @@ typedef struct {
InvocationFunctions ifn; InvocationFunctions ifn;
} JavaMainArgs; } JavaMainArgs;
#define NULL_CHECK0(e) if ((e) == 0) { \ #define NULL_CHECK_RETURN_VALUE(NCRV_check_pointer, NCRV_return_value) \
JLI_ReportErrorMessage(JNI_ERROR); \ do { \
return 0; \ if ((NCRV_check_pointer) == NULL) { \
} JLI_ReportErrorMessage(JNI_ERROR); \
return NCRV_return_value; \
} \
} while (JNI_FALSE)
#define NULL_CHECK(e) if ((e) == 0) { \ #define NULL_CHECK0(NC0_check_pointer) \
JLI_ReportErrorMessage(JNI_ERROR); \ NULL_CHECK_RETURN_VALUE(NC0_check_pointer, 0)
return; \
} #define NULL_CHECK(NC_check_pointer) \
NULL_CHECK_RETURN_VALUE(NC_check_pointer, )
#endif /* _JAVA_H_ */ #endif /* _JAVA_H_ */
/* /*
* Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -136,8 +136,10 @@ WildcardIterator_for(const char *wildcard) ...@@ -136,8 +136,10 @@ WildcardIterator_for(const char *wildcard)
{ {
WildcardIterator it = NEW_(WildcardIterator); WildcardIterator it = NEW_(WildcardIterator);
HANDLE handle = FindFirstFile(wildcard, &find_data); HANDLE handle = FindFirstFile(wildcard, &find_data);
if (handle == INVALID_HANDLE_VALUE) if (handle == INVALID_HANDLE_VALUE) {
JLI_MemFree(it);
return NULL; return NULL;
}
it->handle = handle; it->handle = handle;
it->firstFile = find_data.cFileName; it->firstFile = find_data.cFileName;
return it; return it;
......
...@@ -790,16 +790,12 @@ public class GIFImageReader extends ImageReader { ...@@ -790,16 +790,12 @@ public class GIFImageReader extends ImageReader {
} }
private void startPass(int pass) { private void startPass(int pass) {
if (updateListeners == null) { if (updateListeners == null || !imageMetadata.interlaceFlag) {
return; return;
} }
int y = 0; int y = interlaceOffset[interlacePass];
int yStep = 1; int yStep = interlaceIncrement[interlacePass];
if (imageMetadata.interlaceFlag) {
y = interlaceOffset[interlacePass];
yStep = interlaceIncrement[interlacePass];
}
int[] vals = ReaderUtil. int[] vals = ReaderUtil.
computeUpdatedPixels(sourceRegion, computeUpdatedPixels(sourceRegion,
......
...@@ -99,6 +99,7 @@ class Attribute implements Comparable<Attribute> { ...@@ -99,6 +99,7 @@ class Attribute implements Comparable<Attribute> {
return this == def.canon; return this == def.canon;
} }
@Override
public int compareTo(Attribute that) { public int compareTo(Attribute that) {
return this.def.compareTo(that.def); return this.def.compareTo(that.def);
} }
...@@ -212,20 +213,20 @@ class Attribute implements Comparable<Attribute> { ...@@ -212,20 +213,20 @@ class Attribute implements Comparable<Attribute> {
// Metadata. // Metadata.
// //
// We define metadata using similar layouts // We define metadata using similar layouts
// for all five kinds of metadata attributes. // for all five kinds of metadata attributes and 2 type metadata attributes
// //
// Regular annotations are a counted list of [RSHNH[RUH(1)]][...] // Regular annotations are a counted list of [RSHNH[RUH(1)]][...]
// pack.method.attribute.RuntimeVisibleAnnotations=[NH[(1)]][RSHNH[RUH(1)]][TB...] // pack.method.attribute.RuntimeVisibleAnnotations=[NH[(1)]][RSHNH[RUH(1)]][TB...]
// //
// Parameter annotations are a counted list of regular annotations. // Parameter annotations are a counted list of regular annotations.
// pack.method.attribute.RuntimeVisibleParameterAnnotations=[NH[(1)]][NH[(1)]][RSHNH[RUH(1)]][TB...] // pack.method.attribute.RuntimeVisibleParameterAnnotations=[NB[(1)]][NH[(1)]][RSHNH[RUH(1)]][TB...]
// //
// RuntimeInvisible annotations are defined similarly... // RuntimeInvisible annotations are defined similarly...
// Non-method annotations are defined similarly... // Non-method annotations are defined similarly...
// //
// Annotation are a simple tagged value [TB...] // Annotation are a simple tagged value [TB...]
// pack.attribute.method.AnnotationDefault=[TB...] // pack.attribute.method.AnnotationDefault=[TB...]
//
static { static {
String mdLayouts[] = { String mdLayouts[] = {
Attribute.normalizeLayoutString Attribute.normalizeLayoutString
...@@ -238,6 +239,9 @@ class Attribute implements Comparable<Attribute> { ...@@ -238,6 +239,9 @@ class Attribute implements Comparable<Attribute> {
+"\n # annotations :=" +"\n # annotations :="
+"\n [ NH[(1)] ] # forward call to annotation" +"\n [ NH[(1)] ] # forward call to annotation"
+"\n " +"\n "
),
Attribute.normalizeLayoutString
(""
+"\n # annotation :=" +"\n # annotation :="
+"\n [RSH" +"\n [RSH"
+"\n NH[RUH (1)] # forward call to value" +"\n NH[RUH (1)] # forward call to value"
...@@ -259,24 +263,67 @@ class Attribute implements Comparable<Attribute> { ...@@ -259,24 +263,67 @@ class Attribute implements Comparable<Attribute> {
+"\n ()[] ]" +"\n ()[] ]"
) )
}; };
/*
* RuntimeVisibleTypeAnnotation and RuntimeInvisibleTypeAnnotatation are
* similar to RuntimeVisibleAnnotation and RuntimeInvisibleAnnotation,
* a type-annotation union and a type-path structure precedes the
* annotation structure
*/
String typeLayouts[] = {
Attribute.normalizeLayoutString
(""
+"\n # type-annotations :="
+"\n [ NH[(1)(2)(3)] ] # forward call to type-annotations"
),
Attribute.normalizeLayoutString
( ""
+"\n # type-annotation :="
+"\n [TB"
+"\n (0-1) [B] # {CLASS, METHOD}_TYPE_PARAMETER"
+"\n (16) [FH] # CLASS_EXTENDS"
+"\n (17-18) [BB] # {CLASS, METHOD}_TYPE_PARAMETER_BOUND"
+"\n (19-21) [] # FIELD, METHOD_RETURN, METHOD_RECEIVER"
+"\n (22) [B] # METHOD_FORMAL_PARAMETER"
+"\n (23) [H] # THROWS"
+"\n (64-65) [NH[PHOHH]] # LOCAL_VARIABLE, RESOURCE_VARIABLE"
+"\n (66) [H] # EXCEPTION_PARAMETER"
+"\n (67-70) [PH] # INSTANCEOF, NEW, {CONSTRUCTOR, METHOD}_REFERENCE_RECEIVER"
+"\n (71-75) [PHB] # CAST, {CONSTRUCTOR,METHOD}_INVOCATION_TYPE_ARGUMENT, {CONSTRUCTOR, METHOD}_REFERENCE_TYPE_ARGUMENT"
+"\n ()[] ]"
),
Attribute.normalizeLayoutString
(""
+"\n # type-path"
+"\n [ NB[BB] ]"
)
};
Map<Layout, Attribute> sd = standardDefs; Map<Layout, Attribute> sd = standardDefs;
String defaultLayout = mdLayouts[2]; String defaultLayout = mdLayouts[3];
String annotationsLayout = mdLayouts[1] + mdLayouts[2]; String annotationsLayout = mdLayouts[1] + mdLayouts[2] + mdLayouts[3];
String paramsLayout = mdLayouts[0] + annotationsLayout; String paramsLayout = mdLayouts[0] + annotationsLayout;
String typesLayout = typeLayouts[0] + typeLayouts[1] +
typeLayouts[2] + mdLayouts[2] + mdLayouts[3];
for (int ctype = 0; ctype < ATTR_CONTEXT_LIMIT; ctype++) { for (int ctype = 0; ctype < ATTR_CONTEXT_LIMIT; ctype++) {
if (ctype == ATTR_CONTEXT_CODE) continue; if (ctype != ATTR_CONTEXT_CODE) {
define(sd, ctype,
"RuntimeVisibleAnnotations", annotationsLayout);
define(sd, ctype,
"RuntimeInvisibleAnnotations", annotationsLayout);
if (ctype == ATTR_CONTEXT_METHOD) {
define(sd, ctype,
"RuntimeVisibleParameterAnnotations", paramsLayout);
define(sd, ctype, define(sd, ctype,
"RuntimeInvisibleParameterAnnotations", paramsLayout); "RuntimeVisibleAnnotations", annotationsLayout);
define(sd, ctype, define(sd, ctype,
"AnnotationDefault", defaultLayout); "RuntimeInvisibleAnnotations", annotationsLayout);
if (ctype == ATTR_CONTEXT_METHOD) {
define(sd, ctype,
"RuntimeVisibleParameterAnnotations", paramsLayout);
define(sd, ctype,
"RuntimeInvisibleParameterAnnotations", paramsLayout);
define(sd, ctype,
"AnnotationDefault", defaultLayout);
}
} }
define(sd, ctype,
"RuntimeVisibleTypeAnnotations", typesLayout);
define(sd, ctype,
"RuntimeInvisibleTypeAnnotations", typesLayout);
} }
} }
...@@ -529,6 +576,7 @@ class Attribute implements Comparable<Attribute> { ...@@ -529,6 +576,7 @@ class Attribute implements Comparable<Attribute> {
return canon.addContent(bytes, null); return canon.addContent(bytes, null);
} }
@Override
public boolean equals(Object x) { public boolean equals(Object x) {
return ( x != null) && ( x.getClass() == Layout.class ) && return ( x != null) && ( x.getClass() == Layout.class ) &&
equals((Layout)x); equals((Layout)x);
...@@ -538,11 +586,13 @@ class Attribute implements Comparable<Attribute> { ...@@ -538,11 +586,13 @@ class Attribute implements Comparable<Attribute> {
&& this.layout.equals(that.layout) && this.layout.equals(that.layout)
&& this.ctype == that.ctype; && this.ctype == that.ctype;
} }
@Override
public int hashCode() { public int hashCode() {
return (((17 + name.hashCode()) return (((17 + name.hashCode())
* 37 + layout.hashCode()) * 37 + layout.hashCode())
* 37 + ctype); * 37 + ctype);
} }
@Override
public int compareTo(Layout that) { public int compareTo(Layout that) {
int r; int r;
r = this.name.compareTo(that.name); r = this.name.compareTo(that.name);
...@@ -551,6 +601,7 @@ class Attribute implements Comparable<Attribute> { ...@@ -551,6 +601,7 @@ class Attribute implements Comparable<Attribute> {
if (r != 0) return r; if (r != 0) return r;
return this.ctype - that.ctype; return this.ctype - that.ctype;
} }
@Override
public String toString() { public String toString() {
String str = contextName(ctype)+"."+name+"["+layout+"]"; String str = contextName(ctype)+"."+name+"["+layout+"]";
// If -ea, print out more informative strings! // If -ea, print out more informative strings!
...@@ -698,11 +749,14 @@ class Attribute implements Comparable<Attribute> { ...@@ -698,11 +749,14 @@ class Attribute implements Comparable<Attribute> {
// References (to a local cpMap) are embedded in the bytes. // References (to a local cpMap) are embedded in the bytes.
def.parse(holder, bytes, 0, bytes.length, def.parse(holder, bytes, 0, bytes.length,
new ValueStream() { new ValueStream() {
@Override
public void putInt(int bandIndex, int value) { public void putInt(int bandIndex, int value) {
} }
@Override
public void putRef(int bandIndex, Entry ref) { public void putRef(int bandIndex, Entry ref) {
refs.add(ref); refs.add(ref);
} }
@Override
public int encodeBCI(int bci) { public int encodeBCI(int bci) {
return bci; return bci;
} }
...@@ -716,6 +770,7 @@ class Attribute implements Comparable<Attribute> { ...@@ -716,6 +770,7 @@ class Attribute implements Comparable<Attribute> {
return def.unparse(in, out); return def.unparse(in, out);
} }
@Override
public String toString() { public String toString() {
return def return def
+"{"+(bytes == null ? -1 : size())+"}" +"{"+(bytes == null ? -1 : size())+"}"
...@@ -1309,7 +1364,7 @@ class Attribute implements Comparable<Attribute> { ...@@ -1309,7 +1364,7 @@ class Attribute implements Comparable<Attribute> {
} }
out.putRef(bandIndex, globalRef); out.putRef(bandIndex, globalRef);
break; break;
default: assert(false); continue; default: assert(false);
} }
} }
return pos; return pos;
...@@ -1416,8 +1471,7 @@ class Attribute implements Comparable<Attribute> { ...@@ -1416,8 +1471,7 @@ class Attribute implements Comparable<Attribute> {
int localRef; int localRef;
if (globalRef != null) { if (globalRef != null) {
// It's a one-element array, really an lvalue. // It's a one-element array, really an lvalue.
fixups[0] = Fixups.add(fixups[0], null, out.size(), fixups[0] = Fixups.addRefWithLoc(fixups[0], out.size(), globalRef);
Fixups.U2_FORMAT, globalRef);
localRef = 0; // placeholder for fixups localRef = 0; // placeholder for fixups
} else { } else {
localRef = 0; // fixed null value localRef = 0; // fixed null value
......
...@@ -146,7 +146,6 @@ class Code extends Attribute.Holder { ...@@ -146,7 +146,6 @@ class Code extends Attribute.Holder {
int verbose = getPackage().verbose; int verbose = getPackage().verbose;
if (verbose > 2) if (verbose > 2)
System.out.println("Reference scan "+this); System.out.println("Reference scan "+this);
Class cls = thisClass();
refs.addAll(Arrays.asList(handler_class)); refs.addAll(Arrays.asList(handler_class));
if (fixups != null) { if (fixups != null) {
fixups.visitRefs(refs); fixups.visitRefs(refs);
......
...@@ -785,53 +785,55 @@ class ConstantPool { ...@@ -785,53 +785,55 @@ class ConstantPool {
return new String(sig); return new String(sig);
} }
static private int skipClassNameChars(String sig, int i) { static private int skipTo(char semi, String sig, int i) {
int len = sig.length(); i = sig.indexOf(semi, i);
for (; i < len; i++) { return (i >= 0) ? i : sig.length();
char ch = sig.charAt(i);
if (ch <= ' ') break;
if (ch >= ';' && ch <= '@') break;
}
return i;
} }
static String[] structureSignature(String sig) { static String[] structureSignature(String sig) {
sig = sig.intern(); int firstl = sig.indexOf('L');
if (firstl < 0) {
int formLen = 0;
int nparts = 1;
for (int i = 0; i < sig.length(); i++) {
char ch = sig.charAt(i);
formLen++;
if (ch == 'L') {
nparts++;
int i2 = skipClassNameChars(sig, i+1);
i = i2-1; // keep the semicolon in the form
int i3 = sig.indexOf('<', i+1);
if (i3 > 0 && i3 < i2)
i = i3-1;
}
}
char[] form = new char[formLen];
if (nparts == 1) {
String[] parts = { sig }; String[] parts = { sig };
return parts; return parts;
} }
String[] parts = new String[nparts]; // Segment the string like sig.split("L\\([^;<]*\\)").
int j = 0; // N.B.: Previous version of this code did a more complex match,
int k = 1; // to next ch < ' ' or ch in [';'..'@']. The only important
for (int i = 0; i < sig.length(); i++) { // characters are ';' and '<', since they are part of the
char ch = sig.charAt(i); // signature syntax.
form[j++] = ch; // Examples:
if (ch == 'L') { // "(Ljava/lang/Object;IJLLoo;)V" => {"(L;IJL;)V", "java/lang/Object", "Loo"}
int i2 = skipClassNameChars(sig, i+1); // "Ljava/util/List<Ljava/lang/String;>;" => {"L<L;>;", "java/util/List", "java/lang/String"}
parts[k++] = sig.substring(i+1, i2); char[] form = null;
i = i2; String[] parts = null;
--i; // keep the semicolon in the form for (int pass = 0; pass <= 1; pass++) {
// pass 0 is a sizing pass, pass 1 packs the arrays
int formPtr = 0;
int partPtr = 1;
int nextsemi = 0, nextangl = 0; // next ';' or '<', or zero, or sigLen
int lastj = 0;
for (int i = firstl + 1, j; i > 0; i = sig.indexOf('L', j) + 1) {
// sig[i-1] is 'L', while sig[j] will be the first ';' or '<' after it
// each part is in sig[i .. j-1]
if (nextsemi < i) nextsemi = skipTo(';', sig, i);
if (nextangl < i) nextangl = skipTo('<', sig, i);
j = (nextsemi < nextangl ? nextsemi : nextangl);
if (pass != 0) {
sig.getChars(lastj, i, form, formPtr);
parts[partPtr] = sig.substring(i, j);
}
formPtr += (i - lastj);
partPtr += 1;
lastj = j;
} }
if (pass != 0) {
sig.getChars(lastj, sig.length(), form, formPtr);
break;
}
formPtr += (sig.length() - lastj);
form = new char[formPtr];
parts = new String[partPtr];
} }
assert(j == formLen);
assert(k == parts.length);
parts[0] = new String(form); parts[0] = new String(form);
//assert(flattenSignature(parts).equals(sig)); //assert(flattenSignature(parts).equals(sig));
return parts; return parts;
......
...@@ -45,6 +45,7 @@ class Constants { ...@@ -45,6 +45,7 @@ class Constants {
1.5 to 1.5.X 49,0 1.5 to 1.5.X 49,0
1.6 to 1.5.x 50,0 1.6 to 1.5.x 50,0
1.7 to 1.6.x 51,0 1.7 to 1.6.x 51,0
1.8 to 1.7.x 52,0
*/ */
public final static Package.Version JAVA_MIN_CLASS_VERSION = public final static Package.Version JAVA_MIN_CLASS_VERSION =
...@@ -161,7 +162,9 @@ class Constants { ...@@ -161,7 +162,9 @@ class Constants {
METHOD_ATTR_RuntimeInvisibleParameterAnnotations = 24, METHOD_ATTR_RuntimeInvisibleParameterAnnotations = 24,
CLASS_ATTR_ClassFile_version = 24, CLASS_ATTR_ClassFile_version = 24,
METHOD_ATTR_AnnotationDefault = 25, METHOD_ATTR_AnnotationDefault = 25,
METHOD_ATTR_MethodParameters = 26, METHOD_ATTR_MethodParameters = 26, // JDK8
X_ATTR_RuntimeVisibleTypeAnnotations = 27, // JDK8
X_ATTR_RuntimeInvisibleTypeAnnotations = 28, // JDK8
CODE_ATTR_StackMapTable = 0, // new in Java 6 CODE_ATTR_StackMapTable = 0, // new in Java 6
CODE_ATTR_LineNumberTable = 1, CODE_ATTR_LineNumberTable = 1,
CODE_ATTR_LocalVariableTable = 2, CODE_ATTR_LocalVariableTable = 2,
......
/* /*
* Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -30,6 +30,7 @@ import java.util.AbstractCollection; ...@@ -30,6 +30,7 @@ import java.util.AbstractCollection;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
import java.util.Iterator; import java.util.Iterator;
import java.util.Objects;
/** /**
* Collection of relocatable constant pool references. * Collection of relocatable constant pool references.
...@@ -77,8 +78,9 @@ final class Fixups extends AbstractCollection<Fixups.Fixup> { ...@@ -77,8 +78,9 @@ final class Fixups extends AbstractCollection<Fixups.Fixup> {
private static final int MINBIGSIZE = 1; private static final int MINBIGSIZE = 1;
// cleverly share empty bigDescs: // cleverly share empty bigDescs:
private static int[] noBigDescs = {MINBIGSIZE}; private static final int[] noBigDescs = {MINBIGSIZE};
@Override
public int size() { public int size() {
return size; return size;
} }
...@@ -105,6 +107,7 @@ final class Fixups extends AbstractCollection<Fixups.Fixup> { ...@@ -105,6 +107,7 @@ final class Fixups extends AbstractCollection<Fixups.Fixup> {
} }
} }
@Override
public void clear() { public void clear() {
if (bytes != null) { if (bytes != null) {
// Clean the bytes: // Clean the bytes:
...@@ -141,16 +144,16 @@ final class Fixups extends AbstractCollection<Fixups.Fixup> { ...@@ -141,16 +144,16 @@ final class Fixups extends AbstractCollection<Fixups.Fixup> {
assert(old.equals(new ArrayList<>(this))); assert(old.equals(new ArrayList<>(this)));
} }
static final int LOC_SHIFT = 1; private static final int LOC_SHIFT = 1;
static final int FMT_MASK = 0x1; private static final int FMT_MASK = 0x1;
static final byte UNUSED_BYTE = 0; private static final byte UNUSED_BYTE = 0;
static final byte OVERFLOW_BYTE = -1; private static final byte OVERFLOW_BYTE = -1;
// fill pointer of bigDescs array is in element [0] // fill pointer of bigDescs array is in element [0]
static final int BIGSIZE = 0; private static final int BIGSIZE = 0;
// Format values: // Format values:
public static final int U2_FORMAT = 0; private static final int U2_FORMAT = 0;
public static final int U1_FORMAT = 1; private static final int U1_FORMAT = 1;
// Special values for the static methods. // Special values for the static methods.
private static final int SPECIAL_LOC = 0; private static final int SPECIAL_LOC = 0;
...@@ -232,6 +235,14 @@ final class Fixups extends AbstractCollection<Fixups.Fixup> { ...@@ -232,6 +235,14 @@ final class Fixups extends AbstractCollection<Fixups.Fixup> {
} }
} }
void addU1(int pc, Entry ref) {
add(pc, U1_FORMAT, ref);
}
void addU2(int pc, Entry ref) {
add(pc, U2_FORMAT, ref);
}
/** Simple and necessary tuple to present each fixup. */ /** Simple and necessary tuple to present each fixup. */
public static public static
class Fixup implements Comparable<Fixup> { class Fixup implements Comparable<Fixup> {
...@@ -248,15 +259,25 @@ final class Fixups extends AbstractCollection<Fixups.Fixup> { ...@@ -248,15 +259,25 @@ final class Fixups extends AbstractCollection<Fixups.Fixup> {
public int location() { return descLoc(desc); } public int location() { return descLoc(desc); }
public int format() { return descFmt(desc); } public int format() { return descFmt(desc); }
public Entry entry() { return entry; } public Entry entry() { return entry; }
@Override
public int compareTo(Fixup that) { public int compareTo(Fixup that) {
// Ordering depends only on location. // Ordering depends only on location.
return this.location() - that.location(); return this.location() - that.location();
} }
@Override
public boolean equals(Object x) { public boolean equals(Object x) {
if (!(x instanceof Fixup)) return false; if (!(x instanceof Fixup)) return false;
Fixup that = (Fixup) x; Fixup that = (Fixup) x;
return this.desc == that.desc && this.entry == that.entry; return this.desc == that.desc && this.entry == that.entry;
} }
@Override
public int hashCode() {
int hash = 7;
hash = 59 * hash + this.desc;
hash = 59 * hash + Objects.hashCode(this.entry);
return hash;
}
@Override
public String toString() { public String toString() {
return "@"+location()+(format()==U1_FORMAT?".1":"")+"="+entry; return "@"+location()+(format()==U1_FORMAT?".1":"")+"="+entry;
} }
...@@ -267,8 +288,11 @@ final class Fixups extends AbstractCollection<Fixups.Fixup> { ...@@ -267,8 +288,11 @@ final class Fixups extends AbstractCollection<Fixups.Fixup> {
int index = 0; // index into entries int index = 0; // index into entries
int bigIndex = BIGSIZE+1; // index into bigDescs int bigIndex = BIGSIZE+1; // index into bigDescs
int next = head; // desc pointing to next fixup int next = head; // desc pointing to next fixup
@Override
public boolean hasNext() { return index < size; } public boolean hasNext() { return index < size; }
@Override
public void remove() { throw new UnsupportedOperationException(); } public void remove() { throw new UnsupportedOperationException(); }
@Override
public Fixup next() { public Fixup next() {
int thisIndex = index; int thisIndex = index;
return new Fixup(nextDesc(), entries[thisIndex]); return new Fixup(nextDesc(), entries[thisIndex]);
...@@ -293,17 +317,20 @@ final class Fixups extends AbstractCollection<Fixups.Fixup> { ...@@ -293,17 +317,20 @@ final class Fixups extends AbstractCollection<Fixups.Fixup> {
} }
} }
@Override
public Iterator<Fixup> iterator() { public Iterator<Fixup> iterator() {
return new Itr(); return new Itr();
} }
public void add(int location, int format, Entry entry) { public void add(int location, int format, Entry entry) {
addDesc(makeDesc(location, format), entry); addDesc(makeDesc(location, format), entry);
} }
@Override
public boolean add(Fixup f) { public boolean add(Fixup f) {
addDesc(f.desc, f.entry); addDesc(f.desc, f.entry);
return true; return true;
} }
@Override
public boolean addAll(Collection<? extends Fixup> c) { public boolean addAll(Collection<? extends Fixup> c) {
if (c instanceof Fixups) { if (c instanceof Fixups) {
// Use knowledge of Itr structure to avoid building little structs. // Use knowledge of Itr structure to avoid building little structs.
...@@ -367,7 +394,13 @@ final class Fixups extends AbstractCollection<Fixups.Fixup> { ...@@ -367,7 +394,13 @@ final class Fixups extends AbstractCollection<Fixups.Fixup> {
} }
/// Static methods that optimize the use of this class. /// Static methods that optimize the use of this class.
public static static Object addRefWithBytes(Object f, byte[] bytes, Entry e) {
return add(f, bytes, 0, U2_FORMAT, e);
}
static Object addRefWithLoc(Object f, int loc, Entry entry) {
return add(f, null, loc, U2_FORMAT, entry);
}
private static
Object add(Object prevFixups, Object add(Object prevFixups,
byte[] bytes, int loc, int fmt, byte[] bytes, int loc, int fmt,
Entry e) { Entry e) {
......
/* /*
* Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -259,7 +259,7 @@ class Package { ...@@ -259,7 +259,7 @@ class Package {
byte[] bytes = new byte[2]; byte[] bytes = new byte[2];
sfName = getRefString(obvious); sfName = getRefString(obvious);
Object f = null; Object f = null;
f = Fixups.add(f, bytes, 0, Fixups.U2_FORMAT, sfName); f = Fixups.addRefWithBytes(f, bytes, sfName);
a = attrSourceFileSpecial.addContent(bytes, f); a = attrSourceFileSpecial.addContent(bytes, f);
} }
} else if (obvious.equals(sfName.stringValue())) { } else if (obvious.equals(sfName.stringValue())) {
......
...@@ -116,7 +116,7 @@ class PackageReader extends BandStructure { ...@@ -116,7 +116,7 @@ class PackageReader extends BandStructure {
int nr = super.read(b, off, len); int nr = super.read(b, off, len);
servedPos = pos; servedPos = pos;
if (nr >= 0) served += nr; if (nr >= 0) served += nr;
assert(served <= limit || limit == -1); //assert(served <= limit || limit == -1);
return nr; return nr;
} }
public long skip(long n) throws IOException { public long skip(long n) throws IOException {
...@@ -1500,6 +1500,7 @@ class PackageReader extends BandStructure { ...@@ -1500,6 +1500,7 @@ class PackageReader extends BandStructure {
// ic_local_bands // ic_local_bands
// *class_ClassFile_version_minor_H :UNSIGNED5 // *class_ClassFile_version_minor_H :UNSIGNED5
// *class_ClassFile_version_major_H :UNSIGNED5 // *class_ClassFile_version_major_H :UNSIGNED5
// class_type_metadata_bands
// //
// field_attr_bands: // field_attr_bands:
// *field_flags :UNSIGNED5 // *field_flags :UNSIGNED5
...@@ -1509,6 +1510,7 @@ class PackageReader extends BandStructure { ...@@ -1509,6 +1510,7 @@ class PackageReader extends BandStructure {
// *field_Signature_RS :UNSIGNED5 (cp_Signature) // *field_Signature_RS :UNSIGNED5 (cp_Signature)
// field_metadata_bands // field_metadata_bands
// *field_ConstantValue_KQ :UNSIGNED5 (cp_Int, etc.; see note) // *field_ConstantValue_KQ :UNSIGNED5 (cp_Int, etc.; see note)
// field_type_metadata_bands
// //
// method_attr_bands: // method_attr_bands:
// *method_flags :UNSIGNED5 // *method_flags :UNSIGNED5
...@@ -1522,6 +1524,7 @@ class PackageReader extends BandStructure { ...@@ -1522,6 +1524,7 @@ class PackageReader extends BandStructure {
// *method_MethodParameters_NB: BYTE1 // *method_MethodParameters_NB: BYTE1
// *method_MethodParameters_RUN: UNSIGNED5 (cp_Utf8) // *method_MethodParameters_RUN: UNSIGNED5 (cp_Utf8)
// *method_MethodParameters_FH: UNSIGNED5 (flag) // *method_MethodParameters_FH: UNSIGNED5 (flag)
// method_type_metadata_bands
// //
// code_attr_bands: // code_attr_bands:
// *code_flags :UNSIGNED5 // *code_flags :UNSIGNED5
...@@ -1537,6 +1540,7 @@ class PackageReader extends BandStructure { ...@@ -1537,6 +1540,7 @@ class PackageReader extends BandStructure {
// *code_LocalVariableTable_name_RU :UNSIGNED5 (cp_Utf8) // *code_LocalVariableTable_name_RU :UNSIGNED5 (cp_Utf8)
// *code_LocalVariableTable_type_RS :UNSIGNED5 (cp_Signature) // *code_LocalVariableTable_type_RS :UNSIGNED5 (cp_Signature)
// *code_LocalVariableTable_slot :UNSIGNED5 // *code_LocalVariableTable_slot :UNSIGNED5
// code_type_metadata_bands
countAttrs(ctype, holders); countAttrs(ctype, holders);
readAttrs(ctype, holders); readAttrs(ctype, holders);
...@@ -1703,8 +1707,9 @@ class PackageReader extends BandStructure { ...@@ -1703,8 +1707,9 @@ class PackageReader extends BandStructure {
class_InnerClasses_outer_RCN.readFrom(in); class_InnerClasses_outer_RCN.readFrom(in);
class_InnerClasses_name_RUN.expectLength(tupleCount); class_InnerClasses_name_RUN.expectLength(tupleCount);
class_InnerClasses_name_RUN.readFrom(in); class_InnerClasses_name_RUN.readFrom(in);
} else if (totalCount == 0) { } else if (!optDebugBands && totalCount == 0) {
// Expect no elements at all. Skip quickly. // Expect no elements at all. Skip quickly. however if we
// are debugging bands, read all bands regardless
for (int j = 0; j < ab.length; j++) { for (int j = 0; j < ab.length; j++) {
ab[j].doneWithUnusedBand(); ab[j].doneWithUnusedBand();
} }
...@@ -1723,11 +1728,17 @@ class PackageReader extends BandStructure { ...@@ -1723,11 +1728,17 @@ class PackageReader extends BandStructure {
assert(cbles[j].kind == Attribute.EK_CBLE); assert(cbles[j].kind == Attribute.EK_CBLE);
int entryCount = forwardCounts[j]; int entryCount = forwardCounts[j];
forwardCounts[j] = -1; // No more, please! forwardCounts[j] = -1; // No more, please!
if (cbles[j].flagTest(Attribute.EF_BACK)) if (totalCount > 0 && cbles[j].flagTest(Attribute.EF_BACK))
entryCount += xxx_attr_calls.getInt(); entryCount += xxx_attr_calls.getInt();
readAttrBands(cbles[j].body, entryCount, forwardCounts, ab); readAttrBands(cbles[j].body, entryCount, forwardCounts, ab);
} }
} }
// mark them read, to satisfy asserts
if (optDebugBands && totalCount == 0) {
for (int j = 0; j < ab.length; j++) {
ab[j].doneDisbursing();
}
}
} }
} }
if (!predef) break; if (!predef) break;
...@@ -2154,11 +2165,10 @@ class PackageReader extends BandStructure { ...@@ -2154,11 +2165,10 @@ class PackageReader extends BandStructure {
if (size == 1) ldcRefSet.add(ref); if (size == 1) ldcRefSet.add(ref);
int fmt; int fmt;
switch (size) { switch (size) {
case 1: fmt = Fixups.U1_FORMAT; break; case 1: fixupBuf.addU1(pc, ref); break;
case 2: fmt = Fixups.U2_FORMAT; break; case 2: fixupBuf.addU2(pc, ref); break;
default: assert(false); fmt = 0; default: assert(false); fmt = 0;
} }
fixupBuf.add(pc, fmt, ref);
buf[pc+0] = buf[pc+1] = 0; buf[pc+0] = buf[pc+1] = 0;
pc += size; pc += size;
} }
...@@ -2193,7 +2203,7 @@ class PackageReader extends BandStructure { ...@@ -2193,7 +2203,7 @@ class PackageReader extends BandStructure {
int coding = bc_initref.getInt(); int coding = bc_initref.getInt();
// Find the nth overloading of <init> in classRef. // Find the nth overloading of <init> in classRef.
MemberEntry ref = pkg.cp.getOverloadingForIndex(CONSTANT_Methodref, classRef, "<init>", coding); MemberEntry ref = pkg.cp.getOverloadingForIndex(CONSTANT_Methodref, classRef, "<init>", coding);
fixupBuf.add(pc, Fixups.U2_FORMAT, ref); fixupBuf.addU2(pc, ref);
buf[pc+0] = buf[pc+1] = 0; buf[pc+0] = buf[pc+1] = 0;
pc += 2; pc += 2;
assert(Instruction.opLength(origBC) == (pc - curPC)); assert(Instruction.opLength(origBC) == (pc - curPC));
...@@ -2226,7 +2236,7 @@ class PackageReader extends BandStructure { ...@@ -2226,7 +2236,7 @@ class PackageReader extends BandStructure {
insnMap[numInsns++] = curPC; insnMap[numInsns++] = curPC;
} }
buf[pc++] = (byte) origBC; buf[pc++] = (byte) origBC;
fixupBuf.add(pc, Fixups.U2_FORMAT, ref); fixupBuf.addU2(pc, ref);
buf[pc+0] = buf[pc+1] = 0; buf[pc+0] = buf[pc+1] = 0;
pc += 2; pc += 2;
assert(Instruction.opLength(origBC) == (pc - curPC)); assert(Instruction.opLength(origBC) == (pc - curPC));
...@@ -2289,11 +2299,10 @@ class PackageReader extends BandStructure { ...@@ -2289,11 +2299,10 @@ class PackageReader extends BandStructure {
buf[pc++] = (byte) origBC; buf[pc++] = (byte) origBC;
int fmt; int fmt;
switch (size) { switch (size) {
case 1: fmt = Fixups.U1_FORMAT; break; case 1: fixupBuf.addU1(pc, ref); break;
case 2: fmt = Fixups.U2_FORMAT; break; case 2: fixupBuf.addU2(pc, ref); break;
default: assert(false); fmt = 0; default: assert(false); fmt = 0;
} }
fixupBuf.add(pc, fmt, ref);
buf[pc+0] = buf[pc+1] = 0; buf[pc+0] = buf[pc+1] = 0;
pc += size; pc += size;
if (origBC == _multianewarray) { if (origBC == _multianewarray) {
......
...@@ -102,7 +102,7 @@ public class DnsContext extends ComponentDirContext { ...@@ -102,7 +102,7 @@ public class DnsContext extends ComponentDirContext {
this.domain = new DnsName(domain.endsWith(".") this.domain = new DnsName(domain.endsWith(".")
? domain ? domain
: domain + "."); : domain + ".");
this.servers = servers; this.servers = (servers == null) ? null : servers.clone();
this.environment = (Hashtable<Object,Object>) environment.clone(); this.environment = (Hashtable<Object,Object>) environment.clone();
envShared = false; envShared = false;
parentIsDns = false; parentIsDns = false;
...@@ -129,11 +129,11 @@ public class DnsContext extends ComponentDirContext { ...@@ -129,11 +129,11 @@ public class DnsContext extends ComponentDirContext {
* no conflict. * no conflict.
*/ */
private DnsContext(DnsContext ctx) { private DnsContext(DnsContext ctx) {
environment = ctx.environment; environment = ctx.environment; // shared environment, copy-on-write
envShared = ctx.envShared = true; envShared = ctx.envShared = true;
parentIsDns = ctx.parentIsDns; parentIsDns = ctx.parentIsDns;
domain = ctx.domain; domain = ctx.domain;
servers = ctx.servers; servers = ctx.servers; // shared servers, no write operation
resolver = ctx.resolver; resolver = ctx.resolver;
authoritative = ctx.authoritative; authoritative = ctx.authoritative;
recursion = ctx.recursion; recursion = ctx.recursion;
......
...@@ -81,7 +81,7 @@ public class BasicControl implements Control { ...@@ -81,7 +81,7 @@ public class BasicControl implements Control {
this.id = id; this.id = id;
this.criticality = criticality; this.criticality = criticality;
if (value != null) { if (value != null) {
this.value = value; this.value = value.clone();
} }
} }
......
...@@ -42,7 +42,7 @@ public final class BerDecoder extends Ber { ...@@ -42,7 +42,7 @@ public final class BerDecoder extends Ber {
*/ */
public BerDecoder(byte buf[], int offset, int bufsize) { public BerDecoder(byte buf[], int offset, int bufsize) {
this.buf = buf; this.buf = buf; // shared buffer, be careful to use this class
this.bufsize = bufsize; this.bufsize = bufsize;
this.origOffset = offset; this.origOffset = offset;
......
...@@ -99,7 +99,7 @@ public final class BerEncoder extends Ber { ...@@ -99,7 +99,7 @@ public final class BerEncoder extends Ber {
if (curSeqIndex != 0) { if (curSeqIndex != 0) {
throw new IllegalStateException("BER encode error: Unbalanced SEQUENCEs."); throw new IllegalStateException("BER encode error: Unbalanced SEQUENCEs.");
} }
return buf; return buf; // shared buffer, be careful to use this method.
} }
/** /**
......
...@@ -134,7 +134,9 @@ final public class StartTlsResponseImpl extends StartTlsResponse { ...@@ -134,7 +134,9 @@ final public class StartTlsResponseImpl extends StartTlsResponse {
* @see #negotiate * @see #negotiate
*/ */
public void setEnabledCipherSuites(String[] suites) { public void setEnabledCipherSuites(String[] suites) {
this.suites = suites; // The impl does accept null suites, although the spec requires
// a non-null list.
this.suites = suites == null ? null : suites.clone();
} }
/** /**
......
/*
* Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.script.javascript;
import sun.org.mozilla.javascript.internal.*;
import javax.script.*;
import java.util.*;
/**
* ExternalScriptable is an implementation of Scriptable
* backed by a JSR 223 ScriptContext instance.
*
* @author Mike Grogan
* @author A. Sundararajan
* @since 1.6
*/
final class ExternalScriptable implements Scriptable {
/* Underlying ScriptContext that we use to store
* named variables of this scope.
*/
private ScriptContext context;
/* JavaScript allows variables to be named as numbers (indexed
* properties). This way arrays, objects (scopes) are treated uniformly.
* Note that JSR 223 API supports only String named variables and
* so we can't store these in Bindings. Also, JavaScript allows name
* of the property name to be even empty String! Again, JSR 223 API
* does not support empty name. So, we use the following fallback map
* to store such variables of this scope. This map is not exposed to
* JSR 223 API. We can just script objects "as is" and need not convert.
*/
private Map<Object, Object> indexedProps;
// my prototype
private Scriptable prototype;
// my parent scope, if any
private Scriptable parent;
ExternalScriptable(ScriptContext context) {
this(context, new HashMap<Object, Object>());
}
ExternalScriptable(ScriptContext context, Map<Object, Object> indexedProps) {
if (context == null) {
throw new NullPointerException("context is null");
}
this.context = context;
this.indexedProps = indexedProps;
}
ScriptContext getContext() {
return context;
}
private boolean isEmpty(String name) {
return name.equals("");
}
/**
* Return the name of the class.
*/
public String getClassName() {
return "Global";
}
/**
* Returns the value of the named property or NOT_FOUND.
*
* If the property was created using defineProperty, the
* appropriate getter method is called.
*
* @param name the name of the property
* @param start the object in which the lookup began
* @return the value of the property (may be null), or NOT_FOUND
*/
public synchronized Object get(String name, Scriptable start) {
if (isEmpty(name)) {
if (indexedProps.containsKey(name)) {
return indexedProps.get(name);
} else {
return NOT_FOUND;
}
} else {
synchronized (context) {
int scope = context.getAttributesScope(name);
if (scope != -1) {
Object value = context.getAttribute(name, scope);
return Context.javaToJS(value, this);
} else {
return NOT_FOUND;
}
}
}
}
/**
* Returns the value of the indexed property or NOT_FOUND.
*
* @param index the numeric index for the property
* @param start the object in which the lookup began
* @return the value of the property (may be null), or NOT_FOUND
*/
public synchronized Object get(int index, Scriptable start) {
Integer key = new Integer(index);
if (indexedProps.containsKey(index)) {
return indexedProps.get(key);
} else {
return NOT_FOUND;
}
}
/**
* Returns true if the named property is defined.
*
* @param name the name of the property
* @param start the object in which the lookup began
* @return true if and only if the property was found in the object
*/
public synchronized boolean has(String name, Scriptable start) {
if (isEmpty(name)) {
return indexedProps.containsKey(name);
} else {
synchronized (context) {
return context.getAttributesScope(name) != -1;
}
}
}
/**
* Returns true if the property index is defined.
*
* @param index the numeric index for the property
* @param start the object in which the lookup began
* @return true if and only if the property was found in the object
*/
public synchronized boolean has(int index, Scriptable start) {
Integer key = new Integer(index);
return indexedProps.containsKey(key);
}
/**
* Sets the value of the named property, creating it if need be.
*
* @param name the name of the property
* @param start the object whose property is being set
* @param value value to set the property to
*/
public void put(String name, Scriptable start, Object value) {
if (start == this) {
synchronized (this) {
if (isEmpty(name)) {
indexedProps.put(name, value);
} else {
synchronized (context) {
int scope = context.getAttributesScope(name);
if (scope == -1) {
scope = ScriptContext.ENGINE_SCOPE;
}
context.setAttribute(name, jsToJava(value), scope);
}
}
}
} else {
start.put(name, start, value);
}
}
/**
* Sets the value of the indexed property, creating it if need be.
*
* @param index the numeric index for the property
* @param start the object whose property is being set
* @param value value to set the property to
*/
public void put(int index, Scriptable start, Object value) {
if (start == this) {
synchronized (this) {
indexedProps.put(new Integer(index), value);
}
} else {
start.put(index, start, value);
}
}
/**
* Removes a named property from the object.
*
* If the property is not found, no action is taken.
*
* @param name the name of the property
*/
public synchronized void delete(String name) {
if (isEmpty(name)) {
indexedProps.remove(name);
} else {
synchronized (context) {
int scope = context.getAttributesScope(name);
if (scope != -1) {
context.removeAttribute(name, scope);
}
}
}
}
/**
* Removes the indexed property from the object.
*
* If the property is not found, no action is taken.
*
* @param index the numeric index for the property
*/
public void delete(int index) {
indexedProps.remove(new Integer(index));
}
/**
* Get the prototype of the object.
* @return the prototype
*/
public Scriptable getPrototype() {
return prototype;
}
/**
* Set the prototype of the object.
* @param prototype the prototype to set
*/
public void setPrototype(Scriptable prototype) {
this.prototype = prototype;
}
/**
* Get the parent scope of the object.
* @return the parent scope
*/
public Scriptable getParentScope() {
return parent;
}
/**
* Set the parent scope of the object.
* @param parent the parent scope to set
*/
public void setParentScope(Scriptable parent) {
this.parent = parent;
}
/**
* Get an array of property ids.
*
* Not all property ids need be returned. Those properties
* whose ids are not returned are considered non-enumerable.
*
* @return an array of Objects. Each entry in the array is either
* a java.lang.String or a java.lang.Number
*/
public synchronized Object[] getIds() {
String[] keys = getAllKeys();
int size = keys.length + indexedProps.size();
Object[] res = new Object[size];
System.arraycopy(keys, 0, res, 0, keys.length);
int i = keys.length;
// now add all indexed properties
for (Object index : indexedProps.keySet()) {
res[i++] = index;
}
return res;
}
/**
* Get the default value of the object with a given hint.
* The hints are String.class for type String, Number.class for type
* Number, Scriptable.class for type Object, and Boolean.class for
* type Boolean. <p>
*
* A <code>hint</code> of null means "no hint".
*
* See ECMA 8.6.2.6.
*
* @param hint the type hint
* @return the default value
*/
public Object getDefaultValue(Class typeHint) {
for (int i=0; i < 2; i++) {
boolean tryToString;
if (typeHint == ScriptRuntime.StringClass) {
tryToString = (i == 0);
} else {
tryToString = (i == 1);
}
String methodName;
Object[] args;
if (tryToString) {
methodName = "toString";
args = ScriptRuntime.emptyArgs;
} else {
methodName = "valueOf";
args = new Object[1];
String hint;
if (typeHint == null) {
hint = "undefined";
} else if (typeHint == ScriptRuntime.StringClass) {
hint = "string";
} else if (typeHint == ScriptRuntime.ScriptableClass) {
hint = "object";
} else if (typeHint == ScriptRuntime.FunctionClass) {
hint = "function";
} else if (typeHint == ScriptRuntime.BooleanClass
|| typeHint == Boolean.TYPE)
{
hint = "boolean";
} else if (typeHint == ScriptRuntime.NumberClass ||
typeHint == ScriptRuntime.ByteClass ||
typeHint == Byte.TYPE ||
typeHint == ScriptRuntime.ShortClass ||
typeHint == Short.TYPE ||
typeHint == ScriptRuntime.IntegerClass ||
typeHint == Integer.TYPE ||
typeHint == ScriptRuntime.FloatClass ||
typeHint == Float.TYPE ||
typeHint == ScriptRuntime.DoubleClass ||
typeHint == Double.TYPE)
{
hint = "number";
} else {
throw Context.reportRuntimeError(
"Invalid JavaScript value of type " +
typeHint.toString());
}
args[0] = hint;
}
Object v = ScriptableObject.getProperty(this, methodName);
if (!(v instanceof Function))
continue;
Function fun = (Function) v;
Context cx = RhinoScriptEngine.enterContext();
try {
v = fun.call(cx, fun.getParentScope(), this, args);
} finally {
cx.exit();
}
if (v != null) {
if (!(v instanceof Scriptable)) {
return v;
}
if (typeHint == ScriptRuntime.ScriptableClass
|| typeHint == ScriptRuntime.FunctionClass)
{
return v;
}
if (tryToString && v instanceof Wrapper) {
// Let a wrapped java.lang.String pass for a primitive
// string.
Object u = ((Wrapper)v).unwrap();
if (u instanceof String)
return u;
}
}
}
// fall through to error
String arg = (typeHint == null) ? "undefined" : typeHint.getName();
throw Context.reportRuntimeError(
"Cannot find default value for object " + arg);
}
/**
* Implements the instanceof operator.
*
* @param instance The value that appeared on the LHS of the instanceof
* operator
* @return true if "this" appears in value's prototype chain
*
*/
public boolean hasInstance(Scriptable instance) {
// Default for JS objects (other than Function) is to do prototype
// chasing.
Scriptable proto = instance.getPrototype();
while (proto != null) {
if (proto.equals(this)) return true;
proto = proto.getPrototype();
}
return false;
}
private String[] getAllKeys() {
ArrayList<String> list = new ArrayList<String>();
synchronized (context) {
for (int scope : context.getScopes()) {
Bindings bindings = context.getBindings(scope);
if (bindings != null) {
list.ensureCapacity(bindings.size());
for (String key : bindings.keySet()) {
list.add(key);
}
}
}
}
String[] res = new String[list.size()];
list.toArray(res);
return res;
}
/**
* We convert script values to the nearest Java value.
* We unwrap wrapped Java objects so that access from
* Bindings.get() would return "workable" value for Java.
* But, at the same time, we need to make few special cases
* and hence the following function is used.
*/
private Object jsToJava(Object jsObj) {
if (jsObj instanceof Wrapper) {
Wrapper njb = (Wrapper) jsObj;
/* importClass feature of ImporterTopLevel puts
* NativeJavaClass in global scope. If we unwrap
* it, importClass won't work.
*/
if (njb instanceof NativeJavaClass) {
return njb;
}
/* script may use Java primitive wrapper type objects
* (such as java.lang.Integer, java.lang.Boolean etc)
* explicitly. If we unwrap, then these script objects
* will become script primitive types. For example,
*
* var x = new java.lang.Double(3.0); print(typeof x);
*
* will print 'number'. We don't want that to happen.
*/
Object obj = njb.unwrap();
if (obj instanceof Number || obj instanceof String ||
obj instanceof Boolean || obj instanceof Character) {
// special type wrapped -- we just leave it as is.
return njb;
} else {
// return unwrapped object for any other object.
return obj;
}
} else { // not-a-Java-wrapper
return jsObj;
}
}
}
/*
* Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.script.javascript;
import sun.org.mozilla.javascript.internal.*;
import java.util.*;
/**
* JSAdapter is java.lang.reflect.Proxy equivalent for JavaScript. JSAdapter
* calls specially named JavaScript methods on an adaptee object when property
* access is attempted on it.
*
* Example:
*
* var y = {
* __get__ : function (name) { ... }
* __has__ : function (name) { ... }
* __put__ : function (name, value) {...}
* __delete__ : function (name) { ... }
* __getIds__ : function () { ... }
* };
*
* var x = new JSAdapter(y);
*
* x.i; // calls y.__get__
* i in x; // calls y.__has__
* x.p = 10; // calls y.__put__
* delete x.p; // calls y.__delete__
* for (i in x) { print(i); } // calls y.__getIds__
*
* If a special JavaScript method is not found in the adaptee, then JSAdapter
* forwards the property access to the adaptee itself.
*
* JavaScript caller of adapter object is isolated from the fact that
* the property access/mutation/deletion are really calls to
* JavaScript methods on adaptee. Use cases include 'smart'
* properties, property access tracing/debugging, encaptulation with
* easy client access - in short JavaScript becomes more "Self" like.
*
* Note that Rhino already supports special properties like __proto__
* (to set, get prototype), __parent__ (to set, get parent scope). We
* follow the same double underscore nameing convention here. Similarly
* the name JSAdapter is derived from JavaAdapter -- which is a facility
* to extend, implement Java classes/interfaces by JavaScript.
*
* @author A. Sundararajan
* @since 1.6
*/
public final class JSAdapter implements Scriptable, Function {
private JSAdapter(Scriptable obj) {
setAdaptee(obj);
}
// initializer to setup JSAdapter prototype in the given scope
public static void init(Context cx, Scriptable scope, boolean sealed)
throws RhinoException {
JSAdapter obj = new JSAdapter(cx.newObject(scope));
obj.setParentScope(scope);
obj.setPrototype(getFunctionPrototype(scope));
obj.isPrototype = true;
ScriptableObject.defineProperty(scope, "JSAdapter", obj,
ScriptableObject.DONTENUM);
}
public String getClassName() {
return "JSAdapter";
}
public Object get(String name, Scriptable start) {
Function func = getAdapteeFunction(GET_PROP);
if (func != null) {
return call(func, new Object[] { name });
} else {
start = getAdaptee();
return start.get(name, start);
}
}
public Object get(int index, Scriptable start) {
Function func = getAdapteeFunction(GET_PROP);
if (func != null) {
return call(func, new Object[] { new Integer(index) });
} else {
start = getAdaptee();
return start.get(index, start);
}
}
public boolean has(String name, Scriptable start) {
Function func = getAdapteeFunction(HAS_PROP);
if (func != null) {
Object res = call(func, new Object[] { name });
return Context.toBoolean(res);
} else {
start = getAdaptee();
return start.has(name, start);
}
}
public boolean has(int index, Scriptable start) {
Function func = getAdapteeFunction(HAS_PROP);
if (func != null) {
Object res = call(func, new Object[] { new Integer(index) });
return Context.toBoolean(res);
} else {
start = getAdaptee();
return start.has(index, start);
}
}
public void put(String name, Scriptable start, Object value) {
if (start == this) {
Function func = getAdapteeFunction(PUT_PROP);
if (func != null) {
call(func, new Object[] { name, value });
} else {
start = getAdaptee();
start.put(name, start, value);
}
} else {
start.put(name, start, value);
}
}
public void put(int index, Scriptable start, Object value) {
if (start == this) {
Function func = getAdapteeFunction(PUT_PROP);
if( func != null) {
call(func, new Object[] { new Integer(index), value });
} else {
start = getAdaptee();
start.put(index, start, value);
}
} else {
start.put(index, start, value);
}
}
public void delete(String name) {
Function func = getAdapteeFunction(DEL_PROP);
if (func != null) {
call(func, new Object[] { name });
} else {
getAdaptee().delete(name);
}
}
public void delete(int index) {
Function func = getAdapteeFunction(DEL_PROP);
if (func != null) {
call(func, new Object[] { new Integer(index) });
} else {
getAdaptee().delete(index);
}
}
public Scriptable getPrototype() {
return prototype;
}
public void setPrototype(Scriptable prototype) {
this.prototype = prototype;
}
public Scriptable getParentScope() {
return parent;
}
public void setParentScope(Scriptable parent) {
this.parent = parent;
}
public Object[] getIds() {
Function func = getAdapteeFunction(GET_PROPIDS);
if (func != null) {
Object val = call(func, new Object[0]);
// in most cases, adaptee would return native JS array
if (val instanceof NativeArray) {
NativeArray array = (NativeArray) val;
Object[] res = new Object[(int)array.getLength()];
for (int index = 0; index < res.length; index++) {
res[index] = mapToId(array.get(index, array));
}
return res;
} else if (val instanceof NativeJavaArray) {
// may be attempt wrapped Java array
Object tmp = ((NativeJavaArray)val).unwrap();
Object[] res;
if (tmp.getClass() == Object[].class) {
Object[] array = (Object[]) tmp;
res = new Object[array.length];
for (int index = 0; index < array.length; index++) {
res[index] = mapToId(array[index]);
}
} else {
// just return an empty array
res = Context.emptyArgs;
}
return res;
} else {
// some other return type, just return empty array
return Context.emptyArgs;
}
} else {
return getAdaptee().getIds();
}
}
public boolean hasInstance(Scriptable scriptable) {
if (scriptable instanceof JSAdapter) {
return true;
} else {
Scriptable proto = scriptable.getPrototype();
while (proto != null) {
if (proto.equals(this)) return true;
proto = proto.getPrototype();
}
return false;
}
}
public Object getDefaultValue(Class hint) {
return getAdaptee().getDefaultValue(hint);
}
public Object call(Context cx, Scriptable scope, Scriptable thisObj,
Object[] args)
throws RhinoException {
if (isPrototype) {
return construct(cx, scope, args);
} else {
Scriptable tmp = getAdaptee();
if (tmp instanceof Function) {
return ((Function)tmp).call(cx, scope, tmp, args);
} else {
throw Context.reportRuntimeError("TypeError: not a function");
}
}
}
public Scriptable construct(Context cx, Scriptable scope, Object[] args)
throws RhinoException {
if (isPrototype) {
Scriptable topLevel = ScriptableObject.getTopLevelScope(scope);
JSAdapter newObj;
if (args.length > 0) {
newObj = new JSAdapter(Context.toObject(args[0], topLevel));
} else {
throw Context.reportRuntimeError("JSAdapter requires adaptee");
}
return newObj;
} else {
Scriptable tmp = getAdaptee();
if (tmp instanceof Function) {
return ((Function)tmp).construct(cx, scope, args);
} else {
throw Context.reportRuntimeError("TypeError: not a constructor");
}
}
}
public Scriptable getAdaptee() {
return adaptee;
}
public void setAdaptee(Scriptable adaptee) {
if (adaptee == null) {
throw new NullPointerException("adaptee can not be null");
}
this.adaptee = adaptee;
}
//-- internals only below this point
// map a property id. Property id can only be an Integer or String
private Object mapToId(Object tmp) {
if (tmp instanceof Double) {
return new Integer(((Double)tmp).intValue());
} else {
return Context.toString(tmp);
}
}
private static Scriptable getFunctionPrototype(Scriptable scope) {
return ScriptableObject.getFunctionPrototype(scope);
}
private Function getAdapteeFunction(String name) {
Object o = ScriptableObject.getProperty(getAdaptee(), name);
return (o instanceof Function)? (Function)o : null;
}
private Object call(Function func, Object[] args) {
Context cx = Context.getCurrentContext();
Scriptable thisObj = getAdaptee();
Scriptable scope = func.getParentScope();
try {
return func.call(cx, scope, thisObj, args);
} catch (RhinoException re) {
throw Context.reportRuntimeError(re.getMessage());
}
}
private Scriptable prototype;
private Scriptable parent;
private Scriptable adaptee;
private boolean isPrototype;
// names of adaptee JavaScript functions
private static final String GET_PROP = "__get__";
private static final String HAS_PROP = "__has__";
private static final String PUT_PROP = "__put__";
private static final String DEL_PROP = "__delete__";
private static final String GET_PROPIDS = "__getIds__";
}
/*
* Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.script.javascript;
import javax.script.Invocable;
import sun.org.mozilla.javascript.internal.*;
/**
* This class implements Rhino-like JavaAdapter to help implement a Java
* interface in JavaScript. We support this using Invocable.getInterface.
* Using this JavaAdapter, script author could write:
*
* var r = new java.lang.Runnable() {
* run: function() { script... }
* };
*
* r.run();
* new java.lang.Thread(r).start();
*
* Note that Rhino's JavaAdapter support allows extending a Java class and/or
* implementing one or more interfaces. This JavaAdapter implementation does
* not support these.
*
* @author A. Sundararajan
* @since 1.6
*/
final class JavaAdapter extends ScriptableObject implements Function {
private JavaAdapter(Invocable engine) {
this.engine = engine;
}
static void init(Context cx, Scriptable scope, boolean sealed)
throws RhinoException {
RhinoTopLevel topLevel = (RhinoTopLevel) scope;
Invocable engine = topLevel.getScriptEngine();
JavaAdapter obj = new JavaAdapter(engine);
obj.setParentScope(scope);
obj.setPrototype(getFunctionPrototype(scope));
/*
* Note that we can't use defineProperty. A property of this
* name is already defined in Context.initStandardObjects. We
* simply overwrite the property value!
*/
ScriptableObject.putProperty(topLevel, "JavaAdapter", obj);
}
public String getClassName() {
return "JavaAdapter";
}
public Object call(Context cx, Scriptable scope, Scriptable thisObj,
Object[] args) throws RhinoException {
return construct(cx, scope, args);
}
public Scriptable construct(Context cx, Scriptable scope, Object[] args)
throws RhinoException {
if (args.length == 2) {
Class<?> clazz = null;
Object obj1 = args[0];
if (obj1 instanceof Wrapper) {
Object o = ((Wrapper)obj1).unwrap();
if (o instanceof Class && ((Class)o).isInterface()) {
clazz = (Class) o;
}
} else if (obj1 instanceof Class) {
if (((Class)obj1).isInterface()) {
clazz = (Class) obj1;
}
}
if (clazz == null) {
throw Context.reportRuntimeError("JavaAdapter: first arg should be interface Class");
}
Scriptable topLevel = ScriptableObject.getTopLevelScope(scope);
return cx.toObject(engine.getInterface(args[1], clazz), topLevel);
} else {
throw Context.reportRuntimeError("JavaAdapter requires two arguments");
}
}
private Invocable engine;
}
#script engines supported
com.sun.script.javascript.RhinoScriptEngineFactory #javascript
/*
* Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.script.javascript;
import com.sun.script.util.*;
import javax.script.*;
import sun.org.mozilla.javascript.internal.*;
import java.lang.reflect.Method;
import java.io.*;
import java.util.*;
/**
* Implementation of <code>ScriptEngine</code> using the Mozilla Rhino
* interpreter.
*
* @author Mike Grogan
* @author A. Sundararajan
* @since 1.6
*/
public final class RhinoScriptEngine extends AbstractScriptEngine
implements Invocable, Compilable {
private static final boolean DEBUG = false;
/* Scope where standard JavaScript objects and our
* extensions to it are stored. Note that these are not
* user defined engine level global variables. These are
* variables have to be there on all compliant ECMAScript
* scopes. We put these standard objects in this top level.
*/
private RhinoTopLevel topLevel;
/* map used to store indexed properties in engine scope
* refer to comment on 'indexedProps' in ExternalScriptable.java.
*/
private Map<Object, Object> indexedProps;
private ScriptEngineFactory factory;
private InterfaceImplementor implementor;
private static final int languageVersion = getLanguageVersion();
private static final int optimizationLevel = getOptimizationLevel();
static {
ContextFactory.initGlobal(new ContextFactory() {
protected Context makeContext() {
Context cx = super.makeContext();
cx.setLanguageVersion(languageVersion);
cx.setOptimizationLevel(optimizationLevel);
cx.setClassShutter(RhinoClassShutter.getInstance());
cx.setWrapFactory(RhinoWrapFactory.getInstance());
return cx;
}
});
}
private static final String RHINO_JS_VERSION = "rhino.js.version";
private static int getLanguageVersion() {
int version;
String tmp = java.security.AccessController.doPrivileged(
new sun.security.action.GetPropertyAction(RHINO_JS_VERSION));
if (tmp != null) {
version = Integer.parseInt((String)tmp);
} else {
version = Context.VERSION_1_8;
}
return version;
}
private static final String RHINO_OPT_LEVEL = "rhino.opt.level";
private static int getOptimizationLevel() {
int optLevel = -1;
// disable optimizer under security manager, for now.
if (System.getSecurityManager() == null) {
optLevel = Integer.getInteger(RHINO_OPT_LEVEL, -1);
}
return optLevel;
}
/**
* Creates a new instance of RhinoScriptEngine
*/
public RhinoScriptEngine() {
Context cx = enterContext();
try {
topLevel = new RhinoTopLevel(cx, this);
} finally {
cx.exit();
}
indexedProps = new HashMap<Object, Object>();
//construct object used to implement getInterface
implementor = new InterfaceImplementor(this) {
protected boolean isImplemented(Object thiz, Class<?> iface) {
Context cx = enterContext();
try {
if (thiz != null && !(thiz instanceof Scriptable)) {
thiz = cx.toObject(thiz, topLevel);
}
Scriptable engineScope = getRuntimeScope(context);
Scriptable localScope = (thiz != null)? (Scriptable) thiz :
engineScope;
for (Method method : iface.getMethods()) {
// ignore methods of java.lang.Object class
if (method.getDeclaringClass() == Object.class) {
continue;
}
Object obj = ScriptableObject.getProperty(localScope, method.getName());
if (! (obj instanceof Function)) {
return false;
}
}
return true;
} finally {
cx.exit();
}
}
protected Object convertResult(Method method, Object res)
throws ScriptException {
Class desiredType = method.getReturnType();
if (desiredType == Void.TYPE) {
return null;
} else {
return Context.jsToJava(res, desiredType);
}
}
};
}
public Object eval(Reader reader, ScriptContext ctxt)
throws ScriptException {
Object ret;
Context cx = enterContext();
try {
Scriptable scope = getRuntimeScope(ctxt);
String filename = (String) get(ScriptEngine.FILENAME);
filename = filename == null ? "<Unknown source>" : filename;
ret = cx.evaluateReader(scope, reader, filename , 1, null);
} catch (RhinoException re) {
if (DEBUG) re.printStackTrace();
int line = (line = re.lineNumber()) == 0 ? -1 : line;
String msg;
if (re instanceof JavaScriptException) {
msg = String.valueOf(((JavaScriptException)re).getValue());
} else {
msg = re.toString();
}
ScriptException se = new ScriptException(msg, re.sourceName(), line);
se.initCause(re);
throw se;
} catch (IOException ee) {
throw new ScriptException(ee);
} finally {
cx.exit();
}
return unwrapReturnValue(ret);
}
public Object eval(String script, ScriptContext ctxt) throws ScriptException {
if (script == null) {
throw new NullPointerException("null script");
}
return eval(new StringReader(script) , ctxt);
}
public ScriptEngineFactory getFactory() {
if (factory != null) {
return factory;
} else {
return new RhinoScriptEngineFactory();
}
}
public Bindings createBindings() {
return new SimpleBindings();
}
//Invocable methods
public Object invokeFunction(String name, Object... args)
throws ScriptException, NoSuchMethodException {
return invoke(null, name, args);
}
public Object invokeMethod(Object thiz, String name, Object... args)
throws ScriptException, NoSuchMethodException {
if (thiz == null) {
throw new IllegalArgumentException("script object can not be null");
}
return invoke(thiz, name, args);
}
private Object invoke(Object thiz, String name, Object... args)
throws ScriptException, NoSuchMethodException {
Context cx = enterContext();
try {
if (name == null) {
throw new NullPointerException("method name is null");
}
if (thiz != null && !(thiz instanceof Scriptable)) {
thiz = cx.toObject(thiz, topLevel);
}
Scriptable engineScope = getRuntimeScope(context);
Scriptable localScope = (thiz != null)? (Scriptable) thiz :
engineScope;
Object obj = ScriptableObject.getProperty(localScope, name);
if (! (obj instanceof Function)) {
throw new NoSuchMethodException("no such method: " + name);
}
Function func = (Function) obj;
Scriptable scope = func.getParentScope();
if (scope == null) {
scope = engineScope;
}
Object result = func.call(cx, scope, localScope,
wrapArguments(args));
return unwrapReturnValue(result);
} catch (RhinoException re) {
if (DEBUG) re.printStackTrace();
int line = (line = re.lineNumber()) == 0 ? -1 : line;
ScriptException se = new ScriptException(re.toString(), re.sourceName(), line);
se.initCause(re);
throw se;
} finally {
cx.exit();
}
}
public <T> T getInterface(Class<T> clasz) {
try {
return implementor.getInterface(null, clasz);
} catch (ScriptException e) {
return null;
}
}
public <T> T getInterface(Object thiz, Class<T> clasz) {
if (thiz == null) {
throw new IllegalArgumentException("script object can not be null");
}
try {
return implementor.getInterface(thiz, clasz);
} catch (ScriptException e) {
return null;
}
}
private static final String printSource =
"function print(str, newline) { \n" +
" if (typeof(str) == 'undefined') { \n" +
" str = 'undefined'; \n" +
" } else if (str == null) { \n" +
" str = 'null'; \n" +
" } \n" +
" var out = context.getWriter(); \n" +
" if (!(out instanceof java.io.PrintWriter))\n" +
" out = new java.io.PrintWriter(out); \n" +
" out.print(String(str)); \n" +
" if (newline) out.print('\\n'); \n" +
" out.flush(); \n" +
"}\n" +
"function println(str) { \n" +
" print(str, true); \n" +
"}";
Scriptable getRuntimeScope(ScriptContext ctxt) {
if (ctxt == null) {
throw new NullPointerException("null script context");
}
// we create a scope for the given ScriptContext
Scriptable newScope = new ExternalScriptable(ctxt, indexedProps);
// Set the prototype of newScope to be 'topLevel' so that
// JavaScript standard objects are visible from the scope.
newScope.setPrototype(topLevel);
// define "context" variable in the new scope
newScope.put("context", newScope, ctxt);
// define "print", "println" functions in the new scope
Context cx = enterContext();
try {
cx.evaluateString(newScope, printSource, "print", 1, null);
} finally {
cx.exit();
}
return newScope;
}
//Compilable methods
public CompiledScript compile(String script) throws ScriptException {
return compile(new StringReader(script));
}
public CompiledScript compile(java.io.Reader script) throws ScriptException {
CompiledScript ret = null;
Context cx = enterContext();
try {
String fileName = (String) get(ScriptEngine.FILENAME);
if (fileName == null) {
fileName = "<Unknown Source>";
}
Scriptable scope = getRuntimeScope(context);
Script scr = cx.compileReader(scope, script, fileName, 1, null);
ret = new RhinoCompiledScript(this, scr);
} catch (Exception e) {
if (DEBUG) e.printStackTrace();
throw new ScriptException(e);
} finally {
cx.exit();
}
return ret;
}
//package-private helpers
static Context enterContext() {
// call this always so that initializer of this class runs
// and initializes custom wrap factory and class shutter.
return Context.enter();
}
void setEngineFactory(ScriptEngineFactory fac) {
factory = fac;
}
Object[] wrapArguments(Object[] args) {
if (args == null) {
return Context.emptyArgs;
}
Object[] res = new Object[args.length];
for (int i = 0; i < res.length; i++) {
res[i] = Context.javaToJS(args[i], topLevel);
}
return res;
}
Object unwrapReturnValue(Object result) {
if (result instanceof Wrapper) {
result = ( (Wrapper) result).unwrap();
}
return result instanceof Undefined ? null : result;
}
/*
public static void main(String[] args) throws Exception {
if (args.length == 0) {
System.out.println("No file specified");
return;
}
InputStreamReader r = new InputStreamReader(new FileInputStream(args[0]));
ScriptEngine engine = new RhinoScriptEngine();
engine.put("x", "y");
engine.put(ScriptEngine.FILENAME, args[0]);
engine.eval(r);
System.out.println(engine.get("x"));
}
*/
}
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.script.javascript;
import javax.script.*;
import java.util.*;
import sun.org.mozilla.javascript.internal.*;
import com.sun.script.util.*;
/**
* Factory to create RhinoScriptEngine
*
* @author Mike Grogan
* @since 1.6
*/
public class RhinoScriptEngineFactory extends ScriptEngineFactoryBase {
public RhinoScriptEngineFactory() {
}
public List<String> getExtensions() {
return extensions;
}
public List<String> getMimeTypes() {
return mimeTypes;
}
public List<String> getNames() {
return names;
}
public Object getParameter(String key) {
if (key.equals(ScriptEngine.NAME)) {
return "javascript";
} else if (key.equals(ScriptEngine.ENGINE)) {
return "Mozilla Rhino";
} else if (key.equals(ScriptEngine.ENGINE_VERSION)) {
return "1.7 release 3 PRERELEASE";
} else if (key.equals(ScriptEngine.LANGUAGE)) {
return "ECMAScript";
} else if (key.equals(ScriptEngine.LANGUAGE_VERSION)) {
return "1.8";
} else if (key.equals("THREADING")) {
return "MULTITHREADED";
} else {
throw new IllegalArgumentException("Invalid key");
}
}
public ScriptEngine getScriptEngine() {
RhinoScriptEngine ret = new RhinoScriptEngine();
ret.setEngineFactory(this);
return ret;
}
public String getMethodCallSyntax(String obj, String method, String... args) {
String ret = obj + "." + method + "(";
int len = args.length;
if (len == 0) {
ret += ")";
return ret;
}
for (int i = 0; i < len; i++) {
ret += args[i];
if (i != len - 1) {
ret += ",";
} else {
ret += ")";
}
}
return ret;
}
public String getOutputStatement(String toDisplay) {
StringBuffer buf = new StringBuffer();
int len = toDisplay.length();
buf.append("print(\"");
for (int i = 0; i < len; i++) {
char ch = toDisplay.charAt(i);
switch (ch) {
case '"':
buf.append("\\\"");
break;
case '\\':
buf.append("\\\\");
break;
default:
buf.append(ch);
break;
}
}
buf.append("\")");
return buf.toString();
}
public String getProgram(String... statements) {
int len = statements.length;
String ret = "";
for (int i = 0; i < len; i++) {
ret += statements[i] + ";";
}
return ret;
}
/*
public static void main(String[] args) {
RhinoScriptEngineFactory fact = new RhinoScriptEngineFactory();
System.out.println(fact.getParameter(ScriptEngine.ENGINE_VERSION));
}
*/
private static List<String> names;
private static List<String> mimeTypes;
private static List<String> extensions;
static {
names = new ArrayList<String>(6);
names.add("js");
names.add("rhino");
names.add("JavaScript");
names.add("javascript");
names.add("ECMAScript");
names.add("ecmascript");
names = Collections.unmodifiableList(names);
mimeTypes = new ArrayList<String>(4);
mimeTypes.add("application/javascript");
mimeTypes.add("application/ecmascript");
mimeTypes.add("text/javascript");
mimeTypes.add("text/ecmascript");
mimeTypes = Collections.unmodifiableList(mimeTypes);
extensions = new ArrayList<String>(1);
extensions.add("js");
extensions = Collections.unmodifiableList(extensions);
}
}
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.script.javascript;
import sun.org.mozilla.javascript.internal.*;
import javax.script.*;
/**
* This class serves as top level scope for Rhino. This class adds
* 3 top level functions (bindings, scope, sync) and two constructors
* (JSAdapter, JavaAdapter).
*
* @author A. Sundararajan
* @since 1.6
*/
public final class RhinoTopLevel extends ImporterTopLevel {
RhinoTopLevel(Context cx, RhinoScriptEngine engine) {
super(cx);
this.engine = engine;
// initialize JSAdapter lazily. Reduces footprint & startup time.
new LazilyLoadedCtor(this, "JSAdapter",
"com.sun.script.javascript.JSAdapter",
false);
/*
* initialize JavaAdapter. We can't lazy initialize this because
* lazy initializer attempts to define a new property. But, JavaAdapter
* is an exisiting property that we overwrite.
*/
JavaAdapter.init(cx, this, false);
// add top level functions
String names[] = { "bindings", "scope", "sync" };
defineFunctionProperties(names, RhinoTopLevel.class,
ScriptableObject.DONTENUM);
}
/**
* The bindings function takes a JavaScript scope object
* of type ExternalScriptable and returns the underlying Bindings
* instance.
*
* var page = scope(pageBindings);
* with (page) {
* // code that uses page scope
* }
* var b = bindings(page);
* // operate on bindings here.
*/
public static Object bindings(Context cx, Scriptable thisObj, Object[] args,
Function funObj) {
if (args.length == 1) {
Object arg = args[0];
if (arg instanceof Wrapper) {
arg = ((Wrapper)arg).unwrap();
}
if (arg instanceof ExternalScriptable) {
ScriptContext ctx = ((ExternalScriptable)arg).getContext();
Bindings bind = ctx.getBindings(ScriptContext.ENGINE_SCOPE);
return Context.javaToJS(bind,
ScriptableObject.getTopLevelScope(thisObj));
}
}
return cx.getUndefinedValue();
}
/**
* The scope function creates a new JavaScript scope object
* with given Bindings object as backing store. This can be used
* to create a script scope based on arbitrary Bindings instance.
* For example, in webapp scenario, a 'page' level Bindings instance
* may be wrapped as a scope and code can be run in JavaScripe 'with'
* statement:
*
* var page = scope(pageBindings);
* with (page) {
* // code that uses page scope
* }
*/
public static Object scope(Context cx, Scriptable thisObj, Object[] args,
Function funObj) {
if (args.length == 1) {
Object arg = args[0];
if (arg instanceof Wrapper) {
arg = ((Wrapper)arg).unwrap();
}
if (arg instanceof Bindings) {
ScriptContext ctx = new SimpleScriptContext();
ctx.setBindings((Bindings)arg, ScriptContext.ENGINE_SCOPE);
Scriptable res = new ExternalScriptable(ctx);
res.setPrototype(ScriptableObject.getObjectPrototype(thisObj));
res.setParentScope(ScriptableObject.getTopLevelScope(thisObj));
return res;
}
}
return cx.getUndefinedValue();
}
/**
* The sync function creates a synchronized function (in the sense
* of a Java synchronized method) from an existing function. The
* new function synchronizes on the <code>this</code> object of
* its invocation.
* js> var o = { f : sync(function(x) {
* print("entry");
* Packages.java.lang.Thread.sleep(x*1000);
* print("exit");
* })};
* js> thread(function() {o.f(5);});
* entry
* js> thread(function() {o.f(5);});
* js>
* exit
* entry
* exit
*/
public static Object sync(Context cx, Scriptable thisObj, Object[] args,
Function funObj) {
if (args.length == 1 && args[0] instanceof Function) {
return new Synchronizer((Function)args[0]);
} else {
throw Context.reportRuntimeError("wrong argument(s) for sync");
}
}
RhinoScriptEngine getScriptEngine() {
return engine;
}
private RhinoScriptEngine engine;
}
/*
* Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.script.javascript;
import java.lang.reflect.*;
import static sun.security.util.SecurityConstants.*;
import sun.org.mozilla.javascript.internal.*;
/**
* This wrap factory is used for security reasons. JSR 223 script
* engine interface and JavaScript engine classes are run as bootstrap
* classes. For example, java.lang.Class.forName method (when called without
* class loader) uses caller's class loader. This may be exploited by script
* authors to access classes otherwise not accessible. For example,
* classes in sun.* namespace are normally not accessible to untrusted
* code and hence should not be accessible to JavaScript run from
* untrusted code.
*
* @author A. Sundararajan
* @since 1.6
*/
final class RhinoWrapFactory extends WrapFactory {
private RhinoWrapFactory() {}
private static RhinoWrapFactory theInstance;
static synchronized WrapFactory getInstance() {
if (theInstance == null) {
theInstance = new RhinoWrapFactory();
}
return theInstance;
}
// We use instance of this class to wrap security sensitive
// Java object. Please refer below.
private static class RhinoJavaObject extends NativeJavaObject {
RhinoJavaObject(Scriptable scope, Object obj, Class type) {
// we pass 'null' to object. NativeJavaObject uses
// passed 'type' to reflect fields and methods when
// object is null.
super(scope, null, type);
// Now, we set actual object. 'javaObject' is protected
// field of NativeJavaObject.
javaObject = obj;
}
}
public Scriptable wrapAsJavaObject(Context cx, Scriptable scope,
Object javaObject, Class staticType) {
SecurityManager sm = System.getSecurityManager();
ClassShutter classShutter = RhinoClassShutter.getInstance();
if (javaObject instanceof ClassLoader) {
// Check with Security Manager whether we can expose a
// ClassLoader...
if (sm != null) {
sm.checkPermission(GET_CLASSLOADER_PERMISSION);
}
// if we fall through here, check permission succeeded.
return super.wrapAsJavaObject(cx, scope, javaObject, staticType);
} else {
String name = null;
if (javaObject instanceof Class) {
name = ((Class)javaObject).getName();
} else if (javaObject instanceof Member) {
Member member = (Member) javaObject;
// Check member access. Don't allow reflective access to
// non-public members. Note that we can't call checkMemberAccess
// because that expects exact stack depth!
if (sm != null && !Modifier.isPublic(member.getModifiers())) {
return null;
}
name = member.getDeclaringClass().getName();
}
// Now, make sure that no ClassShutter prevented Class or Member
// of it is accessed reflectively. Note that ClassShutter may
// prevent access to a class, even though SecurityManager permit.
if (name != null) {
if (!classShutter.visibleToScripts(name)) {
return null;
} else {
return super.wrapAsJavaObject(cx, scope, javaObject, staticType);
}
}
}
// we have got some non-reflective object.
Class dynamicType = javaObject.getClass();
String name = dynamicType.getName();
if (!classShutter.visibleToScripts(name)) {
// Object of some sensitive class (such as sun.net.www.*
// objects returned from public method of java.net.URL class.
// We expose this object as though it is an object of some
// super class that is safe for access.
Class type = null;
// Whenever a Java Object is wrapped, we are passed with a
// staticType which is the type found from environment. For
// example, method return type known from signature. The dynamic
// type would be the actual Class of the actual returned object.
// If the staticType is an interface, we just use that type.
if (staticType != null && staticType.isInterface()) {
type = staticType;
} else {
// dynamicType is always a class type and never an interface.
// find an accessible super class of the dynamic type.
while (dynamicType != null) {
dynamicType = dynamicType.getSuperclass();
name = dynamicType.getName();
if (classShutter.visibleToScripts(name)) {
type = dynamicType; break;
}
}
// atleast java.lang.Object has to be accessible. So, when
// we reach here, type variable should not be null.
assert type != null:
"even java.lang.Object is not accessible?";
}
// create custom wrapper with the 'safe' type.
return new RhinoJavaObject(scope, javaObject, type);
} else {
return super.wrapAsJavaObject(cx, scope, javaObject, staticType);
}
}
}
/*
* Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.script.util;
import javax.script.*;
import java.lang.reflect.*;
import java.security.*;
/*
* java.lang.reflect.Proxy based interface implementor. This is meant
* to be used to implement Invocable.getInterface.
*
* @author Mike Grogan
* @since 1.6
*/
public class InterfaceImplementor {
private Invocable engine;
/** Creates a new instance of Invocable */
public InterfaceImplementor(Invocable engine) {
this.engine = engine;
}
private final class InterfaceImplementorInvocationHandler
implements InvocationHandler {
private Object thiz;
private AccessControlContext accCtxt;
public InterfaceImplementorInvocationHandler(Object thiz,
AccessControlContext accCtxt) {
this.thiz = thiz;
this.accCtxt = accCtxt;
}
public Object invoke(Object proxy , Method method, Object[] args)
throws java.lang.Throwable {
// give chance to convert input args
args = convertArguments(method, args);
Object result;
final Method m = method;
final Object[] a = args;
result = AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() {
public Object run() throws Exception {
if (thiz == null) {
return engine.invokeFunction(m.getName(), a);
} else {
return engine.invokeMethod(thiz, m.getName(), a);
}
}
}, accCtxt);
// give chance to convert the method result
return convertResult(method, result);
}
}
public <T> T getInterface(Object thiz, Class<T> iface)
throws ScriptException {
if (iface == null || !iface.isInterface()) {
throw new IllegalArgumentException("interface Class expected");
}
if (! isImplemented(thiz, iface)) {
return null;
}
AccessControlContext accCtxt = AccessController.getContext();
return iface.cast(Proxy.newProxyInstance(iface.getClassLoader(),
new Class[]{iface},
new InterfaceImplementorInvocationHandler(thiz, accCtxt)));
}
protected boolean isImplemented(Object thiz, Class<?> iface) {
return true;
}
// called to convert method result after invoke
protected Object convertResult(Method method, Object res)
throws ScriptException {
// default is identity conversion
return res;
}
// called to convert method arguments before invoke
protected Object[] convertArguments(Method method, Object[] args)
throws ScriptException {
// default is identity conversion
return args;
}
}
...@@ -142,7 +142,7 @@ abstract class AbstractLauncher extends ConnectorImpl implements LaunchingConnec ...@@ -142,7 +142,7 @@ abstract class AbstractLauncher extends ConnectorImpl implements LaunchingConnec
* This class simply provides a context for a single launch and * This class simply provides a context for a single launch and
* accept. It provides instance fields that can be used by * accept. It provides instance fields that can be used by
* all threads involved. This stuff can't be in the Connector proper * all threads involved. This stuff can't be in the Connector proper
* because the connector is is a singleton and not specific to any * because the connector is a singleton and is not specific to any
* one launch. * one launch.
*/ */
private class Helper { private class Helper {
......
...@@ -213,7 +213,7 @@ public class SunCommandLineLauncher extends AbstractLauncher implements Launchin ...@@ -213,7 +213,7 @@ public class SunCommandLineLauncher extends AbstractLauncher implements Launchin
exePath = exe; exePath = exe;
} }
// Quote only if necessary in case the quote arg value is bogus // Quote only if necessary in case the quote arg value is bogus
if (hasWhitespace(exe)) { if (hasWhitespace(exePath)) {
exePath = quote + exePath + quote; exePath = quote + exePath + quote;
} }
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册