mirror of
https://github.com/openjdk/jdk.git
synced 2026-06-05 10:12:35 +00:00
Merge
This commit is contained in:
commit
e629176759
43
jdk/make/mkdemo/jfc/Laffy/Makefile
Normal file
43
jdk/make/mkdemo/jfc/Laffy/Makefile
Normal file
@ -0,0 +1,43 @@
|
||||
#
|
||||
# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation. Oracle designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Oracle in the LICENSE file that accompanied this code.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
#
|
||||
# Makefile to build the Laffy demo.
|
||||
#
|
||||
|
||||
BUILDDIR = ../../..
|
||||
PRODUCT = demo/jfc
|
||||
DEMONAME = Laffy
|
||||
include $(BUILDDIR)/common/Defs.gmk
|
||||
|
||||
DEMO_ROOT = $(CLOSED_SRC)/share/demo/jfc/$(DEMONAME)
|
||||
DEMO_DESTDIR = $(DEMODIR)/jfc/$(DEMONAME)
|
||||
DEMO_TOPFILES = ./readme.html ./laffy.png
|
||||
DEMO_SKIP_SRCZIP = true
|
||||
|
||||
#
|
||||
# Demo jar building rules.
|
||||
#
|
||||
include $(BUILDDIR)/common/Demo.gmk
|
||||
@ -43,7 +43,7 @@ SUBDIRS = \
|
||||
|
||||
# Some demos aren't currently included in OpenJDK
|
||||
ifndef OPENJDK
|
||||
SUBDIRS += Java2D SwingSet2 SwingSet3 Stylepad
|
||||
SUBDIRS += Java2D Laffy SwingSet2 SwingSet3 Stylepad
|
||||
endif
|
||||
|
||||
include $(BUILDDIR)/common/Subdirs.gmk
|
||||
|
||||
@ -21,4 +21,4 @@
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
tzdata2011b
|
||||
tzdata2011d
|
||||
|
||||
@ -531,11 +531,31 @@ Zone Pacific/Pago_Pago 12:37:12 - LMT 1879 Jul 5
|
||||
# to 01:00am and First Sunday April 2011 (03/04/11) - adjust clocks
|
||||
# backwards from 1:00am to 12:00am"
|
||||
|
||||
# From Raymond Hughes (2011-03-07)
|
||||
# I believe this will be posted shortly on the website
|
||||
# <a href="http://www.mcil.gov.ws">
|
||||
# www.mcil.gov.ws
|
||||
# </a>
|
||||
#
|
||||
# PUBLIC NOTICE ON DAYLIGHT SAVING TIME
|
||||
#
|
||||
# Pursuant to the Daylight Saving Act 2009 and Cabinets decision,
|
||||
# businesses and the general public are hereby advised that daylight
|
||||
# saving time is on the first Saturday of April 2011 (02/04/11).
|
||||
#
|
||||
# The public is therefore advised that when the standard time strikes
|
||||
# the hour of four oclock (4.00am or 0400 Hours) on the 2nd April 2011,
|
||||
# then all instruments used to measure standard time are to be
|
||||
# adjusted/changed to three oclock (3:00am or 0300Hrs).
|
||||
#
|
||||
# Margaret Fruean ACTING CHIEF EXECUTIVE OFFICER MINISTRY OF COMMERCE,
|
||||
# INDUSTRY AND LABOUR 28th February 2011
|
||||
|
||||
Zone Pacific/Apia 12:33:04 - LMT 1879 Jul 5
|
||||
-11:26:56 - LMT 1911
|
||||
-11:30 - SAMT 1950 # Samoa Time
|
||||
-11:00 - WST 2010 Sep 26
|
||||
-11:00 1:00 WSDT 2011 Apr 3 1:00
|
||||
-11:00 1:00 WSDT 2011 Apr 2 4:00
|
||||
-11:00 - WST
|
||||
|
||||
# Solomon Is
|
||||
|
||||
@ -58,8 +58,7 @@ Link Etc/GMT Etc/GMT0
|
||||
# (i.e. west of Greenwich) even though many people would expect it to
|
||||
# mean 4 hours ahead of UTC (i.e. east of Greenwich).
|
||||
#
|
||||
# In the draft 5 of POSIX 1003.1-200x, the angle bracket notation
|
||||
# (which is not yet supported by the tz code) allows for
|
||||
# In the draft 5 of POSIX 1003.1-200x, the angle bracket notation allows for
|
||||
# TZ='<GMT-4>+4'; if you want time zone abbreviations conforming to
|
||||
# ISO 8601 you can use TZ='<-0400>+4'. Thus the commonly-expected
|
||||
# offset is kept within the angle bracket (and is used for display)
|
||||
|
||||
@ -2505,25 +2505,18 @@ Zone Europe/Zurich 0:34:08 - LMT 1848 Sep 12
|
||||
# (on a non-government server though) describing dates between 2002 and 2006:
|
||||
# http://www.alomaliye.com/bkk_2002_3769.htm
|
||||
|
||||
# From Sue Williams (2008-08-11):
|
||||
# I spotted this news article about a potential change in Turkey.
|
||||
#
|
||||
# <a href="http://www.hurriyet.com.tr/english/domestic/9626174.asp?scr=1">
|
||||
# http://www.hurriyet.com.tr/english/domestic/9626174.asp?scr=1
|
||||
# From Gökdeniz Karadağ (2011-03-10):
|
||||
#
|
||||
# According to the articles linked below, Turkey will change into summer
|
||||
# time zone (GMT+3) on March 28, 2011 at 3:00 a.m. instead of March 27.
|
||||
# This change is due to a nationwide exam on 27th.
|
||||
#
|
||||
# <a href="http://www.worldbulletin.net/?aType=haber&ArticleID=70872">
|
||||
# http://www.worldbulletin.net/?aType=haber&ArticleID=70872
|
||||
# </a>
|
||||
|
||||
# From Sue Williams (2008-08-20):
|
||||
# This article says that around the end of March 2011, Turkey wants to
|
||||
# adjust the clocks forward by 1/2 hour and stay that way permanently.
|
||||
# The article indicates that this is a change in timezone offset in addition
|
||||
# to stopping observance of DST.
|
||||
# This proposal has not yet been approved.
|
||||
#
|
||||
# Read more here...
|
||||
#
|
||||
# Turkey to abandon daylight saving time in 2011
|
||||
# <a href="http://www.turkishdailynews.com.tr/article.php?enewsid=112989">
|
||||
# http://www.turkishdailynews.com.tr/article.php?enewsid=112989
|
||||
# Turkish:
|
||||
# <a href="http://www.hurriyet.com.tr/ekonomi/17230464.asp?gid=373">
|
||||
# http://www.hurriyet.com.tr/ekonomi/17230464.asp?gid=373
|
||||
# </a>
|
||||
|
||||
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
|
||||
@ -2591,6 +2584,8 @@ Zone Europe/Istanbul 1:55:52 - LMT 1880
|
||||
2:00 Turkey EE%sT 1978 Oct 15
|
||||
3:00 Turkey TR%sT 1985 Apr 20 # Turkey Time
|
||||
2:00 Turkey EE%sT 2007
|
||||
2:00 EU EE%sT 2011 Mar 27 1:00u
|
||||
2:00 - EET 2011 Mar 28 1:00u
|
||||
2:00 EU EE%sT
|
||||
Link Europe/Istanbul Asia/Istanbul # Istanbul is in both continents.
|
||||
|
||||
|
||||
@ -78,13 +78,13 @@ Leap 2008 Dec 31 23:59:60 + S
|
||||
# SERVICE DE LA ROTATION TERRESTRE
|
||||
# OBSERVATOIRE DE PARIS
|
||||
# 61, Av. de l'Observatoire 75014 PARIS (France)
|
||||
# Tel. : 33 (0) 1 40 51 22 26
|
||||
# Tel. : 33 (0) 1 40 51 22 29
|
||||
# FAX : 33 (0) 1 40 51 22 91
|
||||
# Internet : services.iers@obspm.fr
|
||||
#
|
||||
# Paris, 14 July 2010
|
||||
# Paris, 2 February 2011
|
||||
#
|
||||
# Bulletin C 40
|
||||
# Bulletin C 41
|
||||
#
|
||||
# To authorities responsible
|
||||
# for the measurement and
|
||||
@ -92,9 +92,9 @@ Leap 2008 Dec 31 23:59:60 + S
|
||||
#
|
||||
# INFORMATION ON UTC - TAI
|
||||
#
|
||||
# NO positive leap second will be introduced at the end of December 2010.
|
||||
# NO positive leap second will be introduced at the end of June 2011.
|
||||
# The difference between Coordinated Universal Time UTC and the
|
||||
# International Atomic Time TAI is :
|
||||
# International Atomic Time TAI is :
|
||||
#
|
||||
# from 2009 January 1, 0h UTC, until further notice : UTC-TAI = -34 s
|
||||
#
|
||||
@ -104,6 +104,6 @@ Leap 2008 Dec 31 23:59:60 + S
|
||||
# will be no time step at the next possible date.
|
||||
#
|
||||
# Daniel GAMBIS
|
||||
# Director
|
||||
# Earth Orientation Center of IERS
|
||||
# Head
|
||||
# Earth Orientation Center of the IERS
|
||||
# Observatoire de Paris, France
|
||||
|
||||
@ -448,15 +448,74 @@ Zone America/Los_Angeles -7:52:58 - LMT 1883 Nov 18 12:07:02
|
||||
# were nearby inhabitants in some cases and for our purposes perhaps
|
||||
# it's best to simply use the official transition.
|
||||
#
|
||||
|
||||
# From Steve Ferguson (2011-01-31):
|
||||
# The author lives in Alaska and many of the references listed are only
|
||||
# available to Alaskan residents.
|
||||
#
|
||||
# <a href="http://www.alaskahistoricalsociety.org/index.cfm?section=discover%20alaska&page=Glimpses%20of%20the%20Past&viewpost=2&ContentId=98">
|
||||
# http://www.alaskahistoricalsociety.org/index.cfm?section=discover%20alaska&page=Glimpses%20of%20the%20Past&viewpost=2&ContentId=98
|
||||
# </a>
|
||||
|
||||
# From Arthur David Olson (2011-02-01):
|
||||
# Here's database-relevant material from the 2001 "Alaska History" article:
|
||||
#
|
||||
# On September 20 [1979]...DOT...officials decreed that on April 27,
|
||||
# 1980, Juneau and other nearby communities would move to Yukon Time.
|
||||
# Sitka, Petersburg, Wrangell, and Ketchikan, however, would remain on
|
||||
# Pacific Time.
|
||||
#
|
||||
# ...on September 22, 1980, DOT Secretary Neil E. Goldschmidt rescinded the
|
||||
# Department's September 1979 decision. Juneau and other communities in
|
||||
# northern Southeast reverted to Pacific Time on October 26.
|
||||
#
|
||||
# On October 28 [1983]...the Metlakatla Indian Community Council voted
|
||||
# unanimously to keep the reservation on Pacific Time.
|
||||
#
|
||||
# According to DOT official Joanne Petrie, Indian reservations are not
|
||||
# bound to follow time zones imposed by neighboring jurisdictions.
|
||||
#
|
||||
# (The last is consistent with how the database now handles the Navajo
|
||||
# Nation.)
|
||||
|
||||
# From Arthur David Olson (2011-02-09):
|
||||
# I just spoke by phone with a staff member at the Metlakatla Indian
|
||||
# Community office (using contact information available at
|
||||
# <a href="http://www.commerce.state.ak.us/dca/commdb/CIS.cfm?Comm_Boro_name=Metlakatla">
|
||||
# http://www.commerce.state.ak.us/dca/commdb/CIS.cfm?Comm_Boro_name=Metlakatla
|
||||
# </a>).
|
||||
# It's shortly after 1:00 here on the east coast of the United States;
|
||||
# the staffer said it was shortly after 10:00 there. When I asked whether
|
||||
# that meant they were on Pacific time, they said no--they were on their
|
||||
# own time. I asked about daylight saving; they said it wasn't used. I
|
||||
# did not inquire about practices in the past.
|
||||
|
||||
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
|
||||
Zone America/Juneau 15:02:19 - LMT 1867 Oct 18
|
||||
-8:57:41 - LMT 1900 Aug 20 12:00
|
||||
-8:00 - PST 1942
|
||||
-8:00 US P%sT 1946
|
||||
-8:00 - PST 1969
|
||||
-8:00 US P%sT 1980 Apr 27 2:00
|
||||
-9:00 US Y%sT 1980 Oct 26 2:00
|
||||
-8:00 US P%sT 1983 Oct 30 2:00
|
||||
-9:00 US Y%sT 1983 Nov 30
|
||||
-9:00 US AK%sT
|
||||
Zone America/Sitka -14:58:47 - LMT 1867 Oct 18
|
||||
-9:01:13 - LMT 1900 Aug 20 12:00
|
||||
-8:00 - PST 1942
|
||||
-8:00 US P%sT 1946
|
||||
-8:00 - PST 1969
|
||||
-8:00 US P%sT 1983 Oct 30 2:00
|
||||
-9:00 US Y%sT 1983 Nov 30
|
||||
-9:00 US AK%sT
|
||||
Zone America/Metlakatla 15:13:42 - LMT 1867 Oct 18
|
||||
-8:46:18 - LMT 1900 Aug 20 12:00
|
||||
-8:00 - PST 1942
|
||||
-8:00 US P%sT 1946
|
||||
-8:00 - PST 1969
|
||||
-8:00 US P%sT 1983 Oct 30 2:00
|
||||
-8:00 US MeST
|
||||
Zone America/Yakutat 14:41:05 - LMT 1867 Oct 18
|
||||
-9:18:55 - LMT 1900 Aug 20 12:00
|
||||
-9:00 - YST 1942
|
||||
@ -2569,6 +2628,21 @@ Zone America/Costa_Rica -5:36:20 - LMT 1890 # San Jose
|
||||
# the time was announced as "diez cinco"--the same time as here, indicating
|
||||
# that has indeed switched to DST. Assume second Sunday from 2009 forward.
|
||||
|
||||
# From Steffen Thorsen (2011-03-08):
|
||||
# Granma announced that Cuba is going to start DST on 2011-03-20 00:00:00
|
||||
# this year. Nothing about the end date known so far (if that has
|
||||
# changed at all).
|
||||
#
|
||||
# Source:
|
||||
# <a href="http://granma.co.cu/2011/03/08/nacional/artic01.html">
|
||||
# http://granma.co.cu/2011/03/08/nacional/artic01.html
|
||||
# </a>
|
||||
#
|
||||
# Our info:
|
||||
# <a href="http://www.timeanddate.com/news/time/cuba-starts-dst-2011.html">
|
||||
# http://www.timeanddate.com/news/time/cuba-starts-dst-2011.html
|
||||
# </a>
|
||||
|
||||
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
|
||||
Rule Cuba 1928 only - Jun 10 0:00 1:00 D
|
||||
Rule Cuba 1928 only - Oct 10 0:00 0 S
|
||||
@ -2602,7 +2676,9 @@ Rule Cuba 2000 2004 - Apr Sun>=1 0:00s 1:00 D
|
||||
Rule Cuba 2006 max - Oct lastSun 0:00s 0 S
|
||||
Rule Cuba 2007 only - Mar Sun>=8 0:00s 1:00 D
|
||||
Rule Cuba 2008 only - Mar Sun>=15 0:00s 1:00 D
|
||||
Rule Cuba 2009 max - Mar Sun>=8 0:00s 1:00 D
|
||||
Rule Cuba 2009 2010 - Mar Sun>=8 0:00s 1:00 D
|
||||
Rule Cuba 2011 only - Mar Sun>=15 0:00s 1:00 D
|
||||
Rule Cuba 2012 max - Mar Sun>=8 0:00s 1:00 D
|
||||
|
||||
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
|
||||
Zone America/Havana -5:29:28 - LMT 1890
|
||||
|
||||
@ -1176,6 +1176,23 @@ Zone America/Rio_Branco -4:31:12 - LMT 1914
|
||||
# From Arthur Daivd Olson (2010-03-06):
|
||||
# Angel Chiang's message confirmed by Julio Pacheco; Julio provided a patch.
|
||||
|
||||
# From Glenn Eychaner (2011-03-02): [geychaner@mac.com]
|
||||
# It appears that the Chilean government has decided to postpone the
|
||||
# change from summer time to winter time again, by three weeks to April
|
||||
# 2nd:
|
||||
# <a href="http://www.emol.com/noticias/nacional/detalle/detallenoticias.asp?idnoticia=467651">
|
||||
# http://www.emol.com/noticias/nacional/detalle/detallenoticias.asp?idnoticia=467651
|
||||
# </a>
|
||||
#
|
||||
# This is not yet reflected in the offical "cambio de hora" site, but
|
||||
# probably will be soon:
|
||||
# <a href="http://www.horaoficial.cl/cambio.htm">
|
||||
# http://www.horaoficial.cl/cambio.htm
|
||||
# </a>
|
||||
|
||||
# From Arthur David Olson (2011-03-02):
|
||||
# The emol.com article mentions a water shortage as the cause of the
|
||||
# postponement, which may mean that it's not a permanent change.
|
||||
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
|
||||
Rule Chile 1927 1932 - Sep 1 0:00 1:00 S
|
||||
Rule Chile 1928 1932 - Apr 1 0:00 0 -
|
||||
@ -1211,8 +1228,8 @@ Rule Chile 2000 2007 - Mar Sun>=9 3:00u 0 -
|
||||
# which is used below in specifying the transition.
|
||||
Rule Chile 2008 only - Mar 30 3:00u 0 -
|
||||
Rule Chile 2009 only - Mar Sun>=9 3:00u 0 -
|
||||
Rule Chile 2010 only - Apr 4 3:00u 0 -
|
||||
Rule Chile 2011 max - Mar Sun>=9 3:00u 0 -
|
||||
Rule Chile 2010 2011 - Apr Sun>=1 3:00u 0 -
|
||||
Rule Chile 2012 max - Mar Sun>=9 3:00u 0 -
|
||||
# IATA SSIM anomalies: (1992-02) says 1992-03-14;
|
||||
# (1996-09) says 1998-03-08. Ignore these.
|
||||
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
|
||||
|
||||
@ -434,9 +434,11 @@ US +332654-1120424 America/Phoenix Mountain Standard Time - Arizona
|
||||
US +340308-1181434 America/Los_Angeles Pacific Time
|
||||
US +611305-1495401 America/Anchorage Alaska Time
|
||||
US +581807-1342511 America/Juneau Alaska Time - Alaska panhandle
|
||||
US +571035-1351807 America/Sitka Alaska Time - southeast Alaska panhandle
|
||||
US +593249-1394338 America/Yakutat Alaska Time - Alaska panhandle neck
|
||||
US +643004-1652423 America/Nome Alaska Time - west Alaska
|
||||
US +515248-1763929 America/Adak Aleutian Islands
|
||||
US +550737-1313435 America/Metlakatla Metlakatla Time - Annette Island
|
||||
US +211825-1575130 Pacific/Honolulu Hawaii
|
||||
UY -3453-05611 America/Montevideo
|
||||
UZ +3940+06648 Asia/Samarkand west Uzbekistan
|
||||
|
||||
@ -35,7 +35,7 @@ import sun.reflect.misc.*;
|
||||
* is the delegate used by default for classes about
|
||||
* which no information is available. The <code>DefaultPersistenceDelegate</code>
|
||||
* provides, version resilient, public API-based persistence for
|
||||
* classes that follow the JavaBeans conventions without any class specific
|
||||
* classes that follow the JavaBeans™ conventions without any class specific
|
||||
* configuration.
|
||||
* <p>
|
||||
* The key assumptions are that the class has a nullary constructor
|
||||
|
||||
@ -31,7 +31,7 @@ package java.beans;
|
||||
* of java.beans.beancontext.BeanContext, in order to propagate to its nested hierarchy
|
||||
* of java.beans.beancontext.BeanContextChild instances, the current "designTime" property.
|
||||
* <p>
|
||||
* The JavaBeans specification defines the notion of design time as is a
|
||||
* The JavaBeans™ specification defines the notion of design time as is a
|
||||
* mode in which JavaBeans instances should function during their composition
|
||||
* and customization in a interactive design, composition or construction tool,
|
||||
* as opposed to runtime when the JavaBean is part of an applet, application,
|
||||
|
||||
@ -26,7 +26,7 @@ package java.beans;
|
||||
|
||||
/**
|
||||
* An "IndexedPropertyChange" event gets delivered whenever a component that
|
||||
* conforms to the JavaBeans<TM> specification (a "bean") changes a bound
|
||||
* conforms to the JavaBeans™ specification (a "bean") changes a bound
|
||||
* indexed property. This class is an extension of <code>PropertyChangeEvent</code>
|
||||
* but contains the index of the property that has changed.
|
||||
* <P>
|
||||
|
||||
@ -87,7 +87,7 @@ import sun.reflect.misc.ReflectUtil;
|
||||
* <p>
|
||||
* For more information about introspection and design patterns, please
|
||||
* consult the
|
||||
* <a href="http://java.sun.com/products/javabeans/docs/index.html">JavaBeans specification</a>.
|
||||
* <a href="http://java.sun.com/products/javabeans/docs/index.html">JavaBeans™ specification</a>.
|
||||
*/
|
||||
|
||||
public class Introspector {
|
||||
@ -1245,7 +1245,7 @@ public class Introspector {
|
||||
try {
|
||||
type = ClassFinder.findClass(name, type.getClassLoader());
|
||||
// Each customizer should inherit java.awt.Component and implement java.beans.Customizer
|
||||
// according to the section 9.3 of JavaBeans specification
|
||||
// according to the section 9.3 of JavaBeans™ specification
|
||||
if (Component.class.isAssignableFrom(type) && Customizer.class.isAssignableFrom(type)) {
|
||||
return type;
|
||||
}
|
||||
|
||||
@ -474,7 +474,7 @@ public class VetoableChangeSupport implements Serializable {
|
||||
/**
|
||||
* @serialField children Hashtable
|
||||
* @serialField source Object
|
||||
* @serialField propertyChangeSupportSerializedDataVersion int
|
||||
* @serialField vetoableChangeSupportSerializedDataVersion int
|
||||
*/
|
||||
private static final ObjectStreamField[] serialPersistentFields = {
|
||||
new ObjectStreamField("children", Hashtable.class),
|
||||
|
||||
@ -29,7 +29,7 @@
|
||||
|
||||
Contains classes related to developing
|
||||
<em>beans</em> -- components
|
||||
based on the JavaBeans<sup><font size=-2>TM</font></sup> architecture.
|
||||
based on the JavaBeans™ architecture.
|
||||
A few of the
|
||||
classes are used by beans while they run in an application.
|
||||
For example, the event classes are
|
||||
|
||||
@ -987,11 +987,33 @@ public class JOptionPane extends JComponent implements Accessible
|
||||
}
|
||||
dialog.pack();
|
||||
dialog.setLocationRelativeTo(parentComponent);
|
||||
|
||||
final PropertyChangeListener listener = new PropertyChangeListener() {
|
||||
public void propertyChange(PropertyChangeEvent event) {
|
||||
// Let the defaultCloseOperation handle the closing
|
||||
// if the user closed the window without selecting a button
|
||||
// (newValue = null in that case). Otherwise, close the dialog.
|
||||
if (dialog.isVisible() && event.getSource() == JOptionPane.this &&
|
||||
(event.getPropertyName().equals(VALUE_PROPERTY) ||
|
||||
event.getPropertyName().equals(INPUT_VALUE_PROPERTY)) &&
|
||||
event.getNewValue() != null &&
|
||||
event.getNewValue() != JOptionPane.UNINITIALIZED_VALUE) {
|
||||
dialog.setVisible(false);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
WindowAdapter adapter = new WindowAdapter() {
|
||||
private boolean gotFocus = false;
|
||||
public void windowClosing(WindowEvent we) {
|
||||
setValue(null);
|
||||
}
|
||||
|
||||
public void windowClosed(WindowEvent e) {
|
||||
removePropertyChangeListener(listener);
|
||||
dialog.getContentPane().removeAll();
|
||||
}
|
||||
|
||||
public void windowGainedFocus(WindowEvent we) {
|
||||
// Once window gets focus, set initial focus
|
||||
if (!gotFocus) {
|
||||
@ -1008,20 +1030,8 @@ public class JOptionPane extends JComponent implements Accessible
|
||||
setValue(JOptionPane.UNINITIALIZED_VALUE);
|
||||
}
|
||||
});
|
||||
addPropertyChangeListener(new PropertyChangeListener() {
|
||||
public void propertyChange(PropertyChangeEvent event) {
|
||||
// Let the defaultCloseOperation handle the closing
|
||||
// if the user closed the window without selecting a button
|
||||
// (newValue = null in that case). Otherwise, close the dialog.
|
||||
if (dialog.isVisible() && event.getSource() == JOptionPane.this &&
|
||||
(event.getPropertyName().equals(VALUE_PROPERTY) ||
|
||||
event.getPropertyName().equals(INPUT_VALUE_PROPERTY)) &&
|
||||
event.getNewValue() != null &&
|
||||
event.getNewValue() != JOptionPane.UNINITIALIZED_VALUE) {
|
||||
dialog.setVisible(false);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
addPropertyChangeListener(listener);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -216,6 +216,7 @@ public final class TimeZoneNames extends TimeZoneNamesBundle {
|
||||
{"America/Anchorage", AKST},
|
||||
{"AST", AKST},
|
||||
{"America/Halifax", AST},
|
||||
{"America/Sitka", AKST},
|
||||
{"America/St_Johns", NST},
|
||||
{"CNT", NST},
|
||||
{"Europe/Paris", CET},
|
||||
@ -392,6 +393,8 @@ public final class TimeZoneNames extends TimeZoneNamesBundle {
|
||||
{"America/Mendoza", AGT},
|
||||
{"America/Menominee", CST},
|
||||
{"America/Merida", CST},
|
||||
{"America/Metlakatla", new String[] {"Metlakatla Standard Time", "MeST",
|
||||
"Metlakatla Daylight Time", "MeDT"}},
|
||||
{"America/Mexico_City", CST},
|
||||
{"America/Miquelon", new String[] {"Pierre & Miquelon Standard Time", "PMST",
|
||||
"Pierre & Miquelon Daylight Time", "PMDT"}},
|
||||
|
||||
@ -216,6 +216,7 @@ public final class TimeZoneNames_de extends TimeZoneNamesBundle {
|
||||
{"America/Anchorage", AKST},
|
||||
{"AST", AKST},
|
||||
{"America/Halifax", AST},
|
||||
{"America/Sitka", AKST},
|
||||
{"America/St_Johns", NST},
|
||||
{"CNT", NST},
|
||||
{"Europe/Paris", CET},
|
||||
@ -392,6 +393,8 @@ public final class TimeZoneNames_de extends TimeZoneNamesBundle {
|
||||
{"America/Mendoza", AGT},
|
||||
{"America/Menominee", CST},
|
||||
{"America/Merida", CST},
|
||||
{"America/Metlakatla", new String[] {"Metlakatla Standard Time", "MeST",
|
||||
"Metlakatla Daylight Time", "MeDT"}},
|
||||
{"America/Mexico_City", CST},
|
||||
{"America/Miquelon", new String[] {"Pierre & Miquelon Normalzeit", "PMST",
|
||||
"Pierre & Miquelon Sommerzeit", "PMDT"}},
|
||||
|
||||
@ -216,6 +216,7 @@ public final class TimeZoneNames_es extends TimeZoneNamesBundle {
|
||||
{"America/Anchorage", AKST},
|
||||
{"AST", AKST},
|
||||
{"America/Halifax", AST},
|
||||
{"America/Sitka", AKST},
|
||||
{"America/St_Johns", NST},
|
||||
{"CNT", NST},
|
||||
{"Europe/Paris", CET},
|
||||
@ -392,6 +393,8 @@ public final class TimeZoneNames_es extends TimeZoneNamesBundle {
|
||||
{"America/Mendoza", AGT},
|
||||
{"America/Menominee", CST},
|
||||
{"America/Merida", CST},
|
||||
{"America/Metlakatla", new String[] {"Metlakatla Standard Time", "MeST",
|
||||
"Metlakatla Daylight Time", "MeDT"}},
|
||||
{"America/Mexico_City", CST},
|
||||
{"America/Miquelon", new String[] {"Hora est\u00e1ndar de Pierre & Miquelon", "PMST",
|
||||
"Hora de verano de Pierre & Miquelon", "PMDT"}},
|
||||
|
||||
@ -216,6 +216,7 @@ public final class TimeZoneNames_fr extends TimeZoneNamesBundle {
|
||||
{"America/Anchorage", AKST},
|
||||
{"AST", AKST},
|
||||
{"America/Halifax", AST},
|
||||
{"America/Sitka", AKST},
|
||||
{"America/St_Johns", NST},
|
||||
{"CNT", NST},
|
||||
{"Europe/Paris", CET},
|
||||
@ -392,6 +393,8 @@ public final class TimeZoneNames_fr extends TimeZoneNamesBundle {
|
||||
{"America/Mendoza", AGT},
|
||||
{"America/Menominee", CST},
|
||||
{"America/Merida", CST},
|
||||
{"America/Metlakatla", new String[] {"Metlakatla Standard Time", "MeST",
|
||||
"Metlakatla Daylight Time", "MeDT"}},
|
||||
{"America/Mexico_City", CST},
|
||||
{"America/Miquelon", new String[] {"Heure normale de Saint-Pierre et Miquelon", "PMST",
|
||||
"Heure avanc\u00e9e de Saint-Pierre et Miquelon", "PMDT"}},
|
||||
|
||||
@ -216,6 +216,7 @@ public final class TimeZoneNames_it extends TimeZoneNamesBundle {
|
||||
{"America/Anchorage", AKST},
|
||||
{"AST", AKST},
|
||||
{"America/Halifax", AST},
|
||||
{"America/Sitka", AKST},
|
||||
{"America/St_Johns", NST},
|
||||
{"CNT", NST},
|
||||
{"Europe/Paris", CET},
|
||||
@ -392,6 +393,8 @@ public final class TimeZoneNames_it extends TimeZoneNamesBundle {
|
||||
{"America/Mendoza", AGT},
|
||||
{"America/Menominee", CST},
|
||||
{"America/Merida", CST},
|
||||
{"America/Metlakatla", new String[] {"Metlakatla Standard Time", "MeST",
|
||||
"Metlakatla Daylight Time", "MeDT"}},
|
||||
{"America/Mexico_City", CST},
|
||||
{"America/Miquelon", new String[] {"Ora solare di Saint-Pierre e Miquelon", "PMST",
|
||||
"Ora legale di Saint-Pierre e Miquelon", "PMDT"}},
|
||||
|
||||
@ -216,6 +216,7 @@ public final class TimeZoneNames_ja extends TimeZoneNamesBundle {
|
||||
{"America/Anchorage", AKST},
|
||||
{"AST", AKST},
|
||||
{"America/Halifax", AST},
|
||||
{"America/Sitka", AKST},
|
||||
{"America/St_Johns", NST},
|
||||
{"CNT", NST},
|
||||
{"Europe/Paris", CET},
|
||||
@ -392,6 +393,8 @@ public final class TimeZoneNames_ja extends TimeZoneNamesBundle {
|
||||
{"America/Mendoza", AGT},
|
||||
{"America/Menominee", CST},
|
||||
{"America/Merida", CST},
|
||||
{"America/Metlakatla", new String[] {"Metlakatla Standard Time", "MeST",
|
||||
"Metlakatla Daylight Time", "MeDT"}},
|
||||
{"America/Mexico_City", CST},
|
||||
{"America/Miquelon", new String[] {"\u30b5\u30f3\u30d4\u30a8\u30fc\u30eb\u30fb\u30df\u30af\u30ed\u30f3\u8af8\u5cf6\u6a19\u6e96\u6642", "PMST",
|
||||
"\u30b5\u30f3\u30d4\u30a8\u30fc\u30eb\u30fb\u30df\u30af\u30ed\u30f3\u8af8\u5cf6\u590f\u6642\u9593", "PMDT"}},
|
||||
|
||||
@ -216,6 +216,7 @@ public final class TimeZoneNames_ko extends TimeZoneNamesBundle {
|
||||
{"America/Anchorage", AKST},
|
||||
{"AST", AKST},
|
||||
{"America/Halifax", AST},
|
||||
{"America/Sitka", AKST},
|
||||
{"America/St_Johns", NST},
|
||||
{"CNT", NST},
|
||||
{"Europe/Paris", CET},
|
||||
@ -392,6 +393,8 @@ public final class TimeZoneNames_ko extends TimeZoneNamesBundle {
|
||||
{"America/Mendoza", AGT},
|
||||
{"America/Menominee", CST},
|
||||
{"America/Merida", CST},
|
||||
{"America/Metlakatla", new String[] {"Metlakatla Standard Time", "MeST",
|
||||
"Metlakatla Daylight Time", "MeDT"}},
|
||||
{"America/Mexico_City", CST},
|
||||
{"America/Miquelon", new String[] {"\ud53c\uc5d0\ub974 \ubbf8\ud06c\ub860 \ud45c\uc900\uc2dc", "PMST",
|
||||
"\ud53c\uc5d0\ub974 \ubbf8\ud06c\ub860 \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "PMDT"}},
|
||||
|
||||
@ -217,6 +217,7 @@ public final class TimeZoneNames_pt_BR extends TimeZoneNamesBundle {
|
||||
{"America/Anchorage", AKST},
|
||||
{"AST", AKST},
|
||||
{"America/Halifax", AST},
|
||||
{"America/Sitka", AKST},
|
||||
{"America/St_Johns", NST},
|
||||
{"CNT", NST},
|
||||
{"Europe/Paris", CET},
|
||||
@ -392,6 +393,8 @@ public final class TimeZoneNames_pt_BR extends TimeZoneNamesBundle {
|
||||
{"America/Mendoza", AGT},
|
||||
{"America/Menominee", CST},
|
||||
{"America/Merida", CST},
|
||||
{"America/Metlakatla", new String[] {"Metlakatla Standard Time", "MeST",
|
||||
"Metlakatla Daylight Time", "MeDT"}},
|
||||
{"America/Mexico_City", CST},
|
||||
{"America/Miquelon", new String[] {"Fuso hor\u00e1rio padr\u00e3o de S\u00e3o Pedro e Miquelon", "PMST",
|
||||
"Hor\u00e1rio de luz natural de S\u00e3o Pedro e Miquelon", "PMDT"}},
|
||||
|
||||
@ -216,6 +216,7 @@ public final class TimeZoneNames_sv extends TimeZoneNamesBundle {
|
||||
{"America/Anchorage", AKST},
|
||||
{"AST", AKST},
|
||||
{"America/Halifax", AST},
|
||||
{"America/Sitka", AKST},
|
||||
{"America/St_Johns", NST},
|
||||
{"CNT", NST},
|
||||
{"Europe/Paris", CET},
|
||||
@ -392,6 +393,8 @@ public final class TimeZoneNames_sv extends TimeZoneNamesBundle {
|
||||
{"America/Mendoza", AGT},
|
||||
{"America/Menominee", CST},
|
||||
{"America/Merida", CST},
|
||||
{"America/Metlakatla", new String[] {"Metlakatla Standard Time", "MeST",
|
||||
"Metlakatla Daylight Time", "MeDT"}},
|
||||
{"America/Mexico_City", CST},
|
||||
{"America/Miquelon", new String[] {"Saint-Pierre-et-Miquelon, normaltid", "PMST",
|
||||
"Saint-Pierre-et-Miquelon, sommartid", "PMDT"}},
|
||||
|
||||
@ -216,6 +216,7 @@ public final class TimeZoneNames_zh_CN extends TimeZoneNamesBundle {
|
||||
{"America/Anchorage", AKST},
|
||||
{"AST", AKST},
|
||||
{"America/Halifax", AST},
|
||||
{"America/Sitka", AKST},
|
||||
{"America/St_Johns", NST},
|
||||
{"CNT", NST},
|
||||
{"Europe/Paris", CET},
|
||||
@ -392,6 +393,8 @@ public final class TimeZoneNames_zh_CN extends TimeZoneNamesBundle {
|
||||
{"America/Mendoza", AGT},
|
||||
{"America/Menominee", CST},
|
||||
{"America/Merida", CST},
|
||||
{"America/Metlakatla", new String[] {"Metlakatla Standard Time", "MeST",
|
||||
"Metlakatla Daylight Time", "MeDT"}},
|
||||
{"America/Mexico_City", CST},
|
||||
{"America/Miquelon", new String[] {"\u76ae\u57c3\u5c14\u5c9b\u53ca\u5bc6\u514b\u9686\u5c9b\u6807\u51c6\u65f6\u95f4", "PMST",
|
||||
"\u76ae\u57c3\u5c14\u5c9b\u53ca\u5bc6\u514b\u9686\u5c9b\u590f\u4ee4\u65f6", "PMDT"}},
|
||||
|
||||
@ -216,6 +216,7 @@ public final class TimeZoneNames_zh_TW extends TimeZoneNamesBundle {
|
||||
{"America/Anchorage", AKST},
|
||||
{"AST", AKST},
|
||||
{"America/Halifax", AST},
|
||||
{"America/Sitka", AKST},
|
||||
{"America/St_Johns", NST},
|
||||
{"CNT", NST},
|
||||
{"Europe/Paris", CET},
|
||||
@ -392,6 +393,8 @@ public final class TimeZoneNames_zh_TW extends TimeZoneNamesBundle {
|
||||
{"America/Mendoza", AGT},
|
||||
{"America/Menominee", CST},
|
||||
{"America/Merida", CST},
|
||||
{"America/Metlakatla", new String[] {"Metlakatla Standard Time", "MeST",
|
||||
"Metlakatla Daylight Time", "MeDT"}},
|
||||
{"America/Mexico_City", CST},
|
||||
{"America/Miquelon", new String[] {"\u76ae\u57c3\u723e\u5cf6\u53ca\u5bc6\u514b\u9686\u5cf6\u6a19\u6e96\u6642\u9593", "PMST",
|
||||
"\u76ae\u57c3\u723e\u5cf6\u53ca\u5bc6\u514b\u9686\u5cf6\u65e5\u5149\u7bc0\u7d04\u6642\u9593", "PMDT"}},
|
||||
|
||||
83
jdk/test/javax/swing/JOptionPane/6464022/bug6464022.java
Normal file
83
jdk/test/javax/swing/JOptionPane/6464022/bug6464022.java
Normal file
@ -0,0 +1,83 @@
|
||||
/*
|
||||
* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 6464022
|
||||
* @summary Memory leak in JOptionPane.createDialog
|
||||
* @author Pavel Porvatov
|
||||
* @library ../../regtesthelpers
|
||||
* @build Util
|
||||
* @run main bug6464022
|
||||
*/
|
||||
|
||||
import javax.swing.*;
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class bug6464022 {
|
||||
private static JOptionPane pane;
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
final List<WeakReference<JDialog>> references = new ArrayList<WeakReference<JDialog>>();
|
||||
|
||||
SwingUtilities.invokeAndWait(new Runnable() {
|
||||
public void run() {
|
||||
pane = new JOptionPane(null, JOptionPane.UNDEFINED_CONDITION);
|
||||
|
||||
for (int i = 0; i < 10; i++) {
|
||||
JDialog dialog = pane.createDialog(null, "Test " + i);
|
||||
|
||||
references.add(new WeakReference<JDialog>(dialog));
|
||||
|
||||
dialog.dispose();
|
||||
|
||||
System.out.println("Disposing Dialog:" + dialog.hashCode());
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Util.generateOOME();
|
||||
|
||||
SwingUtilities.invokeAndWait(new Runnable() {
|
||||
public void run() {
|
||||
int allocatedCount = 0;
|
||||
|
||||
for (WeakReference<JDialog> ref : references) {
|
||||
if (ref.get() != null) {
|
||||
allocatedCount++;
|
||||
|
||||
System.out.println(ref.get().hashCode() + " is still allocated");
|
||||
}
|
||||
}
|
||||
|
||||
if (allocatedCount > 0) {
|
||||
throw new RuntimeException("Some dialogs still exist in memory. Test failed");
|
||||
} else {
|
||||
System.out.println("All dialogs were GCed. Test passed.");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -26,6 +26,8 @@
|
||||
* @bug 6795356
|
||||
* @summary Leak caused by javax.swing.UIDefaults.ProxyLazyValue.acc
|
||||
* @author Alexander Potochkin
|
||||
* @library ../../regtesthelpers
|
||||
* @build Util
|
||||
* @run main bug6795356
|
||||
*/
|
||||
|
||||
@ -58,43 +60,11 @@ public class bug6795356 {
|
||||
weakRef = new WeakReference<ProtectionDomain>(domain);
|
||||
domain = null;
|
||||
|
||||
// Generate OutOfMemory and check the weak ref
|
||||
generateOOME();
|
||||
Util.generateOOME();
|
||||
|
||||
if (weakRef.get() != null) {
|
||||
throw new RuntimeException("Memory leak found!");
|
||||
}
|
||||
System.out.println("Test passed");
|
||||
}
|
||||
|
||||
static void generateOOME() {
|
||||
List<Object> bigLeak = new LinkedList<Object>();
|
||||
boolean oome = false;
|
||||
System.out.print("Filling the heap");
|
||||
try {
|
||||
for(int i = 0; true ; i++) {
|
||||
// Now, use up all RAM
|
||||
bigLeak.add(new byte[1024 * 1024]);
|
||||
System.out.print(".");
|
||||
|
||||
// Give the GC a change at that weakref
|
||||
if (i % 10 == 0) {
|
||||
System.gc();
|
||||
try {
|
||||
Thread.sleep(100);
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (OutOfMemoryError e) {
|
||||
bigLeak = null;
|
||||
oome = true;
|
||||
}
|
||||
System.out.println("");
|
||||
if (!oome) {
|
||||
throw new RuntimeException("Problem with test case - never got OOME");
|
||||
}
|
||||
System.out.println("Got OOME");
|
||||
}
|
||||
}
|
||||
|
||||
@ -24,6 +24,8 @@
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>This class contains utilities useful for regression testing.
|
||||
@ -72,4 +74,46 @@ public class Util {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fills the heap until OutOfMemoryError occurs. This method is useful for
|
||||
* WeakReferences removing.
|
||||
*/
|
||||
public static void generateOOME() {
|
||||
List<Object> bigLeak = new LinkedList<Object>();
|
||||
|
||||
boolean oome = false;
|
||||
|
||||
System.out.print("Filling the heap");
|
||||
|
||||
try {
|
||||
for(int i = 0; true ; i++) {
|
||||
// Now, use up all RAM
|
||||
bigLeak.add(new byte[1024 * 1024]);
|
||||
|
||||
System.out.print(".");
|
||||
|
||||
// Give the GC a change at that weakref
|
||||
if (i % 10 == 0) {
|
||||
System.gc();
|
||||
try {
|
||||
Thread.sleep(100);
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (OutOfMemoryError e) {
|
||||
bigLeak = null;
|
||||
oome = true;
|
||||
}
|
||||
|
||||
System.out.println("");
|
||||
|
||||
if (!oome) {
|
||||
throw new RuntimeException("Problem with test case - never got OOME");
|
||||
}
|
||||
|
||||
System.out.println("Got OOME");
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user