提交 b60150ca 编写于 作者: A asaha

Merge

......@@ -96,6 +96,7 @@ OTHER_CPPFLAGS += $(LIBARCH_DEFINES)
ifneq ($(PLATFORM), windows) # UNIX systems
LD_RUNPATH_EXTRAS += ..
LIB_LOCATION = $(LIBDIR)/$(LIBARCH)/jli
# Note: its important to keep this order meaning -lc is the
# last library otherwise it could cause compatibility issues
......
......@@ -61,8 +61,5 @@ OTHER_CPPFLAGS += -DLAUNCHER_NAME='"$(LAUNCHER_NAME)"'
ifeq ($(PLATFORM), solaris)
LDFLAGS += -R$(OPENWIN_LIB)
endif
ifeq ($(PLATFORM), solaris)
LDFLAGS += -M mapfile-$(ARCH)
endif
......@@ -194,10 +194,8 @@ endif
# For backwards compatability, make a link of the 32-bit client JVM to $(LIBDIR)
IMPORT_LIST += $(LIB_LOCATION)/$(JVM_NAME)
# create a link from lib/libjvm.so to client/libjvm.so
$(LIB_LOCATION)/$(JVM_NAME): $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVM_NAME)
@$(prep-target)
$(LN) -s $(CLIENT_LOCATION)/$(JVM_NAME) $@
# solaris ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ solaris
endif # 32bit solaris
......
......@@ -21,4 +21,4 @@
# CA 95054 USA or visit www.sun.com if you need additional information or
# have any questions.
#
tzdata2009l
tzdata2009r
......@@ -102,15 +102,38 @@ Rule ChileAQ 2000 max - Mar Sun>=9 3:00u 0 -
# Davis, Vestfold Hills, -6835+07759, since 1957-01-13
# (except 1964-11 - 1969-02)
# Mawson, Holme Bay, -6736+06253, since 1954-02-13
# From Steffen Thorsen (2009-03-11):
# Three Australian stations in Antarctica have changed their time zone:
# Casey moved from UTC+8 to UTC+11
# Davis moved from UTC+7 to UTC+5
# Mawson moved from UTC+6 to UTC+5
# The changes occurred on 2009-10-18 at 02:00 (local times).
#
# Government source: (Australian Antarctic Division)
# <a href="http://www.aad.gov.au/default.asp?casid=37079">
# http://www.aad.gov.au/default.asp?casid=37079
# </a>
#
# We have more background information here:
# <a href="http://www.timeanddate.com/news/time/antarctica-new-times.html">
# http://www.timeanddate.com/news/time/antarctica-new-times.html
# </a>
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Antarctica/Casey 0 - zzz 1969
8:00 - WST # Western (Aus) Standard Time
8:00 - WST 2009 Oct 18 2:00
# Western (Aus) Standard Time
11:00 - CAST # Casey Time
Zone Antarctica/Davis 0 - zzz 1957 Jan 13
7:00 - DAVT 1964 Nov # Davis Time
0 - zzz 1969 Feb
7:00 - DAVT
7:00 - DAVT 2009 Oct 18 2:0
5:00 - DAVT
Zone Antarctica/Mawson 0 - zzz 1954 Feb 13
6:00 - MAWT # Mawson Time
6:00 - MAWT 2009 Oct 18 2:00
# Mawson Time
5:00 - MAWT
# References:
# <a href="http://www.antdiv.gov.au/aad/exop/sfo/casey/casey_aws.html">
# Casey Weather (1998-02-26)
......
......@@ -21,7 +21,6 @@
# CA 95054 USA or visit www.sun.com if you need additional information or
# have any questions.
#
# <pre>
# This file is in the public domain, so clarified as of
# 2009-05-17 by Arthur David Olson.
......@@ -194,11 +193,30 @@ Zone Asia/Bahrain 3:22:20 - LMT 1920 # Al Manamah
#
# No DST end date has been announced yet.
# From Arthur David Olson (2009-07-11):
# Arbitrarily end DST at the end of 2009 so that a POSIX-sytle time zone string
# can appear in the Dhaka binary file and for the benefit of old glibc
# reimplementations of the time zone software that mishandle permanent DST.
# A change will be required once the end date is known.
# From Alexander Krivenyshev (2009-09-25):
# Bangladesh won't go back to Standard Time from October 1, 2009,
# instead it will continue DST measure till the cabinet makes a fresh decision.
#
# Following report by same newspaper-"The Daily Star Friday":
# "DST change awaits cabinet decision-Clock won't go back by 1-hr from Oct 1"
# <a href="http://www.thedailystar.net/newDesign/news-details.php?nid=107021">
# http://www.thedailystar.net/newDesign/news-details.php?nid=107021
# </a>
# or
# <a href="http://www.worldtimezone.com/dst_news/dst_news_bangladesh04.html">
# http://www.worldtimezone.com/dst_news/dst_news_bangladesh04.html
# </a>
# From Steffen Thorsen (2009-10-13):
# IANS (Indo-Asian News Service) now reports:
# Bangladesh has decided that the clock advanced by an hour to make
# maximum use of daylight hours as an energy saving measure would
# "continue for an indefinite period."
#
# One of many places where it is published:
# <a href="http://www.thaindian.com/newsportal/business/bangladesh-to-continue-indefinitely-with-advanced-time_100259987.html">
# http://www.thaindian.com/newsportal/business/bangladesh-to-continue-indefinitely-with-advanced-time_100259987.html
# </a>
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Asia/Dhaka 6:01:40 - LMT 1890
......@@ -208,8 +226,7 @@ Zone Asia/Dhaka 6:01:40 - LMT 1890
6:30 - BURT 1951 Sep 30
6:00 - DACT 1971 Mar 26 # Dacca Time
6:00 - BDT 2009 Jun 19 23:00 # Bangladesh Time
6:00 1:00 BDST 2010
6:00 - BDT
6:00 1:00 BDST
# Bhutan
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
......@@ -373,14 +390,84 @@ Zone Asia/Kashgar 5:03:56 - LMT 1928 # or Kashi or Kaxgar
5:00 - KAST 1980 May
8:00 PRC C%sT
# From Lee Yiu Chung (2009-10-24):
# I found there are some mistakes for the historial DST rule for Hong
# Kong. Accoring to the DST record from Hong Kong Observatory (actually,
# it is not [an] observatory, but the official meteorological agency of HK,
# and also serves as the official timing agency), there are some missing
# and incorrect rules. Although the exact switch over time is missing, I
# think 3:30 is correct. The official DST record for Hong Kong can be
# obtained from
# <a href="http://www.hko.gov.hk/gts/time/Summertime.htm">
# http://www.hko.gov.hk/gts/time/Summertime.htm
# </a>.
# From Arthur David Olson (2009-10-28):
# Here are the dates given at
# <a href="http://www.hko.gov.hk/gts/time/Summertime.htm">
# http://www.hko.gov.hk/gts/time/Summertime.htm
# </a>
# as of 2009-10-28:
# Year Period
# 1941 1 Apr to 30 Sep
# 1942 Whole year
# 1943 Whole year
# 1944 Whole year
# 1945 Whole year
# 1946 20 Apr to 1 Dec
# 1947 13 Apr to 30 Dec
# 1948 2 May to 31 Oct
# 1949 3 Apr to 30 Oct
# 1950 2 Apr to 29 Oct
# 1951 1 Apr to 28 Oct
# 1952 6 Apr to 25 Oct
# 1953 5 Apr to 1 Nov
# 1954 21 Mar to 31 Oct
# 1955 20 Mar to 6 Nov
# 1956 18 Mar to 4 Nov
# 1957 24 Mar to 3 Nov
# 1958 23 Mar to 2 Nov
# 1959 22 Mar to 1 Nov
# 1960 20 Mar to 6 Nov
# 1961 19 Mar to 5 Nov
# 1962 18 Mar to 4 Nov
# 1963 24 Mar to 3 Nov
# 1964 22 Mar to 1 Nov
# 1965 18 Apr to 17 Oct
# 1966 17 Apr to 16 Oct
# 1967 16 Apr to 22 Oct
# 1968 21 Apr to 20 Oct
# 1969 20 Apr to 19 Oct
# 1970 19 Apr to 18 Oct
# 1971 18 Apr to 17 Oct
# 1972 16 Apr to 22 Oct
# 1973 22 Apr to 21 Oct
# 1973/74 30 Dec 73 to 20 Oct 74
# 1975 20 Apr to 19 Oct
# 1976 18 Apr to 17 Oct
# 1977 Nil
# 1978 Nil
# 1979 13 May to 21 Oct
# 1980 to Now Nil
# The page does not give start or end times of day.
# The page does not give a start date for 1942.
# The page does not givw an end date for 1945.
# The Japanese occupation of Hong Kong began on 1941-12-25.
# 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.
# Hong Kong (Xianggang)
# 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 - Sep 30 3:30 0 -
Rule HK 1946 only - Apr 20 3:30 1:00 S
Rule HK 1946 only - Dec 1 3:30 0 -
Rule HK 1947 only - Apr 13 3:30 1:00 S
Rule HK 1947 only - Dec 30 3:30 0 -
Rule HK 1948 only - May 2 3:30 1:00 S
Rule HK 1948 1952 - Oct lastSun 3:30 0 -
Rule HK 1948 1951 - Oct lastSun 3:30 0 -
Rule HK 1952 only - Oct 25 3:30 0 -
Rule HK 1949 1953 - Apr Sun>=1 3:30 1:00 S
Rule HK 1953 only - Nov 1 3:30 0 -
Rule HK 1954 1964 - Mar Sun>=18 3:30 1:00 S
......@@ -388,13 +475,15 @@ Rule HK 1954 only - Oct 31 3:30 0 -
Rule HK 1955 1964 - Nov Sun>=1 3:30 0 -
Rule HK 1965 1977 - Apr Sun>=16 3:30 1:00 S
Rule HK 1965 1977 - Oct Sun>=16 3:30 0 -
Rule HK 1979 1980 - May Sun>=8 3:30 1:00 S
Rule HK 1979 1980 - Oct Sun>=16 3:30 0 -
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 - Oct Sun>=16 3:30 0 -
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Asia/Hong_Kong 7:36:36 - LMT 1904 Oct 30
8:00 HK HK%sT 1941 Dec 25
9:00 - JST 1945 Sep 15
8:00 HK HK%sT
###############################################################################
# Taiwan
......@@ -1696,16 +1785,66 @@ Zone Asia/Muscat 3:54:20 - LMT 1920
# advance clocks in the country by one hour from April 15 to
# conserve energy"
# From Arthur David Olson (2009-04-10):
# Assume for now that Pakistan will end DST in 2009 as it did in 2008.
# From Steffen Thorsen (2009-09-17):
# "The News International," Pakistan reports that: "The Federal
# Government has decided to restore the previous time by moving the
# clocks backward by one hour from October 1. A formal announcement to
# this effect will be made after the Prime Minister grants approval in
# this regard."
# <a href="http://www.thenews.com.pk/updates.asp?id=87168">
# http://www.thenews.com.pk/updates.asp?id=87168
# </a>
# From Alexander Krivenyshev (2009-09-28):
# According to Associated Press Of Pakistan, it is confirmed that
# Pakistan clocks across the country would be turned back by an hour from October
# 1, 2009.
#
# "Clocks to go back one hour from 1 Oct"
# <a href="http://www.app.com.pk/en_/index.php?option=com_content&task=view&id=86715&Itemid=2">
# http://www.app.com.pk/en_/index.php?option=com_content&task=view&id=86715&Itemid=2
# </a>
# or
# <a href="http://www.worldtimezone.com/dst_news/dst_news_pakistan07.htm">
# http://www.worldtimezone.com/dst_news/dst_news_pakistan07.htm
# </a>
# From Steffen Thorsen (2009-09-29):
# Alexander Krivenyshev wrote:
# > According to Associated Press Of Pakistan, it is confirmed that
# > Pakistan clocks across the country would be turned back by an hour from October
# > 1, 2009.
#
# Now they seem to have changed their mind, November 1 is the new date:
# <a href="http://www.thenews.com.pk/top_story_detail.asp?Id=24742">
# http://www.thenews.com.pk/top_story_detail.asp?Id=24742
# </a>
# "The country's clocks will be reversed by one hour on November 1.
# Officials of Federal Ministry for Interior told this to Geo News on
# Monday."
#
# And more importantly, it seems that these dates will be kept every year:
# "It has now been decided that clocks will be wound forward by one hour
# on April 15 and reversed by an hour on November 1 every year without
# obtaining prior approval, the officials added."
#
# We have confirmed this year's end date with both with the Ministry of
# Water and Power and the Pakistan Electric Power Company:
# <a href="http://www.timeanddate.com/news/time/pakistan-ends-dst09.html">
# http://www.timeanddate.com/news/time/pakistan-ends-dst09.html
# </a>
# From Christoph Goehre (2009-10-01):
# [T]he German Consulate General in Karachi reported me today that Pakistan
# will go back to standard time on 1st of November.
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule Pakistan 2002 only - Apr Sun>=2 0:01 1:00 S
Rule Pakistan 2002 only - Oct Sun>=2 0:01 0 -
Rule Pakistan 2008 only - Jun 1 0:00 1:00 S
Rule Pakistan 2008 only - Nov 1 0:00 0 -
Rule Pakistan 2009 only - Apr 15 0:00 1:00 S
Rule Pakistan 2009 only - Nov 1 0:00 0 -
Rule Pakistan 2009 max - Apr 15 0:00 1:00 S
Rule Pakistan 2009 max - Nov 1 0:00 0 -
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Asia/Karachi 4:28:12 - LMT 1907
5:30 - IST 1942 Sep
......@@ -1858,6 +1997,42 @@ Zone Asia/Karachi 4:28:12 - LMT 1907
# http://www.worldtimezone.com/dst_news/dst_news_westbank01.html
# </a>
# From Steffen Thorsen (2009-08-31):
# Palestine's Council of Ministers announced that they will revert back to
# winter time on Friday, 2009-09-04.
#
# One news source:
# <a href="http://www.safa.ps/ara/?action=showdetail&seid=4158">
# http://www.safa.ps/ara/?action=showdetail&seid=4158
# </a>
# (Palestinian press agency, Arabic),
# Google translate: "Decided that the Palestinian government in Ramallah
# headed by Salam Fayyad, the start of work in time for the winter of
# 2009, starting on Friday approved the fourth delay Sept. clock sixty
# minutes per hour as of Friday morning."
#
# We are not sure if Gaza will do the same, last year they had a different
# end date, we will keep this page updated:
# <a href="http://www.timeanddate.com/news/time/westbank-gaza-dst-2009.html">
# http://www.timeanddate.com/news/time/westbank-gaza-dst-2009.html
# </a>
# From Alexander Krivenyshev (2009-09-02):
# Seems that Gaza Strip will go back to Winter Time same date as West Bank.
#
# According to Palestinian Ministry Of Interior, West Bank and Gaza Strip plan
# to change time back to Standard time on September 4, 2009.
#
# "Winter time unite the West Bank and Gaza"
# (from Palestinian National Authority):
# <a href="http://www.moi.gov.ps/en/?page=633167343250594025&nid=11505
# http://www.moi.gov.ps/en/?page=633167343250594025&nid=11505
# </a>
# or
# <a href="http://www.worldtimezone.com/dst_news/dst_news_gazastrip02.html>
# http://www.worldtimezone.com/dst_news/dst_news_gazastrip02.html
# </a>
# The rules for Egypt are stolen from the `africa' file.
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule EgyptAsia 1957 only - May 10 0:00 1:00 S
......@@ -1876,7 +2051,7 @@ Rule Palestine 2006 only - Sep 22 0:00 0 -
Rule Palestine 2007 only - Sep Thu>=8 2:00 0 -
Rule Palestine 2008 only - Aug lastFri 2:00 0 -
Rule Palestine 2009 max - Mar lastFri 0:00 1:00 S
Rule Palestine 2009 max - Sep lastMon 2:00 0 -
Rule Palestine 2009 max - Sep Fri>=1 2:00 0 -
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Asia/Gaza 2:17:52 - LMT 1900 Oct
......@@ -2154,9 +2329,23 @@ Rule Syria 2007 only - Nov Fri>=1 0:00 0 -
# http://www.timeanddate.com/news/time/syria-dst-starts-march-27-2009.html
# </a>
# From Steffen Thorsen (2009-10-27):
# The Syrian Arab News Network on 2009-09-29 reported that Syria will
# revert back to winter (standard) time on midnight between Thursday
# 2009-10-29 and Friday 2009-10-30:
# <a href="http://www.sana.sy/ara/2/2009/09/29/247012.htm">
# http://www.sana.sy/ara/2/2009/09/29/247012.htm (Arabic)
# </a>
# From Arthur David Olson (2009-10-28):
# We'll see if future DST switching times turn out to be end of the last
# Thursday of the month or the start of the last Friday of the month or
# something else. For now, use the start of the last Friday.
Rule Syria 2008 only - Apr Fri>=1 0:00 1:00 S
Rule Syria 2008 max - Nov 1 0:00 0 -
Rule Syria 2008 only - Nov 1 0:00 0 -
Rule Syria 2009 max - Mar lastFri 0:00 1:00 S
Rule Syria 2009 max - Oct lastFri 0:00 0 -
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Asia/Damascus 2:25:12 - LMT 1920 # Dimashq
......
......@@ -465,10 +465,56 @@ Zone Pacific/Pago_Pago 12:37:12 - LMT 1879 Jul 5
# http://www.worldtimezone.com/dst_news/dst_news_samoa01.html
# </a>
# From Steffen Thorsen (2009-08-27):
# Samoa's parliament passed the Daylight Saving Bill 2009, and will start
# daylight saving time on the first Sunday of October 2009 and end on the
# last Sunday of March 2010. We hope that the full text will be published
# soon, but we believe that the bill is only valid for 2009-2010. Samoa's
# Daylight Saving Act 2009 will be enforced as soon as the Head of State
# executes a proclamation publicizing this Act.
#
# Some background information here, which will be updated once we have
# more details:
# <a href="http://www.timeanddate.com/news/time/samoa-dst-plan-2009.html">
# http://www.timeanddate.com/news/time/samoa-dst-plan-2009.html
# </a>
# From Alexander Krivenyshev (2009-10-03):
# First, my deepest condolences to people of Samoa islands and all families and
# loved ones around the world who lost their lives in the earthquake and tsunami.
#
# Considering the recent devastation on Samoa by earthquake and tsunami and that
# many government offices/ ministers are closed- not sure if "Daylight Saving
# Bill 2009" will be implemented in next few days- on October 4, 2009.
#
# Here is reply from Consulate-General of Samoa in New Zealand
# ---------------------------
# Consul General
# consulgeneral@samoaconsulate.org.nz
#
# Talofa Alexander,
#
# Thank you for your sympathy for our country but at this time we have not
# been informed about the Daylight Savings Time Change. Most Ministries in
# Apia are closed or relocating due to weather concerns.
#
# When we do find out if they are still proceeding with the time change we
# will advise you soonest.
#
# Kind Regards,
# Lana
# for: Consul General
# From Steffen Thorsen (2009-10-05):
# We have called a hotel in Samoa and asked about local time there - they
# are still on standard time.
Zone Pacific/Apia 12:33:04 - LMT 1879 Jul 5
-11:26:56 - LMT 1911
-11:30 - SAMT 1950 # Samoa Time
-11:00 - WST # Samoa Time
-11:00 - WST 2009 Oct 4
-11:00 1:00 WSDT 2010 Mar 28
-11:00 - WST
# Solomon Is
# excludes Bougainville, for which see Papua New Guinea
......
......@@ -2094,9 +2094,43 @@ Zone Asia/Novosibirsk 5:31:40 - LMT 1919 Dec 14 6:00
6:00 Russia NOV%sT 1992 Jan 19 2:00s
7:00 Russia NOV%sT 1993 May 23 # say Shanks & P.
6:00 Russia NOV%sT
# From Alexander Krivenyshev (2009-10-13):
# Kemerovo oblast' (Kemerovo region) in Russia will change current time zone on
# March 28, 2010:
# from current Russia Zone 6 - Krasnoyarsk Time Zone (KRA) UTC +0700
# to Russia Zone 5 - Novosibirsk Time Zone (NOV) UTC +0600
#
# This is according to Government of Russia decree # 740, on September
# 14, 2009 "Application in the territory of the Kemerovo region the Fifth
# time zone." ("Russia Zone 5" or old "USSR Zone 5" is GMT +0600)
#
# Russian Government web site (Russian language)
# <a href="http://www.government.ru/content/governmentactivity/rfgovernmentdecisions/archiv">
# http://www.government.ru/content/governmentactivity/rfgovernmentdecisions/archive/2009/09/14/991633.htm
# </a>
# or Russian-English translation by WorldTimeZone.com with reference
# map to local region and new Russia Time Zone map after March 28, 2010
# <a href="http://www.worldtimezone.com/dst_news/dst_news_russia03.html">
# http://www.worldtimezone.com/dst_news/dst_news_russia03.html
# </a>
#
# Thus, when Russia will switch to DST on the night of March 28, 2010
# Kemerovo region (Kemerovo oblast') will not change the clock.
#
# As a result, Kemerovo oblast' will be in the same time zone as
# Novosibirsk, Omsk, Tomsk, Barnaul and Altai Republic.
Zone Asia/Novokuznetsk 5:48:48 - NMT 1920 Jan 6
6:00 - KRAT 1930 Jun 21 # Krasnoyarsk Time
7:00 Russia KRA%sT 1991 Mar 31 2:00s
6:00 Russia KRA%sT 1992 Jan 19 2:00s
7:00 Russia KRA%sT 2010 Mar 28 2:00s
6:00 Russia NOV%sT # Novosibirsk/Novokuznetsk Time
#
# From Oscar van Vlijmen (2001-08-25): [This region consists of]
# Kemerovskaya oblast', Krasnoyarskij kraj,
# Krasnoyarskij kraj,
# Tajmyrskij (Dolgano-Nenetskij) avtonomnyj okrug,
# Respublika Tuva, Respublika Khakasiya, Evenkijskij avtonomnyj okrug.
Zone Asia/Krasnoyarsk 6:11:20 - LMT 1920 Jan 6
......
......@@ -237,9 +237,23 @@ Rule Arg 2000 only - Mar 3 0:00 0 -
# http://www.jujuy.gov.ar/index2/partes_prensa/18_10_08/235-181008.doc
# </a>
# From fullinet (2009-10-18):
# As announced in
# <a hef="http://www.argentina.gob.ar/argentina/portal/paginas.dhtml?pagina=356">
# http://www.argentina.gob.ar/argentina/portal/paginas.dhtml?pagina=356
# </a>
# (an official .gob.ar) under title: "Sin Cambio de Hora" (english: "No hour change")
#
# "Por el momento, el Gobierno Nacional resolvio no modificar la hora
# oficial, decision que estaba en estudio para su implementacion el
# domingo 18 de octubre. Desde el Ministerio de Planificacion se anuncio
# que la Argentina hoy, en estas condiciones meteorologicas, no necesita
# la modificacion del huso horario, ya que 2009 nos encuentra con
# crecimiento en la produccion y distribucion energetica."
Rule Arg 2007 only - Dec 30 0:00 1:00 S
Rule Arg 2008 max - Mar Sun>=15 0:00 0 -
Rule Arg 2008 max - Oct Sun>=15 0:00 1:00 S
Rule Arg 2008 2009 - Mar Sun>=15 0:00 0 -
Rule Arg 2008 only - Oct Sun>=15 0:00 1:00 S
# From Mariano Absatz (2004-05-21):
# Today it was officially published that the Province of Mendoza is changing
......@@ -411,15 +425,40 @@ Rule Arg 2008 max - Oct Sun>=15 0:00 1:00 S
# during 2009, this timezone change will run from 00:00 the third Sunday
# in March until 24:00 of the second Saturday in October.
# From Arthur David Olson (2009-03-16):
# The unofficial claim at
# <a href="http://www.timeanddate.com/news/time/san-luis-new-time-zone.html">
# http://www.timeanddate.com/news/time/san-luis-new-time-zone.html
# From Mariano Absatz (2009-10-16):
# ...the Province of San Luis is a case in itself.
#
# The Law at
# <a href="http://www.diputadossanluis.gov.ar/diputadosasp/paginas/verNorma.asp?NormaID=276>"
# http://www.diputadossanluis.gov.ar/diputadosasp/paginas/verNorma.asp?NormaID=276
# </a>
# is that "The province will most likely follow the next daylight saving schedule,
# which is planned for the second Sunday in October."
# is ambiguous because establishes a calendar from the 2nd Sunday in
# October at 0:00 thru the 2nd Saturday in March at 24:00 and the
# complement of that starting on the 2nd Sunday of March at 0:00 and
# ending on the 2nd Saturday of March at 24:00.
#
# This clearly breaks every time the 1st of March or October is a Sunday.
#
# IMHO, the "spirit of the Law" is to make the changes at 0:00 on the 2nd
# Sunday of October and March.
#
# The problem is that the changes in the rest of the Provinces that did
# change in 2007/2008, were made according to the Federal Law and Decrees
# that did so on the 3rd Sunday of October and March.
#
# In fact, San Luis actually switched from UTC-4 to UTC-3 last Sunday
# (October 11th) at 0:00.
#
# So I guess a new set of rules, besides "Arg", must be made and the last
# America/Argentina/San_Luis entries should change to use these...
#
# I'm enclosing a patch that does what I say... regretfully, the San Luis
# timezone must be called "WART/WARST" even when most of the time (like,
# right now) WARST == ART... that is, since last Sunday, all the country
# is using UTC-3, but in my patch, San Luis calls it "WARST" and the rest
# of the country calls it "ART".
# ...
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
#
# Buenos Aires (BA), Capital Federal (CF),
......@@ -552,6 +591,10 @@ Zone America/Argentina/Mendoza -4:35:16 - LMT 1894 Oct 31
-3:00 - ART
#
# San Luis (SL)
Rule SanLuis 2008 max - Mar Sun>=8 0:00 0 -
Rule SanLuis 2007 max - Oct Sun>=8 0:00 1:00 S
Zone America/Argentina/San_Luis -4:25:24 - LMT 1894 Oct 31
-4:16:48 - CMT 1920 May
-4:00 - ART 1930 Dec
......@@ -566,8 +609,7 @@ Zone America/Argentina/San_Luis -4:25:24 - LMT 1894 Oct 31
-3:00 - ART 2004 May 31
-4:00 - WART 2004 Jul 25
-3:00 Arg AR%sT 2008 Jan 21
-3:00 - ART 2009 Mar 15
-4:00 Arg WAR%sT
-4:00 SanLuis WAR%sT
#
# Santa Cruz (SC)
Zone America/Argentina/Rio_Gallegos -4:36:52 - LMT 1894 Oct 31
......
......@@ -352,6 +352,7 @@ RU +5312+05009 Europe/Samara Moscow+01 - Samara, Udmurtia
RU +5651+06036 Asia/Yekaterinburg Moscow+02 - Urals
RU +5500+07324 Asia/Omsk Moscow+03 - west Siberia
RU +5502+08255 Asia/Novosibirsk Moscow+03 - Novosibirsk
RU +5345+08707 Asia/Novokuznetsk Moscow+03 - Novokuznetsk
RU +5601+09250 Asia/Krasnoyarsk Moscow+04 - Yenisei River
RU +5216+10420 Asia/Irkutsk Moscow+05 - Lake Baikal
RU +6200+12940 Asia/Yakutsk Moscow+06 - Lena River
......
/*
* Copyright 1995-2008 Sun Microsystems, Inc. All Rights Reserved.
* Copyright 1995-2009 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -41,15 +41,13 @@
* options are turned into "-foo" options to the vm. This option
* filtering is handled in a number of places in the launcher, some of
* it in machine-dependent code. In this file, the function
* CheckJVMType removes vm style options and TranslateApplicationArgs
* removes "-J" prefixes. On unix platforms, the
* CreateExecutionEnvironment function from the unix java_md.c file
* processes and removes -d<n> options. However, in case
* CreateExecutionEnvironment does not need to exec because
* LD_LIBRARY_PATH is set acceptably and the data model does not need
* to be changed, ParseArguments will screen out the redundant -d<n>
* options and prevent them from being passed to the vm; this is done
* by RemovableOption.
* CheckJvmType removes vm style options and TranslateApplicationArgs
* removes "-J" prefixes. The CreateExecutionEnvironment function processes
* and removes -d<n> options. On unix, there is a possibility that the running
* data model may not match to the desired data model, in this case an exec is
* required to start the desired model. If the data models match, then
* ParseArguments will remove the -d<n> flags. If the data models do not match
* the CreateExecutionEnviroment will remove the -d<n> flags.
*/
......@@ -1891,11 +1889,11 @@ DumpState()
* Return JNI_TRUE for an option string that has no effect but should
* _not_ be passed on to the vm; return JNI_FALSE otherwise. On
* Solaris SPARC, this screening needs to be done if:
* 1) LD_LIBRARY_PATH does _not_ need to be reset and
* 2) -d32 or -d64 is passed to a binary with a matching data model
* (the exec in SetLibraryPath removes -d<n> options and points the
* exec to the proper binary). When this exec is not done, these options
* would end up getting passed onto the vm.
* -d32 or -d64 is passed to a binary with an unmatched data model
* (the exec in CreateExecutionEnvironment removes -d<n> options and points the
* exec to the proper binary). In the case of when the data model and the
* requested version is matched, an exec would not occur, and these options
* were erroneously passed to the vm.
*/
jboolean
RemovableOption(char * option)
......
......@@ -99,4 +99,58 @@ public interface ExtendedGSSContext extends GSSContext {
*/
public Object inquireSecContext(InquireType type)
throws GSSException;
/**
* Requests that the delegation policy be respected. When a true value is
* requested, the underlying context would use the delegation policy
* defined by the environment as a hint to determine whether credentials
* delegation should be performed. This request can only be made on the
* context initiator's side and it has to be done prior to the first
* call to <code>initSecContext</code>.
* <p>
* When this flag is false, delegation will only be tried when the
* {@link GSSContext#requestCredDeleg(boolean) credentials delegation flag}
* is true.
* <p>
* When this flag is true but the
* {@link GSSContext#requestCredDeleg(boolean) credentials delegation flag}
* is false, delegation will be only tried if the delegation policy permits
* delegation.
* <p>
* When both this flag and the
* {@link GSSContext#requestCredDeleg(boolean) credentials delegation flag}
* are true, delegation will be always tried. However, if the delegation
* policy does not permit delegation, the value of
* {@link #getDelegPolicyState} will be false, even
* if delegation is performed successfully.
* <p>
* In any case, if the delegation is not successful, the value returned
* by {@link GSSContext#getCredDelegState()} is false, and the value
* returned by {@link #getDelegPolicyState()} is also false.
* <p>
* Not all mechanisms support delegation policy. Therefore, the
* application should check to see if the request was honored with the
* {@link #getDelegPolicyState() getDelegPolicyState} method. When
* delegation policy is not supported, <code>requestDelegPolicy</code>
* should return silently without throwing an exception.
* <p>
* Note: for the Kerberos 5 mechanism, the delegation policy is expressed
* through the OK-AS-DELEGATE flag in the service ticket. When it's true,
* the KDC permits delegation to the target server. In a cross-realm
* environment, in order for delegation be permitted, all cross-realm TGTs
* on the authentication path must also have the OK-AS-DELAGATE flags set.
* @param state true if the policy should be respected
* @throws GSSException containing the following
* major error codes:
* {@link GSSException#FAILURE GSSException.FAILURE}
*/
public void requestDelegPolicy(boolean state) throws GSSException;
/**
* Returns the delegation policy response. Called after a security context
* is established. This method can be only called on the initiator's side.
* See {@link ExtendedGSSContext#requestDelegPolicy}.
* @return the delegation policy response
*/
public boolean getDelegPolicyState();
}
......@@ -229,6 +229,21 @@ public class Applet extends Panel {
resize(d.width, d.height);
}
/**
* Indicates if this container is a validate root.
* <p>
* {@code Applet} objects are the validate roots, and, therefore, they
* override this method to return {@code true}.
*
* @return {@code true}
* @since 1.7
* @see java.awt.Container#isValidateRoot
*/
@Override
public boolean isValidateRoot() {
return true;
}
/**
* Requests that the argument string be displayed in the
* "status window". Many browsers and applet viewers
......
/*
* Copyright 1997-2005 Sun Microsystems, Inc. All Rights Reserved.
* Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -92,7 +92,15 @@ import java.security.BasicPermission;
* <td>Enter full-screen exclusive mode</td>
* <td>Entering full-screen exclusive mode allows direct access to
* low-level graphics card memory. This could be used to spoof the
* system, since the program is in direct control of rendering.</td>
* system, since the program is in direct control of rendering. Depending on
* the implementation, the security warning may not be shown for the windows
* used to enter the full-screen exclusive mode (assuming that the {@code
* fullScreenExclusive} permission has been granted to this application). Note
* that this behavior does not mean that the {@code
* showWindowWithoutWarningBanner} permission will be automatically granted to
* the application which has the {@code fullScreenExclusive} permission:
* non-full-screen windows will continue to be shown with the security
* warning.</td>
* </tr>
*
* <tr>
......
......@@ -2764,8 +2764,11 @@ public abstract class Component implements ImageObserver, MenuContainer,
}
/**
* Ensures that this component has a valid layout. This method is
* primarily intended to operate on instances of <code>Container</code>.
* Validates this component.
* <p>
* The meaning of the term <i>validating</i> is defined by the ancestors of
* this class. See {@link Container#validate} for more details.
*
* @see #invalidate
* @see #doLayout()
* @see LayoutManager
......@@ -2794,12 +2797,24 @@ public abstract class Component implements ImageObserver, MenuContainer,
}
/**
* Invalidates this component. This component and all parents
* above it are marked as needing to be laid out. This method can
* be called often, so it needs to execute quickly.
* Invalidates this component and its ancestors.
* <p>
* All the ancestors of this component up to the nearest validate root are
* marked invalid also. If there is no a validate root container for this
* component, all of its ancestors up to the root of the hierarchy are
* marked invalid as well. Marking a container <i>invalid</i> indicates
* that the container needs to be laid out.
* <p>
* This method is called automatically when any layout-related information
* changes (e.g. setting the bounds of the component, or adding the
* component to a container).
* <p>
* This method might be called often, so it should work fast.
*
* @see #validate
* @see #doLayout
* @see LayoutManager
* @see java.awt.Container#isValidateRoot
* @since JDK1.0
*/
public void invalidate() {
......@@ -2818,9 +2833,18 @@ public abstract class Component implements ImageObserver, MenuContainer,
if (!isMaximumSizeSet()) {
maxSize = null;
}
if (parent != null) {
parent.invalidateIfValid();
}
invalidateParent();
}
}
/**
* Invalidates the parent of this component if any.
*
* This method MUST BE invoked under the TreeLock.
*/
void invalidateParent() {
if (parent != null) {
parent.invalidateIfValid();
}
}
......@@ -6727,12 +6751,13 @@ public abstract class Component implements ImageObserver, MenuContainer,
}
}
} else {
// It's native. If the parent is lightweight it
// will need some help.
Container parent = this.parent;
if (parent != null && parent.peer instanceof LightweightPeer) {
// It's native. If the parent is lightweight it will need some
// help.
Container parent = getContainer();
if (parent != null && parent.isLightweight()) {
relocateComponent();
if (!isRecursivelyVisible()) {
if (!parent.isRecursivelyVisibleUpToHeavyweightContainer())
{
peer.setVisible(false);
}
}
......
......@@ -1492,20 +1492,59 @@ public class Container extends Component {
}
/**
* Invalidates the container. The container and all parents
* above it are marked as needing to be laid out. This method can
* be called often, so it needs to execute quickly.
* Indicates if this container is a <i>validate root</i>.
* <p>
* Layout-related changes, such as bounds of the validate root descendants,
* do not affect the layout of the validate root parent. This peculiarity
* enables the {@code invalidate()} method to stop invalidating the
* component hierarchy when the method encounters a validate root.
* <p>
* If a component hierarchy contains validate roots, the {@code validate()}
* method must be invoked on the validate root of a previously invalidated
* component, rather than on the top-level container (such as a {@code
* Frame} object) to restore the validity of the hierarchy later.
* <p>
* The {@code Window} class and the {@code Applet} class are the validate
* roots in AWT. Swing introduces more validate roots.
*
* <p> If the {@code LayoutManager} installed on this container is
* an instance of {@code LayoutManager2}, then
* {@link LayoutManager2#invalidateLayout(Container)} is invoked on
* it supplying this {@code Container} as the argument.
* @return whether this container is a validate root
* @see #invalidate
* @see java.awt.Component#invalidate
* @see javax.swing.JComponent#isValidateRoot
* @see javax.swing.JComponent#revalidate
* @since 1.7
*/
public boolean isValidateRoot() {
return false;
}
/**
* Invalidates the parent of the container unless the container
* is a validate root.
*/
@Override
void invalidateParent() {
if (!isValidateRoot()) {
super.invalidateParent();
}
}
/**
* Invalidates the container.
* <p>
* If the {@code LayoutManager} installed on this container is an instance
* of the {@code LayoutManager2} interface, then
* the {@link LayoutManager2#invalidateLayout(Container)} method is invoked
* on it supplying this {@code Container} as the argument.
* <p>
* Afterwards this method marks this container invalid, and invalidates its
* ancestors. See the {@link Component#invalidate} method for more details.
*
* @see #validate
* @see #layout
* @see LayoutManager
* @see LayoutManager2#invalidateLayout(Container)
* @see LayoutManager2
*/
@Override
public void invalidate() {
LayoutManager layoutMgr = this.layoutMgr;
if (layoutMgr instanceof LayoutManager2) {
......@@ -1518,52 +1557,90 @@ public class Container extends Component {
/**
* Validates this container and all of its subcomponents.
* <p>
* The <code>validate</code> method is used to cause a container
* to lay out its subcomponents again. It should be invoked when
* this container's subcomponents are modified (added to or
* removed from the container, or layout-related information
* changed) after the container has been displayed.
*
* <p>If this {@code Container} is not valid, this method invokes
* Validating a container means laying out its subcomponents.
* Layout-related changes, such as setting the bounds of a component, or
* adding a component to the container, invalidate the container
* automatically. Note that the ancestors of the container may be
* invalidated also (see {@link Component#invalidate} for details.)
* Therefore, to restore the validity of the hierarchy, the {@code
* validate()} method should be invoked on a validate root of an
* invalidated component, or on the top-most container if the hierarchy
* does not contain validate roots.
* <p>
* Validating the container may be a quite time-consuming operation. For
* performance reasons a developer may postpone the validation of the
* hierarchy till a set of layout-related operations completes, e.g. after
* adding all the children to the container.
* <p>
* If this {@code Container} is not valid, this method invokes
* the {@code validateTree} method and marks this {@code Container}
* as valid. Otherwise, no action is performed.
* <p>
* Note that the {@code invalidate()} method may invalidate not only the
* component it is called upon, but also the parents of the component.
* Therefore, to restore the validity of the hierarchy, the {@code
* validate()} method must be invoked on the top-most invalid container of
* the hierarchy. For performance reasons a developer may postpone the
* validation of the hierarchy till a bunch of layout-related operations
* completes, e.g. after adding all the children to the container.
*
* @see #add(java.awt.Component)
* @see #invalidate
* @see Container#isValidateRoot
* @see javax.swing.JComponent#revalidate()
* @see #validateTree
*/
public void validate() {
/* Avoid grabbing lock unless really necessary. */
if (!isValid()) {
boolean updateCur = false;
synchronized (getTreeLock()) {
if (!isValid() && peer != null) {
ContainerPeer p = null;
if (peer instanceof ContainerPeer) {
p = (ContainerPeer) peer;
}
if (p != null) {
p.beginValidate();
}
validateTree();
if (p != null) {
p.endValidate();
boolean updateCur = false;
synchronized (getTreeLock()) {
if ((!isValid() || descendUnconditionallyWhenValidating)
&& peer != null)
{
ContainerPeer p = null;
if (peer instanceof ContainerPeer) {
p = (ContainerPeer) peer;
}
if (p != null) {
p.beginValidate();
}
validateTree();
if (p != null) {
p.endValidate();
// Avoid updating cursor if this is an internal call.
// See validateUnconditionally() for details.
if (!descendUnconditionallyWhenValidating) {
updateCur = isVisible();
}
}
}
if (updateCur) {
updateCursorImmediately();
}
if (updateCur) {
updateCursorImmediately();
}
}
/**
* Indicates whether valid containers should also traverse their
* children and call the validateTree() method on them.
*
* Synchronization: TreeLock.
*
* The field is allowed to be static as long as the TreeLock itself is
* static.
*
* @see #validateUnconditionally()
*/
private static boolean descendUnconditionallyWhenValidating = false;
/**
* Unconditionally validate the component hierarchy.
*/
final void validateUnconditionally() {
boolean updateCur = false;
synchronized (getTreeLock()) {
descendUnconditionallyWhenValidating = true;
validate();
if (peer instanceof ContainerPeer) {
updateCur = isVisible();
}
descendUnconditionallyWhenValidating = false;
}
if (updateCur) {
updateCursorImmediately();
}
}
......@@ -1578,16 +1655,20 @@ public class Container extends Component {
*/
protected void validateTree() {
checkTreeLock();
if (!isValid()) {
if (!isValid() || descendUnconditionallyWhenValidating) {
if (peer instanceof ContainerPeer) {
((ContainerPeer)peer).beginLayout();
}
doLayout();
if (!isValid()) {
doLayout();
}
for (int i = 0; i < component.size(); i++) {
Component comp = component.get(i);
if ( (comp instanceof Container)
&& !(comp instanceof Window)
&& !comp.isValid()) {
&& (!comp.isValid() ||
descendUnconditionallyWhenValidating))
{
((Container)comp).validateTree();
} else {
comp.validate();
......@@ -4092,16 +4173,29 @@ public class Container extends Component {
}
}
/*
/**
* Checks if the container and its direct lightweight containers are
* visible.
*
* Consider the heavyweight container hides or shows the HW descendants
* automatically. Therefore we care of LW containers' visibility only.
*
* This method MUST be invoked under the TreeLock.
*/
private boolean isRecursivelyVisibleUpToHeavyweightContainer() {
final boolean isRecursivelyVisibleUpToHeavyweightContainer() {
if (!isLightweight()) {
return true;
}
return isVisible() && (getContainer() == null ||
getContainer().isRecursivelyVisibleUpToHeavyweightContainer());
for (Container cont = getContainer();
cont != null && cont.isLightweight();
cont = cont.getContainer())
{
if (!cont.isVisible()) {
return false;
}
}
return true;
}
@Override
......
......@@ -1027,7 +1027,9 @@ public class EventQueue {
synchronized (lock) {
Toolkit.getEventQueue().postEvent(event);
lock.wait();
while (!event.isDispatched()) {
lock.wait();
}
}
Throwable eventThrowable = event.getThrowable();
......
......@@ -845,8 +845,11 @@ public class Frame extends Window implements MenuContainer {
* others by setting those fields you want to accept from system
* to <code>Integer.MAX_VALUE</code>.
* <p>
* On some systems only the size portion of the bounds is taken
* into account.
* Note, the given maximized bounds are used as a hint for the native
* system, because the underlying platform may not support setting the
* location and/or size of the maximized windows. If that is the case, the
* provided values do not affect the appearance of the frame in the
* maximized state.
*
* @param bounds bounds for the maximized state
* @see #getMaximizedBounds()
......
......@@ -767,7 +767,7 @@ public class Window extends Container implements Accessible {
isPacked = true;
}
validate();
validateUnconditionally();
}
/**
......@@ -943,7 +943,7 @@ public class Window extends Container implements Accessible {
if (peer == null) {
addNotify();
}
validate();
validateUnconditionally();
isInShow = true;
if (visible) {
......@@ -2599,6 +2599,21 @@ public class Window extends Container implements Accessible {
super.addPropertyChangeListener(propertyName, listener);
}
/**
* Indicates if this container is a validate root.
* <p>
* {@code Window} objects are the validate roots, and, therefore, they
* override this method to return {@code true}.
*
* @return {@code true}
* @since 1.7
* @see java.awt.Container#isValidateRoot
*/
@Override
public boolean isValidateRoot() {
return true;
}
/**
* Dispatches an event to this window or one of its sub components.
* @param e the event
......
......@@ -1184,7 +1184,7 @@ public class DataFlavor implements Externalizable, Cloneable {
*/
public boolean isRepresentationClassRemote() {
return java.rmi.Remote.class.isAssignableFrom(representationClass);
return DataTransferer.isRemote(representationClass);
}
/**
......
......@@ -78,10 +78,21 @@ public class InvocationEvent extends AWTEvent implements ActiveEvent {
/**
* The (potentially null) Object whose notifyAll() method will be called
* immediately after the Runnable.run() method returns.
* immediately after the Runnable.run() method has returned or thrown an exception.
*
* @see #isDispatched
*/
protected Object notifier;
/**
* Indicates whether the <code>run()</code> method of the <code>runnable</code>
* was executed or not.
*
* @see #isDispatched
* @since 1.7
*/
private volatile boolean dispatched = false;
/**
* Set to true if dispatch() catches Throwable and stores it in the
* exception instance variable. If false, Throwables are propagated up
......@@ -144,7 +155,7 @@ public class InvocationEvent extends AWTEvent implements ActiveEvent {
* source which will execute the runnable's <code>run</code>
* method when dispatched. If notifier is non-<code>null</code>,
* <code>notifyAll()</code> will be called on it
* immediately after <code>run</code> returns.
* immediately after <code>run</code> has returned or thrown an exception.
* <p>An invocation of the form <tt>InvocationEvent(source,
* runnable, notifier, catchThrowables)</tt>
* behaves in exactly the same way as the invocation of
......@@ -159,7 +170,8 @@ public class InvocationEvent extends AWTEvent implements ActiveEvent {
* executed
* @param notifier The {@code Object} whose <code>notifyAll</code>
* method will be called after
* <code>Runnable.run</code> has returned
* <code>Runnable.run</code> has returned or
* thrown an exception
* @param catchThrowables Specifies whether <code>dispatch</code>
* should catch Throwable when executing
* the <code>Runnable</code>'s <code>run</code>
......@@ -180,8 +192,8 @@ public class InvocationEvent extends AWTEvent implements ActiveEvent {
* Constructs an <code>InvocationEvent</code> with the specified
* source and ID which will execute the runnable's <code>run</code>
* method when dispatched. If notifier is non-<code>null</code>,
* <code>notifyAll</code> will be called on it
* immediately after <code>run</code> returns.
* <code>notifyAll</code> will be called on it immediately after
* <code>run</code> has returned or thrown an exception.
* <p>This method throws an
* <code>IllegalArgumentException</code> if <code>source</code>
* is <code>null</code>.
......@@ -195,7 +207,8 @@ public class InvocationEvent extends AWTEvent implements ActiveEvent {
* <code>run</code> method will be executed
* @param notifier The <code>Object</code> whose <code>notifyAll</code>
* method will be called after
* <code>Runnable.run</code> has returned
* <code>Runnable.run</code> has returned or
* thrown an exception
* @param catchThrowables Specifies whether <code>dispatch</code>
* should catch Throwable when executing the
* <code>Runnable</code>'s <code>run</code>
......@@ -217,27 +230,33 @@ public class InvocationEvent extends AWTEvent implements ActiveEvent {
/**
* Executes the Runnable's <code>run()</code> method and notifies the
* notifier (if any) when <code>run()</code> returns.
* notifier (if any) when <code>run()</code> has returned or thrown an exception.
*
* @see #isDispatched
*/
public void dispatch() {
if (catchExceptions) {
try {
runnable.run();
}
catch (Throwable t) {
if (t instanceof Exception) {
exception = (Exception) t;
try {
if (catchExceptions) {
try {
runnable.run();
}
catch (Throwable t) {
if (t instanceof Exception) {
exception = (Exception) t;
}
throwable = t;
}
throwable = t;
}
}
else {
runnable.run();
}
else {
runnable.run();
}
} finally {
dispatched = true;
if (notifier != null) {
synchronized (notifier) {
notifier.notifyAll();
if (notifier != null) {
synchronized (notifier) {
notifier.notifyAll();
}
}
}
}
......@@ -277,6 +296,40 @@ public class InvocationEvent extends AWTEvent implements ActiveEvent {
return when;
}
/**
* Returns {@code true} if the event is dispatched or any exception is
* thrown while dispatching, {@code false} otherwise. The method should
* be called by a waiting thread that calls the {@code notifier.wait()} method.
* Since spurious wakeups are possible (as explained in {@link Object#wait()}),
* this method should be used in a waiting loop to ensure that the event
* got dispatched:
* <pre>
* while (!event.isDispatched()) {
* notifier.wait();
* }
* </pre>
* If the waiting thread wakes up without dispatching the event,
* the {@code isDispatched()} method returns {@code false}, and
* the {@code while} loop executes once more, thus, causing
* the awakened thread to revert to the waiting mode.
* <p>
* If the {@code notifier.notifyAll()} happens before the waiting thread
* enters the {@code notifier.wait()} method, the {@code while} loop ensures
* that the waiting thread will not enter the {@code notifier.wait()} method.
* Otherwise, there is no guarantee that the waiting thread will ever be woken
* from the wait.
*
* @return {@code true} if the event has been dispatched, or any exception
* has been thrown while dispatching, {@code false} otherwise
* @see #dispatch
* @see #notifier
* @see #catchExceptions
* @since 1.7
*/
public boolean isDispatched() {
return dispatched;
}
/**
* Returns a parameter string identifying this event.
* This method is useful for event-logging and for debugging.
......
......@@ -65,7 +65,7 @@ import javax.print.attribute.PrintServiceAttribute;
* PrinterStateReason PrinterStateReason} objects to an existing
* PrinterStateReasons object and remove them again. However, like class
* {@link java.util.HashMap java.util.HashMap}, class PrinterStateReasons is
* bot multiple thread safe. If a PrinterStateReasons object will be used by
* not multiple thread safe. If a PrinterStateReasons object will be used by
* multiple threads, be sure to synchronize its operations (e.g., using a
* synchronized map view obtained from class {@link java.util.Collections
* java.util.Collections}).
......
......@@ -795,7 +795,6 @@ public abstract class JComponent extends Container implements Serializable,
* @see java.awt.Container#paint
*/
protected void paintChildren(Graphics g) {
boolean isJComponent;
Graphics sg = g;
synchronized(getTreeLock()) {
......@@ -826,12 +825,21 @@ public abstract class JComponent extends Container implements Serializable,
}
}
boolean printing = getFlag(IS_PRINTING);
final Window window = SwingUtilities.getWindowAncestor(this);
final boolean isWindowOpaque = window == null || window.isOpaque();
for (; i >= 0 ; i--) {
Component comp = getComponent(i);
isJComponent = (comp instanceof JComponent);
if (comp != null &&
(isJComponent || isLightweightComponent(comp)) &&
(comp.isVisible() == true)) {
if (comp == null) {
continue;
}
final boolean isJComponent = comp instanceof JComponent;
// Enable painting of heavyweights in non-opaque windows.
// See 6884960
if ((!isWindowOpaque || isJComponent ||
isLightweightComponent(comp)) && comp.isVisible())
{
Rectangle cr;
cr = comp.getBounds(tmpRect);
......@@ -887,6 +895,8 @@ public abstract class JComponent extends Container implements Serializable,
}
}
} else {
// The component is either lightweight, or
// heavyweight in a non-opaque window
if (!printing) {
comp.paint(cg);
}
......@@ -4868,7 +4878,9 @@ public abstract class JComponent extends Container implements Serializable,
* @see #revalidate
* @see java.awt.Component#invalidate
* @see java.awt.Container#validate
* @see java.awt.Container#isValidateRoot
*/
@Override
public boolean isValidateRoot() {
return false;
}
......
......@@ -1330,7 +1330,7 @@ public class JEditorPane extends JTextComponent {
*/
public Dimension getPreferredSize() {
Dimension d = super.getPreferredSize();
JViewport port = SwingUtilities2.getViewport(this);
JViewport port = SwingUtilities.getParentViewport(this);
if (port != null) {
TextUI ui = getUI();
int prefWidth = d.width;
......@@ -1452,7 +1452,7 @@ public class JEditorPane extends JTextComponent {
* match its own, false otherwise
*/
public boolean getScrollableTracksViewportWidth() {
JViewport port = SwingUtilities2.getViewport(this);
JViewport port = SwingUtilities.getParentViewport(this);
if (port != null) {
TextUI ui = getUI();
int w = port.getWidth();
......@@ -1474,7 +1474,7 @@ public class JEditorPane extends JTextComponent {
* false otherwise
*/
public boolean getScrollableTracksViewportHeight() {
JViewport port = SwingUtilities2.getViewport(this);
JViewport port = SwingUtilities.getParentViewport(this);
if (port != null) {
TextUI ui = getUI();
int h = port.getHeight();
......
......@@ -2722,7 +2722,7 @@ public class JList extends JComponent implements Scrollable, Accessible
getVisibleRowCount() <= 0) {
return true;
}
JViewport port = SwingUtilities2.getViewport(this);
JViewport port = SwingUtilities.getParentViewport(this);
if (port != null) {
return port.getWidth() > getPreferredSize().width;
}
......@@ -2748,7 +2748,7 @@ public class JList extends JComponent implements Scrollable, Accessible
getVisibleRowCount() <= 0) {
return true;
}
JViewport port = SwingUtilities2.getViewport(this);
JViewport port = SwingUtilities.getParentViewport(this);
if (port != null) {
return port.getHeight() > getPreferredSize().height;
}
......
......@@ -725,8 +725,10 @@ public class JRootPane extends JComponent implements Accessible {
* because both classes override <code>isValidateRoot</code> to return true.
*
* @see JComponent#isValidateRoot
* @see java.awt.Container#isValidateRoot
* @return true
*/
@Override
public boolean isValidateRoot() {
return true;
}
......
......@@ -453,10 +453,12 @@ public class JScrollPane extends JComponent implements ScrollPaneConstants, Acce
* @see java.awt.Container#validate
* @see JComponent#revalidate
* @see JComponent#isValidateRoot
* @see java.awt.Container#isValidateRoot
*
* @beaninfo
* hidden: true
*/
@Override
public boolean isValidateRoot() {
return true;
}
......
......@@ -947,10 +947,12 @@ public class JSplitPane extends JComponent implements Accessible
*
* @return true
* @see JComponent#revalidate
* @see java.awt.Container#isValidateRoot
*
* @beaninfo
* hidden: true
*/
@Override
public boolean isValidateRoot() {
return true;
}
......
......@@ -57,6 +57,7 @@ import sun.swing.SwingUtilities2;
import sun.swing.SwingUtilities2.Section;
import static sun.swing.SwingUtilities2.Section.*;
import sun.swing.PrintingStatus;
import sun.swing.SwingLazyValue;
/**
* The <code>JTable</code> is used to display and edit regular two-dimensional tables
......@@ -718,7 +719,7 @@ public class JTable extends JComponent implements TableModelListener, Scrollable
* @see #addNotify
*/
protected void configureEnclosingScrollPane() {
JViewport port = SwingUtilities2.getViewport(this);
JViewport port = SwingUtilities.getParentViewport(this);
if (port != null) {
Container gp = port.getParent();
if (gp instanceof JScrollPane) {
......@@ -727,7 +728,8 @@ public class JTable extends JComponent implements TableModelListener, Scrollable
// example, the rowHeaderView of the scrollPane -
// an implementor of fixed columns might do this.
JViewport viewport = scrollPane.getViewport();
if (viewport == null || viewport.getView() != this) {
if (viewport == null ||
SwingUtilities.getUnwrappedView(viewport) != this) {
return;
}
scrollPane.setColumnHeaderView(getTableHeader());
......@@ -750,7 +752,7 @@ public class JTable extends JComponent implements TableModelListener, Scrollable
* from configureEnclosingScrollPane() and updateUI() in a safe manor.
*/
private void configureEnclosingScrollPaneUI() {
JViewport port = SwingUtilities2.getViewport(this);
JViewport port = SwingUtilities.getParentViewport(this);
if (port != null) {
Container gp = port.getParent();
if (gp instanceof JScrollPane) {
......@@ -759,7 +761,8 @@ public class JTable extends JComponent implements TableModelListener, Scrollable
// example, the rowHeaderView of the scrollPane -
// an implementor of fixed columns might do this.
JViewport viewport = scrollPane.getViewport();
if (viewport == null || viewport.getView() != this) {
if (viewport == null ||
SwingUtilities.getUnwrappedView(viewport) != this) {
return;
}
// scrollPane.getViewport().setBackingStoreEnabled(true);
......@@ -819,7 +822,7 @@ public class JTable extends JComponent implements TableModelListener, Scrollable
* @since 1.3
*/
protected void unconfigureEnclosingScrollPane() {
JViewport port = SwingUtilities2.getViewport(this);
JViewport port = SwingUtilities.getParentViewport(this);
if (port != null) {
Container gp = port.getParent();
if (gp instanceof JScrollPane) {
......@@ -828,7 +831,8 @@ public class JTable extends JComponent implements TableModelListener, Scrollable
// example, the rowHeaderView of the scrollPane -
// an implementor of fixed columns might do this.
JViewport viewport = scrollPane.getViewport();
if (viewport == null || viewport.getView() != this) {
if (viewport == null ||
SwingUtilities.getUnwrappedView(viewport) != this) {
return;
}
scrollPane.setColumnHeaderView(null);
......@@ -5215,7 +5219,7 @@ public class JTable extends JComponent implements TableModelListener, Scrollable
* @see #getFillsViewportHeight
*/
public boolean getScrollableTracksViewportHeight() {
JViewport port = SwingUtilities2.getViewport(this);
JViewport port = SwingUtilities.getParentViewport(this);
return getFillsViewportHeight()
&& port != null
&& port.getHeight() > getPreferredSize().height;
......@@ -5316,7 +5320,7 @@ public class JTable extends JComponent implements TableModelListener, Scrollable
}
private void setLazyValue(Hashtable h, Class c, String s) {
h.put(c, new UIDefaults.ProxyLazyValue(s));
h.put(c, new SwingLazyValue(s));
}
private void setLazyRenderer(Class c, String s) {
......
......@@ -288,9 +288,11 @@ public class JTextField extends JTextComponent implements SwingConstants {
*
* @see JComponent#revalidate
* @see JComponent#isValidateRoot
* @see java.awt.Container#isValidateRoot
*/
@Override
public boolean isValidateRoot() {
return SwingUtilities2.getViewport(this) == null;
return SwingUtilities.getParentViewport(this) == null;
}
......
......@@ -3498,7 +3498,7 @@ public class JTree extends JComponent implements Scrollable, Accessible
* @see Scrollable#getScrollableTracksViewportWidth
*/
public boolean getScrollableTracksViewportWidth() {
JViewport port = SwingUtilities2.getViewport(this);
JViewport port = SwingUtilities.getParentViewport(this);
if (port != null) {
return port.getWidth() > getPreferredSize().width;
}
......@@ -3515,7 +3515,7 @@ public class JTree extends JComponent implements Scrollable, Accessible
* @see Scrollable#getScrollableTracksViewportHeight
*/
public boolean getScrollableTracksViewportHeight() {
JViewport port = SwingUtilities2.getViewport(this);
JViewport port = SwingUtilities.getParentViewport(this);
if (port != null) {
return port.getHeight() > getPreferredSize().height;
}
......
......@@ -469,49 +469,12 @@ public class JViewport extends JComponent implements Accessible
* is the synchronous version of a <code>revalidate</code>.
*/
private void validateView() {
Component validateRoot = null;
Component validateRoot = SwingUtilities.getValidateRoot(this, false);
/* Find the first JComponent ancestor of this component whose
* isValidateRoot() method returns true.
*/
for(Component c = this; c != null; c = c.getParent()) {
if ((c instanceof CellRendererPane) || (c.getPeer() == null)) {
return;
}
if ((c instanceof JComponent) &&
(((JComponent)c).isValidateRoot())) {
validateRoot = c;
break;
}
}
// If no validateRoot, nothing to validate from.
if (validateRoot == null) {
return;
}
// Make sure all ancestors are visible.
Component root = null;
for(Component c = validateRoot; c != null; c = c.getParent()) {
// We don't check isVisible here, otherwise if the component
// is contained in something like a JTabbedPane when the
// component is made visible again it won't have scrolled
// to the correct location.
if (c.getPeer() == null) {
return;
}
if ((c instanceof Window) || (c instanceof Applet)) {
root = c;
break;
}
}
// Make sure there is a Window ancestor.
if (root == null) {
return;
}
// Validate the root.
validateRoot.validate();
......
......@@ -310,47 +310,13 @@ public class RepaintManager
delegate.addInvalidComponent(invalidComponent);
return;
}
Component validateRoot = null;
Component validateRoot =
SwingUtilities.getValidateRoot(invalidComponent, true);
/* Find the first JComponent ancestor of this component whose
* isValidateRoot() method returns true.
*/
for(Component c = invalidComponent; c != null; c = c.getParent()) {
if ((c instanceof CellRendererPane) || (c.getPeer() == null)) {
return;
}
if ((c instanceof JComponent) && (((JComponent)c).isValidateRoot())) {
validateRoot = c;
break;
}
}
/* There's no validateRoot to apply validate to, so we're done.
*/
if (validateRoot == null) {
return;
}
/* If the validateRoot and all of its ancestors aren't visible
* then we don't do anything. While we're walking up the tree
* we find the root Window or Applet.
*/
Component root = null;
for(Component c = validateRoot; c != null; c = c.getParent()) {
if (!c.isVisible() || (c.getPeer() == null)) {
return;
}
if ((c instanceof Window) || (c instanceof Applet)) {
root = c;
break;
}
}
if (root == null) {
return;
}
/* Lazily create the invalidateComponents vector and add the
* validateRoot if it's not there already. If this validateRoot
* is already in the vector, we're done.
......
......@@ -1967,4 +1967,114 @@ public class SwingUtilities implements SwingConstants
SwingUtilities.updateComponentTreeUI(component);
}
}
/**
* Looks for the first ancestor of the {@code component}
* which is not an instance of {@link JLayer}.
* If this ancestor is an instance of {@code JViewport},
* this {@code JViewport} is returned, otherwise returns {@code null}.
* The following way of obtaining the parent {@code JViewport}
* is not recommended any more:
* <pre>
* JViewport port = null;
* Container parent = component.getParent();
* // not recommended any more
* if(parent instanceof JViewport) {
* port = (JViewport) parent;
* }
* </pre>
* Here is the way to go:
* <pre>
* // the correct way:
* JViewport port = SwingUtilities.getParentViewport(component);
* </pre>
* @param component {@code Component} to get the parent {@code JViewport} of.
* @return the {@code JViewport} instance for the {@code component}
* or {@code null}
* @throws NullPointerException if {@code component} is {@code null}
*
* @since 1.7
*/
public static JViewport getParentViewport(Component component) {
do {
component = component.getParent();
if (component instanceof JViewport) {
return (JViewport) component;
}
} while(component instanceof JLayer);
return null;
}
/**
* Returns the first {@code JViewport}'s descendant
* which is not an instance of {@code JLayer} or {@code null}.
*
* If the {@code viewport}'s view component is not a {@code JLayer},
* this method is equal to {@link JViewport#getView()}
* otherwise {@link JLayer#getView()} will be recursively tested
*
* @return the first {@code JViewport}'s descendant
* which is not an instance of {@code JLayer} or {@code null}.
*
* @throws NullPointerException if {@code viewport} is {@code null}
* @see JViewport#getView()
* @see JLayer
*/
static Component getUnwrappedView(JViewport viewport) {
Component view = viewport.getView();
while (view instanceof JLayer) {
view = ((JLayer)view).getView();
}
return view;
}
/**
* Retrieves the validate root of a given container.
*
* If the container is contained within a {@code CellRendererPane}, this
* method returns {@code null} due to the synthetic nature of the {@code
* CellRendererPane}.
* <p>
* The component hierarchy must be displayable up to the toplevel component
* (either a {@code Frame} or an {@code Applet} object.) Otherwise this
* method returns {@code null}.
* <p>
* If the {@code visibleOnly} argument is {@code true}, the found validate
* root and all its parents up to the toplevel component must also be
* visible. Otherwise this method returns {@code null}.
*
* @return the validate root of the given container or null
* @see java.awt.Component#isDisplayable()
* @see java.awt.Component#isVisible()
* @since 1.7
*/
static Container getValidateRoot(Container c, boolean visibleOnly) {
Container root = null;
for (; c != null; c = c.getParent())
{
if (!c.isDisplayable() || c instanceof CellRendererPane) {
return null;
}
if (c.isValidateRoot()) {
root = c;
break;
}
}
if (root == null) {
return null;
}
for (; c != null; c = c.getParent()) {
if (!c.isDisplayable() || (visibleOnly && !c.isVisible())) {
return null;
}
if (c instanceof Window || c instanceof Applet) {
return root;
}
}
return null;
}
}
......@@ -33,7 +33,8 @@ import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.text.MessageFormat;
import java.util.Vector;
import java.util.List;
import java.util.ArrayList;
import java.lang.ref.WeakReference;
import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeEvent;
......@@ -173,22 +174,27 @@ public abstract class FileSystemView {
* @since 1.4
*/
public String getSystemDisplayName(File f) {
String name = null;
if (f != null) {
name = f.getName();
if (!name.equals("..") && !name.equals(".") &&
(useSystemExtensionHiding ||
!isFileSystem(f) ||
isFileSystemRoot(f)) &&
((f instanceof ShellFolder) ||
f.exists())) {
if (f == null) {
return null;
}
String name = f.getName();
if (!name.equals("..") && !name.equals(".") &&
(useSystemExtensionHiding || !isFileSystem(f) || isFileSystemRoot(f)) &&
(f instanceof ShellFolder || f.exists())) {
try {
name = getShellFolder(f).getDisplayName();
if (name == null || name.length() == 0) {
name = f.getPath(); // e.g. "/"
}
} catch (FileNotFoundException e) {
return null;
}
if (name == null || name.length() == 0) {
name = f.getPath(); // e.g. "/"
}
}
return name;
}
......@@ -222,17 +228,25 @@ public abstract class FileSystemView {
* @since 1.4
*/
public Icon getSystemIcon(File f) {
if (f != null) {
ShellFolder sf = getShellFolder(f);
Image img = sf.getIcon(false);
if (img != null) {
return new ImageIcon(img, sf.getFolderType());
} else {
return UIManager.getIcon(f.isDirectory() ? "FileView.directoryIcon" : "FileView.fileIcon");
}
} else {
if (f == null) {
return null;
}
ShellFolder sf;
try {
sf = getShellFolder(f);
} catch (FileNotFoundException e) {
return null;
}
Image img = sf.getIcon(false);
if (img != null) {
return new ImageIcon(img, sf.getFolderType());
} else {
return UIManager.getIcon(f.isDirectory() ? "FileView.directoryIcon" : "FileView.fileIcon");
}
}
/**
......@@ -446,24 +460,28 @@ public abstract class FileSystemView {
* Gets the list of shown (i.e. not hidden) files.
*/
public File[] getFiles(File dir, boolean useFileHiding) {
Vector<File> files = new Vector<File>();
List<File> files = new ArrayList<File>();
// add all files in dir
File[] names;
if (!(dir instanceof ShellFolder)) {
if (!(dir instanceof ShellFolder)) {
try {
dir = getShellFolder(dir);
} catch (FileNotFoundException e) {
return new File[0];
}
}
names = ((ShellFolder)dir).listFiles(!useFileHiding);
File f;
File[] names = ((ShellFolder) dir).listFiles(!useFileHiding);
int nameCount = (names == null) ? 0 : names.length;
for (int i = 0; i < nameCount; i++) {
if (names == null) {
return new File[0];
}
for (File f : names) {
if (Thread.currentThread().isInterrupted()) {
break;
}
f = names[i];
if (!(f instanceof ShellFolder)) {
if (isFileSystemRoot(f)) {
f = createFileSystemRoot(f);
......@@ -481,7 +499,7 @@ public abstract class FileSystemView {
}
}
if (!useFileHiding || !isHiddenFile(f)) {
files.addElement(f);
files.add(f);
}
}
......@@ -497,42 +515,50 @@ public abstract class FileSystemView {
* <code>null</code> if <code>dir</code> is <code>null</code>
*/
public File getParentDirectory(File dir) {
if (dir != null && dir.exists()) {
ShellFolder sf = getShellFolder(dir);
File psf = sf.getParentFile();
if (psf != null) {
if (isFileSystem(psf)) {
File f = psf;
if (f != null && !f.exists()) {
// This could be a node under "Network Neighborhood".
File ppsf = psf.getParentFile();
if (ppsf == null || !isFileSystem(ppsf)) {
// We're mostly after the exists() override for windows below.
f = createFileSystemRoot(f);
}
}
return f;
} else {
return psf;
if (dir == null || !dir.exists()) {
return null;
}
ShellFolder sf;
try {
sf = getShellFolder(dir);
} catch (FileNotFoundException e) {
return null;
}
File psf = sf.getParentFile();
if (psf == null) {
return null;
}
if (isFileSystem(psf)) {
File f = psf;
if (!f.exists()) {
// This could be a node under "Network Neighborhood".
File ppsf = psf.getParentFile();
if (ppsf == null || !isFileSystem(ppsf)) {
// We're mostly after the exists() override for windows below.
f = createFileSystemRoot(f);
}
}
return f;
} else {
return psf;
}
return null;
}
ShellFolder getShellFolder(File f) {
if (!(f instanceof ShellFolder)
&& !(f instanceof FileSystemRoot)
&& isFileSystemRoot(f)) {
/**
* Throws {@code FileNotFoundException} if file not found or current thread was interrupted
*/
ShellFolder getShellFolder(File f) throws FileNotFoundException {
if (!(f instanceof ShellFolder) && !(f instanceof FileSystemRoot) && isFileSystemRoot(f)) {
f = createFileSystemRoot(f);
}
try {
return ShellFolder.getShellFolder(f);
} catch (FileNotFoundException e) {
System.err.println("FileSystemView.getShellFolder: f="+f);
e.printStackTrace();
return null;
} catch (InternalError e) {
System.err.println("FileSystemView.getShellFolder: f="+f);
e.printStackTrace();
......@@ -596,9 +622,9 @@ class UnixFileSystemView extends FileSystemView {
// Unix - using OpenWindows' default folder name. Can't find one for Motif/CDE.
newFolder = createFileObject(containingDir, newFolderString);
int i = 1;
while (newFolder.exists() && (i < 100)) {
while (newFolder.exists() && i < 100) {
newFolder = createFileObject(containingDir, MessageFormat.format(
newFolderNextString, new Object[] { new Integer(i) }));
newFolderNextString, new Integer(i)));
i++;
}
......@@ -612,7 +638,7 @@ class UnixFileSystemView extends FileSystemView {
}
public boolean isFileSystemRoot(File dir) {
return (dir != null && dir.getAbsolutePath().equals("/"));
return dir != null && dir.getAbsolutePath().equals("/");
}
public boolean isDrive(File dir) {
......@@ -654,7 +680,7 @@ class WindowsFileSystemView extends FileSystemView {
public File getChild(File parent, String fileName) {
if (fileName.startsWith("\\")
&& !(fileName.startsWith("\\\\"))
&& !fileName.startsWith("\\\\")
&& isFileSystem(parent)) {
//Path is relative to the root of parent's drive
......@@ -677,9 +703,13 @@ class WindowsFileSystemView extends FileSystemView {
* The Windows implementation gets information from the ShellFolder class.
*/
public String getSystemTypeDescription(File f) {
if (f != null) {
if (f == null) {
return null;
}
try {
return getShellFolder(f).getFolderType();
} else {
} catch (FileNotFoundException e) {
return null;
}
}
......@@ -701,9 +731,9 @@ class WindowsFileSystemView extends FileSystemView {
// Using NT's default folder name
File newFolder = createFileObject(containingDir, newFolderString);
int i = 2;
while (newFolder.exists() && (i < 100)) {
while (newFolder.exists() && i < 100) {
newFolder = createFileObject(containingDir, MessageFormat.format(
newFolderNextString, new Object[] { new Integer(i) }));
newFolderNextString, new Integer(i)));
i++;
}
......@@ -727,7 +757,7 @@ class WindowsFileSystemView extends FileSystemView {
}
});
return (path != null && (path.equals("A:\\") || path.equals("B:\\")));
return path != null && (path.equals("A:\\") || path.equals("B:\\"));
}
/**
......
......@@ -71,33 +71,410 @@ public class LayerUI<V extends Component>
* Subclasses should override this method and use
* the specified {@code Graphics} object to
* render the content of the component.
* <p/>
* If {@code g} is not an instance of {@code Graphics2D},
* this method is no-op.
*
* @param g the {@code Graphics} context in which to paint;
* @param c the component being painted;
* it can be safely cast to the {@code JLayer<V>}
* it can be safely cast to {@code JLayer<? extends V>}
*
* @see #configureGraphics(Graphics2D, JLayer)
* @see #paintLayer(Graphics2D, JLayer)
*/
@Override
public void paint(Graphics g, JComponent c) {
c.paint(g);
if (g instanceof Graphics2D) {
Graphics2D g2 = (Graphics2D) g.create();
JLayer<? extends V> l = (JLayer<? extends V>) c;
configureGraphics(g2, l);
paintLayer(g2, l);
g2.dispose();
}
}
/**
* This method is called by the {@link #paint} method prior to
* {@link #paintLayer} to configure the {@code Graphics2D} object.
* The default implementation is empty.
*
* @param g2 the {@code Graphics2D} object to configure
* @param l the {@code JLayer} being painted
*
* @see #paintLayer(Graphics2D, JLayer)
*/
protected void configureGraphics(Graphics2D g2, JLayer<? extends V> l) {
}
/**
* Called by the {@link #paint} method,
* subclasses should override this method
* to perform any custom painting operations.
* <p/>
* The default implementation paints the passed {@code JLayer} as is.
*
* @param g2 the {@code Graphics2D} context in which to paint
* @param l the {@code JLayer} being painted
*
* @see #configureGraphics(Graphics2D, JLayer)
*/
protected void paintLayer(Graphics2D g2, JLayer<? extends V> l) {
l.paint(g2);
}
/**
* Dispatches {@code AWTEvent}s for {@code JLayer}
* and <b>all it subcomponents</b> to this {@code LayerUI} instance.
* <p>
* To enable the {@code AWTEvent} of the particular type,
* you call {@link javax.swing.JLayer#setLayerEventMask}
* and <b>all its subcomponents</b> to this {@code LayerUI} instance.
* <p/>
* To enable the {@code AWTEvent}s of a particular type,
* you call {@link JLayer#setLayerEventMask}
* in {@link #installUI(javax.swing.JComponent)}
* and set the layer event mask to {@code 0}
* in {@link #uninstallUI(javax.swing.JComponent)} after that
* in {@link #uninstallUI(javax.swing.JComponent)} after that.
* By default this method calls the appropriate
* {@code process&lt;event&nbsp;type&gt;Event}
* method for the given class of event.
*
* @param e the event to be dispatched
* @param l the layer this LayerUI is set to
*
* @see JLayer#setLayerEventMask(long)
* @see javax.swing.JLayer#getLayerEventMask()
* @see #installUI(javax.swing.JComponent)
* @see #uninstallUI(javax.swing.JComponent)
* @see #processComponentEvent
* @see #processFocusEvent
* @see #processKeyEvent
* @see #processMouseEvent
* @see #processMouseMotionEvent
* @see #processInputMethodEvent
* @see #processHierarchyEvent
* @see #processMouseWheelEvent
*/
public void eventDispatched(AWTEvent e, JLayer<? extends V> l){
if (e instanceof FocusEvent) {
processFocusEvent((FocusEvent)e, l);
} else if (e instanceof MouseEvent) {
switch(e.getID()) {
case MouseEvent.MOUSE_PRESSED:
case MouseEvent.MOUSE_RELEASED:
case MouseEvent.MOUSE_CLICKED:
case MouseEvent.MOUSE_ENTERED:
case MouseEvent.MOUSE_EXITED:
processMouseEvent((MouseEvent)e, l);
break;
case MouseEvent.MOUSE_MOVED:
case MouseEvent.MOUSE_DRAGGED:
processMouseMotionEvent((MouseEvent)e, l);
break;
case MouseEvent.MOUSE_WHEEL:
processMouseWheelEvent((MouseWheelEvent)e, l);
break;
}
} else if (e instanceof KeyEvent) {
processKeyEvent((KeyEvent)e, l);
} else if (e instanceof ComponentEvent) {
processComponentEvent((ComponentEvent)e, l);
} else if (e instanceof InputMethodEvent) {
processInputMethodEvent((InputMethodEvent)e, l);
} else if (e instanceof HierarchyEvent) {
switch (e.getID()) {
case HierarchyEvent.HIERARCHY_CHANGED:
processHierarchyEvent((HierarchyEvent)e, l);
break;
case HierarchyEvent.ANCESTOR_MOVED:
case HierarchyEvent.ANCESTOR_RESIZED:
processHierarchyBoundsEvent((HierarchyEvent)e, l);
break;
}
}
}
/**
* Processes component events occurring on the {@link JLayer}
* or any of its subcomponents.
* <p/>
* This method is not called unless component events are
* enabled for the {@code JLayer} objects, this {@code LayerUI} is set to.
* Component events are enabled in the overridden {@link #installUI} method
* and should be disabled in the {@link #uninstallUI} method after that.
* <pre>
* public void installUI(JComponent c) {
* super.installUI(c);
* JLayer l = (JLayer) c;
* l.setLayerEventMask(AWTEvent.COMPONENT_EVENT_MASK);
* }
*
* public void unistallUI(JComponent c) {
* super.uninstallUI(c);
* JLayer l = (JLayer) c;
* l.setLayerEventMask(0);
* }
* </pre>
*
* @param e the {@code ComponentEvent} to be processed
* @param l the layer this {@code LayerUI} instance is set to
*
* @see JLayer#setLayerEventMask(long)
* @see #installUI(javax.swing.JComponent)
* @see #uninstallUI(javax.swing.JComponent)
*/
protected void processComponentEvent(ComponentEvent e, JLayer<? extends V> l) {
}
/**
* Processes focus events occurring on the {@link JLayer}
* or any of its subcomponents.
* <p/>
* This method is not called unless focus events are
* enabled for the {@code JLayer} objects, this {@code LayerUI} is set to.
* Focus events are enabled in the overridden {@link #installUI} method
* and should be disabled in the {@link #uninstallUI} method after that.
* <pre>
* public void installUI(JComponent c) {
* super.installUI(c);
* JLayer l = (JLayer) c;
* l.setLayerEventMask(AWTEvent.FOCUS_EVENT_MASK);
* }
*
* public void unistallUI(JComponent c) {
* super.uninstallUI(c);
* JLayer l = (JLayer) c;
* l.setLayerEventMask(0);
* }
* </pre>
*
* @param e the {@code FocusEvent} to be processed
* @param l the layer this {@code LayerUI} instance is set to
*
* @see JLayer#setLayerEventMask(long)
* @see #installUI(javax.swing.JComponent)
* @see #uninstallUI(javax.swing.JComponent)
*/
protected void processFocusEvent(FocusEvent e, JLayer<? extends V> l) {
}
/**
* Processes key events occurring on the {@link JLayer}
* or any of its subcomponents.
* <p/>
* This method is not called unless key events are
* enabled for the {@code JLayer} objects, this {@code LayerUI} is set to.
* Key events are enabled in the overridden {@link #installUI} method
* and should be disabled in the {@link #uninstallUI} method after that.
* <pre>
* public void installUI(JComponent c) {
* super.installUI(c);
* JLayer l = (JLayer) c;
* l.setLayerEventMask(AWTEvent.KEY_EVENT_MASK);
* }
*
* public void unistallUI(JComponent c) {
* super.uninstallUI(c);
* JLayer l = (JLayer) c;
* l.setLayerEventMask(0);
* }
* </pre>
*
* @param e the {@code KeyEvent} to be processed
* @param l the layer this {@code LayerUI} instance is set to
*
* @see JLayer#setLayerEventMask(long)
* @see #installUI(javax.swing.JComponent)
* @see #uninstallUI(javax.swing.JComponent)
*/
protected void processKeyEvent(KeyEvent e, JLayer<? extends V> l) {
}
/**
* Processes mouse events occurring on the {@link JLayer}
* or any of its subcomponents.
* <p/>
* This method is not called unless mouse events are
* enabled for the {@code JLayer} objects, this {@code LayerUI} is set to.
* Mouse events are enabled in the overridden {@link #installUI} method
* and should be disabled in the {@link #uninstallUI} method after that.
* <pre>
* public void installUI(JComponent c) {
* super.installUI(c);
* JLayer l = (JLayer) c;
* l.setLayerEventMask(AWTEvent.MOUSE_EVENT_MASK);
* }
*
* public void unistallUI(JComponent c) {
* super.uninstallUI(c);
* JLayer l = (JLayer) c;
* l.setLayerEventMask(0);
* }
* </pre>
*
* @param e the {@code MouseEvent} to be processed
* @param l the layer this {@code LayerUI} instance is set to
*
* @see JLayer#setLayerEventMask(long)
* @see #installUI(javax.swing.JComponent)
* @see #uninstallUI(javax.swing.JComponent)
*/
protected void processMouseEvent(MouseEvent e, JLayer<? extends V> l) {
}
/**
* Processes mouse motion event occurring on the {@link JLayer}
* or any of its subcomponents.
* <p/>
* This method is not called unless mouse motion events are
* enabled for the {@code JLayer} objects, this {@code LayerUI} is set to.
* Mouse motion events are enabled in the overridden {@link #installUI} method
* and should be disabled in the {@link #uninstallUI} method after that.
* <pre>
* public void installUI(JComponent c) {
* super.installUI(c);
* JLayer l = (JLayer) c;
* l.setLayerEventMask(AWTEvent.MOUSE_MOTION_EVENT_MASK);
* }
*
* public void unistallUI(JComponent c) {
* super.uninstallUI(c);
* JLayer l = (JLayer) c;
* l.setLayerEventMask(0);
* }
* </pre>
*
* @param e the {@code MouseEvent} to be processed
* @param l the layer this {@code LayerUI} instance is set to
*
* @see JLayer#setLayerEventMask(long)
* @see #installUI(javax.swing.JComponent)
* @see #uninstallUI(javax.swing.JComponent)
*/
protected void processMouseMotionEvent(MouseEvent e, JLayer<? extends V> l) {
}
/**
* Processes mouse wheel event occurring on the {@link JLayer}
* or any of its subcomponents.
* <p/>
* This method is not called unless mouse wheel events are
* enabled for the {@code JLayer} objects, this {@code LayerUI} is set to.
* Mouse wheel events are enabled in the overridden {@link #installUI} method
* and should be disabled in the {@link #uninstallUI} method after that.
* <pre>
* public void installUI(JComponent c) {
* super.installUI(c);
* JLayer l = (JLayer) c;
* l.setLayerEventMask(AWTEvent.MOUSE_WHEEL_EVENT_MASK);
* }
*
* public void unistallUI(JComponent c) {
* super.uninstallUI(c);
* JLayer l = (JLayer) c;
* l.setLayerEventMask(0);
* }
* </pre>
*
* @param e the {@code MouseEvent} to be processed
* @param l the layer this {@code LayerUI} instance is set to
*
* @see JLayer#setLayerEventMask(long)
* @see #installUI(javax.swing.JComponent)
* @see #uninstallUI(javax.swing.JComponent)
*/
protected void processMouseWheelEvent(MouseWheelEvent e, JLayer<? extends V> l) {
}
/**
* Processes input event occurring on the {@link JLayer}
* or any of its subcomponents.
* <p/>
* This method is not called unless input events are
* enabled for the {@code JLayer} objects, this {@code LayerUI} is set to.
* Input events are enabled in the overridden {@link #installUI} method
* and should be disabled in the {@link #uninstallUI} method after that.
* <pre>
* public void installUI(JComponent c) {
* super.installUI(c);
* JLayer l = (JLayer) c;
* l.setLayerEventMask(AWTEvent.INPUT_METHOD_EVENT_MASK);
* }
*
* public void unistallUI(JComponent c) {
* super.uninstallUI(c);
* JLayer l = (JLayer) c;
* l.setLayerEventMask(0);
* }
* </pre>
*
* @param e the {@code InputMethodEvent} to be processed
* @param l the layer this {@code LayerUI} instance is set to
*
* @see JLayer#setLayerEventMask(long)
* @see #installUI(javax.swing.JComponent)
* @see #uninstallUI(javax.swing.JComponent)
*/
protected void processInputMethodEvent(InputMethodEvent e, JLayer<? extends V> l) {
}
/**
* Processes hierarchy event occurring on the {@link JLayer}
* or any of its subcomponents.
* <p/>
* This method is not called unless hierarchy events are
* enabled for the {@code JLayer} objects, this {@code LayerUI} is set to.
* Hierarchy events are enabled in the overridden {@link #installUI} method
* and should be disabled in the {@link #uninstallUI} method after that.
* <pre>
* public void installUI(JComponent c) {
* super.installUI(c);
* JLayer l = (JLayer) c;
* l.setLayerEventMask(AWTEvent.HIERARCHY_EVENT_MASK);
* }
*
* public void unistallUI(JComponent c) {
* super.uninstallUI(c);
* JLayer l = (JLayer) c;
* l.setLayerEventMask(0);
* }
* </pre>
*
* @param e the {@code HierarchyEvent} to be processed
* @param l the layer this {@code LayerUI} instance is set to
*
* @see JLayer#setLayerEventMask(long)
* @see #installUI(javax.swing.JComponent)
* @see #uninstallUI(javax.swing.JComponent)
*/
protected void processHierarchyEvent(HierarchyEvent e, JLayer<? extends V> l) {
}
/**
* Processes hierarchy bounds event occurring on the {@link JLayer}
* or any of its subcomponents.
* <p/>
* This method is not called unless hierarchy bounds events are
* enabled for the {@code JLayer} objects, this {@code LayerUI} is set to.
* Hierarchy bounds events are enabled in the overridden {@link #installUI}
* method and should be disabled in the {@link #uninstallUI} method after that.
* <pre>
* public void installUI(JComponent c) {
* super.installUI(c);
* JLayer l = (JLayer) c;
* l.setLayerEventMask(AWTEvent.HIERARCHY_BOUNDS_EVENT_MASK);
* }
*
* public void unistallUI(JComponent c) {
* super.uninstallUI(c);
* JLayer l = (JLayer) c;
* l.setLayerEventMask(0);
* }
* </pre>
*
* @param e the {@code HierarchyEvent} to be processed
* @param l the layer this {@code LayerUI} instance is set to
*
* @see JLayer#setLayerEventMask(long)
* @see #installUI(javax.swing.JComponent)
* @see #uninstallUI(javax.swing.JComponent)
*/
protected void processHierarchyBoundsEvent(HierarchyEvent e, JLayer<? extends V> l) {
}
/**
......@@ -250,14 +627,29 @@ public class LayerUI<V extends Component>
propertyChangeSupport.firePropertyChange(propertyName, oldValue, newValue);
}
/**
* Repaints all {@code JLayer} instances this {@code LayerUI} is set to.
* Call this method when the state of this {@code LayerUI} is changed
* and the visual appearance of its {@code JLayer} objects needs to be updated.
*
* @see Component#repaint()
*/
protected void repaintLayer() {
firePropertyChange("dirty", null, null);
}
/**
* Notifies the {@code LayerUI} when any of its property are changed
* and enables updating every {@code JLayer} this {@code LayerUI} instance is set to.
* and enables updating every {@code JLayer}
* this {@code LayerUI} instance is set to.
*
* @param evt the PropertyChangeEvent generated by this {@code LayerUI}
* @param l the {@code JLayer} this LayerUI is set to
*/
public void applyPropertyChange(PropertyChangeEvent evt, JLayer<? extends V> l) {
if ("dirty".equals(evt.getPropertyName())) {
l.repaint();
}
}
/**
......
......@@ -486,7 +486,7 @@ public class BasicDirectoryModel extends AbstractListModel implements PropertyCh
}
if (remSize > 0 && addSize == 0) {
fireIntervalRemoved(BasicDirectoryModel.this, remStart, remStart + remSize - 1);
} else if (addSize > 0 && remSize == 0 && fileCache.size() > addSize) {
} else if (addSize > 0 && remSize == 0 && addStart + addSize <= fileCache.size()) {
fireIntervalAdded(BasicDirectoryModel.this, addStart, addStart + addSize - 1);
} else {
fireContentsChanged();
......
......@@ -32,6 +32,7 @@ import javax.swing.*;
import javax.swing.plaf.*;
import sun.swing.SwingUtilities2;
import sun.swing.PrintColorUIResource;
import sun.swing.SwingLazyValue;
/**
* The default theme for the {@code MetalLookAndFeel}.
......@@ -128,7 +129,7 @@ public class OceanTheme extends DefaultMetalTheme {
* @throws NullPointerException if {@code table} is {@code null}
*/
public void addCustomEntriesToTable(UIDefaults table) {
Object focusBorder = new UIDefaults.ProxyLazyValue(
Object focusBorder = new SwingLazyValue(
"javax.swing.plaf.BorderUIResource$LineBorderUIResource",
new Object[] {getPrimary1()});
// .30 0 DDE8F3 white secondary2
......
......@@ -638,7 +638,7 @@ class SynthTableUI extends BasicTableUI implements SynthUI,
if ((b == null || b instanceof UIResource
|| component instanceof SynthBooleanTableCellRenderer)
&& !table.isCellSelected(row, column)) {
if (alternateColor != null && row % 2 == 0) {
if (alternateColor != null && row % 2 != 0) {
component.setBackground(alternateColor);
}
}
......
......@@ -214,8 +214,9 @@ public class DefaultTableCellRenderer extends JLabel
: table.getBackground();
if (background == null || background instanceof javax.swing.plaf.UIResource) {
Color alternateColor = DefaultLookup.getColor(this, ui, "Table.alternateRowColor");
if (alternateColor != null && row % 2 == 0)
if (alternateColor != null && row % 2 != 0) {
background = alternateColor;
}
}
super.setForeground(unselectedForeground != null
? unselectedForeground
......
......@@ -2069,7 +2069,7 @@ public abstract class JTextComponent extends JComponent implements Scrollable, A
* width to match its own
*/
public boolean getScrollableTracksViewportWidth() {
JViewport port = SwingUtilities2.getViewport(this);
JViewport port = SwingUtilities.getParentViewport(this);
if (port != null) {
return port.getWidth() > getPreferredSize().width;
}
......@@ -2090,7 +2090,7 @@ public abstract class JTextComponent extends JComponent implements Scrollable, A
* to match its own
*/
public boolean getScrollableTracksViewportHeight() {
JViewport port = SwingUtilities2.getViewport(this);
JViewport port = SwingUtilities.getParentViewport(this);
if (port != null) {
return (port.getHeight() > getPreferredSize().height);
}
......
/*
* Copyright 2000-2001 Sun Microsystems, Inc. All Rights Reserved.
* Copyright 2000-2009 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -678,7 +678,7 @@ public interface GSSContext {
* are not definitive then the method will attempt to treat all
* available bytes as part of the token.<p>
*
* Other than the possible blocking behaviour described above, this
* Other than the possible blocking behavior described above, this
* method is equivalent to the byte array based {@link #unwrap(byte[],
* int, int, MessageProp) unwrap} method.<p>
*
......@@ -826,7 +826,7 @@ public interface GSSContext {
* are not definitive then the method will attempt to treat all
* available bytes as part of the token.<p>
*
* Other than the possible blocking behaviour described above, this
* Other than the possible blocking behavior described above, this
* method is equivalent to the byte array based {@link #verifyMIC(byte[],
* int, int, byte[], int, int, MessageProp) verifyMIC} method.<p>
*
......@@ -917,7 +917,7 @@ public interface GSSContext {
* getMutualAuthState} method.<p>
*
* @param state a boolean value indicating whether mutual
* authentication shouls be used or not.
* authentication should be used or not.
* @see #getMutualAuthState()
*
* @throws GSSException containing the following
......@@ -928,7 +928,7 @@ public interface GSSContext {
/**
* Requests that replay detection be enabled for the
* per-message security services after context establishemnt. This
* per-message security services after context establishment. This
* request can only be made on the context initiator's side and it has
* to be done prior to the first call to
* <code>initSecContext</code>. During context establishment replay
......@@ -958,7 +958,7 @@ public interface GSSContext {
/**
* Requests that sequence checking be enabled for the
* per-message security services after context establishemnt. This
* per-message security services after context establishment. This
* request can only be made on the context initiator's side and it has
* to be done prior to the first call to
* <code>initSecContext</code>. During context establishment sequence
......
......@@ -63,8 +63,6 @@ import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.rmi.MarshalledObject;
import java.security.AccessControlContext;
import java.security.AccessControlException;
import java.security.AccessController;
......@@ -493,6 +491,13 @@ public abstract class DataTransferer {
}
}
/**
* Returns {@code true} if the given type is a java.rmi.Remote.
*/
public static boolean isRemote(Class<?> type) {
return RMI.isRemote(type);
}
/**
* Returns an Iterator which traverses a SortedSet of Strings which are
* a total order of the standard character sets supported by the JRE. The
......@@ -1360,7 +1365,7 @@ search:
// Source data is an RMI object
} else if (flavor.isRepresentationClassRemote()) {
MarshalledObject mo = new MarshalledObject(obj);
Object mo = RMI.newMarshalledObject(obj);
ObjectOutputStream oos = new ObjectOutputStream(bos);
oos.writeObject(mo);
oos.close();
......@@ -1671,7 +1676,7 @@ search:
try {
byte[] ba = inputStreamToByteArray(str);
ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(ba));
Object ret = ((MarshalledObject)(ois.readObject())).get();
Object ret = RMI.getMarshalledObject(ois.readObject());
ois.close();
str.close();
return ret;
......@@ -2669,8 +2674,12 @@ search:
Integer.valueOf(0));
nonTextRepresentationsMap.put(java.io.Serializable.class,
Integer.valueOf(1));
nonTextRepresentationsMap.put(java.rmi.Remote.class,
Integer.valueOf(2));
Class<?> remoteClass = RMI.remoteClass();
if (remoteClass != null) {
nonTextRepresentationsMap.put(remoteClass,
Integer.valueOf(2));
}
nonTextRepresentations =
Collections.unmodifiableMap(nonTextRepresentationsMap);
......@@ -2900,4 +2909,95 @@ search:
}
}
}
/**
* A class that provides access to java.rmi.Remote and java.rmi.MarshalledObject
* without creating a static dependency.
*/
private static class RMI {
private static final Class<?> remoteClass = getClass("java.rmi.Remote");
private static final Class<?> marshallObjectClass =
getClass("java.rmi.MarshalledObject");
private static final Constructor<?> marshallCtor =
getConstructor(marshallObjectClass, Object.class);
private static final Method marshallGet =
getMethod(marshallObjectClass, "get");
private static Class<?> getClass(String name) {
try {
return Class.forName(name, true, null);
} catch (ClassNotFoundException e) {
return null;
}
}
private static Constructor<?> getConstructor(Class<?> c, Class<?>... types) {
try {
return (c == null) ? null : c.getDeclaredConstructor(types);
} catch (NoSuchMethodException x) {
throw new AssertionError(x);
}
}
private static Method getMethod(Class<?> c, String name, Class<?>... types) {
try {
return (c == null) ? null : c.getMethod(name, types);
} catch (NoSuchMethodException e) {
throw new AssertionError(e);
}
}
/**
* Returns {@code true} if the given class is java.rmi.Remote.
*/
static boolean isRemote(Class<?> c) {
return (remoteClass == null) ? null : remoteClass.isAssignableFrom(c);
}
/**
* Returns java.rmi.Remote.class if RMI is present; otherwise {@code null}.
*/
static Class<?> remoteClass() {
return remoteClass;
}
/**
* Returns a new MarshalledObject containing the serialized representation
* of the given object.
*/
static Object newMarshalledObject(Object obj) throws IOException {
try {
return marshallCtor.newInstance(obj);
} catch (InstantiationException x) {
throw new AssertionError(x);
} catch (IllegalAccessException x) {
throw new AssertionError(x);
} catch (InvocationTargetException x) {
Throwable cause = x.getCause();
if (cause instanceof IOException)
throw (IOException)cause;
throw new AssertionError(x);
}
}
/**
* Returns a new copy of the contained marshalled object.
*/
static Object getMarshalledObject(Object obj)
throws IOException, ClassNotFoundException
{
try {
return marshallGet.invoke(obj);
} catch (IllegalAccessException x) {
throw new AssertionError(x);
} catch (InvocationTargetException x) {
Throwable cause = x.getCause();
if (cause instanceof IOException)
throw (IOException)cause;
if (cause instanceof ClassNotFoundException)
throw (ClassNotFoundException)cause;
throw new AssertionError(x);
}
}
}
}
......@@ -358,7 +358,9 @@ class ExecutableInputMethodManager extends InputMethodManager
AppContext requesterAppContext = SunToolkit.targetToAppContext(requester);
synchronized (lock) {
SunToolkit.postEvent(requesterAppContext, event);
lock.wait();
while (!event.isDispatched()) {
lock.wait();
}
}
Throwable eventThrowable = event.getThrowable();
......
......@@ -201,6 +201,8 @@ public abstract class ShellFolder extends File {
private static ShellFolderManager shellFolderManager;
private static Invoker invoker;
static {
String managerClassName = (String)Toolkit.getDefaultToolkit().
getDesktopProperty("Shell.shellFolderManager");
......@@ -225,6 +227,8 @@ public abstract class ShellFolder extends File {
throw new Error ("Could not access Shell Folder Manager: "
+ managerClass.getName());
}
invoker = shellFolderManager.createInvoker();
}
/**
......@@ -486,21 +490,6 @@ public abstract class ShellFolder extends File {
return null;
}
private static Invoker invoker;
/**
* Provides the single access point to the {@link Invoker}. It is guaranteed that the value
* returned by this method will be always the same.
*
* @return the singleton instance of {@link Invoker}
*/
public static Invoker getInvoker() {
if (invoker == null) {
invoker = shellFolderManager.createInvoker();
}
return invoker;
}
/**
* Invokes the {@code task} which doesn't throw checked exceptions
* from its {@code call} method. If invokation is interrupted then Thread.currentThread().isInterrupted() will
......@@ -522,7 +511,7 @@ public abstract class ShellFolder extends File {
public static <T, E extends Throwable> T invoke(Callable<T> task, Class<E> exceptionClass)
throws InterruptedException, E {
try {
return getInvoker().invoke(task);
return invoker.invoke(task);
} catch (Exception e) {
if (e instanceof RuntimeException) {
// Rethrow unchecked exceptions
......
......@@ -320,21 +320,6 @@ public abstract class Font2D {
lastFontStrike = new SoftReference(strike);
StrikeCache.refStrike(strike);
return strike;
} else {
/* We have found a cleared reference that has not yet
* been removed by the disposer.
* If we make this reference unreachable by removing it
* from the map,or overwriting it with a new reference to
* a new strike, then it is possible it may never be
* enqueued for disposal. That is the implication of
* the docs for java.lang.ref. So on finding a cleared
* reference, we need to dispose the native resources,
* if they haven't already been freed.
* The reference object needs to have a reference to
* the disposer instance for this to occur.
*/
((StrikeCache.DisposableStrike)strikeRef)
.getDisposer().dispose();
}
}
/* When we create a new FontStrike instance, we *must*
......
......@@ -171,7 +171,7 @@ public final class FontDesignMetrics extends FontMetrics {
* out we can clear the keys from the table.
*/
private static class KeyReference extends SoftReference
implements DisposerRecord {
implements DisposerRecord, Disposer.PollDisposable {
static ReferenceQueue queue = Disposer.getQueue();
......
......@@ -25,6 +25,7 @@
package sun.font;
import sun.java2d.Disposer;
import sun.java2d.DisposerRecord;
/*
......@@ -49,7 +50,8 @@ import sun.java2d.DisposerRecord;
* entries would be removed much more promptly than we need.
*/
class FontStrikeDisposer implements DisposerRecord {
class FontStrikeDisposer
implements DisposerRecord, Disposer.PollDisposable {
Font2D font2D;
FontStrikeDesc desc;
......
......@@ -254,9 +254,20 @@ public final class StrikeCache {
// because they may be accessed on that thread at the time of the
// disposal (for example, when the accel. cache is invalidated)
// REMIND: this look a bit heavyweight, but should be ok
// because strike disposal is a relatively infrequent operation,
// more worrisome is the necessity of getting a GC here.
// Whilst this is a bit heavyweight, in most applications
// strike disposal is a relatively infrequent operation, so it
// doesn't matter. But in some tests that use vast numbers
// of strikes, the switching back and forth is measurable.
// So the "pollRemove" call is added to batch up the work.
// If we are polling we know we've already been called back
// and can directly dispose the record.
// Also worrisome is the necessity of getting a GC here.
if (Disposer.pollingQueue) {
doDispose(disposer);
return;
}
RenderQueue rq = null;
GraphicsEnvironment ge =
GraphicsEnvironment.getLocalGraphicsEnvironment();
......@@ -277,6 +288,7 @@ public final class StrikeCache {
rq.flushAndInvokeNow(new Runnable() {
public void run() {
doDispose(disposer);
Disposer.pollRemove();
}
});
} finally {
......
......@@ -29,6 +29,7 @@ import java.lang.ref.Reference;
import java.lang.ref.ReferenceQueue;
import java.lang.ref.PhantomReference;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.Hashtable;
/**
......@@ -146,6 +147,7 @@ public class Disposer implements Runnable {
rec.dispose();
obj = null;
rec = null;
clearDeferredRecords();
} catch (Exception e) {
System.out.println("Exception while removing reference: " + e);
e.printStackTrace();
......@@ -153,6 +155,85 @@ public class Disposer implements Runnable {
}
}
/*
* This is a marker interface that, if implemented, means it
* doesn't acquire any special locks, and is safe to
* be disposed in the poll loop on whatever thread
* which happens to be the Toolkit thread, is in use.
*/
public static interface PollDisposable {
};
private static ArrayList<DisposerRecord> deferredRecords = null;
private static void clearDeferredRecords() {
if (deferredRecords == null || deferredRecords.isEmpty()) {
return;
}
for (int i=0;i<deferredRecords.size(); i++) {
try {
DisposerRecord rec = deferredRecords.get(i);
rec.dispose();
} catch (Exception e) {
System.out.println("Exception while disposing deferred rec.");
e.printStackTrace();
}
}
deferredRecords.clear();
}
/*
* Set to indicate the queue is presently being polled.
*/
public static volatile boolean pollingQueue = false;
/*
* The pollRemove() method is called back from a dispose method
* that is running on the toolkit thread and wants to
* dispose any pending refs that are safe to be disposed
* on that thread.
*/
public static void pollRemove() {
/* This should never be called recursively, so this check
* is just a safeguard against the unexpected.
*/
if (pollingQueue) {
return;
}
Object obj;
pollingQueue = true;
int freed = 0;
int deferred = 0;
try {
while ((obj = queue.poll()) != null
&& freed < 10000 && deferred < 100) {
freed++;
((Reference)obj).clear();
DisposerRecord rec = (DisposerRecord)records.remove(obj);
if (rec instanceof PollDisposable) {
rec.dispose();
obj = null;
rec = null;
} else {
if (rec == null) { // shouldn't happen, but just in case.
continue;
}
deferred++;
if (deferredRecords == null) {
deferredRecords = new ArrayList<DisposerRecord>(5);
}
deferredRecords.add(rec);
}
}
} catch (Exception e) {
System.out.println("Exception while removing reference: " + e);
e.printStackTrace();
} finally {
pollingQueue = false;
}
}
private static native void initIDs();
/*
......
......@@ -257,7 +257,6 @@ public final class SunGraphics2D
font = defaultFont;
}
loops = sd.getRenderLoops(this);
setDevClip(sd.getBounds());
invalidatePipe();
}
......@@ -367,6 +366,7 @@ public final class SunGraphics2D
shapepipe = invalidpipe;
textpipe = invalidpipe;
imagepipe = invalidpipe;
loops = null;
}
public void validatePipe() {
......
......@@ -69,6 +69,7 @@ import sun.java2d.pipe.DrawImagePipe;
import sun.java2d.pipe.DrawImage;
import sun.awt.SunHints;
import sun.awt.image.SurfaceManager;
import sun.java2d.pipe.LoopBasedPipe;
/**
* This class provides various pieces of information relevant to a
......@@ -506,7 +507,6 @@ public abstract class SurfaceData
sg2d.textpipe = solidTextRenderer;
}
sg2d.shapepipe = colorPrimitives;
sg2d.loops = getRenderLoops(sg2d);
// assert(sg2d.surfaceData == this);
}
} else if (sg2d.compositeState == sg2d.COMP_CUSTOM) {
......@@ -603,9 +603,18 @@ public abstract class SurfaceData
sg2d.textpipe = getTextPipe(sg2d, false /* AA==OFF */);
sg2d.shapepipe = colorPrimitives;
sg2d.loops = getRenderLoops(sg2d);
// assert(sg2d.surfaceData == this);
}
// check for loops
if (sg2d.textpipe instanceof LoopBasedPipe ||
sg2d.shapepipe instanceof LoopBasedPipe ||
sg2d.fillpipe instanceof LoopBasedPipe ||
sg2d.drawpipe instanceof LoopBasedPipe ||
sg2d.imagepipe instanceof LoopBasedPipe)
{
sg2d.loops = getRenderLoops(sg2d);
}
}
/* Return the text pipe to be used based on the graphics AA hint setting,
......
......@@ -34,8 +34,9 @@ import sun.font.GlyphList;
* a solid source colour to an opaque destination.
*/
public class AATextRenderer extends GlyphListLoopPipe {
public class AATextRenderer extends GlyphListLoopPipe
implements LoopBasedPipe
{
protected void drawGlyphList(SunGraphics2D sg2d, GlyphList gl) {
sg2d.loops.drawGlyphListAALoop.DrawGlyphListAA(sg2d, sg2d.surfaceData,
gl);
......
......@@ -36,8 +36,9 @@ import sun.font.GlyphList;
* the installed loop may not match the glyphvector.
*/
public abstract class GlyphListLoopPipe extends GlyphListPipe {
public abstract class GlyphListLoopPipe extends GlyphListPipe
implements LoopBasedPipe
{
protected void drawGlyphList(SunGraphics2D sg2d, GlyphList gl,
int aaHint) {
switch (aaHint) {
......
/*
* Copyright 2007 Sun Microsystems, Inc. All Rights Reserved.
* Copyright 2009 Sun Microsystems, Inc. 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.
* published by the Free Software Foundation. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun 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
......@@ -22,25 +23,15 @@
* have any questions.
*/
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class libraryCaller */
package sun.java2d.pipe;
#ifndef _Included_libraryCaller
#define _Included_libraryCaller
#ifdef __cplusplus
extern "C" {
#endif
/*
* Class: libraryCaller
* Method: number
* Signature: ()I
/**
* This is a marker interface used by Pipes that need RenderLoops.
* RenderLoops are validated in SurfaceData when a pipe is recognised to
* implement this interface.
*
* @author Mario Torre <neugens@aicas.com>
*/
JNIEXPORT jint JNICALL Java_libraryCaller_number
(JNIEnv *, jclass);
public interface LoopBasedPipe {
#ifdef __cplusplus
}
#endif
#endif
......@@ -46,7 +46,8 @@ import sun.awt.SunHints;
public class LoopPipe
implements PixelDrawPipe,
PixelFillPipe,
ShapeDrawPipe
ShapeDrawPipe,
LoopBasedPipe
{
final static RenderingEngine RenderEngine = RenderingEngine.getInstance();
......
......@@ -35,8 +35,9 @@ import sun.font.GlyphList;
* a solid source colour to an opaque destination.
*/
public class SolidTextRenderer extends GlyphListLoopPipe {
public class SolidTextRenderer extends GlyphListLoopPipe
implements LoopBasedPipe
{
protected void drawGlyphList(SunGraphics2D sg2d, GlyphList gl) {
sg2d.loops.drawGlyphListLoop.DrawGlyphList(sg2d, sg2d.surfaceData, gl);
}
......
......@@ -65,7 +65,9 @@ public abstract class SpanShapeRenderer implements ShapeDrawPipe {
}
}
public static class Simple extends SpanShapeRenderer {
public static class Simple extends SpanShapeRenderer
implements LoopBasedPipe
{
public Object startSequence(SunGraphics2D sg, Shape s,
Rectangle devR, int[] bbox) {
return sg;
......
......@@ -775,10 +775,12 @@ public class Renderer extends LineSink {
// Free sorting arrays if larger than maximum size
private void crossingListFinished() {
if (crossings.length > DEFAULT_CROSSINGS_SIZE) {
if (crossings != null && crossings.length > DEFAULT_CROSSINGS_SIZE) {
crossings = new int[DEFAULT_CROSSINGS_SIZE];
}
if (crossingIndices.length > DEFAULT_INDICES_SIZE) {
if (crossingIndices != null &&
crossingIndices.length > DEFAULT_INDICES_SIZE)
{
crossingIndices = new int[DEFAULT_INDICES_SIZE];
}
}
......
......@@ -25,6 +25,7 @@
package sun.net.www.protocol.http.spnego;
import com.sun.security.jgss.ExtendedGSSContext;
import java.io.IOException;
import org.ietf.jgss.GSSContext;
......@@ -100,15 +101,10 @@ public class NegotiatorImpl extends Negotiator {
null,
GSSContext.DEFAULT_LIFETIME);
// In order to support credential delegation in HTTP/SPNEGO,
// we always request it before initSecContext. The current
// implementation will check the OK-AS-DELEGATE flag inside
// the service ticket of the web server, and only enable
// delegation when this flag is set. This check is only
// performed when the GSS caller is CALLER_HTTP_NEGOTIATE,
// so all other normal GSS-API calls are not affected.
context.requestCredDeleg(true);
// Always respect delegation policy in HTTP/SPNEGO.
if (context instanceof ExtendedGSSContext) {
((ExtendedGSSContext)context).requestDelegPolicy(true);
}
oneToken = context.initSecContext(new byte[0], 0, 0);
}
......
......@@ -89,7 +89,8 @@ import com.sun.security.jgss.*;
*/
class GSSContextImpl implements ExtendedGSSContext {
private GSSManagerImpl gssManager = null;
private final GSSManagerImpl gssManager;
private final boolean initiator;
// private flags for the context state
private static final int PRE_INIT = 1;
......@@ -99,14 +100,12 @@ class GSSContextImpl implements ExtendedGSSContext {
// instance variables
private int currentState = PRE_INIT;
private boolean initiator;
private GSSContextSpi mechCtxt = null;
private Oid mechOid = null;
private ObjectIdentifier objId = null;
private GSSCredentialImpl myCred = null;
private GSSCredentialImpl delegCred = null;
private GSSNameImpl srcName = null;
private GSSNameImpl targName = null;
......@@ -121,6 +120,7 @@ class GSSContextImpl implements ExtendedGSSContext {
private boolean reqSequenceDetState = true;
private boolean reqCredDelegState = false;
private boolean reqAnonState = false;
private boolean reqDelegPolicyState = false;
/**
* Creates a GSSContextImp on the context initiator's side.
......@@ -221,6 +221,7 @@ class GSSContextImpl implements ExtendedGSSContext {
mechCtxt.requestSequenceDet(reqSequenceDetState);
mechCtxt.requestAnonymity(reqAnonState);
mechCtxt.setChannelBinding(channelBindings);
mechCtxt.requestDelegPolicy(reqDelegPolicyState);
objId = new ObjectIdentifier(mechOid.toString());
......@@ -465,42 +466,42 @@ class GSSContextImpl implements ExtendedGSSContext {
}
public void requestMutualAuth(boolean state) throws GSSException {
if (mechCtxt == null)
if (mechCtxt == null && initiator)
reqMutualAuthState = state;
}
public void requestReplayDet(boolean state) throws GSSException {
if (mechCtxt == null)
if (mechCtxt == null && initiator)
reqReplayDetState = state;
}
public void requestSequenceDet(boolean state) throws GSSException {
if (mechCtxt == null)
if (mechCtxt == null && initiator)
reqSequenceDetState = state;
}
public void requestCredDeleg(boolean state) throws GSSException {
if (mechCtxt == null)
if (mechCtxt == null && initiator)
reqCredDelegState = state;
}
public void requestAnonymity(boolean state) throws GSSException {
if (mechCtxt == null)
if (mechCtxt == null && initiator)
reqAnonState = state;
}
public void requestConf(boolean state) throws GSSException {
if (mechCtxt == null)
if (mechCtxt == null && initiator)
reqConfState = state;
}
public void requestInteg(boolean state) throws GSSException {
if (mechCtxt == null)
if (mechCtxt == null && initiator)
reqIntegState = state;
}
public void requestLifetime(int lifetime) throws GSSException {
if (mechCtxt == null)
if (mechCtxt == null && initiator)
reqLifetime = lifetime;
}
......@@ -630,6 +631,8 @@ class GSSContextImpl implements ExtendedGSSContext {
targName = null;
}
// ExtendedGSSContext methods:
@Override
public Object inquireSecContext(InquireType type) throws GSSException {
SecurityManager security = System.getSecurityManager();
......@@ -641,4 +644,18 @@ class GSSContextImpl implements ExtendedGSSContext {
}
return mechCtxt.inquireSecContext(type);
}
@Override
public void requestDelegPolicy(boolean state) throws GSSException {
if (mechCtxt == null && initiator)
reqDelegPolicyState = state;
}
@Override
public boolean getDelegPolicyState() {
if (mechCtxt != null)
return mechCtxt.getDelegPolicyState();
else
return reqDelegPolicyState;
}
}
......@@ -85,32 +85,39 @@ abstract class InitialToken extends Krb5Token {
int size = CHECKSUM_LENGTH_SIZE + CHECKSUM_BINDINGS_SIZE +
CHECKSUM_FLAGS_SIZE;
if (!tgt.isForwardable()) {
context.setCredDelegState(false);
context.setDelegPolicyState(false);
} else if (context.getCredDelegState()) {
if (context.getDelegPolicyState()) {
if (!serviceTicket.checkDelegate()) {
// delegation not permitted by server policy, mark it
context.setDelegPolicyState(false);
}
}
} else if (context.getDelegPolicyState()) {
if (serviceTicket.checkDelegate()) {
context.setCredDelegState(true);
} else {
context.setDelegPolicyState(false);
}
}
if (context.getCredDelegState()) {
if (context.getCaller() instanceof HttpCaller &&
!serviceTicket.getFlags()[Krb5.TKT_OPTS_DELEGATE]) {
// When the caller is HTTP/SPNEGO and OK-AS-DELEGATE
// is not present in the service ticket, delegation
// is disabled.
context.setCredDelegState(false);
} else if (!tgt.isForwardable()) {
// XXX log this resetting of delegation state
context.setCredDelegState(false);
KrbCred krbCred = null;
CipherHelper cipherHelper =
context.getCipherHelper(serviceTicket.getSessionKey());
if (useNullKey(cipherHelper)) {
krbCred = new KrbCred(tgt, serviceTicket,
EncryptionKey.NULL_KEY);
} else {
KrbCred krbCred = null;
CipherHelper cipherHelper =
context.getCipherHelper(serviceTicket.getSessionKey());
if (useNullKey(cipherHelper)) {
krbCred = new KrbCred(tgt, serviceTicket,
EncryptionKey.NULL_KEY);
} else {
krbCred = new KrbCred(tgt, serviceTicket,
serviceTicket.getSessionKey());
}
krbCredMessage = krbCred.getMessage();
size += CHECKSUM_DELEG_OPT_SIZE +
CHECKSUM_DELEG_LGTH_SIZE +
krbCredMessage.length;
krbCred = new KrbCred(tgt, serviceTicket,
serviceTicket.getSessionKey());
}
krbCredMessage = krbCred.getMessage();
size += CHECKSUM_DELEG_OPT_SIZE +
CHECKSUM_DELEG_LGTH_SIZE +
krbCredMessage.length;
}
checksumBytes = new byte[size];
......@@ -296,6 +303,7 @@ abstract class InitialToken extends Krb5Token {
return delegCreds;
}
// Only called by acceptor
public void setContextFlags(Krb5Context context) {
// default for cred delegation is false
if ((flags & CHECKSUM_DELEG_FLAG) > 0)
......
......@@ -78,6 +78,7 @@ class Krb5Context implements GSSContextSpi {
private boolean sequenceDetState = true;
private boolean confState = true;
private boolean integState = true;
private boolean delegPolicyState = false;
private int mySeqNumber;
private int peerSeqNumber;
......@@ -299,6 +300,21 @@ class Krb5Context implements GSSContextSpi {
return sequenceDetState || replayDetState;
}
/**
* Requests that the deleg policy be respected.
*/
public final void requestDelegPolicy(boolean value) {
if (state == STATE_NEW && isInitiator())
delegPolicyState = value;
}
/**
* Is deleg policy respected?
*/
public final boolean getDelegPolicyState() {
return delegPolicyState;
}
/*
* Anonymity is a little different in that after an application
* requests anonymity it will want to know whether the mechanism
......@@ -422,6 +438,10 @@ class Krb5Context implements GSSContextSpi {
integState = state;
}
final void setDelegPolicyState(boolean state) {
delegPolicyState = state;
}
/**
* Sets the channel bindings to be used during context
* establishment.
......
......@@ -124,6 +124,8 @@ public interface GSSContextSpi {
public void requestInteg(boolean state) throws GSSException;
public void requestDelegPolicy(boolean state) throws GSSException;
public void setChannelBinding(ChannelBinding cb) throws GSSException;
public boolean getCredDelegState();
......@@ -136,6 +138,8 @@ public interface GSSContextSpi {
public boolean getAnonymityState();
public boolean getDelegPolicyState();
public boolean isTransferable() throws GSSException;
public boolean isProtReady();
......
......@@ -57,6 +57,12 @@ public final class SpNegoMechFactory implements MechanismFactory {
GSSName.NT_HOSTBASED_SERVICE,
GSSName.NT_EXPORT_NAME};
// The default underlying mech of SPNEGO, must not be SPNEGO itself.
private static final Oid DEFAULT_SPNEGO_MECH_OID =
ProviderList.DEFAULT_MECH_OID.equals(GSS_SPNEGO_MECH_OID)?
GSSUtil.GSS_KRB5_MECH_OID:
ProviderList.DEFAULT_MECH_OID;
// Use an instance of a GSSManager whose provider list
// does not include native provider
final GSSManagerImpl manager;
......@@ -100,18 +106,27 @@ public final class SpNegoMechFactory implements MechanismFactory {
availableMechs[j++] = mechs[i];
}
}
// Move the preferred mech to first place
for (int i=0; i<availableMechs.length; i++) {
if (availableMechs[i].equals(DEFAULT_SPNEGO_MECH_OID)) {
if (i != 0) {
availableMechs[i] = availableMechs[0];
availableMechs[0] = DEFAULT_SPNEGO_MECH_OID;
}
break;
}
}
}
public GSSNameSpi getNameElement(String nameStr, Oid nameType)
throws GSSException {
// get NameElement for the default Mechanism
return manager.getNameElement(nameStr, nameType, null);
throws GSSException {
return manager.getNameElement(
nameStr, nameType, DEFAULT_SPNEGO_MECH_OID);
}
public GSSNameSpi getNameElement(byte[] name, Oid nameType)
throws GSSException {
// get NameElement for the default Mechanism
return manager.getNameElement(name, nameType, null);
throws GSSException {
return manager.getNameElement(name, nameType, DEFAULT_SPNEGO_MECH_OID);
}
public GSSCredentialSpi getCredentialElement(GSSNameSpi name,
......
......@@ -549,6 +549,9 @@ class NativeGSSContext implements GSSContextSpi {
public void requestInteg(boolean state) throws GSSException {
changeFlags(GSS_C_INTEG_FLAG, state);
}
public void requestDelegPolicy(boolean state) throws GSSException {
// Not supported, ignore
}
public void requestLifetime(int lifetime) throws GSSException {
if (isInitiator && pContext == 0) {
this.lifetime = lifetime;
......@@ -590,6 +593,9 @@ class NativeGSSContext implements GSSContextSpi {
public boolean getIntegState() {
return checkFlags(GSS_C_INTEG_FLAG);
}
public boolean getDelegPolicyState() {
return false;
}
public int getLifetime() {
return cStub.getContextTime(pContext);
}
......
......@@ -234,7 +234,19 @@ public class Credentials {
* @return true if OK-AS_DELEGATE flag is set, otherwise, return false.
*/
public boolean checkDelegate() {
return (flags.get(Krb5.TKT_OPTS_DELEGATE));
return flags.get(Krb5.TKT_OPTS_DELEGATE);
}
/**
* Reset TKT_OPTS_DELEGATE to false, called at credentials acquirement
* when one of the cross-realm TGTs does not have the OK-AS-DELEGATE
* flag set. This info must be preservable and restorable through
* the Krb5Util.credsToTicket/ticketToCreds() methods so that even if
* the service ticket is cached it still remembers the cross-realm
* authentication result.
*/
public void resetDelegate() {
flags.set(Krb5.TKT_OPTS_DELEGATE, false);
}
public Credentials renew() throws KrbException, IOException {
......
/*
* Portions Copyright 2001-2004 Sun Microsystems, Inc. All Rights Reserved.
* Portions Copyright 2001-2009 Sun Microsystems, Inc. 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
......@@ -117,6 +117,7 @@ rs.
// Get a list of realms to traverse
String[] realms = Realm.getRealmsList(localRealm, serviceRealm);
boolean okAsDelegate = true;
if (realms == null || realms.length == 0)
{
......@@ -194,6 +195,15 @@ rs.
*/
newTgtRealm = newTgt.getServer().getInstanceComponent();
if (okAsDelegate && !newTgt.checkDelegate()) {
if (DEBUG)
{
System.out.println(">>> Credentials acquireServiceCreds: " +
"global OK-AS-DELEGATE turned off at " +
newTgt.getServer());
}
okAsDelegate = false;
}
if (DEBUG)
{
......@@ -283,6 +293,9 @@ rs.
System.out.println(">>> Credentials acquireServiceCreds: returning creds:");
Credentials.printDebug(theCreds);
}
if (!okAsDelegate) {
theCreds.resetDelegate();
}
return theCreds;
}
throw new KrbApErrException(Krb5.KRB_AP_ERR_GEN_CRED,
......
......@@ -1807,22 +1807,4 @@ public class SwingUtilities2 {
boolean three) {
return liesIn(rect, p, false, false, three);
}
/**
* Returns the {@code JViewport} instance for the {@code component}
* or {@code null}.
*
* @return the {@code JViewport} instance for the {@code component}
* or {@code null}
* @throws NullPointerException if {@code component} is {@code null}
*/
public static JViewport getViewport(Component component) {
do {
component = component.getParent();
if (component instanceof JViewport) {
return (JViewport) component;
}
} while(component instanceof JLayer);
return null;
}
}
此差异已折叠。
......@@ -42,6 +42,10 @@
#include <sys/ipc.h>
#include <sys/shm.h>
#include <X11/extensions/XShm.h>
#ifndef X_ShmAttach
#include <X11/Xmd.h>
#include <X11/extensions/shmproto.h>
#endif
extern int XShmQueryExtension();
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册