Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
b6363f21
D
dragonwell8_jdk
项目概览
openanolis
/
dragonwell8_jdk
通知
4
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_jdk
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
b6363f21
编写于
11月 02, 2010
作者:
L
lana
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
0604ccb5
722e0664
变更
74
展开全部
显示空白变更内容
内联
并排
Showing
74 changed file
with
4618 addition
and
1970 deletion
+4618
-1970
make/javax/sound/jsoundds/Makefile
make/javax/sound/jsoundds/Makefile
+1
-1
make/sun/javazic/tzdata/VERSION
make/sun/javazic/tzdata/VERSION
+1
-1
make/sun/javazic/tzdata/asia
make/sun/javazic/tzdata/asia
+2
-2
make/sun/javazic/tzdata/australasia
make/sun/javazic/tzdata/australasia
+25
-2
make/sun/javazic/tzdata/zone.tab
make/sun/javazic/tzdata/zone.tab
+1
-1
src/share/classes/java/awt/BasicStroke.java
src/share/classes/java/awt/BasicStroke.java
+4
-1
src/share/classes/java/awt/GradientPaint.java
src/share/classes/java/awt/GradientPaint.java
+3
-1
src/share/classes/java/awt/LinearGradientPaint.java
src/share/classes/java/awt/LinearGradientPaint.java
+3
-2
src/share/classes/java/awt/RadialGradientPaint.java
src/share/classes/java/awt/RadialGradientPaint.java
+3
-1
src/share/classes/java/awt/Toolkit.java
src/share/classes/java/awt/Toolkit.java
+5
-1
src/share/classes/java/awt/geom/AffineTransform.java
src/share/classes/java/awt/geom/AffineTransform.java
+3
-1
src/share/classes/java/text/DateFormatSymbols.java
src/share/classes/java/text/DateFormatSymbols.java
+80
-47
src/share/classes/java/text/DecimalFormat.java
src/share/classes/java/text/DecimalFormat.java
+7
-5
src/share/classes/java/text/SimpleDateFormat.java
src/share/classes/java/text/SimpleDateFormat.java
+13
-12
src/share/classes/java/util/Calendar.java
src/share/classes/java/util/Calendar.java
+6
-3
src/share/classes/java/util/Locale.java
src/share/classes/java/util/Locale.java
+43
-27
src/share/classes/java/util/TimeZone.java
src/share/classes/java/util/TimeZone.java
+0
-5
src/share/classes/javax/swing/BorderFactory.java
src/share/classes/javax/swing/BorderFactory.java
+123
-0
src/share/classes/javax/swing/DebugGraphics.java
src/share/classes/javax/swing/DebugGraphics.java
+2
-4
src/share/classes/javax/swing/JComponent.java
src/share/classes/javax/swing/JComponent.java
+12
-15
src/share/classes/javax/swing/JDialog.java
src/share/classes/javax/swing/JDialog.java
+8
-12
src/share/classes/javax/swing/JLayer.java
src/share/classes/javax/swing/JLayer.java
+1
-1
src/share/classes/javax/swing/JViewport.java
src/share/classes/javax/swing/JViewport.java
+5
-5
src/share/classes/javax/swing/RepaintManager.java
src/share/classes/javax/swing/RepaintManager.java
+11
-0
src/share/classes/javax/swing/border/StrokeBorder.java
src/share/classes/javax/swing/border/StrokeBorder.java
+156
-0
src/share/classes/javax/swing/plaf/basic/BasicScrollPaneUI.java
...are/classes/javax/swing/plaf/basic/BasicScrollPaneUI.java
+8
-0
src/share/classes/javax/swing/plaf/synth/SynthTabbedPaneUI.java
...are/classes/javax/swing/plaf/synth/SynthTabbedPaneUI.java
+1
-4
src/share/classes/javax/swing/table/DefaultTableCellRenderer.java
...e/classes/javax/swing/table/DefaultTableCellRenderer.java
+3
-0
src/share/classes/javax/swing/text/DefaultCaret.java
src/share/classes/javax/swing/text/DefaultCaret.java
+2
-4
src/share/classes/javax/swing/text/DefaultStyledDocument.java
...share/classes/javax/swing/text/DefaultStyledDocument.java
+2
-2
src/share/classes/javax/swing/text/InternationalFormatter.java
...hare/classes/javax/swing/text/InternationalFormatter.java
+0
-2
src/share/classes/javax/swing/text/JTextComponent.java
src/share/classes/javax/swing/text/JTextComponent.java
+5
-8
src/share/classes/javax/swing/text/MaskFormatter.java
src/share/classes/javax/swing/text/MaskFormatter.java
+10
-11
src/share/classes/javax/swing/text/NumberFormatter.java
src/share/classes/javax/swing/text/NumberFormatter.java
+1
-31
src/share/classes/javax/swing/text/PlainDocument.java
src/share/classes/javax/swing/text/PlainDocument.java
+1
-4
src/share/classes/javax/swing/text/TabSet.java
src/share/classes/javax/swing/text/TabSet.java
+1
-1
src/share/classes/javax/swing/text/html/FormView.java
src/share/classes/javax/swing/text/html/FormView.java
+6
-29
src/share/classes/javax/swing/text/html/MinimalHTMLWriter.java
...hare/classes/javax/swing/text/html/MinimalHTMLWriter.java
+2
-2
src/share/classes/javax/swing/text/html/StyleSheet.java
src/share/classes/javax/swing/text/html/StyleSheet.java
+1
-1
src/share/classes/javax/swing/text/html/parser/Parser.java
src/share/classes/javax/swing/text/html/parser/Parser.java
+1
-1
src/share/classes/javax/swing/text/rtf/AbstractFilter.java
src/share/classes/javax/swing/text/rtf/AbstractFilter.java
+2
-2
src/share/classes/sun/util/resources/LocaleNames.properties
src/share/classes/sun/util/resources/LocaleNames.properties
+488
-2
src/share/native/java/lang/System.c
src/share/native/java/lang/System.c
+8
-2
src/share/native/java/lang/java_props.h
src/share/native/java/lang/java_props.h
+3
-0
src/solaris/native/java/lang/java_props_md.c
src/solaris/native/java/lang/java_props_md.c
+26
-7
src/solaris/native/java/lang/locale_str.h
src/solaris/native/java/lang/locale_str.h
+516
-0
src/windows/bin/java_md.c
src/windows/bin/java_md.c
+246
-0
src/windows/classes/sun/awt/windows/WInputMethod.java
src/windows/classes/sun/awt/windows/WInputMethod.java
+1
-1
src/windows/classes/sun/awt/windows/WToolkit.java
src/windows/classes/sun/awt/windows/WToolkit.java
+8
-4
src/windows/native/com/sun/media/sound/PLATFORM_API_WinOS_DirectSound.cpp
...ve/com/sun/media/sound/PLATFORM_API_WinOS_DirectSound.cpp
+2
-0
src/windows/native/java/lang/java_props_md.c
src/windows/native/java/lang/java_props_md.c
+44
-38
src/windows/native/sun/java2d/d3d/D3DGraphicsDevice.cpp
src/windows/native/sun/java2d/d3d/D3DGraphicsDevice.cpp
+2
-18
src/windows/native/sun/java2d/d3d/D3DPipelineManager.cpp
src/windows/native/sun/java2d/d3d/D3DPipelineManager.cpp
+91
-0
src/windows/native/sun/java2d/d3d/D3DPipelineManager.h
src/windows/native/sun/java2d/d3d/D3DPipelineManager.h
+43
-1
src/windows/native/sun/java2d/windows/WindowsFlags.cpp
src/windows/native/sun/java2d/windows/WindowsFlags.cpp
+2
-1
src/windows/native/sun/windows/awt_InputMethod.cpp
src/windows/native/sun/windows/awt_InputMethod.cpp
+8
-27
src/windows/native/sun/windows/awt_Toolkit.cpp
src/windows/native/sun/windows/awt_Toolkit.cpp
+361
-2
src/windows/native/sun/windows/awt_Toolkit.h
src/windows/native/sun/windows/awt_Toolkit.h
+145
-0
test/java/beans/XMLEncoder/java_awt_BasicStroke.java
test/java/beans/XMLEncoder/java_awt_BasicStroke.java
+46
-0
test/java/beans/XMLEncoder/java_awt_GradientPaint.java
test/java/beans/XMLEncoder/java_awt_GradientPaint.java
+47
-0
test/java/beans/XMLEncoder/java_awt_LinearGradientPaint.java
test/java/beans/XMLEncoder/java_awt_LinearGradientPaint.java
+60
-0
test/java/beans/XMLEncoder/java_awt_RadialGradientPaint.java
test/java/beans/XMLEncoder/java_awt_RadialGradientPaint.java
+60
-0
test/java/beans/XMLEncoder/java_awt_geom_AffineTransform.java
.../java/beans/XMLEncoder/java_awt_geom_AffineTransform.java
+45
-0
test/java/beans/XMLEncoder/javax_swing_border_StrokeBorder.java
...ava/beans/XMLEncoder/javax_swing_border_StrokeBorder.java
+48
-0
test/java/util/Locale/data/deflocale.rhel5
test/java/util/Locale/data/deflocale.rhel5
+131
-131
test/java/util/Locale/data/deflocale.rhel5.fmtasdefault
test/java/util/Locale/data/deflocale.rhel5.fmtasdefault
+131
-131
test/java/util/Locale/data/deflocale.sol10
test/java/util/Locale/data/deflocale.sol10
+7
-7
test/java/util/Locale/data/deflocale.sol10.fmtasdefault
test/java/util/Locale/data/deflocale.sol10.fmtasdefault
+6
-6
test/java/util/Locale/data/deflocale.win7
test/java/util/Locale/data/deflocale.win7
+591
-591
test/java/util/Locale/data/deflocale.win7.fmtasdefault
test/java/util/Locale/data/deflocale.win7.fmtasdefault
+667
-667
test/java/util/ResourceBundle/Bug4168625Test.java
test/java/util/ResourceBundle/Bug4168625Test.java
+4
-82
test/javax/swing/JComponent/6989617/bug6989617.java
test/javax/swing/JComponent/6989617/bug6989617.java
+103
-0
test/javax/swing/JTable/6735286/bug6735286.java
test/javax/swing/JTable/6735286/bug6735286.java
+42
-0
test/javax/swing/plaf/basic/BasicScrollPaneUI/Test6632810.java
...javax/swing/plaf/basic/BasicScrollPaneUI/Test6632810.java
+72
-0
未找到文件。
make/javax/sound/jsoundds/Makefile
浏览文件 @
b6363f21
...
...
@@ -53,7 +53,7 @@ FILES_export = \
#
# Extra cc/linker flags.
#
LDLIBS
+=
dsound.lib winmm.lib user32.lib
LDLIBS
+=
dsound.lib winmm.lib user32.lib
ole32.lib
CPPFLAGS
+=
\
-DUSE_DAUDIO
=
TRUE
\
-I
$(SHARE_SRC)
/native/com/sun/media/sound
\
...
...
make/sun/javazic/tzdata/VERSION
浏览文件 @
b6363f21
...
...
@@ -21,4 +21,4 @@
# or visit www.oracle.com if you need additional information or have any
# questions.
#
tzdata2010
l
tzdata2010
o
make/sun/javazic/tzdata/asia
浏览文件 @
b6363f21
...
...
@@ -569,8 +569,8 @@ Rule HK 1953 only - Nov 1 3:30 0 -
Rule HK 1954 1964 - Mar Sun>=18 3:30 1:00 S
Rule HK 1954 only - Oct 31 3:30 0 -
Rule HK 1955 1964 - Nov Sun>=1 3:30 0 -
Rule HK 1965 197
7
- Apr Sun>=16 3:30 1:00 S
Rule HK 1965 197
7
- Oct Sun>=16 3:30 0 -
Rule HK 1965 197
6
- Apr Sun>=16 3:30 1:00 S
Rule HK 1965 197
6
- 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 -
...
...
make/sun/javazic/tzdata/australasia
浏览文件 @
b6363f21
...
...
@@ -306,13 +306,26 @@ Zone Indian/Cocos 6:27:40 - LMT 1900
# http://www.timeanddate.com/news/time/fiji-dst-ends-march-2010.html
# </a>
# From Alexander Krivenyshev (2010-10-24):
# According to Radio Fiji and Fiji Times online, Fiji will end DST 3
# weeks earlier than expected - on March 6, 2011, not March 27, 2011...
# Here is confirmation from Government of the Republic of the Fiji Islands,
# Ministry of Information (fiji.gov.fj) web site:
# <a href="http://www.fiji.gov.fj/index.php?option=com_content&view=article&id=2608:daylight-savings&catid=71:press-releases&Itemid=155">
# http://www.fiji.gov.fj/index.php?option=com_content&view=article&id=2608:daylight-savings&catid=71:press-releases&Itemid=155
# </a>
# or
# <a href="http://www.worldtimezone.com/dst_news/dst_news_fiji04.html">
# http://www.worldtimezone.com/dst_news/dst_news_fiji04.html
# </a>
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule Fiji 1998 1999 - Nov Sun>=1 2:00 1:00 S
Rule Fiji 1999 2000 - Feb lastSun 3:00 0 -
Rule Fiji 2009 only - Nov 29 2:00 1:00 S
Rule Fiji 2010 only - Mar lastSun 3:00 0 -
Rule Fiji 2010 only - Oct 24 2:00 1:00 S
Rule Fiji 2011 only - Mar
lastSun
3:00 0 -
Rule Fiji 2011 only - Mar
Sun>=1
3:00 0 -
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Pacific/Fiji 11:53:40 - LMT 1915 Oct 26 # Suva
12:00 Fiji FJ%sT # Fiji Time
...
...
@@ -509,11 +522,21 @@ Zone Pacific/Pago_Pago 12:37:12 - LMT 1879 Jul 5
# http://www.parliament.gov.ws/documents/acts/Daylight%20Saving%20Act%20%202009%20%28English%29%20-%20Final%207-7-091.pdf
# </a>
# From Raymond Hughes (2010-10-07):
# Please see
# <a href="http://www.mcil.gov.ws">
# http://www.mcil.gov.ws
# </a>,
# the Ministry of Commerce, Industry and Labour (sideframe) "Last Sunday
# September 2010 (26/09/10) - adjust clocks forward from 12:00 midnight
# to 01:00am and First Sunday April 2011 (03/04/11) - adjust clocks
# backwards from 1:00am to 12:00am"
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
-11:00 1:00 WSDT 2011 Apr 3
1:00
-11:00 - WST
# Solomon Is
...
...
make/sun/javazic/tzdata/zone.tab
浏览文件 @
b6363f21
...
...
@@ -63,7 +63,7 @@ AQ -6448-06406 Antarctica/Palmer Palmer Station, Anvers Island
AQ -6736+06253 Antarctica/Mawson Mawson Station, Holme Bay
AQ -6835+07758 Antarctica/Davis Davis Station, Vestfold Hills
AQ -6617+11031 Antarctica/Casey Casey Station, Bailey Peninsula
AQ -7824+10654 Antarctica/Vostok Vostok Station,
S Magnetic Pole
AQ -7824+10654 Antarctica/Vostok Vostok Station,
Lake Vostok
AQ -6640+14001 Antarctica/DumontDUrville Dumont-d'Urville Station, Terre Adelie
AQ -690022+0393524 Antarctica/Syowa Syowa Station, E Ongul I
AQ -5430+15857 Antarctica/Macquarie Macquarie Island Station, Macquarie Island
...
...
src/share/classes/java/awt/BasicStroke.java
浏览文件 @
b6363f21
/*
* Copyright (c) 1997, 20
07
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 20
10
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
...
...
@@ -25,6 +25,8 @@
package
java.awt
;
import
java.beans.ConstructorProperties
;
/**
* The <code>BasicStroke</code> class defines a basic set of rendering
* attributes for the outlines of graphics primitives, which are rendered
...
...
@@ -183,6 +185,7 @@ public class BasicStroke implements Stroke {
* <code>dash</code> is zero
* @throws IllegalArgumentException if dash lengths are all zero.
*/
@ConstructorProperties
({
"lineWidth"
,
"endCap"
,
"lineJoin"
,
"miterLimit"
,
"dashArray"
,
"dashPhase"
})
public
BasicStroke
(
float
width
,
int
cap
,
int
join
,
float
miterlimit
,
float
dash
[],
float
dash_phase
)
{
if
(
width
<
0.0f
)
{
...
...
src/share/classes/java/awt/GradientPaint.java
浏览文件 @
b6363f21
/*
* Copyright (c) 1997, 20
08
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 20
10
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
...
...
@@ -29,6 +29,7 @@ import java.awt.geom.Point2D;
import
java.awt.geom.Rectangle2D
;
import
java.awt.geom.AffineTransform
;
import
java.awt.image.ColorModel
;
import
java.beans.ConstructorProperties
;
/**
* The <code>GradientPaint</code> class provides a way to fill
...
...
@@ -166,6 +167,7 @@ public class GradientPaint implements Paint {
* @throws NullPointerException if either one of colors or points
* is null
*/
@ConstructorProperties
({
"point1"
,
"color1"
,
"point2"
,
"color2"
,
"cyclic"
})
public
GradientPaint
(
Point2D
pt1
,
Color
color1
,
Point2D
pt2
,
...
...
src/share/classes/java/awt/LinearGradientPaint.java
浏览文件 @
b6363f21
/*
* Copyright (c) 2006, 20
08
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2006, 20
10
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
...
...
@@ -26,10 +26,10 @@
package
java.awt
;
import
java.awt.geom.AffineTransform
;
import
java.awt.geom.NoninvertibleTransformException
;
import
java.awt.geom.Point2D
;
import
java.awt.geom.Rectangle2D
;
import
java.awt.image.ColorModel
;
import
java.beans.ConstructorProperties
;
/**
* The {@code LinearGradientPaint} class provides a way to fill
...
...
@@ -271,6 +271,7 @@ public final class LinearGradientPaint extends MultipleGradientPaint {
* or a {@code fractions} value is less than 0.0 or greater than 1.0,
* or the {@code fractions} are not provided in strictly increasing order
*/
@ConstructorProperties
({
"startPoint"
,
"endPoint"
,
"fractions"
,
"colors"
,
"cycleMethod"
,
"colorSpace"
,
"transform"
})
public
LinearGradientPaint
(
Point2D
start
,
Point2D
end
,
float
[]
fractions
,
Color
[]
colors
,
CycleMethod
cycleMethod
,
...
...
src/share/classes/java/awt/RadialGradientPaint.java
浏览文件 @
b6363f21
/*
* Copyright (c) 2006, 20
08
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2006, 20
10
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
...
...
@@ -29,6 +29,7 @@ import java.awt.geom.AffineTransform;
import
java.awt.geom.Point2D
;
import
java.awt.geom.Rectangle2D
;
import
java.awt.image.ColorModel
;
import
java.beans.ConstructorProperties
;
/**
* The {@code RadialGradientPaint} class provides a way to fill a shape with
...
...
@@ -428,6 +429,7 @@ public final class RadialGradientPaint extends MultipleGradientPaint {
* or a {@code fractions} value is less than 0.0 or greater than 1.0,
* or the {@code fractions} are not provided in strictly increasing order
*/
@ConstructorProperties
({
"centerPoint"
,
"radius"
,
"focusPoint"
,
"fractions"
,
"colors"
,
"cycleMethod"
,
"colorSpace"
,
"transform"
})
public
RadialGradientPaint
(
Point2D
center
,
float
radius
,
Point2D
focus
,
...
...
src/share/classes/java/awt/Toolkit.java
浏览文件 @
b6363f21
...
...
@@ -1831,8 +1831,12 @@ public abstract class Toolkit {
desktopProperties
.
put
(
name
,
newValue
);
}
// Don't fire change event if old and new values are null.
// It helps to avoid recursive resending of WM_THEMECHANGED
if
(
oldValue
!=
null
||
newValue
!=
null
)
{
desktopPropsSupport
.
firePropertyChange
(
name
,
oldValue
,
newValue
);
}
}
/**
* an opportunity to lazily evaluate desktop property values.
...
...
src/share/classes/java/awt/geom/AffineTransform.java
浏览文件 @
b6363f21
/*
* Copyright (c) 1996, 20
06
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 20
10
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
...
...
@@ -26,6 +26,7 @@
package
java.awt.geom
;
import
java.awt.Shape
;
import
java.beans.ConstructorProperties
;
/**
* The <code>AffineTransform</code> class represents a 2D affine transform
...
...
@@ -508,6 +509,7 @@ public class AffineTransform implements Cloneable, java.io.Serializable {
* @param m12 the Y coordinate translation element of the 3x3 matrix
* @since 1.2
*/
@ConstructorProperties
({
"scaleX"
,
"shearY"
,
"shearX"
,
"scaleY"
,
"translateX"
,
"translateY"
})
public
AffineTransform
(
float
m00
,
float
m10
,
float
m01
,
float
m11
,
float
m02
,
float
m12
)
{
...
...
src/share/classes/java/text/DateFormatSymbols.java
浏览文件 @
b6363f21
...
...
@@ -44,11 +44,12 @@ import java.io.Serializable;
import
java.lang.ref.SoftReference
;
import
java.text.spi.DateFormatSymbolsProvider
;
import
java.util.Arrays
;
import
java.util.Hashtable
;
import
java.util.List
;
import
java.util.Locale
;
import
java.util.ResourceBundle
;
import
java.util.TimeZone
;
import
java.util.concurrent.ConcurrentHashMap
;
import
java.util.concurrent.ConcurrentMap
;
import
java.util.spi.LocaleServiceProvider
;
import
sun.util.LocaleServiceProviderPool
;
import
sun.util.TimeZoneNameUtility
;
...
...
@@ -321,20 +322,64 @@ public class DateFormatSymbols implements Serializable, Cloneable {
* @since 1.6
*/
public
static
final
DateFormatSymbols
getInstance
(
Locale
locale
)
{
DateFormatSymbols
dfs
=
getProviderInstance
(
locale
);
if
(
dfs
!=
null
)
{
return
dfs
;
}
return
(
DateFormatSymbols
)
getCachedInstance
(
locale
).
clone
();
}
/**
* Returns a DateFormatSymbols provided by a provider or found in
* the cache. Note that this method returns a cached instance,
* not its clone. Therefore, the instance should never be given to
* an application.
*/
static
final
DateFormatSymbols
getInstanceRef
(
Locale
locale
)
{
DateFormatSymbols
dfs
=
getProviderInstance
(
locale
);
if
(
dfs
!=
null
)
{
return
dfs
;
}
return
getCachedInstance
(
locale
);
}
private
static
DateFormatSymbols
getProviderInstance
(
Locale
locale
)
{
DateFormatSymbols
providersInstance
=
null
;
// Check whether a provider can provide an implementation that's closer
// to the requested locale than what the Java runtime itself can provide.
LocaleServiceProviderPool
pool
=
LocaleServiceProviderPool
.
getPool
(
DateFormatSymbolsProvider
.
class
);
if
(
pool
.
hasProviders
())
{
DateFormatSymbols
providersInstance
=
pool
.
getLocalizedObject
(
providersInstance
=
pool
.
getLocalizedObject
(
DateFormatSymbolsGetter
.
INSTANCE
,
locale
);
if
(
providersInstance
!=
null
)
{
return
providersInstance
;
}
return
providersInstance
;
}
return
new
DateFormatSymbols
(
locale
);
/**
* Returns a cached DateFormatSymbols if it's found in the
* cache. Otherwise, this method returns a newly cached instance
* for the given locale.
*/
private
static
DateFormatSymbols
getCachedInstance
(
Locale
locale
)
{
SoftReference
<
DateFormatSymbols
>
ref
=
cachedInstances
.
get
(
locale
);
DateFormatSymbols
dfs
=
null
;
if
(
ref
==
null
||
(
dfs
=
ref
.
get
())
==
null
)
{
dfs
=
new
DateFormatSymbols
(
locale
);
ref
=
new
SoftReference
<
DateFormatSymbols
>(
dfs
);
SoftReference
<
DateFormatSymbols
>
x
=
cachedInstances
.
putIfAbsent
(
locale
,
ref
);
if
(
x
!=
null
)
{
DateFormatSymbols
y
=
x
.
get
();
if
(
y
!=
null
)
{
dfs
=
y
;
}
else
{
// Replace the empty SoftReference with ref.
cachedInstances
.
put
(
locale
,
ref
);
}
}
}
return
dfs
;
}
/**
...
...
@@ -597,56 +642,44 @@ public class DateFormatSymbols implements Serializable, Cloneable {
static
final
int
millisPerHour
=
60
*
60
*
1000
;
/**
* Cache to hold the FormatData and TimeZoneNames ResourceBundles
* of a Locale.
* Cache to hold DateFormatSymbols instances per Locale.
*/
private
static
Hashtable
cachedLocaleData
=
new
Hashtable
(
3
);
private
static
final
ConcurrentMap
<
Locale
,
SoftReference
<
DateFormatSymbols
>>
cachedInstances
=
new
ConcurrentHashMap
<
Locale
,
SoftReference
<
DateFormatSymbols
>>(
3
);
/**
* Look up resource data for the desiredLocale in the cache; update the
* cache if necessary.
*/
private
static
ResourceBundle
cacheLookup
(
Locale
desiredLocale
)
{
ResourceBundle
rb
;
SoftReference
data
=
(
SoftReference
)
cachedLocaleData
.
get
(
desiredLocale
);
if
(
data
==
null
)
{
rb
=
LocaleData
.
getDateFormatData
(
desiredLocale
);
data
=
new
SoftReference
(
rb
);
cachedLocaleData
.
put
(
desiredLocale
,
data
);
}
else
{
if
((
rb
=
(
ResourceBundle
)
data
.
get
())
==
null
)
{
rb
=
LocaleData
.
getDateFormatData
(
desiredLocale
);
data
=
new
SoftReference
(
rb
);
}
}
return
rb
;
private
void
initializeData
(
Locale
desiredLocale
)
{
locale
=
desiredLocale
;
// Copy values of a cached instance if any.
SoftReference
<
DateFormatSymbols
>
ref
=
cachedInstances
.
get
(
locale
);
DateFormatSymbols
dfs
;
if
(
ref
!=
null
&&
(
dfs
=
ref
.
get
())
!=
null
)
{
copyMembers
(
dfs
,
this
);
return
;
}
private
void
initializeData
(
Locale
desiredLocale
)
{
int
i
;
ResourceBundle
resource
=
cacheLookup
(
desiredLocale
);
// Initialize the fields from the ResourceBundle for locale.
ResourceBundle
resource
=
LocaleData
.
getDateFormatData
(
locale
);
// FIXME: cache only ResourceBundle. Hence every time, will do
// getObject(). This won't be necessary if the Resource itself
// is cached.
eras
=
(
String
[])
resource
.
getObject
(
"Eras"
);
eras
=
resource
.
getStringArray
(
"Eras"
);
months
=
resource
.
getStringArray
(
"MonthNames"
);
shortMonths
=
resource
.
getStringArray
(
"MonthAbbreviations"
);
String
[]
lWeekdays
=
resource
.
getStringArray
(
"DayNames"
);
weekdays
=
new
String
[
8
];
weekdays
[
0
]
=
""
;
// 1-based
for
(
i
=
0
;
i
<
lWeekdays
.
length
;
i
++)
weekdays
[
i
+
1
]
=
lWeekdays
[
i
];
String
[]
sWeekdays
=
resource
.
getStringArray
(
"DayAbbreviations"
);
shortWeekdays
=
new
String
[
8
];
shortWeekdays
[
0
]
=
""
;
// 1-based
for
(
i
=
0
;
i
<
sWeekdays
.
length
;
i
++)
shortWeekdays
[
i
+
1
]
=
sWeekdays
[
i
];
ampms
=
resource
.
getStringArray
(
"AmPmMarkers"
);
localPatternChars
=
resource
.
getString
(
"DateTimePatternChars"
);
locale
=
desiredLocale
;
// Day of week names are stored in a 1-based array.
weekdays
=
toOneBasedArray
(
resource
.
getStringArray
(
"DayNames"
));
shortWeekdays
=
toOneBasedArray
(
resource
.
getStringArray
(
"DayAbbreviations"
));
}
private
static
String
[]
toOneBasedArray
(
String
[]
src
)
{
int
len
=
src
.
length
;
String
[]
dst
=
new
String
[
len
+
1
];
dst
[
0
]
=
""
;
for
(
int
i
=
0
;
i
<
len
;
i
++)
{
dst
[
i
+
1
]
=
src
[
i
];
}
return
dst
;
}
/**
...
...
src/share/classes/java/text/DecimalFormat.java
浏览文件 @
b6363f21
/*
* Copyright (c) 1996, 20
06
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 20
10
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
...
...
@@ -46,9 +46,10 @@ import java.math.BigInteger;
import
java.math.RoundingMode
;
import
java.util.ArrayList
;
import
java.util.Currency
;
import
java.util.Hashtable
;
import
java.util.Locale
;
import
java.util.ResourceBundle
;
import
java.util.concurrent.ConcurrentHashMap
;
import
java.util.concurrent.ConcurrentMap
;
import
java.util.concurrent.atomic.AtomicInteger
;
import
java.util.concurrent.atomic.AtomicLong
;
import
sun.util.resources.LocaleData
;
...
...
@@ -394,14 +395,14 @@ public class DecimalFormat extends NumberFormat {
public
DecimalFormat
()
{
Locale
def
=
Locale
.
getDefault
(
Locale
.
Category
.
FORMAT
);
// try to get the pattern from the cache
String
pattern
=
(
String
)
cachedLocaleData
.
get
(
def
);
String
pattern
=
cachedLocaleData
.
get
(
def
);
if
(
pattern
==
null
)
{
/* cache miss */
// Get the pattern for the default locale.
ResourceBundle
rb
=
LocaleData
.
getNumberFormatData
(
def
);
String
[]
all
=
rb
.
getStringArray
(
"NumberPatterns"
);
pattern
=
all
[
0
];
/* update cache */
cachedLocaleData
.
put
(
def
,
pattern
);
cachedLocaleData
.
put
IfAbsent
(
def
,
pattern
);
}
// Always applyPattern after the symbols are set
...
...
@@ -3272,5 +3273,6 @@ public class DecimalFormat extends NumberFormat {
/**
* Cache to hold the NumberPattern of a Locale.
*/
private
static
Hashtable
cachedLocaleData
=
new
Hashtable
(
3
);
private
static
final
ConcurrentMap
<
Locale
,
String
>
cachedLocaleData
=
new
ConcurrentHashMap
<
Locale
,
String
>(
3
);
}
src/share/classes/java/text/SimpleDateFormat.java
浏览文件 @
b6363f21
...
...
@@ -44,13 +44,14 @@ import java.io.ObjectInputStream;
import
java.util.Calendar
;
import
java.util.Date
;
import
java.util.GregorianCalendar
;
import
java.util.Hashtable
;
import
java.util.Locale
;
import
java.util.Map
;
import
java.util.MissingResourceException
;
import
java.util.ResourceBundle
;
import
java.util.SimpleTimeZone
;
import
java.util.TimeZone
;
import
java.util.concurrent.ConcurrentHashMap
;
import
java.util.concurrent.ConcurrentMap
;
import
sun.util.calendar.CalendarUtils
;
import
sun.util.calendar.ZoneInfoFile
;
import
sun.util.resources.LocaleData
;
...
...
@@ -503,14 +504,14 @@ public class SimpleDateFormat extends DateFormat {
/**
* Cache to hold the DateTimePatterns of a Locale.
*/
private
static
Hashtable
<
String
,
String
[]>
cachedLocaleData
=
new
Hashtable
<
String
,
String
[]>(
3
);
private
static
final
ConcurrentMap
<
String
,
String
[]>
cachedLocaleData
=
new
ConcurrentHashMap
<
String
,
String
[]>(
3
);
/**
* Cache NumberFormat instances with Locale key.
*/
private
static
Hashtable
<
Locale
,
NumberFormat
>
cachedNumberFormatData
=
new
Hashtable
<
Locale
,
NumberFormat
>(
3
);
private
static
final
ConcurrentMap
<
Locale
,
NumberFormat
>
cachedNumberFormatData
=
new
ConcurrentHashMap
<
Locale
,
NumberFormat
>(
3
);
/**
* The Locale used to instantiate this
...
...
@@ -579,7 +580,7 @@ public class SimpleDateFormat extends DateFormat {
initializeCalendar
(
locale
);
this
.
pattern
=
pattern
;
this
.
formatData
=
DateFormatSymbols
.
getInstance
(
locale
);
this
.
formatData
=
DateFormatSymbols
.
getInstance
Ref
(
locale
);
this
.
locale
=
locale
;
initialize
(
locale
);
}
...
...
@@ -632,9 +633,9 @@ public class SimpleDateFormat extends DateFormat {
dateTimePatterns
=
r
.
getStringArray
(
"DateTimePatterns"
);
}
/* update cache */
cachedLocaleData
.
put
(
key
,
dateTimePatterns
);
cachedLocaleData
.
put
IfAbsent
(
key
,
dateTimePatterns
);
}
formatData
=
DateFormatSymbols
.
getInstance
(
loc
);
formatData
=
DateFormatSymbols
.
getInstance
Ref
(
loc
);
if
((
timeStyle
>=
0
)
&&
(
dateStyle
>=
0
))
{
Object
[]
dateTimeArgs
=
{
dateTimePatterns
[
timeStyle
],
dateTimePatterns
[
dateStyle
+
4
]};
...
...
@@ -665,7 +666,7 @@ public class SimpleDateFormat extends DateFormat {
numberFormat
.
setGroupingUsed
(
false
);
/* update cache */
cachedNumberFormatData
.
put
(
loc
,
numberFormat
);
cachedNumberFormatData
.
put
IfAbsent
(
loc
,
numberFormat
);
}
numberFormat
=
(
NumberFormat
)
numberFormat
.
clone
();
...
...
@@ -897,7 +898,7 @@ public class SimpleDateFormat extends DateFormat {
* so we can call it from readObject().
*/
private
void
initializeDefaultCentury
()
{
calendar
.
setTime
(
new
Date
()
);
calendar
.
setTime
InMillis
(
System
.
currentTimeMillis
()
);
calendar
.
add
(
Calendar
.
YEAR
,
-
80
);
parseAmbiguousDatesAsAfter
(
calendar
.
getTime
());
}
...
...
@@ -921,7 +922,7 @@ public class SimpleDateFormat extends DateFormat {
* @since 1.2
*/
public
void
set2DigitYearStart
(
Date
startDate
)
{
parseAmbiguousDatesAsAfter
(
startDate
);
parseAmbiguousDatesAsAfter
(
new
Date
(
startDate
.
getTime
())
);
}
/**
...
...
@@ -934,7 +935,7 @@ public class SimpleDateFormat extends DateFormat {
* @since 1.2
*/
public
Date
get2DigitYearStart
()
{
return
defaultCenturyStart
;
return
(
Date
)
defaultCenturyStart
.
clone
()
;
}
/**
...
...
src/share/classes/java/util/Calendar.java
浏览文件 @
b6363f21
...
...
@@ -51,6 +51,8 @@ import java.security.PrivilegedExceptionAction;
import
java.security.ProtectionDomain
;
import
java.text.DateFormat
;
import
java.text.DateFormatSymbols
;
import
java.util.concurrent.ConcurrentHashMap
;
import
java.util.concurrent.ConcurrentMap
;
import
sun.util.BuddhistCalendar
;
import
sun.util.calendar.ZoneInfo
;
import
sun.util.resources.LocaleData
;
...
...
@@ -837,7 +839,8 @@ public abstract class Calendar implements Serializable, Cloneable, Comparable<Ca
* Cache to hold the firstDayOfWeek and minimalDaysInFirstWeek
* of a Locale.
*/
private
static
Hashtable
<
Locale
,
int
[]>
cachedLocaleData
=
new
Hashtable
<
Locale
,
int
[]>(
3
);
private
static
final
ConcurrentMap
<
Locale
,
int
[]>
cachedLocaleData
=
new
ConcurrentHashMap
<
Locale
,
int
[]>(
3
);
// Special values of stamp[]
/**
...
...
@@ -2588,7 +2591,7 @@ public abstract class Calendar implements Serializable, Cloneable, Comparable<Ca
data
=
new
int
[
2
];
data
[
0
]
=
Integer
.
parseInt
(
bundle
.
getString
(
"firstDayOfWeek"
));
data
[
1
]
=
Integer
.
parseInt
(
bundle
.
getString
(
"minimalDaysInFirstWeek"
));
cachedLocaleData
.
put
(
desiredLocale
,
data
);
cachedLocaleData
.
put
IfAbsent
(
desiredLocale
,
data
);
}
firstDayOfWeek
=
data
[
0
];
minimalDaysInFirstWeek
=
data
[
1
];
...
...
src/share/classes/java/util/Locale.java
浏览文件 @
b6363f21
...
...
@@ -758,7 +758,7 @@ public final class Locale implements Cloneable, Serializable {
}
private
static
void
initDefault
()
{
String
language
,
region
,
country
,
variant
;
String
language
,
region
,
script
,
country
,
variant
;
language
=
AccessController
.
doPrivileged
(
new
GetPropertyAction
(
"user.language"
,
"en"
));
// for compatibility, check for old user.region property
...
...
@@ -774,43 +774,41 @@ public final class Locale implements Cloneable, Serializable {
country
=
region
;
variant
=
""
;
}
script
=
""
;
}
else
{
script
=
AccessController
.
doPrivileged
(
new
GetPropertyAction
(
"user.script"
,
""
));
country
=
AccessController
.
doPrivileged
(
new
GetPropertyAction
(
"user.country"
,
""
));
variant
=
AccessController
.
doPrivileged
(
new
GetPropertyAction
(
"user.variant"
,
""
));
}
defaultLocale
=
getInstance
(
language
,
country
,
variant
);
defaultLocale
=
getInstance
(
language
,
script
,
country
,
variant
,
null
);
}
private
static
void
initDefault
(
Locale
.
Category
category
)
{
String
language
,
region
,
country
,
variant
;
// make sure defaultLocale is initialized
if
(
defaultLocale
==
null
)
{
initDefault
();
}
Locale
defaultCategoryLocale
=
getInstance
(
AccessController
.
doPrivileged
(
new
GetPropertyAction
(
category
.
languageKey
,
defaultLocale
.
getLanguage
())),
AccessController
.
doPrivileged
(
new
GetPropertyAction
(
category
.
scriptKey
,
defaultLocale
.
getScript
())),
AccessController
.
doPrivileged
(
new
GetPropertyAction
(
category
.
countryKey
,
defaultLocale
.
getCountry
())),
AccessController
.
doPrivileged
(
new
GetPropertyAction
(
category
.
variantKey
,
defaultLocale
.
getVariant
())),
null
);
switch
(
category
)
{
case
DISPLAY:
language
=
AccessController
.
doPrivileged
(
new
GetPropertyAction
(
"user.language.display"
,
""
));
if
(
""
.
equals
(
language
))
{
defaultDisplayLocale
=
getDefault
();
}
else
{
country
=
AccessController
.
doPrivileged
(
new
GetPropertyAction
(
"user.country.display"
,
""
));
variant
=
AccessController
.
doPrivileged
(
new
GetPropertyAction
(
"user.variant.display"
,
""
));
defaultDisplayLocale
=
getInstance
(
language
,
country
,
variant
);
}
defaultDisplayLocale
=
defaultCategoryLocale
;
break
;
case
FORMAT:
language
=
AccessController
.
doPrivileged
(
new
GetPropertyAction
(
"user.language.format"
,
""
));
if
(
""
.
equals
(
language
))
{
defaultFormatLocale
=
getDefault
();
}
else
{
country
=
AccessController
.
doPrivileged
(
new
GetPropertyAction
(
"user.country.format"
,
""
));
variant
=
AccessController
.
doPrivileged
(
new
GetPropertyAction
(
"user.variant.format"
,
""
));
defaultFormatLocale
=
getInstance
(
language
,
country
,
variant
);
}
defaultFormatLocale
=
defaultCategoryLocale
;
break
;
}
}
...
...
@@ -2124,13 +2122,31 @@ public final class Locale implements Cloneable, Serializable {
* Category used to represent the default locale for
* displaying user interfaces.
*/
DISPLAY
,
DISPLAY
(
"user.language.display"
,
"user.script.display"
,
"user.country.display"
,
"user.variant.display"
),
/**
* Category used to represent the default locale for
* formatting dates, numbers, and/or currencies.
*/
FORMAT
,
FORMAT
(
"user.language.format"
,
"user.script.format"
,
"user.country.format"
,
"user.variant.format"
);
Category
(
String
languageKey
,
String
scriptKey
,
String
countryKey
,
String
variantKey
)
{
this
.
languageKey
=
languageKey
;
this
.
scriptKey
=
scriptKey
;
this
.
countryKey
=
countryKey
;
this
.
variantKey
=
variantKey
;
}
final
String
languageKey
;
final
String
scriptKey
;
final
String
countryKey
;
final
String
variantKey
;
}
/**
...
...
src/share/classes/java/util/TimeZone.java
浏览文件 @
b6363f21
...
...
@@ -160,11 +160,6 @@ abstract public class TimeZone implements Serializable, Cloneable {
private
static
final
int
ONE_HOUR
=
60
*
ONE_MINUTE
;
private
static
final
int
ONE_DAY
=
24
*
ONE_HOUR
;
/**
* Cache to hold the SimpleDateFormat objects for a Locale.
*/
private
static
Hashtable
cachedLocaleData
=
new
Hashtable
(
3
);
// Proclaim serialization compatibility with JDK 1.1
static
final
long
serialVersionUID
=
3581463369166924961L
;
...
...
src/share/classes/javax/swing/BorderFactory.java
浏览文件 @
b6363f21
...
...
@@ -24,8 +24,10 @@
*/
package
javax.swing
;
import
java.awt.BasicStroke
;
import
java.awt.Color
;
import
java.awt.Font
;
import
java.awt.Paint
;
import
javax.swing.border.*
;
/**
...
...
@@ -636,4 +638,125 @@ public class BorderFactory
Icon
tileIcon
)
{
return
new
MatteBorder
(
top
,
left
,
bottom
,
right
,
tileIcon
);
}
//// StrokeBorder //////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
/**
* Creates a border of the specified {@code stroke}.
* The component's foreground color will be used to render the border.
*
* @param stroke the {@link BasicStroke} object used to stroke a shape
* @return the {@code Border} object
*
* @throws NullPointerException if the specified {@code stroke} is {@code null}
*
* @since 1.7
*/
public
static
Border
createStrokeBorder
(
BasicStroke
stroke
)
{
return
new
StrokeBorder
(
stroke
);
}
/**
* Creates a border of the specified {@code stroke} and {@code paint}.
* If the specified {@code paint} is {@code null},
* the component's foreground color will be used to render the border.
*
* @param stroke the {@link BasicStroke} object used to stroke a shape
* @param paint the {@link Paint} object used to generate a color
* @return the {@code Border} object
*
* @throws NullPointerException if the specified {@code stroke} is {@code null}
*
* @since 1.7
*/
public
static
Border
createStrokeBorder
(
BasicStroke
stroke
,
Paint
paint
)
{
return
new
StrokeBorder
(
stroke
,
paint
);
}
//// DashedBorder //////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
private
static
Border
sharedDashedBorder
;
/**
* Creates a dashed border of the specified {@code paint}.
* If the specified {@code paint} is {@code null},
* the component's foreground color will be used to render the border.
* The width of a dash line is equal to {@code 1}.
* The relative length of a dash line and
* the relative spacing between dash lines are equal to {@code 1}.
* A dash line is not rounded.
*
* @param paint the {@link Paint} object used to generate a color
* @return the {@code Border} object
*
* @since 1.7
*/
public
static
Border
createDashedBorder
(
Paint
paint
)
{
return
createDashedBorder
(
paint
,
1.0f
,
1.0f
,
1.0f
,
false
);
}
/**
* Creates a dashed border of the specified {@code paint},
* relative {@code length}, and relative {@code spacing}.
* If the specified {@code paint} is {@code null},
* the component's foreground color will be used to render the border.
* The width of a dash line is equal to {@code 1}.
* A dash line is not rounded.
*
* @param paint the {@link Paint} object used to generate a color
* @param length the relative length of a dash line
* @param spacing the relative spacing between dash lines
* @return the {@code Border} object
*
* @throws IllegalArgumentException if the specified {@code length} is less than {@code 1}, or
* if the specified {@code spacing} is less than {@code 0}
* @since 1.7
*/
public
static
Border
createDashedBorder
(
Paint
paint
,
float
length
,
float
spacing
)
{
return
createDashedBorder
(
paint
,
1.0f
,
length
,
spacing
,
false
);
}
/**
* Creates a dashed border of the specified {@code paint}, {@code thickness},
* line shape, relative {@code length}, and relative {@code spacing}.
* If the specified {@code paint} is {@code null},
* the component's foreground color will be used to render the border.
*
* @param paint the {@link Paint} object used to generate a color
* @param thickness the width of a dash line
* @param length the relative length of a dash line
* @param spacing the relative spacing between dash lines
* @param rounded whether or not line ends should be round
* @return the {@code Border} object
*
* @throws IllegalArgumentException if the specified {@code thickness} is less than {@code 1}, or
* if the specified {@code length} is less than {@code 1}, or
* if the specified {@code spacing} is less than {@code 0}
* @since 1.7
*/
public
static
Border
createDashedBorder
(
Paint
paint
,
float
thickness
,
float
length
,
float
spacing
,
boolean
rounded
)
{
boolean
shared
=
!
rounded
&&
(
paint
==
null
)
&&
(
thickness
==
1.0f
)
&&
(
length
==
1.0f
)
&&
(
spacing
==
1.0f
);
if
(
shared
&&
(
sharedDashedBorder
!=
null
))
{
return
sharedDashedBorder
;
}
if
(
thickness
<
1.0f
)
{
throw
new
IllegalArgumentException
(
"thickness is less than 1"
);
}
if
(
length
<
1.0f
)
{
throw
new
IllegalArgumentException
(
"length is less than 1"
);
}
if
(
spacing
<
0.0f
)
{
throw
new
IllegalArgumentException
(
"spacing is less than 0"
);
}
int
cap
=
rounded
?
BasicStroke
.
CAP_ROUND
:
BasicStroke
.
CAP_SQUARE
;
int
join
=
rounded
?
BasicStroke
.
JOIN_ROUND
:
BasicStroke
.
JOIN_MITER
;
float
[]
array
=
{
thickness
*
(
length
-
1.0f
),
thickness
*
(
spacing
+
1.0f
)
};
Border
border
=
createStrokeBorder
(
new
BasicStroke
(
thickness
,
cap
,
join
,
thickness
*
2.0f
,
array
,
0.0f
),
paint
);
if
(
shared
)
{
sharedDashedBorder
=
border
;
}
return
border
;
}
}
src/share/classes/javax/swing/DebugGraphics.java
浏览文件 @
b6363f21
...
...
@@ -1322,13 +1322,11 @@ public class DebugGraphics extends Graphics {
}
String
toShortString
()
{
StringBuffer
buffer
=
new
StringBuffer
(
"Graphics"
+
(
isDrawingBuffer
()
?
"<B>"
:
""
)
+
"("
+
graphicsID
+
"-"
+
debugOptions
+
")"
);
return
buffer
.
toString
();
return
"Graphics"
+
(
isDrawingBuffer
()
?
"<B>"
:
""
)
+
"("
+
graphicsID
+
"-"
+
debugOptions
+
")"
;
}
String
pointToString
(
int
x
,
int
y
)
{
StringBuffer
buffer
=
new
StringBuffer
(
"("
+
x
+
", "
+
y
+
")"
);
return
buffer
.
toString
();
return
"("
+
x
+
", "
+
y
+
")"
;
}
/** Enables/disables diagnostic information about every graphics
...
...
src/share/classes/javax/swing/JComponent.java
浏览文件 @
b6363f21
...
...
@@ -4783,21 +4783,11 @@ public abstract class JComponent extends Container implements Serializable,
* @param y the y value of the dirty region
* @param width the width of the dirty region
* @param height the height of the dirty region
* @see #isPaintingOrigin()
* @see java.awt.Component#isShowing
* @see RepaintManager#addDirtyRegion
*/
public
void
repaint
(
long
tm
,
int
x
,
int
y
,
int
width
,
int
height
)
{
Container
p
=
this
;
while
((
p
=
p
.
getParent
())
instanceof
JComponent
)
{
JComponent
jp
=
(
JComponent
)
p
;
if
(
jp
.
isPaintingOrigin
())
{
Rectangle
rectangle
=
SwingUtilities
.
convertRectangle
(
this
,
new
Rectangle
(
x
,
y
,
width
,
height
),
jp
);
jp
.
repaint
(
tm
,
rectangle
.
x
,
rectangle
.
y
,
rectangle
.
width
,
rectangle
.
height
);
return
;
}
}
RepaintManager
.
currentManager
(
this
).
addDirtyRegion
(
this
,
x
,
y
,
width
,
height
);
}
...
...
@@ -4808,6 +4798,7 @@ public abstract class JComponent extends Container implements Serializable,
* currently pending events have been dispatched.
*
* @param r a <code>Rectangle</code> containing the dirty region
* @see #isPaintingOrigin()
* @see java.awt.Component#isShowing
* @see RepaintManager#addDirtyRegion
*/
...
...
@@ -4912,13 +4903,19 @@ public abstract class JComponent extends Container implements Serializable,
}
/**
* Returns
true
if a paint triggered on a child component should cause
* Returns
{@code true}
if a paint triggered on a child component should cause
* painting to originate from this Component, or one of its ancestors.
* <p/>
* Calling {@link JComponent#repaint} on a Swing component will be delegated to
* the first ancestor which {@code isPaintingOrigin()} returns {@true},
* if there are any.
* <p/>
* {@code JComponent} subclasses that need to be repainted when any of their
* children are repainted should override this method to return {@code true}.
*
* @return true if painting should originate from this Component or
* one of its ancestors.
* @return always returns {@code false}
*/
boolean
isPaintingOrigin
()
{
protected
boolean
isPaintingOrigin
()
{
return
false
;
}
...
...
src/share/classes/javax/swing/JDialog.java
浏览文件 @
b6363f21
...
...
@@ -303,10 +303,9 @@ public class JDialog extends Dialog implements WindowConstants,
* @param modal specifies whether dialog blocks user input to other top-level
* windows when shown. If {@code true}, the modality type property is set to
* {@code DEFAULT_MODALITY_TYPE}, otherwise the dialog is modeless.
* @param gc the {@code GraphicsConfiguration}
* of the target screen device. If {@code gc} is
* {@code null}, the same
* {@code GraphicsConfiguration} as the owning Frame is used.
* @param gc the {@code GraphicsConfiguration} of the target screen device;
* if {@code null}, the default system {@code GraphicsConfiguration}
* is assumed
* @throws HeadlessException if {@code GraphicsEnvironment.isHeadless()}
* returns {@code true}.
* @see java.awt.Dialog.ModalityType
...
...
@@ -441,10 +440,9 @@ public class JDialog extends Dialog implements WindowConstants,
* @param modal specifies whether dialog blocks user input to other top-level
* windows when shown. If {@code true}, the modality type property is set to
* {@code DEFAULT_MODALITY_TYPE}, otherwise the dialog is modeless
* @param gc the {@code GraphicsConfiguration}
* of the target screen device. If {@code gc} is
* {@code null}, the same
* {@code GraphicsConfiguration} as the owning Dialog is used.
* @param gc the {@code GraphicsConfiguration} of the target screen device;
* if {@code null}, the default system {@code GraphicsConfiguration}
* is assumed
* @throws HeadlessException if {@code GraphicsEnvironment.isHeadless()}
* returns {@code true}.
* @see java.awt.Dialog.ModalityType
...
...
@@ -612,10 +610,8 @@ public class JDialog extends Dialog implements WindowConstants,
* windows when shown. {@code null} value and unsupported modality
* types are equivalent to {@code MODELESS}
* @param gc the {@code GraphicsConfiguration} of the target screen device;
* if {@code null}, the {@code GraphicsConfiguration} from the owning
* window is used; if {@code owner} is also {@code null}, the
* system default {@code GraphicsConfiguration} is assumed
*
* if {@code null}, the default system {@code GraphicsConfiguration}
* is assumed
* @throws IllegalArgumentException
* if the {@code owner} is not an instance of {@link java.awt.Dialog Dialog}
* or {@link java.awt.Frame Frame}
...
...
src/share/classes/javax/swing/JLayer.java
浏览文件 @
b6363f21
...
...
@@ -384,7 +384,7 @@ public final class JLayer<V extends Component>
* @return true
* @see JComponent#isPaintingOrigin()
*/
boolean
isPaintingOrigin
()
{
protected
boolean
isPaintingOrigin
()
{
return
true
;
}
...
...
src/share/classes/javax/swing/JViewport.java
浏览文件 @
b6363f21
...
...
@@ -637,14 +637,14 @@ public class JViewport extends JComponent implements Accessible
}
/**
* Returns true if scroll mode is a
BACKINGSTORE_SCROLL_MODE
to cause
* painting to originate from
<code>JViewport</code>
, or one of its
* ancestors. Otherwise returns
false
.
* Returns true if scroll mode is a
{@code BACKINGSTORE_SCROLL_MODE}
to cause
* painting to originate from
{@code JViewport}
, or one of its
* ancestors. Otherwise returns
{@code false}
.
*
* @return true if if scroll mode is a
BACKINGSTORE_SCROLL_MODE
.
* @return true if if scroll mode is a
{@code BACKINGSTORE_SCROLL_MODE}
.
* @see JComponent#isPaintingOrigin()
*/
boolean
isPaintingOrigin
()
{
protected
boolean
isPaintingOrigin
()
{
return
scrollMode
==
BACKINGSTORE_SCROLL_MODE
;
}
...
...
src/share/classes/javax/swing/RepaintManager.java
浏览文件 @
b6363f21
...
...
@@ -438,6 +438,7 @@ public class RepaintManager
* @param y Y coordinate of the region to repaint
* @param w Width of the region to repaint
* @param h Height of the region to repaint
* @see JComponent#isPaintingOrigin()
* @see JComponent#repaint
*/
public
void
addDirtyRegion
(
JComponent
c
,
int
x
,
int
y
,
int
w
,
int
h
)
...
...
@@ -447,6 +448,16 @@ public class RepaintManager
delegate
.
addDirtyRegion
(
c
,
x
,
y
,
w
,
h
);
return
;
}
Container
p
=
c
;
while
((
p
=
p
.
getParent
())
instanceof
JComponent
)
{
JComponent
jp
=
(
JComponent
)
p
;
if
(
jp
.
isPaintingOrigin
())
{
Rectangle
rectangle
=
SwingUtilities
.
convertRectangle
(
c
,
new
Rectangle
(
x
,
y
,
w
,
h
),
jp
);
jp
.
repaint
(
0
,
rectangle
.
x
,
rectangle
.
y
,
rectangle
.
width
,
rectangle
.
height
);
return
;
}
}
addDirtyRegion0
(
c
,
x
,
y
,
w
,
h
);
}
...
...
src/share/classes/javax/swing/border/StrokeBorder.java
0 → 100644
浏览文件 @
b6363f21
/*
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package
javax.swing.border
;
import
java.awt.BasicStroke
;
import
java.awt.Component
;
import
java.awt.Graphics
;
import
java.awt.Graphics2D
;
import
java.awt.Insets
;
import
java.awt.Paint
;
import
java.awt.RenderingHints
;
import
java.awt.geom.Rectangle2D
;
import
java.beans.ConstructorProperties
;
/**
* A class which implements a border of an arbitrary stroke.
* <p>
* <strong>Warning:</strong>
* Serialized objects of this class will not be compatible with
* future Swing releases. The current serialization support is
* appropriate for short term storage or RMI
* between applications running the same version of Swing.
* As of 1.4, support for long term storage of all JavaBeans™
* has been added to the <code>java.beans</code> package.
* Please see {@link java.beans.XMLEncoder}.
*
* @author Sergey A. Malenkov
*
* @since 1.7
*/
public
class
StrokeBorder
extends
AbstractBorder
{
private
final
BasicStroke
stroke
;
private
final
Paint
paint
;
/**
* Creates a border of the specified {@code stroke}.
* The component's foreground color will be used to render the border.
*
* @param stroke the {@link BasicStroke} object used to stroke a shape
*
* @throws NullPointerException if the specified {@code stroke} is {@code null}
*/
public
StrokeBorder
(
BasicStroke
stroke
)
{
this
(
stroke
,
null
);
}
/**
* Creates a border of the specified {@code stroke} and {@code paint}.
* If the specified {@code paint} is {@code null},
* the component's foreground color will be used to render the border.
*
* @param stroke the {@link BasicStroke} object used to stroke a shape
* @param paint the {@link Paint} object used to generate a color
*
* @throws NullPointerException if the specified {@code stroke} is {@code null}
*/
@ConstructorProperties
({
"stroke"
,
"paint"
})
public
StrokeBorder
(
BasicStroke
stroke
,
Paint
paint
)
{
if
(
stroke
==
null
)
{
throw
new
NullPointerException
(
"border's stroke"
);
}
this
.
stroke
=
stroke
;
this
.
paint
=
paint
;
}
/**
* Paints the border for the specified component
* with the specified position and size.
*
* @param c the component for which this border is being painted
* @param g the paint graphics
* @param x the x position of the painted border
* @param y the y position of the painted border
* @param width the width of the painted border
* @param height the height of the painted border
*
* @throws NullPointerException if the specified {@code c} or {@code g} are {@code null}
*/
@Override
public
void
paintBorder
(
Component
c
,
Graphics
g
,
int
x
,
int
y
,
int
width
,
int
height
)
{
float
size
=
this
.
stroke
.
getLineWidth
();
if
(
size
>
0.0f
)
{
g
=
g
.
create
();
if
(
g
instanceof
Graphics2D
)
{
Graphics2D
g2d
=
(
Graphics2D
)
g
;
g2d
.
setStroke
(
this
.
stroke
);
g2d
.
setPaint
(
this
.
paint
!=
null
?
this
.
paint
:
c
.
getForeground
());
g2d
.
setRenderingHint
(
RenderingHints
.
KEY_ANTIALIASING
,
RenderingHints
.
VALUE_ANTIALIAS_ON
);
g2d
.
draw
(
new
Rectangle2D
.
Float
(
x
+
size
/
2
,
y
+
size
/
2
,
width
-
size
,
height
-
size
));
}
g
.
dispose
();
}
}
/**
* Reinitializes the {@code insets} parameter
* with this border's current insets.
* All insets are equal to the line width of the stroke.
*
* @param c the component for which this border insets value applies
* @param insets the {@code Insets} object to be reinitialized
* @return the reinitialized {@code insets} parameter
*
* @throws NullPointerException if the specified {@code insets} is {@code null}
*/
@Override
public
Insets
getBorderInsets
(
Component
c
,
Insets
insets
)
{
int
size
=
(
int
)
Math
.
ceil
(
this
.
stroke
.
getLineWidth
());
insets
.
set
(
size
,
size
,
size
,
size
);
return
insets
;
}
/**
* Returns the {@link BasicStroke} object used to stroke a shape
* during the border rendering.
*
* @return the {@link BasicStroke} object
*/
public
BasicStroke
getStroke
()
{
return
this
.
stroke
;
}
/**
* Returns the {@link Paint} object used to generate a color
* during the border rendering.
*
* @return the {@link Paint} object or {@code null}
* if the {@code paint} parameter is not set
*/
public
Paint
getPaint
()
{
return
this
.
paint
;
}
}
src/share/classes/javax/swing/plaf/basic/BasicScrollPaneUI.java
浏览文件 @
b6363f21
...
...
@@ -362,6 +362,14 @@ public class BasicScrollPaneUI
* @since 1.6
*/
public
int
getBaseline
(
JComponent
c
,
int
width
,
int
height
)
{
if
(
c
==
null
)
{
throw
new
NullPointerException
(
"Component must be non-null"
);
}
if
(
width
<
0
||
height
<
0
)
{
throw
new
IllegalArgumentException
(
"Width and height must be >= 0"
);
}
JViewport
viewport
=
scrollpane
.
getViewport
();
Insets
spInsets
=
scrollpane
.
getInsets
();
int
y
=
spInsets
.
top
;
...
...
src/share/classes/javax/swing/plaf/synth/SynthTabbedPaneUI.java
浏览文件 @
b6363f21
...
...
@@ -115,9 +115,6 @@ public class SynthTabbedPaneUI extends BasicTabbedPaneUI
return
new
SynthTabbedPaneUI
();
}
private
SynthTabbedPaneUI
()
{
}
private
boolean
scrollableTabLayoutEnabled
()
{
return
(
tabPane
.
getTabLayoutPolicy
()
==
JTabbedPane
.
SCROLL_TAB_LAYOUT
);
}
...
...
src/share/classes/javax/swing/table/DefaultTableCellRenderer.java
浏览文件 @
b6363f21
...
...
@@ -186,6 +186,9 @@ public class DefaultTableCellRenderer extends JLabel
*/
public
Component
getTableCellRendererComponent
(
JTable
table
,
Object
value
,
boolean
isSelected
,
boolean
hasFocus
,
int
row
,
int
column
)
{
if
(
table
==
null
)
{
return
this
;
}
Color
fg
=
null
;
Color
bg
=
null
;
...
...
src/share/classes/javax/swing/text/DefaultCaret.java
浏览文件 @
b6363f21
...
...
@@ -1334,13 +1334,13 @@ public class DefaultCaret extends Rectangle implements Caret, FocusListener, Mou
&&
component
.
getClientProperty
(
"JPasswordField.cutCopyAllowed"
)
!=
Boolean
.
TRUE
)
{
//fix for 4793761
StringBu
ff
er
txt
=
null
;
StringBu
ild
er
txt
=
null
;
char
echoChar
=
((
JPasswordField
)
component
).
getEchoChar
();
int
p0
=
Math
.
min
(
getDot
(),
getMark
());
int
p1
=
Math
.
max
(
getDot
(),
getMark
());
for
(
int
i
=
p0
;
i
<
p1
;
i
++)
{
if
(
txt
==
null
)
{
txt
=
new
StringBu
ff
er
();
txt
=
new
StringBu
ild
er
();
}
txt
.
append
(
echoChar
);
}
...
...
@@ -1675,7 +1675,6 @@ public class DefaultCaret extends Rectangle implements Caret, FocusListener, Mou
}
return
;
}
int
adjust
=
0
;
int
offset
=
e
.
getOffset
();
int
length
=
e
.
getLength
();
int
newDot
=
dot
;
...
...
@@ -1759,7 +1758,6 @@ public class DefaultCaret extends Rectangle implements Caret, FocusListener, Mou
}
int
offs0
=
e
.
getOffset
();
int
offs1
=
offs0
+
e
.
getLength
();
int
adjust
=
0
;
int
newDot
=
dot
;
boolean
adjustDotBias
=
false
;
int
newMark
=
mark
;
...
...
src/share/classes/javax/swing/text/DefaultStyledDocument.java
浏览文件 @
b6363f21
...
...
@@ -132,7 +132,7 @@ public class DefaultStyledDocument extends AbstractDocument implements StyledDoc
// install the content
Content
c
=
getContent
();
int
n
=
data
.
length
;
StringBu
ffer
sb
=
new
StringBuff
er
();
StringBu
ilder
sb
=
new
StringBuild
er
();
for
(
int
i
=
0
;
i
<
n
;
i
++)
{
ElementSpec
es
=
data
[
i
];
if
(
es
.
getLength
()
>
0
)
{
...
...
@@ -191,7 +191,7 @@ public class DefaultStyledDocument extends AbstractDocument implements StyledDoc
// install the content
Content
c
=
getContent
();
int
n
=
data
.
length
;
StringBu
ffer
sb
=
new
StringBuff
er
();
StringBu
ilder
sb
=
new
StringBuild
er
();
for
(
int
i
=
0
;
i
<
n
;
i
++)
{
ElementSpec
es
=
data
[
i
];
if
(
es
.
getLength
()
>
0
)
{
...
...
src/share/classes/javax/swing/text/InternationalFormatter.java
浏览文件 @
b6363f21
...
...
@@ -30,7 +30,6 @@ import java.text.*;
import
java.text.AttributedCharacterIterator.Attribute
;
import
java.util.*
;
import
javax.swing.*
;
import
javax.swing.text.*
;
/**
* <code>InternationalFormatter</code> extends <code>DefaultFormatter</code>,
...
...
@@ -875,7 +874,6 @@ public class InternationalFormatter extends DefaultFormatter {
(
f
instanceof
AttributedCharacterIterator
.
Attribute
))
{
AttributedCharacterIterator
.
Attribute
field
=
(
AttributedCharacterIterator
.
Attribute
)
f
;
int
index
=
0
;
iterator
.
first
();
while
(
iterator
.
getIndex
()
<
start
)
{
...
...
src/share/classes/javax/swing/text/JTextComponent.java
浏览文件 @
b6363f21
...
...
@@ -35,10 +35,7 @@ import java.util.HashMap;
import
java.util.Hashtable
;
import
java.util.Enumeration
;
import
java.util.Vector
;
import
java.util.Iterator
;
import
java.util.Map
;
import
java.util.Map.Entry
;
import
java.util.Set
;
import
java.util.concurrent.*
;
...
...
@@ -4058,7 +4055,7 @@ public abstract class JTextComponent extends JComponent implements Scrollable, A
private
static
final
Object
KEYMAP_TABLE
=
new
StringBuilder
(
"JTextComponent_KeymapTable"
);
private
JTextComponent
editor
;
//
// member variables used for on-the-spot input method
// editing style support
...
...
@@ -4748,14 +4745,14 @@ public abstract class JTextComponent extends JComponent implements Scrollable, A
processKeyEvent
(
ke
);
}
}
else
{
StringBu
ffer
strBuf
=
new
StringBuff
er
();
StringBu
ilder
strBuf
=
new
StringBuild
er
();
for
(
char
c
=
text
.
current
();
commitCount
>
0
;
c
=
text
.
next
(),
commitCount
--)
{
strBuf
.
append
(
c
);
}
// map it to an ActionEvent
mapCommittedTextToAction
(
new
String
(
strBuf
));
mapCommittedTextToAction
(
strBuf
.
toString
(
));
}
// Remember latest committed text end index
...
...
@@ -4801,7 +4798,7 @@ public abstract class JTextComponent extends JComponent implements Scrollable, A
private
void
createComposedTextAttribute
(
int
composedIndex
,
AttributedCharacterIterator
text
)
{
Document
doc
=
getDocument
();
StringBu
ffer
strBuf
=
new
StringBuff
er
();
StringBu
ilder
strBuf
=
new
StringBuild
er
();
// create attributed string with no attributes
for
(
char
c
=
text
.
setIndex
(
composedIndex
);
...
...
@@ -4809,7 +4806,7 @@ public abstract class JTextComponent extends JComponent implements Scrollable, A
strBuf
.
append
(
c
);
}
composedTextContent
=
new
String
(
strBuf
);
composedTextContent
=
strBuf
.
toString
(
);
composedTextAttribute
=
new
SimpleAttributeSet
();
composedTextAttribute
.
addAttribute
(
StyleConstants
.
ComposedTextAttribute
,
new
AttributedString
(
text
,
composedIndex
,
text
.
getEndIndex
()));
...
...
src/share/classes/javax/swing/text/MaskFormatter.java
浏览文件 @
b6363f21
...
...
@@ -29,7 +29,6 @@ import java.io.*;
import
java.text.*
;
import
java.util.*
;
import
javax.swing.*
;
import
javax.swing.text.*
;
/**
* <code>MaskFormatter</code> is used to format and edit strings. The behavior
...
...
@@ -385,7 +384,7 @@ public class MaskFormatter extends DefaultFormatter {
*/
public
String
valueToString
(
Object
value
)
throws
ParseException
{
String
sValue
=
(
value
==
null
)
?
""
:
value
.
toString
();
StringBu
ffer
result
=
new
StringBuff
er
();
StringBu
ilder
result
=
new
StringBuild
er
();
String
placeholder
=
getPlaceholder
();
int
[]
valueCounter
=
{
0
};
...
...
@@ -484,7 +483,7 @@ public class MaskFormatter extends DefaultFormatter {
* Invokes <code>append</code> on the mask characters in
* <code>mask</code>.
*/
private
void
append
(
StringBu
ff
er
result
,
String
value
,
int
[]
index
,
private
void
append
(
StringBu
ild
er
result
,
String
value
,
int
[]
index
,
String
placeholder
,
MaskCharacter
[]
mask
)
throws
ParseException
{
for
(
int
counter
=
0
,
maxCounter
=
mask
.
length
;
...
...
@@ -611,13 +610,13 @@ public class MaskFormatter extends DefaultFormatter {
* Removes the literal characters from the passed in string.
*/
private
String
stripLiteralChars
(
String
string
)
{
StringBu
ff
er
sb
=
null
;
StringBu
ild
er
sb
=
null
;
int
last
=
0
;
for
(
int
counter
=
0
,
max
=
string
.
length
();
counter
<
max
;
counter
++){
if
(
isLiteral
(
counter
))
{
if
(
sb
==
null
)
{
sb
=
new
StringBu
ff
er
();
sb
=
new
StringBu
ild
er
();
if
(
counter
>
0
)
{
sb
.
append
(
string
.
substring
(
0
,
counter
));
}
...
...
@@ -715,10 +714,10 @@ public class MaskFormatter extends DefaultFormatter {
*/
boolean
canReplace
(
ReplaceHolder
rh
)
{
// This method is rather long, but much of the burden is in
// maintaining a String and swapping to a StringBu
ff
er only if
// maintaining a String and swapping to a StringBu
ild
er only if
// absolutely necessary.
if
(!
getAllowsInvalid
())
{
StringBu
ff
er
replace
=
null
;
StringBu
ild
er
replace
=
null
;
String
text
=
rh
.
text
;
int
tl
=
(
text
!=
null
)
?
text
.
length
()
:
0
;
...
...
@@ -737,7 +736,7 @@ public class MaskFormatter extends DefaultFormatter {
char
aChar
=
text
.
charAt
(
textIndex
);
if
(
aChar
!=
getCharacter
(
rh
.
offset
+
counter
,
aChar
))
{
if
(
replace
==
null
)
{
replace
=
new
StringBu
ff
er
();
replace
=
new
StringBu
ild
er
();
if
(
textIndex
>
0
)
{
replace
.
append
(
text
.
substring
(
0
,
textIndex
));
}
...
...
@@ -758,7 +757,7 @@ public class MaskFormatter extends DefaultFormatter {
}
}
else
if
(
textIndex
>
0
)
{
replace
=
new
StringBu
ff
er
(
max
);
replace
=
new
StringBu
ild
er
(
max
);
replace
.
append
(
text
.
substring
(
0
,
textIndex
));
replace
.
append
(
getLiteral
(
rh
.
offset
+
counter
));
if
(
textIndex
<
tl
)
{
...
...
@@ -780,7 +779,7 @@ public class MaskFormatter extends DefaultFormatter {
else
if
(
textIndex
>=
tl
)
{
// placeholder
if
(
replace
==
null
)
{
replace
=
new
StringBu
ff
er
();
replace
=
new
StringBu
ild
er
();
if
(
text
!=
null
)
{
replace
.
append
(
text
);
}
...
...
@@ -863,7 +862,7 @@ public class MaskFormatter extends DefaultFormatter {
* Appends the necessary character in <code>formatting</code> at
* <code>index</code> to <code>buff</code>.
*/
public
void
append
(
StringBu
ff
er
buff
,
String
formatting
,
int
[]
index
,
public
void
append
(
StringBu
ild
er
buff
,
String
formatting
,
int
[]
index
,
String
placeholder
)
throws
ParseException
{
boolean
inString
=
index
[
0
]
<
formatting
.
length
();
...
...
src/share/classes/javax/swing/text/NumberFormatter.java
浏览文件 @
b6363f21
...
...
@@ -27,7 +27,6 @@ package javax.swing.text;
import
java.lang.reflect.*
;
import
java.text.*
;
import
java.util.*
;
import
javax.swing.text.*
;
/**
* <code>NumberFormatter</code> subclasses <code>InternationalFormatter</code>
...
...
@@ -132,7 +131,7 @@ public class NumberFormatter extends InternationalFormatter {
DecimalFormatSymbols
dfs
=
getDecimalFormatSymbols
();
if
(
dfs
!=
null
)
{
StringBu
ffer
sb
=
new
StringBuff
er
();
StringBu
ilder
sb
=
new
StringBuild
er
();
sb
.
append
(
dfs
.
getCurrencySymbol
());
sb
.
append
(
dfs
.
getDecimalSeparator
());
...
...
@@ -239,13 +238,6 @@ public class NumberFormatter extends InternationalFormatter {
return
null
;
}
/**
*/
private
boolean
isValidInsertionCharacter
(
char
aChar
)
{
return
(
Character
.
isDigit
(
aChar
)
||
specialChars
.
indexOf
(
aChar
)
!=
-
1
);
}
/**
* Subclassed to return false if <code>text</code> contains in an invalid
* character to insert, that is, it is not a digit
...
...
@@ -402,28 +394,6 @@ public class NumberFormatter extends InternationalFormatter {
return
false
;
}
/**
* Returns true if the range offset to length identifies the only
* integer field.
*/
private
boolean
isOnlyIntegerField
(
int
offset
,
int
length
)
{
if
(
isValidMask
())
{
int
start
=
getAttributeStart
(
NumberFormat
.
Field
.
INTEGER
);
if
(
start
!=
-
1
)
{
AttributedCharacterIterator
iterator
=
getIterator
();
iterator
.
setIndex
(
start
);
if
(
offset
>
start
||
iterator
.
getRunLimit
(
NumberFormat
.
Field
.
INTEGER
)
>
(
offset
+
length
))
{
return
false
;
}
return
true
;
}
}
return
false
;
}
/**
* Invoked to toggle the sign. For this to work the value class
* must have a single arg constructor that takes a String.
...
...
src/share/classes/javax/swing/text/PlainDocument.java
浏览文件 @
b6363f21
...
...
@@ -25,7 +25,6 @@
package
javax.swing.text
;
import
java.util.Vector
;
import
javax.swing.event.*
;
/**
* A plain document that maintains no character attributes. The
...
...
@@ -118,7 +117,7 @@ public class PlainDocument extends AbstractDocument {
Object
filterNewlines
=
getProperty
(
"filterNewlines"
);
if
((
filterNewlines
instanceof
Boolean
)
&&
filterNewlines
.
equals
(
Boolean
.
TRUE
))
{
if
((
str
!=
null
)
&&
(
str
.
indexOf
(
'\n'
)
>=
0
))
{
StringBu
ffer
filtered
=
new
StringBuff
er
(
str
);
StringBu
ilder
filtered
=
new
StringBuild
er
(
str
);
int
n
=
filtered
.
length
();
for
(
int
i
=
0
;
i
<
n
;
i
++)
{
if
(
filtered
.
charAt
(
i
)
==
'\n'
)
{
...
...
@@ -204,11 +203,9 @@ public class PlainDocument extends AbstractDocument {
}
}
if
(
hasBreaks
)
{
int
rmCount
=
1
;
removed
.
addElement
(
rmCandidate
);
if
((
offset
+
length
==
rmOffs1
)
&&
(
lastOffset
!=
rmOffs1
)
&&
((
index
+
1
)
<
lineMap
.
getElementCount
()))
{
rmCount
+=
1
;
Element
e
=
lineMap
.
getElement
(
index
+
1
);
removed
.
addElement
(
e
);
rmOffs1
=
e
.
getEndOffset
();
...
...
src/share/classes/javax/swing/text/TabSet.java
浏览文件 @
b6363f21
...
...
@@ -199,7 +199,7 @@ public class TabSet implements Serializable
*/
public
String
toString
()
{
int
tabCount
=
getTabCount
();
StringBu
ffer
buffer
=
new
StringBuff
er
(
"[ "
);
StringBu
ilder
buffer
=
new
StringBuild
er
(
"[ "
);
for
(
int
counter
=
0
;
counter
<
tabCount
;
counter
++)
{
if
(
counter
>
0
)
...
...
src/share/classes/javax/swing/text/html/FormView.java
浏览文件 @
b6363f21
...
...
@@ -362,7 +362,7 @@ public class FormView extends ComponentView implements ActionListener {
*/
public
void
actionPerformed
(
ActionEvent
evt
)
{
Element
element
=
getElement
();
StringBu
ffer
dataBuffer
=
new
StringBuff
er
();
StringBu
ilder
dataBuffer
=
new
StringBuild
er
();
HTMLDocument
doc
=
(
HTMLDocument
)
getDocument
();
AttributeSet
attr
=
element
.
getAttributes
();
...
...
@@ -508,7 +508,7 @@ public class FormView extends ComponentView implements ActionListener {
*/
protected
void
imageSubmit
(
String
imageData
)
{
StringBu
ffer
dataBuffer
=
new
StringBuff
er
();
StringBu
ilder
dataBuffer
=
new
StringBuild
er
();
Element
elem
=
getElement
();
HTMLDocument
hdoc
=
(
HTMLDocument
)
elem
.
getDocument
();
getFormData
(
dataBuffer
);
...
...
@@ -589,7 +589,7 @@ public class FormView extends ComponentView implements ActionListener {
* @param targetElement the element that triggered the
* form submission
*/
void
getFormData
(
StringBuff
er
buffer
)
{
private
void
getFormData
(
StringBuild
er
buffer
)
{
Element
formE
=
getFormElement
();
if
(
formE
!=
null
)
{
ElementIterator
it
=
new
ElementIterator
(
formE
);
...
...
@@ -623,7 +623,7 @@ public class FormView extends ComponentView implements ActionListener {
* data is loaded in name/value pairs.
*
*/
private
void
loadElementDataIntoBuffer
(
Element
elem
,
StringBu
ff
er
buffer
)
{
private
void
loadElementDataIntoBuffer
(
Element
elem
,
StringBu
ild
er
buffer
)
{
AttributeSet
attr
=
elem
.
getAttributes
();
String
name
=
(
String
)
attr
.
getAttribute
(
HTML
.
Attribute
.
NAME
);
...
...
@@ -692,29 +692,6 @@ public class FormView extends ComponentView implements ActionListener {
}
if
(
path
!=
null
&&
path
.
length
()
>
0
)
{
value
=
path
;
/*
try {
Reader reader = new BufferedReader(new FileReader(path));
StringBuffer buffer = new StringBuffer();
char[] cBuff = new char[1024];
int read;
try {
while ((read = reader.read(cBuff)) != -1) {
buffer.append(cBuff, 0, read);
}
} catch (IOException ioe) {
buffer = null;
}
try {
reader.close();
} catch (IOException ioe) {}
if (buffer != null) {
value = buffer.toString();
}
} catch (IOException ioe) {}
*/
}
}
return
value
;
...
...
@@ -740,7 +717,7 @@ public class FormView extends ComponentView implements ActionListener {
* form element. Basically, only items that are selected
* and have their name attribute set are added to the buffer.
*/
private
void
loadSelectData
(
AttributeSet
attr
,
StringBu
ff
er
buffer
)
{
private
void
loadSelectData
(
AttributeSet
attr
,
StringBu
ild
er
buffer
)
{
String
name
=
(
String
)
attr
.
getAttribute
(
HTML
.
Attribute
.
NAME
);
if
(
name
==
null
)
{
...
...
@@ -771,7 +748,7 @@ public class FormView extends ComponentView implements ActionListener {
* URLEncoder.encode() method before being added to the
* buffer.
*/
private
void
appendBuffer
(
StringBu
ff
er
buffer
,
String
name
,
String
value
)
{
private
void
appendBuffer
(
StringBu
ild
er
buffer
,
String
name
,
String
value
)
{
if
(
buffer
.
length
()
>
0
)
{
buffer
.
append
(
'&'
);
}
...
...
src/share/classes/javax/swing/text/html/MinimalHTMLWriter.java
浏览文件 @
b6363f21
...
...
@@ -691,11 +691,11 @@ public class MinimalHTMLWriter extends AbstractWriter {
if
(
styleNameMapping
==
null
)
{
return
style
;
}
StringBu
ff
er
sb
=
null
;
StringBu
ild
er
sb
=
null
;
for
(
int
counter
=
style
.
length
()
-
1
;
counter
>=
0
;
counter
--)
{
if
(!
isValidCharacter
(
style
.
charAt
(
counter
)))
{
if
(
sb
==
null
)
{
sb
=
new
StringBu
ff
er
(
style
);
sb
=
new
StringBu
ild
er
(
style
);
}
sb
.
setCharAt
(
counter
,
'a'
);
}
...
...
src/share/classes/javax/swing/text/html/StyleSheet.java
浏览文件 @
b6363f21
...
...
@@ -998,7 +998,7 @@ public class StyleSheet extends StyleContext {
void
addRule
(
String
[]
selector
,
AttributeSet
declaration
,
boolean
isLinked
)
{
int
n
=
selector
.
length
;
StringBu
ffer
sb
=
new
StringBuff
er
();
StringBu
ilder
sb
=
new
StringBuild
er
();
sb
.
append
(
selector
[
0
]);
for
(
int
counter
=
1
;
counter
<
n
;
counter
++)
{
sb
.
append
(
' '
);
...
...
src/share/classes/javax/swing/text/html/parser/Parser.java
浏览文件 @
b6363f21
...
...
@@ -1470,7 +1470,7 @@ class Parser implements DTDConstants {
*/
public
String
parseDTDMarkup
()
throws
IOException
{
StringBu
ffer
strBuff
=
new
StringBuff
er
();
StringBu
ilder
strBuff
=
new
StringBuild
er
();
ch
=
readCh
();
while
(
true
)
{
switch
(
ch
)
{
...
...
src/share/classes/javax/swing/text/rtf/AbstractFilter.java
浏览文件 @
b6363f21
...
...
@@ -160,7 +160,7 @@ abstract class AbstractFilter extends OutputStream
public
void
write
(
byte
[]
buf
,
int
off
,
int
len
)
throws
IOException
{
StringBu
ff
er
accumulator
=
null
;
StringBu
ild
er
accumulator
=
null
;
while
(
len
>
0
)
{
short
b
=
(
short
)
buf
[
off
];
...
...
@@ -178,7 +178,7 @@ abstract class AbstractFilter extends OutputStream
char
ch
=
translationTable
[
b
];
if
(
ch
!=
(
char
)
0
)
{
if
(
accumulator
==
null
)
accumulator
=
new
StringBu
ff
er
();
accumulator
=
new
StringBu
ild
er
();
accumulator
.
append
(
ch
);
}
}
...
...
src/share/classes/sun/util/resources/LocaleNames.properties
浏览文件 @
b6363f21
...
...
@@ -228,6 +228,492 @@ za=Zhuang
zh
=
Chinese
zu
=
Zulu
# key is ISO 639.2 language code
aar
=
Afar
abk
=
Abkhazian
ace
=
Achinese
ach
=
Acoli
ada
=
Adangme
ady
=
Adyghe
afa
=
Afro-Asiatic
afh
=
Afrihili
afr
=
Afrikaans
ain
=
Ainu
aka
=
Akan
akk
=
Akkadian
alb
=
Albanian
ale
=
Aleut
alg
=
Algonquian
alt
=
Southern Altai
amh
=
Amharic
ang
=
English, Old (ca.450-1100)
anp
=
Angika
apa
=
Apache
ara
=
Arabic
arc
=
Official Aramaic (700-300 BCE)
arg
=
Aragonese
arm
=
Armenian
arn
=
Mapudungun
arp
=
Arapaho
art
=
Artificial
arw
=
Arawak
asm
=
Assamese
ast
=
Asturian
ath
=
Athapascan
aus
=
Australian
ava
=
Avaric
ave
=
Avestan
awa
=
Awadhi
aym
=
Aymara
aze
=
Azerbaijani
bad
=
Banda
bai
=
Bamileke
bak
=
Bashkir
bal
=
Baluchi
bam
=
Bambara
ban
=
Balinese
baq
=
Basque
bas
=
Basa
bat
=
Baltic
bej
=
Beja
bel
=
Belarusian
bem
=
Bemba
ben
=
Bengali
ber
=
Berber
bho
=
Bhojpuri
bih
=
Bihari
bik
=
Bikol
bin
=
Bini
bis
=
Bislama
bla
=
Siksika
bnt
=
Bantu
bos
=
Bosnian
bra
=
Braj
bre
=
Breton
btk
=
Batak
bua
=
Buriat
bug
=
Buginese
bul
=
Bulgarian
bur
=
Burmese
byn
=
Blin
cad
=
Caddo
cai
=
Central American Indian
car
=
Galibi Carib
cat
=
Catalan
cau
=
Caucasian
ceb
=
Cebuano
cel
=
Celtic
cha
=
Chamorro
chb
=
Chibcha
che
=
Chechen
chg
=
Chagatai
chi
=
Chinese
chk
=
Chuukese
chm
=
Mari
chn
=
Chinook jargon
cho
=
Choctaw
chp
=
Chipewyan
chr
=
Cherokee
chu
=
Church Slavic
chv
=
Chuvash
chy
=
Cheyenne
cmc
=
Chamic
cop
=
Coptic
cor
=
Cornish
cos
=
Corsican
cpe
=
Creoles and pidgins, English based
cpf
=
Creoles and pidgins, French-based
cpp
=
Creoles and pidgins, Portuguese-based
cre
=
Cree
crh
=
Crimean Tatar
crp
=
Creoles and pidgins
csb
=
Kashubian
cus
=
Cushitic
cze
=
Czech
dak
=
Dakota
dan
=
Danish
dar
=
Dargwa
day
=
Land Dayak
del
=
Delaware
den
=
Slave (Athapascan)
dgr
=
Dogrib
din
=
Dinka
div
=
Divehi
doi
=
Dogri
dra
=
Dravidian
dsb
=
Lower Sorbian
dua
=
Duala
dum
=
Dutch, Middle (ca.1050-1350)
dut
=
Dutch
dyu
=
Dyula
dzo
=
Dzongkha
efi
=
Efik
egy
=
Egyptian (Ancient)
eka
=
Ekajuk
elx
=
Elamite
eng
=
English
enm
=
English, Middle (1100-1500)
epo
=
Esperanto
est
=
Estonian
ewe
=
Ewe
ewo
=
Ewondo
fan
=
Fang
fao
=
Faroese
fat
=
Fanti
fij
=
Fijian
fil
=
Filipino
fin
=
Finnish
fiu
=
Finno-Ugrian
fon
=
Fon
fre
=
French
frm
=
French, Middle (ca.1400-1600)
fro
=
French, Old (842-ca.1400)
frr
=
Northern Frisian
frs
=
Eastern Frisian
fry
=
Western Frisian
ful
=
Fulah
fur
=
Friulian
gaa
=
Ga
gay
=
Gayo
gba
=
Gbaya
gem
=
Germanic
geo
=
Georgian
ger
=
German
gez
=
Geez
gil
=
Gilbertese
gla
=
Gaelic
gle
=
Irish
glg
=
Galician
glv
=
Manx
gmh
=
German, Middle High (ca.1050-1500)
goh
=
German, Old High (ca.750-1050)
gon
=
Gondi
gor
=
Gorontalo
got
=
Gothic
grb
=
Grebo
grc
=
Greek, Ancient (to 1453)
gre
=
Greek, Modern (1453-)
grn
=
Guarani
gsw
=
Swiss German
guj
=
Gujarati
gwi
=
Gwich'in
hai
=
Haida
hat
=
Haitian
hau
=
Hausa
haw
=
Hawaiian
heb
=
Hebrew
her
=
Herero
hil
=
Hiligaynon
him
=
Himachali
hin
=
Hindi
hit
=
Hittite
hmn
=
Hmong
hmo
=
Hiri Motu
hrv
=
Croatian
hsb
=
Upper Sorbian
hun
=
Hungarian
hup
=
Hupa
iba
=
Iban
ibo
=
Igbo
ice
=
Icelandic
ido
=
Ido
iii
=
Sichuan Yi
ijo
=
Ijo
iku
=
Inuktitut
ile
=
Interlingue
ilo
=
Iloko
ina
=
Interlingua (International Auxiliary Language Association)
inc
=
Indic
ind
=
Indonesian
ine
=
Indo-European
inh
=
Ingush
ipk
=
Inupiaq
ira
=
Iranian
iro
=
Iroquoian
ita
=
Italian
jav
=
Javanese
jbo
=
Lojban
jpn
=
Japanese
jpr
=
Judeo-Persian
jrb
=
Judeo-Arabic
kaa
=
Kara-Kalpak
kab
=
Kabyle
kac
=
Kachin
kal
=
Kalaallisut
kam
=
Kamba
kan
=
Kannada
kar
=
Karen
kas
=
Kashmiri
kau
=
Kanuri
kaw
=
Kawi
kaz
=
Kazakh
kbd
=
Kabardian
kha
=
Khasi
khi
=
Khoisan
khm
=
Central Khmer
kho
=
Khotanese
kik
=
Kikuyu
kin
=
Kinyarwanda
kir
=
Kirghiz
kmb
=
Kimbundu
kok
=
Konkani
kom
=
Komi
kon
=
Kongo
kor
=
Korean
kos
=
Kosraean
kpe
=
Kpelle
krc
=
Karachay-Balkar
krl
=
Karelian
kro
=
Kru
kru
=
Kurukh
kua
=
Kuanyama
kum
=
Kumyk
kur
=
Kurdish
kut
=
Kutenai
lad
=
Ladino
lah
=
Lahnda
lam
=
Lamba
lao
=
Lao
lat
=
Latin
lav
=
Latvian
lez
=
Lezghian
lim
=
Limburgan
lin
=
Lingala
lit
=
Lithuanian
lol
=
Mongo
loz
=
Lozi
ltz
=
Luxembourgish
lua
=
Luba-Lulua
lub
=
Luba-Katanga
lug
=
Ganda
lui
=
Luiseno
lun
=
Lunda
luo
=
Luo (Kenya and Tanzania)
lus
=
Lushai
mac
=
Macedonian
mad
=
Madurese
mag
=
Magahi
mah
=
Marshallese
mai
=
Maithili
mak
=
Makasar
mal
=
Malayalam
man
=
Mandingo
mao
=
Maori
map
=
Austronesian
mar
=
Marathi
mas
=
Masai
may
=
Malay
mdf
=
Moksha
mdr
=
Mandar
men
=
Mende
mga
=
Irish, Middle (900-1200)
mic
=
Mi'kmaq
min
=
Minangkabau
mis
=
Uncoded
mkh
=
Mon-Khmer
mlg
=
Malagasy
mlt
=
Maltese
mnc
=
Manchu
mni
=
Manipuri
mno
=
Manobo
moh
=
Mohawk
mon
=
Mongolian
mos
=
Mossi
mul
=
Multiple
mun
=
Munda
mus
=
Creek
mwl
=
Mirandese
mwr
=
Marwari
myn
=
Mayan
myv
=
Erzya
nah
=
Nahuatl
nai
=
North American Indian
nap
=
Neapolitan
nau
=
Nauru
nav
=
Navajo
nbl
=
Ndebele, South
nde
=
Ndebele, North
ndo
=
Ndonga
nds
=
Low German
nep
=
Nepali
new
=
Nepal Bhasa
nia
=
Nias
nic
=
Niger-Kordofanian
niu
=
Niuean
nno
=
Norwegian Nynorsk
nob
=
Bokm
\u
00e5l, Norwegian
nog
=
Nogai
non
=
Norse, Old
nor
=
Norwegian
nqo
=
N'Ko
nso
=
Pedi
nub
=
Nubian
nwc
=
Classical Newari
nya
=
Chichewa
nym
=
Nyamwezi
nyn
=
Nyankole
nyo
=
Nyoro
nzi
=
Nzima
oci
=
Occitan (post 1500)
oji
=
Ojibwa
ori
=
Oriya
orm
=
Oromo
osa
=
Osage
oss
=
Ossetian
ota
=
Turkish, Ottoman (1500-1928)
oto
=
Otomian
paa
=
Papuan
pag
=
Pangasinan
pal
=
Pahlavi
pam
=
Pampanga
pan
=
Panjabi
pap
=
Papiamento
pau
=
Palauan
peo
=
Persian, Old (ca.600-400 B.C.)
per
=
Persian
phi
=
Philippine
phn
=
Phoenician
pli
=
Pali
pol
=
Polish
pon
=
Pohnpeian
por
=
Portuguese
pra
=
Prakrit
pro
=
Proven
\u
00e7al, Old (to 1500)
pus
=
Pushto; Pashto
que
=
Quechua
raj
=
Rajasthani
rap
=
Rapanui
rar
=
Rarotongan
roa
=
Romance
roh
=
Romansh
rom
=
Romany
rum
=
Romanian
run
=
Rundi
rup
=
Aromanian
rus
=
Russian
sad
=
Sandawe
sag
=
Sango
sah
=
Yakut
sai
=
South American Indian
sal
=
Salishan
sam
=
Samaritan Aramaic
san
=
Sanskrit
sas
=
Sasak
sat
=
Santali
scn
=
Sicilian
sco
=
Scots
sel
=
Selkup
sem
=
Semitic
sga
=
Irish, Old (to 900)
sgn
=
Sign
shn
=
Shan
sid
=
Sidamo
sin
=
Sinhala
sio
=
Siouan
sit
=
Sino-Tibetan
sla
=
Slavic
slo
=
Slovak
slv
=
Slovenian
sma
=
Southern Sami
sme
=
Northern Sami
smi
=
Sami
smj
=
Lule Sami
smn
=
Inari Sami
smo
=
Samoan
sms
=
Skolt Sami
sna
=
Shona
snd
=
Sindhi
snk
=
Soninke
sog
=
Sogdian
som
=
Somali
son
=
Songhai
sot
=
Sotho, Southern
spa
=
Spanish
srd
=
Sardinian
srn
=
Sranan Tongo
srp
=
Serbian
srr
=
Serer
ssa
=
Nilo-Saharan
ssw
=
Swati
suk
=
Sukuma
sun
=
Sundanese
sus
=
Susu
sux
=
Sumerian
swa
=
Swahili
swe
=
Swedish
syc
=
Classical Syriac
syr
=
Syriac
tah
=
Tahitian
tai
=
Tai
tam
=
Tamil
tat
=
Tatar
tel
=
Telugu
tem
=
Timne
ter
=
Tereno
tet
=
Tetum
tgk
=
Tajik
tgl
=
Tagalog
tha
=
Thai
tib
=
Tibetan
tig
=
Tigre
tir
=
Tigrinya
tiv
=
Tiv
tkl
=
Tokelau
tlh
=
Klingon
tli
=
Tlingit
tmh
=
Tamashek
tog
=
Tonga (Nyasa)
ton
=
Tonga (Tonga Islands)
tpi
=
Tok Pisin
tsi
=
Tsimshian
tsn
=
Tswana
tso
=
Tsonga
tuk
=
Turkmen
tum
=
Tumbuka
tup
=
Tupi
tur
=
Turkish
tut
=
Altaic
tvl
=
Tuvalu
twi
=
Twi
tyv
=
Tuvinian
udm
=
Udmurt
uga
=
Ugaritic
uig
=
Uighur
ukr
=
Ukrainian
umb
=
Umbundu
und
=
Undetermined
urd
=
Urdu
uzb
=
Uzbek
vai
=
Vai
ven
=
Venda
vie
=
Vietnamese
vol
=
Volap
\u
00fck
vot
=
Votic
wak
=
Wakashan
wal
=
Wolaitta
war
=
Waray
was
=
Washo
wel
=
Welsh
wen
=
Sorbian
wln
=
Walloon
wol
=
Wolof
xal
=
Kalmyk
xho
=
Xhosa
yao
=
Yao
yap
=
Yapese
yid
=
Yiddish
yor
=
Yoruba
ypk
=
Yupik
zap
=
Zapotec
zbl
=
Blissymbols
zen
=
Zenaga
zha
=
Zhuang
znd
=
Zande
zul
=
Zulu
zun
=
Zuni
zxx
=
No linguistic content
zza
=
Zaza
# script names
# key is ISO 15924 script code
...
...
src/share/native/java/lang/System.c
浏览文件 @
b6363f21
...
...
@@ -219,11 +219,14 @@ Java_java_lang_System_initProperties(JNIEnv *env, jclass cla, jobject props)
/*
* user.language
* user.country, user.variant (if user's environment specifies them)
* user.
script, user.
country, user.variant (if user's environment specifies them)
* file.encoding
* file.encoding.pkg
*/
PUTPROP
(
props
,
"user.language"
,
sprops
->
language
);
if
(
sprops
->
script
)
{
PUTPROP
(
props
,
"user.script"
,
sprops
->
script
);
}
if
(
sprops
->
country
)
{
PUTPROP
(
props
,
"user.country"
,
sprops
->
country
);
}
...
...
@@ -305,11 +308,12 @@ Java_java_lang_System_initProperties(JNIEnv *env, jclass cla, jobject props)
}
/*
* unset "user.language", "user.country", and "user.variant"
* unset "user.language", "user.
script", "user.
country", and "user.variant"
* in order to tell whether the command line option "-DXXXX=YYYY" is
* specified or not. They will be reset in fillI18nProps() below.
*/
REMOVEPROP
(
props
,
"user.language"
);
REMOVEPROP
(
props
,
"user.script"
);
REMOVEPROP
(
props
,
"user.country"
);
REMOVEPROP
(
props
,
"user.variant"
);
REMOVEPROP
(
props
,
"file.encoding"
);
...
...
@@ -328,6 +332,8 @@ Java_java_lang_System_initProperties(JNIEnv *env, jclass cla, jobject props)
/* reconstruct i18n related properties */
fillI18nProps
(
env
,
props
,
"user.language"
,
sprops
->
display_language
,
sprops
->
format_language
,
putID
,
getPropID
);
fillI18nProps
(
env
,
props
,
"user.script"
,
sprops
->
display_script
,
sprops
->
format_script
,
putID
,
getPropID
);
fillI18nProps
(
env
,
props
,
"user.country"
,
sprops
->
display_country
,
sprops
->
format_country
,
putID
,
getPropID
);
fillI18nProps
(
env
,
props
,
"user.variant"
,
...
...
src/share/native/java/lang/java_props.h
浏览文件 @
b6363f21
...
...
@@ -55,6 +55,9 @@ typedef struct {
char
*
language
;
char
*
format_language
;
char
*
display_language
;
char
*
script
;
char
*
format_script
;
char
*
display_script
;
char
*
country
;
char
*
format_country
;
char
*
display_country
;
...
...
src/solaris/native/java/lang/java_props_md.c
浏览文件 @
b6363f21
...
...
@@ -117,7 +117,8 @@ setPathEnvironment(char *envstring)
#define P_tmpdir "/var/tmp"
#endif
static
int
ParseLocale
(
int
cat
,
char
**
std_language
,
char
**
std_country
,
char
**
std_variant
,
char
**
std_encoding
)
{
static
int
ParseLocale
(
int
cat
,
char
**
std_language
,
char
**
std_script
,
char
**
std_country
,
char
**
std_variant
,
char
**
std_encoding
)
{
char
temp
[
64
];
char
*
language
=
NULL
,
*
country
=
NULL
,
*
variant
=
NULL
,
*
encoding
=
NULL
;
...
...
@@ -189,6 +190,14 @@ static int ParseLocale(int cat, char ** std_language, char ** std_country, char
if
(
mapLookup
(
locale_aliases
,
temp
,
&
p
))
{
strcpy
(
temp
,
p
);
// check the "encoding_variant" again, if any.
if
((
p
=
strchr
(
temp
,
'.'
))
!=
NULL
)
{
strcpy
(
encoding_variant
,
p
);
/* Copy the leading '.' */
*
p
=
'\0'
;
}
else
if
((
p
=
strchr
(
temp
,
'@'
))
!=
NULL
)
{
strcpy
(
encoding_variant
,
p
);
/* Copy the leading '@' */
*
p
=
'\0'
;
}
}
language
=
temp
;
...
...
@@ -219,11 +228,18 @@ static int ParseLocale(int cat, char ** std_language, char ** std_country, char
mapLookup
(
country_names
,
country
,
std_country
);
}
/* Normalize the variant name. Note that we only use
* variants listed in the mapping array; others are ignored. */
if
(
std_variant
!=
NULL
&&
variant
!=
NULL
)
{
/* Normalize the script and variant name. Note that we only use
* variants listed in the mapping array; others are ignored.
*/
if
(
variant
!=
NULL
)
{
if
(
std_script
!=
NULL
)
{
mapLookup
(
script_names
,
variant
,
std_script
);
}
if
(
std_variant
!=
NULL
)
{
mapLookup
(
variant_names
,
variant
,
std_variant
);
}
}
/* Normalize the encoding name. Note that we IGNORE the string
* 'encoding' extracted from the locale name above. Instead, we use the
...
...
@@ -358,11 +374,13 @@ GetJavaProperties(JNIEnv *env)
setlocale
(
LC_ALL
,
""
);
if
(
ParseLocale
(
LC_CTYPE
,
&
(
sprops
.
format_language
),
&
(
sprops
.
format_script
),
&
(
sprops
.
format_country
),
&
(
sprops
.
format_variant
),
&
(
sprops
.
encoding
)))
{
ParseLocale
(
LC_MESSAGES
,
&
(
sprops
.
language
),
&
(
sprops
.
script
),
&
(
sprops
.
country
),
&
(
sprops
.
variant
),
NULL
);
...
...
@@ -371,6 +389,7 @@ GetJavaProperties(JNIEnv *env)
sprops
.
encoding
=
"ISO8859-1"
;
}
sprops
.
display_language
=
sprops
.
language
;
sprops
.
display_script
=
sprops
.
script
;
sprops
.
display_country
=
sprops
.
country
;
sprops
.
display_variant
=
sprops
.
variant
;
sprops
.
sun_jnu_encoding
=
sprops
.
encoding
;
...
...
src/solaris/native/java/lang/locale_str.h
浏览文件 @
b6363f21
...
...
@@ -86,6 +86,8 @@
"wa"
,
"wa_BE"
,
"zh"
,
"zh_CN"
,
#ifdef __linux__
"bokmal"
,
"nb_NO"
,
"bokm\u00e5l"
,
"nb_NO"
,
"catalan"
,
"ca_ES"
,
"croatian"
,
"hr_HR"
,
"czech"
,
"cs_CZ"
,
...
...
@@ -93,9 +95,13 @@
"dansk"
,
"da_DK"
,
"deutsch"
,
"de_DE"
,
"dutch"
,
"nl_NL"
,
"eesti"
,
"et_EE"
,
"estonian"
,
"et_EE"
,
"finnish"
,
"fi_FI"
,
"fran
\xE7\x61
is"
,
"fr_FR"
,
"french"
,
"fr_FR"
,
"galego"
,
"gl_ES"
,
"galician"
,
"gl_ES"
,
"german"
,
"de_DE"
,
"greek"
,
"el_GR"
,
"hebrew"
,
"iw_IL"
,
...
...
@@ -104,7 +110,10 @@
"icelandic"
,
"is_IS"
,
"italian"
,
"it_IT"
,
"japanese"
,
"ja_JP"
,
"korean"
,
"ko_KR"
,
"lithuanian"
,
"lt_LT"
,
"norwegian"
,
"no_NO"
,
"nynorsk"
,
"nn_NO"
,
"polish"
,
"pl_PL"
,
"portuguese"
,
"pt_PT"
,
"romanian"
,
"ro_RO"
,
...
...
@@ -114,11 +123,16 @@
"slovenian"
,
"sl_SI"
,
"spanish"
,
"es_ES"
,
"swedish"
,
"sv_SE"
,
"thai"
,
"th_TH"
,
"turkish"
,
"tr_TR"
,
#else
"big5"
,
"zh_TW.Big5"
,
"chinese"
,
"zh_CN"
,
"iso_8859_1"
,
"en_US.ISO8859-1"
,
"iso_8859_15"
,
"en_US.ISO8859-15"
,
"japanese"
,
"ja_JP"
,
"no_NY"
,
"no_NO@nynorsk"
,
"sr_SP"
,
"sr_YU"
,
"tchinese"
,
"zh_TW"
,
#endif
""
...
...
@@ -361,6 +375,506 @@ static char *language_names[] = {
"japanese"
,
"ja"
,
"korean"
,
"ko"
,
#endif
/* ISO 639.2 codes */
"aar"
,
"aar"
,
"abk"
,
"abk"
,
"ace"
,
"ace"
,
"ach"
,
"ach"
,
"ada"
,
"ada"
,
"ady"
,
"ady"
,
"afa"
,
"afa"
,
"afh"
,
"afh"
,
"afr"
,
"afr"
,
"ain"
,
"ain"
,
"aka"
,
"aka"
,
"akk"
,
"akk"
,
"alb"
,
"alb"
,
"ale"
,
"ale"
,
"alg"
,
"alg"
,
"alt"
,
"alt"
,
"amh"
,
"amh"
,
"ang"
,
"ang"
,
"anp"
,
"anp"
,
"apa"
,
"apa"
,
"ara"
,
"ara"
,
"arc"
,
"arc"
,
"arg"
,
"arg"
,
"arm"
,
"arm"
,
"arn"
,
"arn"
,
"arp"
,
"arp"
,
"art"
,
"art"
,
"arw"
,
"arw"
,
"asm"
,
"asm"
,
"ast"
,
"ast"
,
"ath"
,
"ath"
,
"aus"
,
"aus"
,
"ava"
,
"ava"
,
"ave"
,
"ave"
,
"awa"
,
"awa"
,
"aym"
,
"aym"
,
"aze"
,
"aze"
,
"bad"
,
"bad"
,
"bai"
,
"bai"
,
"bak"
,
"bak"
,
"bal"
,
"bal"
,
"bam"
,
"bam"
,
"ban"
,
"ban"
,
"baq"
,
"baq"
,
"bas"
,
"bas"
,
"bat"
,
"bat"
,
"bej"
,
"bej"
,
"bel"
,
"bel"
,
"bem"
,
"bem"
,
"ben"
,
"ben"
,
"ber"
,
"ber"
,
"bho"
,
"bho"
,
"bih"
,
"bih"
,
"bik"
,
"bik"
,
"bin"
,
"bin"
,
"bis"
,
"bis"
,
"bla"
,
"bla"
,
"bnt"
,
"bnt"
,
"bos"
,
"bos"
,
"bra"
,
"bra"
,
"bre"
,
"bre"
,
"btk"
,
"btk"
,
"bua"
,
"bua"
,
"bug"
,
"bug"
,
"bul"
,
"bul"
,
"bur"
,
"bur"
,
"byn"
,
"byn"
,
"cad"
,
"cad"
,
"cai"
,
"cai"
,
"car"
,
"car"
,
"cat"
,
"cat"
,
"cau"
,
"cau"
,
"ceb"
,
"ceb"
,
"cel"
,
"cel"
,
"cha"
,
"cha"
,
"chb"
,
"chb"
,
"che"
,
"che"
,
"chg"
,
"chg"
,
"chi"
,
"chi"
,
"chk"
,
"chk"
,
"chm"
,
"chm"
,
"chn"
,
"chn"
,
"cho"
,
"cho"
,
"chp"
,
"chp"
,
"chr"
,
"chr"
,
"chu"
,
"chu"
,
"chv"
,
"chv"
,
"chy"
,
"chy"
,
"cmc"
,
"cmc"
,
"cop"
,
"cop"
,
"cor"
,
"cor"
,
"cos"
,
"cos"
,
"cpe"
,
"cpe"
,
"cpf"
,
"cpf"
,
"cpp"
,
"cpp"
,
"cre"
,
"cre"
,
"crh"
,
"crh"
,
"crp"
,
"crp"
,
"csb"
,
"csb"
,
"cus"
,
"cus"
,
"cze"
,
"cze"
,
"dak"
,
"dak"
,
"dan"
,
"dan"
,
"dar"
,
"dar"
,
"day"
,
"day"
,
"del"
,
"del"
,
"den"
,
"den"
,
"dgr"
,
"dgr"
,
"din"
,
"din"
,
"div"
,
"div"
,
"doi"
,
"doi"
,
"dra"
,
"dra"
,
"dsb"
,
"dsb"
,
"dua"
,
"dua"
,
"dum"
,
"dum"
,
"dut"
,
"dut"
,
"dyu"
,
"dyu"
,
"dzo"
,
"dzo"
,
"efi"
,
"efi"
,
"egy"
,
"egy"
,
"eka"
,
"eka"
,
"elx"
,
"elx"
,
"eng"
,
"eng"
,
"enm"
,
"enm"
,
"epo"
,
"epo"
,
"est"
,
"est"
,
"ewe"
,
"ewe"
,
"ewo"
,
"ewo"
,
"fan"
,
"fan"
,
"fao"
,
"fao"
,
"fat"
,
"fat"
,
"fij"
,
"fij"
,
"fil"
,
"fil"
,
"fin"
,
"fin"
,
"fiu"
,
"fiu"
,
"fon"
,
"fon"
,
"fre"
,
"fre"
,
"frm"
,
"frm"
,
"fro"
,
"fro"
,
"frr"
,
"frr"
,
"frs"
,
"frs"
,
"fry"
,
"fry"
,
"ful"
,
"ful"
,
"fur"
,
"fur"
,
"gaa"
,
"gaa"
,
"gay"
,
"gay"
,
"gba"
,
"gba"
,
"gem"
,
"gem"
,
"geo"
,
"geo"
,
"ger"
,
"ger"
,
"gez"
,
"gez"
,
"gil"
,
"gil"
,
"gla"
,
"gla"
,
"gle"
,
"gle"
,
"glg"
,
"glg"
,
"glv"
,
"glv"
,
"gmh"
,
"gmh"
,
"goh"
,
"goh"
,
"gon"
,
"gon"
,
"gor"
,
"gor"
,
"got"
,
"got"
,
"grb"
,
"grb"
,
"grc"
,
"grc"
,
"gre"
,
"gre"
,
"grn"
,
"grn"
,
"gsw"
,
"gsw"
,
"guj"
,
"guj"
,
"gwi"
,
"gwi"
,
"hai"
,
"hai"
,
"hat"
,
"hat"
,
"hau"
,
"hau"
,
"haw"
,
"haw"
,
"heb"
,
"heb"
,
"her"
,
"her"
,
"hil"
,
"hil"
,
"him"
,
"him"
,
"hin"
,
"hin"
,
"hit"
,
"hit"
,
"hmn"
,
"hmn"
,
"hmo"
,
"hmo"
,
"hrv"
,
"hrv"
,
"hsb"
,
"hsb"
,
"hun"
,
"hun"
,
"hup"
,
"hup"
,
"iba"
,
"iba"
,
"ibo"
,
"ibo"
,
"ice"
,
"ice"
,
"ido"
,
"ido"
,
"iii"
,
"iii"
,
"ijo"
,
"ijo"
,
"iku"
,
"iku"
,
"ile"
,
"ile"
,
"ilo"
,
"ilo"
,
"ina"
,
"ina"
,
"inc"
,
"inc"
,
"ind"
,
"ind"
,
"ine"
,
"ine"
,
"inh"
,
"inh"
,
"ipk"
,
"ipk"
,
"ira"
,
"ira"
,
"iro"
,
"iro"
,
"ita"
,
"ita"
,
"jav"
,
"jav"
,
"jbo"
,
"jbo"
,
"jpn"
,
"jpn"
,
"jpr"
,
"jpr"
,
"jrb"
,
"jrb"
,
"kaa"
,
"kaa"
,
"kab"
,
"kab"
,
"kac"
,
"kac"
,
"kal"
,
"kal"
,
"kam"
,
"kam"
,
"kan"
,
"kan"
,
"kar"
,
"kar"
,
"kas"
,
"kas"
,
"kau"
,
"kau"
,
"kaw"
,
"kaw"
,
"kaz"
,
"kaz"
,
"kbd"
,
"kbd"
,
"kha"
,
"kha"
,
"khi"
,
"khi"
,
"khm"
,
"khm"
,
"kho"
,
"kho"
,
"kik"
,
"kik"
,
"kin"
,
"kin"
,
"kir"
,
"kir"
,
"kmb"
,
"kmb"
,
"kok"
,
"kok"
,
"kom"
,
"kom"
,
"kon"
,
"kon"
,
"kor"
,
"kor"
,
"kos"
,
"kos"
,
"kpe"
,
"kpe"
,
"krc"
,
"krc"
,
"krl"
,
"krl"
,
"kro"
,
"kro"
,
"kru"
,
"kru"
,
"kua"
,
"kua"
,
"kum"
,
"kum"
,
"kur"
,
"kur"
,
"kut"
,
"kut"
,
"lad"
,
"lad"
,
"lah"
,
"lah"
,
"lam"
,
"lam"
,
"lao"
,
"lao"
,
"lat"
,
"lat"
,
"lav"
,
"lav"
,
"lez"
,
"lez"
,
"lim"
,
"lim"
,
"lin"
,
"lin"
,
"lit"
,
"lit"
,
"lol"
,
"lol"
,
"loz"
,
"loz"
,
"ltz"
,
"ltz"
,
"lua"
,
"lua"
,
"lub"
,
"lub"
,
"lug"
,
"lug"
,
"lui"
,
"lui"
,
"lun"
,
"lun"
,
"luo"
,
"luo"
,
"lus"
,
"lus"
,
"mac"
,
"mac"
,
"mad"
,
"mad"
,
"mag"
,
"mag"
,
"mah"
,
"mah"
,
"mai"
,
"mai"
,
"mak"
,
"mak"
,
"mal"
,
"mal"
,
"man"
,
"man"
,
"mao"
,
"mao"
,
"map"
,
"map"
,
"mar"
,
"mar"
,
"mas"
,
"mas"
,
"may"
,
"may"
,
"mdf"
,
"mdf"
,
"mdr"
,
"mdr"
,
"men"
,
"men"
,
"mga"
,
"mga"
,
"mic"
,
"mic"
,
"min"
,
"min"
,
"mis"
,
"mis"
,
"mkh"
,
"mkh"
,
"mlg"
,
"mlg"
,
"mlt"
,
"mlt"
,
"mnc"
,
"mnc"
,
"mni"
,
"mni"
,
"mno"
,
"mno"
,
"moh"
,
"moh"
,
"mon"
,
"mon"
,
"mos"
,
"mos"
,
"mul"
,
"mul"
,
"mun"
,
"mun"
,
"mus"
,
"mus"
,
"mwl"
,
"mwl"
,
"mwr"
,
"mwr"
,
"myn"
,
"myn"
,
"myv"
,
"myv"
,
"nah"
,
"nah"
,
"nai"
,
"nai"
,
"nap"
,
"nap"
,
"nau"
,
"nau"
,
"nav"
,
"nav"
,
"nbl"
,
"nbl"
,
"nde"
,
"nde"
,
"ndo"
,
"ndo"
,
"nds"
,
"nds"
,
"nep"
,
"nep"
,
"new"
,
"new"
,
"nia"
,
"nia"
,
"nic"
,
"nic"
,
"niu"
,
"niu"
,
"nno"
,
"nno"
,
"nob"
,
"nob"
,
"nog"
,
"nog"
,
"non"
,
"non"
,
"nor"
,
"nor"
,
"nqo"
,
"nqo"
,
"nso"
,
"nso"
,
"nub"
,
"nub"
,
"nwc"
,
"nwc"
,
"nya"
,
"nya"
,
"nym"
,
"nym"
,
"nyn"
,
"nyn"
,
"nyo"
,
"nyo"
,
"nzi"
,
"nzi"
,
"oci"
,
"oci"
,
"oji"
,
"oji"
,
"ori"
,
"ori"
,
"orm"
,
"orm"
,
"osa"
,
"osa"
,
"oss"
,
"oss"
,
"ota"
,
"ota"
,
"oto"
,
"oto"
,
"paa"
,
"paa"
,
"pag"
,
"pag"
,
"pal"
,
"pal"
,
"pam"
,
"pam"
,
"pan"
,
"pan"
,
"pap"
,
"pap"
,
"pau"
,
"pau"
,
"peo"
,
"peo"
,
"per"
,
"per"
,
"phi"
,
"phi"
,
"phn"
,
"phn"
,
"pli"
,
"pli"
,
"pol"
,
"pol"
,
"pon"
,
"pon"
,
"por"
,
"por"
,
"pra"
,
"pra"
,
"pro"
,
"pro"
,
"pus"
,
"pus"
,
"que"
,
"que"
,
"raj"
,
"raj"
,
"rap"
,
"rap"
,
"rar"
,
"rar"
,
"roa"
,
"roa"
,
"roh"
,
"roh"
,
"rom"
,
"rom"
,
"rum"
,
"rum"
,
"run"
,
"run"
,
"rup"
,
"rup"
,
"rus"
,
"rus"
,
"sad"
,
"sad"
,
"sag"
,
"sag"
,
"sah"
,
"sah"
,
"sai"
,
"sai"
,
"sal"
,
"sal"
,
"sam"
,
"sam"
,
"san"
,
"san"
,
"sas"
,
"sas"
,
"sat"
,
"sat"
,
"scn"
,
"scn"
,
"sco"
,
"sco"
,
"sel"
,
"sel"
,
"sem"
,
"sem"
,
"sga"
,
"sga"
,
"sgn"
,
"sgn"
,
"shn"
,
"shn"
,
"sid"
,
"sid"
,
"sin"
,
"sin"
,
"sio"
,
"sio"
,
"sit"
,
"sit"
,
"sla"
,
"sla"
,
"slo"
,
"slo"
,
"slv"
,
"slv"
,
"sma"
,
"sma"
,
"sme"
,
"sme"
,
"smi"
,
"smi"
,
"smj"
,
"smj"
,
"smn"
,
"smn"
,
"smo"
,
"smo"
,
"sms"
,
"sms"
,
"sna"
,
"sna"
,
"snd"
,
"snd"
,
"snk"
,
"snk"
,
"sog"
,
"sog"
,
"som"
,
"som"
,
"son"
,
"son"
,
"sot"
,
"sot"
,
"spa"
,
"spa"
,
"srd"
,
"srd"
,
"srn"
,
"srn"
,
"srp"
,
"srp"
,
"srr"
,
"srr"
,
"ssa"
,
"ssa"
,
"ssw"
,
"ssw"
,
"suk"
,
"suk"
,
"sun"
,
"sun"
,
"sus"
,
"sus"
,
"sux"
,
"sux"
,
"swa"
,
"swa"
,
"swe"
,
"swe"
,
"syc"
,
"syc"
,
"syr"
,
"syr"
,
"tah"
,
"tah"
,
"tai"
,
"tai"
,
"tam"
,
"tam"
,
"tat"
,
"tat"
,
"tel"
,
"tel"
,
"tem"
,
"tem"
,
"ter"
,
"ter"
,
"tet"
,
"tet"
,
"tgk"
,
"tgk"
,
"tgl"
,
"tgl"
,
"tha"
,
"tha"
,
"tib"
,
"tib"
,
"tig"
,
"tig"
,
"tir"
,
"tir"
,
"tiv"
,
"tiv"
,
"tkl"
,
"tkl"
,
"tlh"
,
"tlh"
,
"tli"
,
"tli"
,
"tmh"
,
"tmh"
,
"tog"
,
"tog"
,
"ton"
,
"ton"
,
"tpi"
,
"tpi"
,
"tsi"
,
"tsi"
,
"tsn"
,
"tsn"
,
"tso"
,
"tso"
,
"tuk"
,
"tuk"
,
"tum"
,
"tum"
,
"tup"
,
"tup"
,
"tur"
,
"tur"
,
"tut"
,
"tut"
,
"tvl"
,
"tvl"
,
"twi"
,
"twi"
,
"tyv"
,
"tyv"
,
"udm"
,
"udm"
,
"uga"
,
"uga"
,
"uig"
,
"uig"
,
"ukr"
,
"ukr"
,
"umb"
,
"umb"
,
"und"
,
"und"
,
"urd"
,
"urd"
,
"uzb"
,
"uzb"
,
"vai"
,
"vai"
,
"ven"
,
"ven"
,
"vie"
,
"vie"
,
"vol"
,
"vol"
,
"vot"
,
"vot"
,
"wak"
,
"wak"
,
"wal"
,
"wal"
,
"war"
,
"war"
,
"was"
,
"was"
,
"wel"
,
"wel"
,
"wen"
,
"wen"
,
"wln"
,
"wln"
,
"wol"
,
"wol"
,
"xal"
,
"xal"
,
"xho"
,
"xho"
,
"yao"
,
"yao"
,
"yap"
,
"yap"
,
"yid"
,
"yid"
,
"yor"
,
"yor"
,
"ypk"
,
"ypk"
,
"zap"
,
"zap"
,
"zbl"
,
"zbl"
,
"zen"
,
"zen"
,
"zha"
,
"zha"
,
"znd"
,
"znd"
,
"zul"
,
"zul"
,
"zun"
,
"zun"
,
"zxx"
,
"zxx"
,
"zza"
,
"zza"
,
""
,
};
/*
* Linux/Solaris script string to Java script name mapping table.
*/
static
char
*
script_names
[]
=
{
#ifdef __linux__
"cyrillic"
,
"Cyrl"
,
"devanagari"
,
"Deva"
,
"iqtelif"
,
"Latn"
,
"latin"
,
"Latn"
,
#endif
""
,
};
...
...
@@ -503,6 +1017,7 @@ static char *country_names[] = {
"MA"
,
"MA"
,
"MC"
,
"MC"
,
"MD"
,
"MD"
,
"ME"
,
"ME"
,
"MG"
,
"MG"
,
"MH"
,
"MH"
,
"MK"
,
"MK"
,
...
...
@@ -554,6 +1069,7 @@ static char *country_names[] = {
"RN"
,
"US"
,
// used on Linux, not clear what it stands for
#endif
"RO"
,
"RO"
,
"RS"
,
"RS"
,
"RU"
,
"RU"
,
"RW"
,
"RW"
,
"SA"
,
"SA"
,
...
...
src/windows/bin/java_md.c
浏览文件 @
b6363f21
...
...
@@ -51,6 +51,92 @@ static jboolean GetJVMPath(const char *jrepath, const char *jvmtype,
static
jboolean
GetJREPath
(
char
*
path
,
jint
pathsize
);
static
void
EnsureJreInstallation
(
const
char
*
jrepath
);
/* We supports warmup for UI stack that is performed in parallel
* to VM initialization.
* This helps to improve startup of UI application as warmup phase
* might be long due to initialization of OS or hardware resources.
* It is not CPU bound and therefore it does not interfere with VM init.
* Obviously such warmup only has sense for UI apps and therefore it needs
* to be explicitly requested by passing -Dsun.awt.warmup=true property
* (this is always the case for plugin/javaws).
*
* Implementation launches new thread after VM starts and use it to perform
* warmup code (platform dependent).
* This thread is later reused as AWT toolkit thread as graphics toolkit
* often assume that they are used from the same thread they were launched on.
*
* At the moment we only support warmup for D3D. It only possible on windows
* and only if other flags do not prohibit this (e.g. OpenGL support requested).
*/
#undef ENABLE_AWT_PRELOAD
#ifndef JAVA_ARGS
/* turn off AWT preloading for javac, jar, etc */
#define ENABLE_AWT_PRELOAD
#endif
#ifdef ENABLE_AWT_PRELOAD
/* "AWT was preloaded" flag;
* turned on by AWTPreload().
*/
int
awtPreloaded
=
0
;
/* Calls a function with the name specified
* the function must be int(*fn)(void).
*/
int
AWTPreload
(
const
char
*
funcName
);
/* stops AWT preloading */
void
AWTPreloadStop
();
/* D3D preloading */
/* -1: not initialized; 0: OFF, 1: ON */
int
awtPreloadD3D
=
-
1
;
/* command line parameter to swith D3D preloading on */
#define PARAM_PRELOAD_D3D "-Dsun.awt.warmup"
/* D3D/OpenGL management parameters */
#define PARAM_NODDRAW "-Dsun.java2d.noddraw"
#define PARAM_D3D "-Dsun.java2d.d3d"
#define PARAM_OPENGL "-Dsun.java2d.opengl"
/* funtion in awt.dll (src/windows/native/sun/java2d/d3d/D3DPipelineManager.cpp) */
#define D3D_PRELOAD_FUNC "preloadD3D"
/* Extracts value of a parameter with the specified name
* from command line argument (returns pointer in the argument).
* Returns NULL if the argument does not contains the parameter.
* e.g.:
* GetParamValue("theParam", "theParam=value") returns pointer to "value".
*/
const
char
*
GetParamValue
(
const
char
*
paramName
,
const
char
*
arg
)
{
int
nameLen
=
JLI_StrLen
(
paramName
);
if
(
JLI_StrNCmp
(
paramName
,
arg
,
nameLen
)
==
0
)
{
/* arg[nameLen] is valid (may contain final NULL) */
if
(
arg
[
nameLen
]
==
'='
)
{
return
arg
+
nameLen
+
1
;
}
}
return
NULL
;
}
/* Checks if commandline argument contains property specified
* and analyze it as boolean property (true/false).
* Returns -1 if the argument does not contain the parameter;
* Returns 1 if the argument contains the parameter and its value is "true";
* Returns 0 if the argument contains the parameter and its value is "false".
*/
int
GetBoolParamValue
(
const
char
*
paramName
,
const
char
*
arg
)
{
const
char
*
paramValue
=
GetParamValue
(
paramName
,
arg
);
if
(
paramValue
!=
NULL
)
{
if
(
JLI_StrCaseCmp
(
paramValue
,
"true"
)
==
0
)
{
return
1
;
}
if
(
JLI_StrCaseCmp
(
paramValue
,
"false"
)
==
0
)
{
return
0
;
}
}
return
-
1
;
}
#endif
/* ENABLE_AWT_PRELOAD */
static
jboolean
_isjavaw
=
JNI_FALSE
;
...
...
@@ -132,6 +218,30 @@ CreateExecutionEnvironment(int *pargc, char ***pargv,
exit
(
4
);
}
/* If we got here, jvmpath has been correctly initialized. */
/* Check if we need preload AWT */
#ifdef ENABLE_AWT_PRELOAD
argv
=
*
pargv
;
for
(
i
=
0
;
i
<
*
pargc
;
i
++
)
{
/* Tests the "turn on" parameter only if not set yet. */
if
(
awtPreloadD3D
<
0
)
{
if
(
GetBoolParamValue
(
PARAM_PRELOAD_D3D
,
argv
[
i
])
==
1
)
{
awtPreloadD3D
=
1
;
}
}
/* Test parameters which can disable preloading if not already disabled. */
if
(
awtPreloadD3D
!=
0
)
{
if
(
GetBoolParamValue
(
PARAM_NODDRAW
,
argv
[
i
])
==
1
||
GetBoolParamValue
(
PARAM_D3D
,
argv
[
i
])
==
0
||
GetBoolParamValue
(
PARAM_OPENGL
,
argv
[
i
])
==
1
)
{
awtPreloadD3D
=
0
;
/* no need to test the rest of the parameters */
break
;
}
}
}
#endif
/* ENABLE_AWT_PRELOAD */
}
...
...
@@ -1087,6 +1197,40 @@ ContinueInNewThread0(int (JNICALL *continuation)(void *), jlong stack_size, void
0
,
&
thread_id
);
}
/* AWT preloading (AFTER main thread start) */
#ifdef ENABLE_AWT_PRELOAD
/* D3D preloading */
if
(
awtPreloadD3D
!=
0
)
{
char
*
envValue
;
/* D3D routines checks env.var J2D_D3D if no appropriate
* command line params was specified
*/
envValue
=
getenv
(
"J2D_D3D"
);
if
(
envValue
!=
NULL
&&
JLI_StrCaseCmp
(
envValue
,
"false"
)
==
0
)
{
awtPreloadD3D
=
0
;
}
/* Test that AWT preloading isn't disabled by J2D_D3D_PRELOAD env.var */
envValue
=
getenv
(
"J2D_D3D_PRELOAD"
);
if
(
envValue
!=
NULL
&&
JLI_StrCaseCmp
(
envValue
,
"false"
)
==
0
)
{
awtPreloadD3D
=
0
;
}
if
(
awtPreloadD3D
<
0
)
{
/* If awtPreloadD3D is still undefined (-1), test
* if it is turned on by J2D_D3D_PRELOAD env.var.
* By default it's turned OFF.
*/
awtPreloadD3D
=
0
;
if
(
envValue
!=
NULL
&&
JLI_StrCaseCmp
(
envValue
,
"true"
)
==
0
)
{
awtPreloadD3D
=
1
;
}
}
}
if
(
awtPreloadD3D
)
{
AWTPreload
(
D3D_PRELOAD_FUNC
);
}
#endif
/* ENABLE_AWT_PRELOAD */
if
(
thread_handle
)
{
WaitForSingleObject
(
thread_handle
,
INFINITE
);
GetExitCodeThread
(
thread_handle
,
&
rslt
);
...
...
@@ -1094,6 +1238,13 @@ ContinueInNewThread0(int (JNICALL *continuation)(void *), jlong stack_size, void
}
else
{
rslt
=
continuation
(
args
);
}
#ifdef ENABLE_AWT_PRELOAD
if
(
awtPreloaded
)
{
AWTPreloadStop
();
}
#endif
/* ENABLE_AWT_PRELOAD */
return
rslt
;
}
...
...
@@ -1140,3 +1291,98 @@ InitLauncher(boolean javaw)
_isjavaw
=
javaw
;
JLI_SetTraceLauncher
();
}
/* ============================== */
/* AWT preloading */
#ifdef ENABLE_AWT_PRELOAD
typedef
int
FnPreloadStart
(
void
);
typedef
void
FnPreloadStop
(
void
);
static
FnPreloadStop
*
fnPreloadStop
=
NULL
;
static
HMODULE
hPreloadAwt
=
NULL
;
/*
* Starts AWT preloading
*/
int
AWTPreload
(
const
char
*
funcName
)
{
int
result
=
-
1
;
/* load AWT library once (if several preload function should be called) */
if
(
hPreloadAwt
==
NULL
)
{
/* awt.dll is not loaded yet */
char
libraryPath
[
MAXPATHLEN
];
int
jrePathLen
=
0
;
HMODULE
hJava
=
NULL
;
HMODULE
hVerify
=
NULL
;
while
(
1
)
{
/* awt.dll depends on jvm.dll & java.dll;
* jvm.dll is already loaded, so we need only java.dll;
* java.dll depends on MSVCRT lib & verify.dll.
*/
if
(
!
GetJREPath
(
libraryPath
,
MAXPATHLEN
))
{
break
;
}
/* save path length */
jrePathLen
=
JLI_StrLen
(
libraryPath
);
/* load msvcrt 1st */
LoadMSVCRT
();
/* load verify.dll */
JLI_StrCat
(
libraryPath
,
"
\\
bin
\\
verify.dll"
);
hVerify
=
LoadLibrary
(
libraryPath
);
if
(
hVerify
==
NULL
)
{
break
;
}
/* restore jrePath */
libraryPath
[
jrePathLen
]
=
0
;
/* load java.dll */
JLI_StrCat
(
libraryPath
,
"
\\
bin
\\
"
JAVA_DLL
);
hJava
=
LoadLibrary
(
libraryPath
);
if
(
hJava
==
NULL
)
{
break
;
}
/* restore jrePath */
libraryPath
[
jrePathLen
]
=
0
;
/* load awt.dll */
JLI_StrCat
(
libraryPath
,
"
\\
bin
\\
awt.dll"
);
hPreloadAwt
=
LoadLibrary
(
libraryPath
);
if
(
hPreloadAwt
==
NULL
)
{
break
;
}
/* get "preloadStop" func ptr */
fnPreloadStop
=
(
FnPreloadStop
*
)
GetProcAddress
(
hPreloadAwt
,
"preloadStop"
);
break
;
}
}
if
(
hPreloadAwt
!=
NULL
)
{
FnPreloadStart
*
fnInit
=
(
FnPreloadStart
*
)
GetProcAddress
(
hPreloadAwt
,
funcName
);
if
(
fnInit
!=
NULL
)
{
/* don't forget to stop preloading */
awtPreloaded
=
1
;
result
=
fnInit
();
}
}
return
result
;
}
/*
* Terminates AWT preloading
*/
void
AWTPreloadStop
()
{
if
(
fnPreloadStop
!=
NULL
)
{
fnPreloadStop
();
}
}
#endif
/* ENABLE_AWT_PRELOAD */
src/windows/classes/sun/awt/windows/WInputMethod.java
浏览文件 @
b6363f21
...
...
@@ -169,7 +169,7 @@ public class WInputMethod extends InputMethodAdapter
locale
.
equals
(
Locale
.
JAPAN
)
&&
lang
.
equals
(
Locale
.
JAPANESE
)
||
locale
.
equals
(
Locale
.
KOREA
)
&&
lang
.
equals
(
Locale
.
KOREAN
))
{
if
(
isActive
)
{
setNativeLocale
(
locale
.
to
Strin
g
(),
onActivate
);
setNativeLocale
(
locale
.
to
LanguageTa
g
(),
onActivate
);
}
currentLocale
=
locale
;
return
true
;
...
...
src/windows/classes/sun/awt/windows/WToolkit.java
浏览文件 @
b6363f21
...
...
@@ -218,6 +218,8 @@ public class WToolkit extends SunToolkit implements Runnable {
private
static
native
void
postDispose
();
private
static
native
boolean
startToolkitThread
(
Runnable
thread
);
public
WToolkit
()
{
// Startup toolkit threads
if
(
PerformanceLogger
.
loggingEnabled
())
{
...
...
@@ -231,9 +233,6 @@ public class WToolkit extends SunToolkit implements Runnable {
// where notifyAll can be called before
// the "AWT-Windows" thread's parent thread is
// waiting, resulting in a deadlock on startup.
Thread
toolkitThread
=
new
Thread
(
this
,
"AWT-Windows"
);
toolkitThread
.
setDaemon
(
true
);
toolkitThread
.
setPriority
(
Thread
.
NORM_PRIORITY
+
1
);
/*
* Fix for 4701990.
...
...
@@ -242,7 +241,11 @@ public class WToolkit extends SunToolkit implements Runnable {
*/
AWTAutoShutdown
.
notifyToolkitThreadBusy
();
if
(!
startToolkitThread
(
this
))
{
Thread
toolkitThread
=
new
Thread
(
this
,
"AWT-Windows"
);
toolkitThread
.
setDaemon
(
true
);
toolkitThread
.
start
();
}
try
{
wait
();
...
...
@@ -263,6 +266,7 @@ public class WToolkit extends SunToolkit implements Runnable {
}
public
void
run
()
{
Thread
.
currentThread
().
setPriority
(
Thread
.
NORM_PRIORITY
+
1
);
boolean
startPump
=
init
();
if
(
startPump
)
{
...
...
src/windows/native/com/sun/media/sound/PLATFORM_API_WinOS_DirectSound.cpp
浏览文件 @
b6363f21
...
...
@@ -476,6 +476,7 @@ DS_StartBufferHelper::Data::~Data() {
DWORD
WINAPI
__stdcall
DS_StartBufferHelper
::
ThreadProc
(
void
*
param
)
{
::
CoInitialize
(
NULL
);
while
(
1
)
{
// wait for something to do
::
WaitForSingleObject
(
data
.
startEvent
,
INFINITE
);
...
...
@@ -492,6 +493,7 @@ DWORD WINAPI __stdcall DS_StartBufferHelper::ThreadProc(void *param)
}
::
SetEvent
(
data
.
startedEvent
);
}
::
CoUninitialize
();
return
0
;
}
...
...
src/windows/native/java/lang/java_props_md.c
浏览文件 @
b6363f21
...
...
@@ -43,11 +43,14 @@
#endif
typedef
void
(
WINAPI
*
PGNSI
)(
LPSYSTEM_INFO
);
static
void
SetupI18nProps
(
LCID
lcid
,
char
**
language
,
char
**
country
,
static
void
SetupI18nProps
(
LCID
lcid
,
char
**
language
,
char
**
script
,
char
**
country
,
char
**
variant
,
char
**
encoding
);
#define SHELL_KEY "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders"
#define PROPSIZE 9 // eight-letter + null terminator
#define SNAMESIZE 86 // max number of chars for LOCALE_SNAME is 85
static
char
*
getEncodingInternal
(
LCID
lcid
)
{
...
...
@@ -127,30 +130,31 @@ getEncodingFromLangID(LANGID langID)
return
getEncodingInternal
(
MAKELCID
(
langID
,
SORT_DEFAULT
));
}
// Returns BCP47 Language Tag
DllExport
const
char
*
getJavaIDFromLangID
(
LANGID
langID
)
{
char
*
lang
;
char
*
ctry
;
char
*
vrnt
;
char
*
enc
;
char
*
ret
=
malloc
(
16
);
char
*
elems
[
5
];
// lang, script, ctry, variant, encoding
char
*
ret
=
malloc
(
SNAMESIZE
);
int
index
;
SetupI18nProps
(
MAKELCID
(
langID
,
SORT_DEFAULT
),
&
lang
,
&
ctry
,
&
vrnt
,
&
enc
);
if
(
ctry
[
0
]
!=
'\0'
)
{
if
(
vrnt
[
0
]
!=
'\0'
)
{
sprintf
(
ret
,
"%s_%s_%s"
,
lang
,
ctry
,
vrnt
);
}
else
{
sprintf
(
ret
,
"%s_%s"
,
lang
,
ctry
);
SetupI18nProps
(
MAKELCID
(
langID
,
SORT_DEFAULT
),
&
(
elems
[
0
]),
&
(
elems
[
1
]),
&
(
elems
[
2
]),
&
(
elems
[
3
]),
&
(
elems
[
4
]));
// there always is the "language" tag
strcpy
(
ret
,
elems
[
0
]);
// append other elements, if any
for
(
index
=
1
;
index
<
4
;
index
++
)
{
if
((
elems
[
index
])[
0
]
!=
'\0'
)
{
strcat
(
ret
,
"-"
);
strcat
(
ret
,
elems
[
index
]);
}
}
else
{
strcpy
(
ret
,
lang
);
}
free
(
lang
);
free
(
ctry
);
free
(
vrnt
);
free
(
enc
);
for
(
index
=
0
;
index
<
5
;
index
++
)
{
free
(
elems
[
index
]);
}
return
ret
;
}
...
...
@@ -289,39 +293,38 @@ cpu_isalist(void)
return
NULL
;
}
#define PROPSIZE 3 // two-letter + null terminator
static
void
SetupI18nProps
(
LCID
lcid
,
char
**
language
,
char
**
country
,
SetupI18nProps
(
LCID
lcid
,
char
**
language
,
char
**
script
,
char
**
country
,
char
**
variant
,
char
**
encoding
)
{
/* script */
char
tmp
[
SNAMESIZE
];
*
script
=
malloc
(
PROPSIZE
);
if
(
GetLocaleInfo
(
lcid
,
LOCALE_SNAME
,
tmp
,
SNAMESIZE
)
==
0
||
sscanf
(
tmp
,
"%*[a-z
\\
-]%1[A-Z]%[a-z]"
,
*
script
,
&
((
*
script
)[
1
]))
==
0
||
strlen
(
*
script
)
!=
4
)
{
(
*
script
)[
0
]
=
'\0'
;
}
/* country */
*
country
=
malloc
(
PROPSIZE
);
if
(
GetLocaleInfo
(
lcid
,
LOCALE_SISO3166CTRYNAME
,
*
country
,
PROPSIZE
)
==
0
)
{
LOCALE_SISO3166CTRYNAME
,
*
country
,
PROPSIZE
)
==
0
&&
GetLocaleInfo
(
lcid
,
LOCALE_SISO3166CTRYNAME2
,
*
country
,
PROPSIZE
)
==
0
)
{
(
*
country
)[
0
]
=
'\0'
;
}
/* language */
*
language
=
malloc
(
PROPSIZE
);
if
(
lcid
==
0x46c
)
{
/* Windows returns non-existent language code "ns" for Northern Sotho.
* Defaults to en_US
*/
strcpy
(
*
language
,
"en"
);
strcpy
(
*
country
,
"US"
);
}
else
if
(
GetLocaleInfo
(
lcid
,
LOCALE_SISO639LANGNAME
,
*
language
,
PROPSIZE
)
==
0
)
{
if
(
lcid
==
0x465
)
{
/* for some reason, Windows returns "div" for this Divehi LCID, even though
* there is a two letter language code "dv". Tweak it here.
*/
strcpy
(
*
language
,
"dv"
);
strcpy
(
*
country
,
"MV"
);
}
else
{
if
(
GetLocaleInfo
(
lcid
,
LOCALE_SISO639LANGNAME
,
*
language
,
PROPSIZE
)
==
0
&&
GetLocaleInfo
(
lcid
,
LOCALE_SISO639LANGNAME2
,
*
language
,
PROPSIZE
)
==
0
)
{
/* defaults to en_US */
strcpy
(
*
language
,
"en"
);
strcpy
(
*
country
,
"US"
);
}
}
/* variant */
*
variant
=
malloc
(
PROPSIZE
);
...
...
@@ -564,7 +567,7 @@ GetJavaProperties(JNIEnv* env)
/*
* user.language
* user.country, user.variant (if user's environment specifies them)
* user.
script, user.
country, user.variant (if user's environment specifies them)
* file.encoding
* file.encoding.pkg
*/
...
...
@@ -582,16 +585,19 @@ GetJavaProperties(JNIEnv* env)
SetupI18nProps
(
userDefaultUILang
,
&
sprops
.
language
,
&
sprops
.
script
,
&
sprops
.
country
,
&
sprops
.
variant
,
&
display_encoding
);
SetupI18nProps
(
userDefaultLCID
,
&
sprops
.
format_language
,
&
sprops
.
format_script
,
&
sprops
.
format_country
,
&
sprops
.
format_variant
,
&
sprops
.
encoding
);
SetupI18nProps
(
userDefaultUILang
,
&
sprops
.
display_language
,
&
sprops
.
display_script
,
&
sprops
.
display_country
,
&
sprops
.
display_variant
,
&
display_encoding
);
...
...
src/windows/native/sun/java2d/d3d/D3DGraphicsDevice.cpp
浏览文件 @
b6363f21
...
...
@@ -36,22 +36,6 @@ extern jobject CreateDisplayMode(JNIEnv* env, jint width, jint height,
extern
void
addDisplayMode
(
JNIEnv
*
env
,
jobject
arrayList
,
jint
width
,
jint
height
,
jint
bitDepth
,
jint
refreshRate
);
void
InitD3D
(
void
*
pReturn
)
{
J2dTraceLn
(
J2D_TRACE_INFO
,
"InitD3D"
);
jboolean
*
pRet
=
(
jboolean
*
)
pReturn
;
D3DPipelineManager
*
pMgr
=
D3DPipelineManager
::
CreateInstance
();
if
(
pMgr
==
NULL
)
{
J2dTraceLn
(
J2D_TRACE_ERROR
,
"InitD3D: could not create or init d3d"
);
*
pRet
=
JNI_FALSE
;
}
else
{
J2dTraceLn
(
J2D_TRACE_INFO
,
"InitD3D: successfully initialized d3d"
);
*
pRet
=
JNI_TRUE
;
}
}
extern
"C"
{
/*
* Class: sun_java2d_d3d_D3DGraphicsDevice
...
...
@@ -63,8 +47,8 @@ JNIEXPORT jboolean JNICALL Java_sun_java2d_d3d_D3DGraphicsDevice_initD3D
{
J2dTraceLn
(
J2D_TRACE_INFO
,
"D3DGD_initD3D"
);
jboolean
result
=
JNI_FALSE
;
AwtToolkit
::
GetInstance
().
InvokeFunction
(
InitD3D
,
&
result
)
;
jboolean
result
=
D3DInitializer
::
GetInstance
().
EnsureInited
()
?
JNI_TRUE
:
JNI_FALSE
;
J2dTraceLn1
(
J2D_TRACE_INFO
,
"D3DGD_initD3D: result=%x"
,
result
);
return
result
;
}
...
...
src/windows/native/sun/java2d/d3d/D3DPipelineManager.cpp
浏览文件 @
b6363f21
...
...
@@ -40,6 +40,7 @@ static BOOL bNoHwCheck = (getenv("J2D_D3D_NO_HWCHECK") != NULL);
D3DPipelineManager
*
D3DPipelineManager
::
pMgr
=
NULL
;
D3DPipelineManager
*
D3DPipelineManager
::
CreateInstance
(
void
)
{
if
(
!
IsD3DEnabled
()
||
...
...
@@ -179,6 +180,12 @@ void D3DPipelineManager::NotifyAdapterEventListeners(UINT adapter,
HMONITOR
hMon
;
int
gdiScreen
;
D3DPipelineManager
*
pMgr
;
// fix for 6946559: if d3d preloading fails jmv may be NULL
if
(
jvm
==
NULL
)
{
return
;
}
JNIEnv
*
env
=
(
JNIEnv
*
)
JNU_GetEnv
(
jvm
,
JNI_VERSION_1_2
);
pMgr
=
D3DPipelineManager
::
GetInstance
();
...
...
@@ -934,3 +941,87 @@ HRESULT D3DPipelineManager::GetD3DContext(UINT adapterOrdinal,
*
ppd3dContext
=
pAdapters
[
adapterOrdinal
].
pd3dContext
;
return
res
;
}
//==============================================================
// D3DInitializer
//==============================================================
D3DInitializer
D3DInitializer
::
theInstance
;
D3DInitializer
::
D3DInitializer
()
:
bComInitialized
(
false
),
pAdapterIniters
(
NULL
)
{
}
D3DInitializer
::~
D3DInitializer
()
{
if
(
pAdapterIniters
)
{
delete
[]
pAdapterIniters
;
}
}
void
D3DInitializer
::
InitImpl
()
{
J2dRlsTraceLn
(
J2D_TRACE_INFO
,
"D3DInitializer::InitImpl"
);
if
(
SUCCEEDED
(
::
CoInitialize
(
NULL
)))
{
bComInitialized
=
true
;
}
D3DPipelineManager
*
pMgr
=
D3DPipelineManager
::
CreateInstance
();
if
(
pMgr
!=
NULL
)
{
UINT
adapterCount
=
pMgr
->
adapterCount
;
pAdapterIniters
=
new
D3DAdapterInitializer
[
adapterCount
];
for
(
UINT
i
=
0
;
i
<
adapterCount
;
i
++
)
{
pAdapterIniters
[
i
].
setAdapter
(
i
);
AwtToolkit
::
GetInstance
().
GetPreloadThread
().
AddAction
(
&
pAdapterIniters
[
i
]);
}
}
}
void
D3DInitializer
::
CleanImpl
(
bool
reInit
)
{
J2dRlsTraceLn1
(
J2D_TRACE_INFO
,
"D3DInitializer::CleanImpl (%s)"
,
reInit
?
"RELAUNCH"
:
"normal"
);
D3DPipelineManager
::
DeleteInstance
();
if
(
bComInitialized
)
{
CoUninitialize
();
}
}
void
D3DInitializer
::
D3DAdapterInitializer
::
InitImpl
()
{
J2dRlsTraceLn1
(
J2D_TRACE_INFO
,
"D3DAdapterInitializer::InitImpl(%d) started"
,
adapter
);
D3DPipelineManager
*
pMgr
=
D3DPipelineManager
::
GetInstance
();
if
(
pMgr
==
NULL
)
{
return
;
}
D3DContext
*
pd3dContext
;
pMgr
->
GetD3DContext
(
adapter
,
&
pd3dContext
);
J2dRlsTraceLn1
(
J2D_TRACE_INFO
,
"D3DAdapterInitializer::InitImpl(%d) finished"
,
adapter
);
}
void
D3DInitializer
::
D3DAdapterInitializer
::
CleanImpl
(
bool
reInit
)
{
// nothing to do - D3DPipelineManager cleans adapters
}
extern
"C"
{
/*
* Export function to start D3D preloading
* (called from java/javaw - see src/windows/bin/java-md.c)
*/
__declspec
(
dllexport
)
int
preloadD3D
()
{
J2dRlsTraceLn
(
J2D_TRACE_INFO
,
"AWT warmup: preloadD3D"
);
AwtToolkit
::
GetInstance
().
GetPreloadThread
().
AddAction
(
&
D3DInitializer
::
GetInstance
());
return
1
;
}
}
src/windows/native/sun/java2d/d3d/D3DPipelineManager.h
浏览文件 @
b6363f21
...
...
@@ -26,6 +26,7 @@
#include "D3DPipeline.h"
#include "D3DContext.h"
#include "awt_Toolkit.h"
typedef
class
D3DPipelineManager
*
LPD3DPIPELINEMANAGER
;
...
...
@@ -38,11 +39,15 @@ typedef struct D3DAdapter
class
D3DPIPELINE_API
D3DPipelineManager
{
public:
friend
class
D3DInitializer
;
private:
// creates and initializes instance of D3DPipelineManager, may return NULL
static
D3DPipelineManager
*
CreateInstance
(
void
);
// deletes the single instance of the manager
static
void
DeleteInstance
();
public:
// returns the single instance of the manager, may return NULL
static
D3DPipelineManager
*
GetInstance
(
void
);
...
...
@@ -143,3 +148,40 @@ private:
#define OS_ALL (OS_VISTA|OS_WINSERV_2008|OS_WINXP|OS_WINXP_64|OS_WINSERV_2003)
#define OS_UNKNOWN (~OS_ALL)
BOOL
D3DPPLM_OsVersionMatches
(
USHORT
osInfo
);
class
D3DInitializer
:
public
AwtToolkit
::
PreloadAction
{
private:
D3DInitializer
();
~
D3DInitializer
();
protected:
// PreloadAction overrides
virtual
void
InitImpl
();
virtual
void
CleanImpl
(
bool
reInit
);
public:
static
D3DInitializer
&
GetInstance
()
{
return
theInstance
;
}
private:
// single instance
static
D3DInitializer
theInstance
;
// adapter initializer class
class
D3DAdapterInitializer
:
public
AwtToolkit
::
PreloadAction
{
public:
void
setAdapter
(
UINT
adapter
)
{
this
->
adapter
=
adapter
;
}
protected:
// PreloadAction overrides
virtual
void
InitImpl
();
virtual
void
CleanImpl
(
bool
reInit
);
private:
UINT
adapter
;
};
// the flag indicates success of COM initialization
bool
bComInitialized
;
D3DAdapterInitializer
*
pAdapterIniters
;
};
src/windows/native/sun/java2d/windows/WindowsFlags.cpp
浏览文件 @
b6363f21
...
...
@@ -28,7 +28,8 @@
#include "WindowsFlags.h"
BOOL
accelReset
;
// reset registry 2d acceleration settings
BOOL
useD3D
;
// d3d enabled flag
BOOL
useD3D
=
TRUE
;
// d3d enabled flag
// initially is TRUE to allow D3D preloading
BOOL
forceD3DUsage
;
// force d3d on or off
jboolean
g_offscreenSharing
;
// JAWT accelerated surface sharing
BOOL
checkRegistry
;
// Diagnostic tool: outputs 2d registry settings
...
...
src/windows/native/sun/windows/awt_InputMethod.cpp
浏览文件 @
b6363f21
...
...
@@ -540,34 +540,15 @@ jobject CreateLocaleObject(JNIEnv *env, const char * name)
{
TRY
;
// get language, country, variant information
char
*
language
=
(
char
*
)
safe_Malloc
(
strlen
(
name
)
+
1
);
char
*
country
;
char
*
variant
;
DASSERT
(
!
safe_ExceptionOccurred
(
env
));
strcpy
(
language
,
name
);
for
(
country
=
language
;
*
country
!=
'_'
&&
*
country
!=
'\0'
;
country
++
);
if
(
*
country
==
'_'
)
{
*
country
++
=
'\0'
;
for
(
variant
=
country
;
*
variant
!=
'_'
&&
*
variant
!=
'\0'
;
variant
++
);
if
(
*
variant
==
'_'
)
{
*
variant
++
=
'\0'
;
}
}
else
{
variant
=
country
;
}
// create Locale object
jobject
langObj
=
env
->
NewStringUTF
(
language
);
jobject
ctryObj
=
env
->
NewStringUTF
(
country
);
jobject
vrntObj
=
env
->
NewStringUTF
(
variant
);
jobject
localeObj
=
JNU_NewObjectByName
(
env
,
"java/util/Locale"
,
"(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V"
,
langObj
,
ctryObj
,
vrntObj
);
free
(
language
);
env
->
DeleteLocalRef
(
langObj
);
env
->
DeleteLocalRef
(
ctryObj
);
env
->
DeleteLocalRef
(
vrntObj
);
jobject
langtagObj
=
env
->
NewStringUTF
(
name
);
jobject
localeObj
=
JNU_CallStaticMethodByName
(
env
,
NULL
,
"java/util/Locale"
,
"forLanguageTag"
,
"(Ljava/lang/String;)Ljava/util/Locale;"
,
langtagObj
).
l
;
env
->
DeleteLocalRef
(
langtagObj
);
return
localeObj
;
...
...
src/windows/native/sun/windows/awt_Toolkit.cpp
浏览文件 @
b6363f21
...
...
@@ -28,6 +28,7 @@
#include "awt.h"
#include <signal.h>
#include <windowsx.h>
#include <process.h>
#include "awt_DrawingSurface.h"
#include "awt_AWTEvent.h"
...
...
@@ -88,7 +89,7 @@ extern void DWMResetCompositionEnabled();
/* Initialize the Java VM instance variable when the library is
first loaded */
JavaVM
*
jvm
;
JavaVM
*
jvm
=
NULL
;
JNIEXPORT
jint
JNICALL
JNI_OnLoad
(
JavaVM
*
vm
,
void
*
reserved
)
...
...
@@ -358,6 +359,95 @@ HWND AwtToolkit::CreateToolkitWnd(LPCTSTR name)
return
hwnd
;
}
struct
ToolkitThreadProc_Data
{
bool
result
;
HANDLE
hCompleted
;
jobject
thread
;
};
void
ToolkitThreadProc
(
void
*
param
)
{
ToolkitThreadProc_Data
*
data
=
(
ToolkitThreadProc_Data
*
)
param
;
bool
bNotified
=
false
;
JNIEnv
*
env
;
JavaVMAttachArgs
attachArgs
;
attachArgs
.
version
=
JNI_VERSION_1_2
;
attachArgs
.
name
=
"AWT-Windows"
;
attachArgs
.
group
=
NULL
;
jint
res
=
jvm
->
AttachCurrentThreadAsDaemon
((
void
**
)
&
env
,
&
attachArgs
);
if
(
res
<
0
)
{
return
;
}
jobject
thread
=
env
->
NewGlobalRef
(
data
->
thread
);
if
(
thread
!=
NULL
)
{
jclass
cls
=
env
->
GetObjectClass
(
thread
);
if
(
cls
!=
NULL
)
{
jmethodID
runId
=
env
->
GetMethodID
(
cls
,
"run"
,
"()V"
);
if
(
runId
!=
NULL
)
{
data
->
result
=
true
;
::
SetEvent
(
data
->
hCompleted
);
bNotified
=
true
;
env
->
CallVoidMethod
(
thread
,
runId
);
if
(
env
->
ExceptionCheck
())
{
env
->
ExceptionDescribe
();
env
->
ExceptionClear
();
// TODO: handle
}
}
env
->
DeleteLocalRef
(
cls
);
}
env
->
DeleteGlobalRef
(
thread
);
}
if
(
!
bNotified
)
{
::
SetEvent
(
data
->
hCompleted
);
}
jvm
->
DetachCurrentThread
();
}
/*
* Class: sun_awt_windows_WToolkit
* Method: startToolkitThread
* Signature: (Ljava/lang/Runnable;)Z
*/
JNIEXPORT
jboolean
JNICALL
Java_sun_awt_windows_WToolkit_startToolkitThread
(
JNIEnv
*
env
,
jclass
cls
,
jobject
thread
)
{
AwtToolkit
&
tk
=
AwtToolkit
::
GetInstance
();
ToolkitThreadProc_Data
data
;
data
.
result
=
false
;
data
.
thread
=
env
->
NewGlobalRef
(
thread
);
if
(
data
.
thread
==
NULL
)
{
return
JNI_FALSE
;
}
data
.
hCompleted
=
::
CreateEvent
(
NULL
,
FALSE
,
FALSE
,
NULL
);
bool
result
=
tk
.
GetPreloadThread
()
.
InvokeAndTerminate
(
ToolkitThreadProc
,
&
data
);
if
(
result
)
{
::
WaitForSingleObject
(
data
.
hCompleted
,
INFINITE
);
result
=
data
.
result
;
}
else
{
// no awt preloading
// return back to the usual toolkit way
}
::
CloseHandle
(
data
.
hCompleted
);
env
->
DeleteGlobalRef
(
data
.
thread
);
return
result
?
JNI_TRUE
:
JNI_FALSE
;
}
BOOL
AwtToolkit
::
Initialize
(
BOOL
localPump
)
{
AwtToolkit
&
tk
=
AwtToolkit
::
GetInstance
();
...
...
@@ -371,6 +461,11 @@ BOOL AwtToolkit::Initialize(BOOL localPump) {
// ComCtl32Util was constructed but not disposed
ComCtl32Util
::
GetInstance
().
InitLibraries
();
if
(
!
localPump
)
{
// if preload thread was run, terminate it
preloadThread
.
Terminate
(
true
);
}
/* Register this toolkit's helper window */
VERIFY
(
tk
.
RegisterClass
()
!=
NULL
);
...
...
@@ -439,7 +534,7 @@ BOOL AwtToolkit::Dispose() {
// dispose Direct3D-related resources. This should be done
// before AwtObjectList::Cleanup() as the d3d will attempt to
// shutdown when the last of its windows is disposed of
D3D
PipelineManager
::
DeleteInstance
();
D3D
Initializer
::
GetInstance
().
Clean
();
AwtObjectList
::
Cleanup
();
AwtFont
::
Cleanup
();
...
...
@@ -1635,6 +1730,270 @@ void AwtToolkit::GetWindowRect(HWND hWnd, LPRECT lpRect)
::
GetWindowRect
(
hWnd
,
lpRect
);
}
/************************************************************************
* AWT preloading support
*/
bool
AwtToolkit
::
PreloadAction
::
EnsureInited
()
{
DWORD
_initThreadId
=
GetInitThreadID
();
if
(
_initThreadId
!=
0
)
{
// already inited
// ensure the action is inited on correct thread
PreloadThread
&
preloadThread
=
AwtToolkit
::
GetInstance
().
GetPreloadThread
();
if
(
_initThreadId
==
preloadThread
.
GetThreadId
())
{
if
(
!
preloadThread
.
IsWrongThread
())
{
return
true
;
}
// inited on preloadThread (wrongThread), not cleaned yet
// have to wait cleanup completion
preloadThread
.
Wait4Finish
();
}
else
{
// inited on other thread (Toolkit thread?)
// consider as correctly inited
return
true
;
}
}
// init on Toolkit thread
AwtToolkit
::
GetInstance
().
InvokeFunction
(
InitWrapper
,
this
);
return
true
;
}
DWORD
AwtToolkit
::
PreloadAction
::
GetInitThreadID
()
{
CriticalSection
::
Lock
lock
(
initLock
);
return
initThreadId
;
}
bool
AwtToolkit
::
PreloadAction
::
Clean
()
{
DWORD
_initThreadId
=
GetInitThreadID
();
if
(
_initThreadId
==
::
GetCurrentThreadId
())
{
// inited on this thread
Clean
(
false
);
return
true
;
}
return
false
;
}
/*static*/
void
AwtToolkit
::
PreloadAction
::
InitWrapper
(
void
*
param
)
{
PreloadAction
*
pThis
=
(
PreloadAction
*
)
param
;
pThis
->
Init
();
}
void
AwtToolkit
::
PreloadAction
::
Init
()
{
CriticalSection
::
Lock
lock
(
initLock
);
if
(
initThreadId
==
0
)
{
initThreadId
=
::
GetCurrentThreadId
();
InitImpl
();
}
}
void
AwtToolkit
::
PreloadAction
::
Clean
(
bool
reInit
)
{
CriticalSection
::
Lock
lock
(
initLock
);
if
(
initThreadId
!=
0
)
{
//ASSERT(initThreadId == ::GetCurrentThreadId());
CleanImpl
(
reInit
);
initThreadId
=
0
;
}
}
// PreloadThread implementation
AwtToolkit
::
PreloadThread
::
PreloadThread
()
:
status
(
None
),
wrongThread
(
false
),
threadId
(
0
),
pActionChain
(
NULL
),
pLastProcessedAction
(
NULL
),
execFunc
(
NULL
),
execParam
(
NULL
)
{
hFinished
=
::
CreateEvent
(
NULL
,
TRUE
,
FALSE
,
NULL
);
hAwake
=
::
CreateEvent
(
NULL
,
FALSE
,
FALSE
,
NULL
);
}
AwtToolkit
::
PreloadThread
::~
PreloadThread
()
{
//Terminate(false);
::
CloseHandle
(
hFinished
);
::
CloseHandle
(
hAwake
);
}
bool
AwtToolkit
::
PreloadThread
::
AddAction
(
AwtToolkit
::
PreloadAction
*
pAction
)
{
CriticalSection
::
Lock
lock
(
threadLock
);
if
(
status
>
Preloading
)
{
// too late - the thread already terminated or run as toolkit thread
return
false
;
}
if
(
pActionChain
==
NULL
)
{
// 1st action
pActionChain
=
pAction
;
}
else
{
// add the action to the chain
PreloadAction
*
pChain
=
pActionChain
;
while
(
true
)
{
PreloadAction
*
pNext
=
pChain
->
GetNext
();
if
(
pNext
==
NULL
)
{
break
;
}
pChain
=
pNext
;
}
pChain
->
SetNext
(
pAction
);
}
if
(
status
>
None
)
{
// the thread is already running (status == Preloading)
AwakeThread
();
return
true
;
}
// need to start thread
::
ResetEvent
(
hAwake
);
::
ResetEvent
(
hFinished
);
HANDLE
hThread
=
(
HANDLE
)
_beginthreadex
(
NULL
,
0x100000
,
StaticThreadProc
,
this
,
0
,
&
threadId
);
if
(
hThread
==
0
)
{
threadId
=
0
;
return
false
;
}
status
=
Preloading
;
::
CloseHandle
(
hThread
);
return
true
;
}
bool
AwtToolkit
::
PreloadThread
::
Terminate
(
bool
wrongThread
)
{
CriticalSection
::
Lock
lock
(
threadLock
);
if
(
status
!=
Preloading
)
{
return
false
;
}
execFunc
=
NULL
;
execParam
=
NULL
;
this
->
wrongThread
=
wrongThread
;
status
=
Cleaning
;
AwakeThread
();
return
true
;
}
bool
AwtToolkit
::
PreloadThread
::
InvokeAndTerminate
(
void
(
_cdecl
*
fn
)(
void
*
),
void
*
param
)
{
CriticalSection
::
Lock
lock
(
threadLock
);
if
(
status
!=
Preloading
)
{
return
false
;
}
execFunc
=
fn
;
execParam
=
param
;
status
=
fn
==
NULL
?
Cleaning
:
RunningToolkit
;
AwakeThread
();
return
true
;
}
/*static*/
unsigned
WINAPI
AwtToolkit
::
PreloadThread
::
StaticThreadProc
(
void
*
param
)
{
AwtToolkit
::
PreloadThread
*
pThis
=
(
AwtToolkit
::
PreloadThread
*
)
param
;
return
pThis
->
ThreadProc
();
}
unsigned
AwtToolkit
::
PreloadThread
::
ThreadProc
()
{
void
(
_cdecl
*
_execFunc
)(
void
*
)
=
NULL
;
void
*
_execParam
=
NULL
;
bool
_wrongThread
=
false
;
// initialization
while
(
true
)
{
PreloadAction
*
pAction
;
{
CriticalSection
::
Lock
lock
(
threadLock
);
if
(
status
!=
Preloading
)
{
// get invoke parameters
_execFunc
=
execFunc
;
_execParam
=
execParam
;
_wrongThread
=
wrongThread
;
break
;
}
pAction
=
GetNextAction
();
}
if
(
pAction
!=
NULL
)
{
pAction
->
Init
();
}
else
{
::
WaitForSingleObject
(
hAwake
,
INFINITE
);
}
}
// call a function from InvokeAndTerminate
if
(
_execFunc
!=
NULL
)
{
_execFunc
(
_execParam
);
}
else
{
// time to terminate..
}
// cleanup
{
CriticalSection
::
Lock
lock
(
threadLock
);
pLastProcessedAction
=
NULL
;
// goto 1st action in the chain
status
=
Cleaning
;
}
for
(
PreloadAction
*
pAction
=
GetNextAction
();
pAction
!=
NULL
;
pAction
=
GetNextAction
())
{
pAction
->
Clean
(
_wrongThread
);
}
// don't clear threadId! it is used by PreloadAction::EnsureInited
{
CriticalSection
::
Lock
lock
(
threadLock
);
status
=
Finished
;
}
::
SetEvent
(
hFinished
);
return
0
;
}
AwtToolkit
::
PreloadAction
*
AwtToolkit
::
PreloadThread
::
GetNextAction
()
{
CriticalSection
::
Lock
lock
(
threadLock
);
PreloadAction
*
pAction
=
(
pLastProcessedAction
==
NULL
)
?
pActionChain
:
pLastProcessedAction
->
GetNext
();
if
(
pAction
!=
NULL
)
{
pLastProcessedAction
=
pAction
;
}
return
pAction
;
}
extern
"C"
{
/* Terminates preload thread (if it's still alive
* - it may occur if the application doesn't use AWT).
* The function is called from launcher after completion main java thread.
*/
__declspec
(
dllexport
)
void
preloadStop
()
{
AwtToolkit
::
GetInstance
().
GetPreloadThread
().
Terminate
(
false
);
}
}
/************************************************************************
* Toolkit native methods
*/
...
...
src/windows/native/sun/windows/awt_Toolkit.h
浏览文件 @
b6363f21
...
...
@@ -465,6 +465,151 @@ public:
void
InstallMouseLowLevelHook
();
void
UninstallMouseLowLevelHook
();
/* AWT preloading (early Toolkit thread start)
*/
public:
/* Toolkit preload action class.
* Preload actions should be registered with
* AwtToolkit::getInstance().GetPreloadThread().AddAction().
* AwtToolkit thread calls InitImpl method at the beghining
* and CleanImpl(false) before exiting for all registered actions.
* If an application provides own Toolkit thread
* (sun.awt.windows.WToolkit.embeddedInit), the thread calls Clean(true)
* for each action.
*/
class
PreloadThread
;
// forward declaration
class
PreloadAction
{
friend
class
PreloadThread
;
public:
PreloadAction
()
:
initThreadId
(
0
),
pNext
(
NULL
)
{}
virtual
~
PreloadAction
()
{}
protected:
// called by PreloadThread or as result
// of EnsureInited() call (on Toolkit thread!).
virtual
void
InitImpl
()
=
0
;
// called by PreloadThread (before exiting).
// reInit == false: normal shutdown;
// reInit == true: PreloadThread is shutting down due external
// Toolkit thread was provided.
virtual
void
CleanImpl
(
bool
reInit
)
=
0
;
public:
// Initialized the action on the Toolkit thread if not yet initialized.
bool
EnsureInited
();
// returns thread ID which the action was inited on (0 if not inited)
DWORD
GetInitThreadID
();
// Allows to deinitialize action earlier.
// The method must be called on the Toolkit thread only.
// returns true on success,
// false if the action was inited on other thread.
bool
Clean
();
private:
unsigned
initThreadId
;
// lock for Init/Clean
CriticalSection
initLock
;
// Chain support (for PreloadThread)
PreloadAction
*
pNext
;
// for action chain used by PreloadThread
void
SetNext
(
PreloadAction
*
pNext
)
{
this
->
pNext
=
pNext
;
}
PreloadAction
*
GetNext
()
{
return
pNext
;
}
// wrapper for AwtToolkit::InvokeFunction
static
void
InitWrapper
(
void
*
param
);
void
Init
();
void
Clean
(
bool
reInit
);
};
/** Toolkit preload thread class.
*/
class
PreloadThread
{
public:
PreloadThread
();
~
PreloadThread
();
// adds action & start the thread if not yet started
bool
AddAction
(
PreloadAction
*
pAction
);
// sets termination flag; returns true if the thread is running.
// wrongThread specifies cause of the termination:
// false means termination on the application shutdown;
// wrongThread is used as reInit parameter for action cleanup.
bool
Terminate
(
bool
wrongThread
);
bool
InvokeAndTerminate
(
void
(
_cdecl
*
fn
)(
void
*
),
void
*
param
);
// waits for the the thread completion;
// use the method after Terminate() only if Terminate() returned true
INLINE
void
Wait4Finish
()
{
::
WaitForSingleObject
(
hFinished
,
INFINITE
);
}
INLINE
unsigned
GetThreadId
()
{
CriticalSection
::
Lock
lock
(
threadLock
);
return
threadId
;
}
INLINE
bool
IsWrongThread
()
{
CriticalSection
::
Lock
lock
(
threadLock
);
return
wrongThread
;
}
private:
// data access lock
CriticalSection
threadLock
;
// the thread status
enum
Status
{
None
=
-
1
,
// initial
Preloading
=
0
,
// preloading in progress
RunningToolkit
,
// Running as Toolkit thread
Cleaning
,
// exited from Toolkit thread proc, cleaning
Finished
//
}
status
;
// "wrong thread" flag
bool
wrongThread
;
// thread proc (calls (this)param->ThreadProc())
static
unsigned
WINAPI
StaticThreadProc
(
void
*
param
);
unsigned
ThreadProc
();
INLINE
void
AwakeThread
()
{
::
SetEvent
(
hAwake
);
}
// if threadId != 0 -> we are running
unsigned
threadId
;
// ThreadProc sets the event on exit
HANDLE
hFinished
;
// ThreadProc waits on the event for NewAction/Terminate/InvokeAndTerminate
HANDLE
hAwake
;
// function/param to invoke (InvokeAndTerminate)
// if execFunc == NULL => just terminate
void
(
_cdecl
*
execFunc
)(
void
*
);
void
*
execParam
;
// action chain
PreloadAction
*
pActionChain
;
PreloadAction
*
pLastProcessedAction
;
// returns next action in the list (NULL if no more actions)
PreloadAction
*
GetNextAction
();
};
INLINE
PreloadThread
&
GetPreloadThread
()
{
return
preloadThread
;
}
private:
PreloadThread
preloadThread
;
};
...
...
test/java/beans/XMLEncoder/java_awt_BasicStroke.java
0 → 100644
浏览文件 @
b6363f21
/*
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* 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 4358979
* @summary Tests BasicStroke encoding
* @author Sergey Malenkov
*/
import
java.awt.BasicStroke
;
public
final
class
java_awt_BasicStroke
extends
AbstractTest
<
BasicStroke
>
{
public
static
void
main
(
String
[]
args
)
{
new
java_awt_BasicStroke
().
test
(
true
);
}
protected
BasicStroke
getObject
()
{
return
new
BasicStroke
();
}
protected
BasicStroke
getAnotherObject
()
{
float
[]
f
=
{
1.0f
,
2.0f
,
3.0f
,
4.0f
};
return
new
BasicStroke
(
f
[
1
],
BasicStroke
.
CAP_ROUND
,
BasicStroke
.
JOIN_ROUND
,
f
[
2
],
f
,
f
[
3
]);
}
}
test/java/beans/XMLEncoder/java_awt_GradientPaint.java
0 → 100644
浏览文件 @
b6363f21
/*
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* 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 4358979
* @summary Tests GradientPaint encoding
* @author Sergey Malenkov
*/
import
java.awt.Color
;
import
java.awt.GradientPaint
;
public
final
class
java_awt_GradientPaint
extends
AbstractTest
<
GradientPaint
>
{
public
static
void
main
(
String
[]
args
)
{
new
java_awt_GradientPaint
().
test
(
true
);
}
protected
GradientPaint
getObject
()
{
return
new
GradientPaint
(
0.1f
,
0.2f
,
Color
.
BLACK
,
0.3f
,
0.4f
,
Color
.
WHITE
,
true
);
}
protected
GradientPaint
getAnotherObject
()
{
return
null
;
/* TODO: could not update property
return new GradientPaint(0.4f, 0.3f, Color.WHITE, 0.2f, 0.1f, Color.BLACK, false);*/
}
}
test/java/beans/XMLEncoder/java_awt_LinearGradientPaint.java
0 → 100644
浏览文件 @
b6363f21
/*
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* 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 4358979
* @summary Tests LinearGradientPaint encoding
* @author Sergey Malenkov
*/
import
java.awt.Color
;
import
java.awt.LinearGradientPaint
;
import
java.awt.geom.AffineTransform
;
import
java.awt.geom.Point2D
;
import
static
java
.
awt
.
MultipleGradientPaint
.
ColorSpaceType
.
LINEAR_RGB
;
import
static
java
.
awt
.
MultipleGradientPaint
.
CycleMethod
.
REFLECT
;
public
final
class
java_awt_LinearGradientPaint
extends
AbstractTest
<
LinearGradientPaint
>
{
public
static
void
main
(
String
[]
args
)
{
new
java_awt_LinearGradientPaint
().
test
(
true
);
}
protected
LinearGradientPaint
getObject
()
{
float
[]
f
=
{
0.1f
,
0.2f
,
0.3f
,
0.4f
,
0.5f
,
0.6f
};
Color
[]
c
=
{
Color
.
BLUE
,
Color
.
GREEN
,
Color
.
RED
,
Color
.
BLUE
,
Color
.
GREEN
,
Color
.
RED
};
return
new
LinearGradientPaint
(
f
[
0
],
f
[
1
],
f
[
2
],
f
[
3
],
f
,
c
);
}
protected
LinearGradientPaint
getAnotherObject
()
{
return
null
;
/* TODO: could not update property
float[] f = { 0.4f, 0.5f, 0.6f, 0.7f, 0.8f, 0.9f };
Color[] c = { Color.RED, Color.GREEN, Color.BLUE, Color.RED, Color.GREEN, Color.BLUE };
return new LinearGradientPaint(
new Point2D.Float(f[0], f[1]),
new Point2D.Float(f[2], f[3]),
f, c, REFLECT, LINEAR_RGB,
new AffineTransform(f));*/
}
}
test/java/beans/XMLEncoder/java_awt_RadialGradientPaint.java
0 → 100644
浏览文件 @
b6363f21
/*
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* 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 4358979
* @summary Tests RadialGradientPaint encoding
* @author Sergey Malenkov
*/
import
java.awt.Color
;
import
java.awt.RadialGradientPaint
;
import
java.awt.geom.AffineTransform
;
import
java.awt.geom.Point2D
;
import
static
java
.
awt
.
MultipleGradientPaint
.
ColorSpaceType
.
LINEAR_RGB
;
import
static
java
.
awt
.
MultipleGradientPaint
.
CycleMethod
.
REFLECT
;
public
final
class
java_awt_RadialGradientPaint
extends
AbstractTest
<
RadialGradientPaint
>
{
public
static
void
main
(
String
[]
args
)
{
new
java_awt_RadialGradientPaint
().
test
(
true
);
}
protected
RadialGradientPaint
getObject
()
{
float
[]
f
=
{
0.1f
,
0.2f
,
0.3f
,
0.4f
,
0.5f
,
0.6f
};
Color
[]
c
=
{
Color
.
BLUE
,
Color
.
GREEN
,
Color
.
RED
,
Color
.
BLUE
,
Color
.
GREEN
,
Color
.
RED
};
return
new
RadialGradientPaint
(
f
[
0
],
f
[
1
],
f
[
2
],
f
,
c
);
}
protected
RadialGradientPaint
getAnotherObject
()
{
return
null
;
/* TODO: could not update property
float[] f = { 0.4f, 0.5f, 0.6f, 0.7f, 0.8f, 0.9f };
Color[] c = { Color.RED, Color.GREEN, Color.BLUE, Color.RED, Color.GREEN, Color.BLUE };
return new RadialGradientPaint(
new Point2D.Float(f[0], f[1]), 100.0f,
new Point2D.Float(f[2], f[3]),
f, c, REFLECT, LINEAR_RGB,
new AffineTransform(f));*/
}
}
test/java/beans/XMLEncoder/java_awt_geom_AffineTransform.java
0 → 100644
浏览文件 @
b6363f21
/*
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* 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 4358979
* @summary Tests AffineTransform encoding
* @author Sergey Malenkov
*/
import
java.awt.geom.AffineTransform
;
public
final
class
java_awt_geom_AffineTransform
extends
AbstractTest
<
AffineTransform
>
{
public
static
void
main
(
String
[]
args
)
{
new
java_awt_geom_AffineTransform
().
test
(
true
);
}
protected
AffineTransform
getObject
()
{
return
new
AffineTransform
(
0.1f
,
0.2f
,
0.3f
,
0.4f
,
0.5f
,
0.6f
);
}
protected
AffineTransform
getAnotherObject
()
{
return
new
AffineTransform
(
0.4f
,
0.5f
,
0.6f
,
0.7f
,
0.8f
,
0.9f
);
}
}
test/java/beans/XMLEncoder/javax_swing_border_StrokeBorder.java
0 → 100644
浏览文件 @
b6363f21
/*
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* 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 4358979
* @summary Tests StrokeBorder encoding
* @author Sergey Malenkov
*/
import
java.awt.BasicStroke
;
import
java.awt.Color
;
import
javax.swing.border.StrokeBorder
;
public
final
class
javax_swing_border_StrokeBorder
extends
AbstractTest
<
StrokeBorder
>
{
public
static
void
main
(
String
[]
args
)
{
new
javax_swing_border_StrokeBorder
().
test
(
true
);
}
protected
StrokeBorder
getObject
()
{
return
new
StrokeBorder
(
new
BasicStroke
(
0
),
Color
.
WHITE
);
}
protected
StrokeBorder
getAnotherObject
()
{
return
null
;
// TODO: could not update property
//return new StrokeBorder(new BasicStroke(1));
}
}
test/java/util/Locale/data/deflocale.rhel5
浏览文件 @
b6363f21
...
...
@@ -465,15 +465,15 @@ format locale: ID: be_BY, Name: Belarusian (Belarus)
default charset: UTF-8
OS Locale: be_BY.utf8@latin
default locale: ID: be_BY
, Name: Belarusian (
Belarus)
display locale: ID: be_BY
, Name: Belarusian (
Belarus)
format locale: ID: be_BY
, Name: Belarusian (
Belarus)
default locale: ID: be_BY
_#Latn, Name: Belarusian (Latin,
Belarus)
display locale: ID: be_BY
_#Latn, Name: Belarusian (Latin,
Belarus)
format locale: ID: be_BY
_#Latn, Name: Belarusian (Latin,
Belarus)
default charset: UTF-8
OS Locale: be_BY@latin
default locale: ID: be_BY
, Name: Belarusian (
Belarus)
display locale: ID: be_BY
, Name: Belarusian (
Belarus)
format locale: ID: be_BY
, Name: Belarusian (
Belarus)
default locale: ID: be_BY
_#Latn, Name: Belarusian (Latin,
Belarus)
display locale: ID: be_BY
_#Latn, Name: Belarusian (Latin,
Belarus)
format locale: ID: be_BY
_#Latn, Name: Belarusian (Latin,
Belarus)
default charset: UTF-8
OS Locale: bg_BG
...
...
@@ -518,13 +518,13 @@ display locale: ID: bn_IN, Name: Bengali (India)
format locale: ID: bn_IN, Name: Bengali (India)
default charset: UTF-8
OS Locale: bokml
default locale: ID:
en, Name: English
display locale: ID:
en, Name: English
format locale: ID:
en, Name: English
OS Locale: bokm
a
l
default locale: ID:
nb_NO, Name: Norwegian Bokml (Norway)
display locale: ID:
nb_NO, Name: Norwegian Bokml (Norway)
format locale: ID:
nb_NO, Name: Norwegian Bokml (Norway)
default charset: ISO-8859-1
OS Locale: bokm
a
l
OS Locale: bokml
default locale: ID: en, Name: English
display locale: ID: en, Name: English
format locale: ID: en, Name: English
...
...
@@ -579,15 +579,15 @@ format locale: ID: bs_BA, Name: Bosnian (Bosnia and Herzegovina)
default charset: UTF-8
OS Locale: byn_ER
default locale: ID:
en_ER, Name: English
(Eritrea)
display locale: ID:
en_ER, Name: English
(Eritrea)
format locale: ID:
en_ER, Name: English
(Eritrea)
default locale: ID:
byn_ER, Name: Blin
(Eritrea)
display locale: ID:
byn_ER, Name: Blin
(Eritrea)
format locale: ID:
byn_ER, Name: Blin
(Eritrea)
default charset: UTF-8
OS Locale: byn_ER.utf8
default locale: ID:
en_ER, Name: English
(Eritrea)
display locale: ID:
en_ER, Name: English
(Eritrea)
format locale: ID:
en_ER, Name: English
(Eritrea)
default locale: ID:
byn_ER, Name: Blin
(Eritrea)
display locale: ID:
byn_ER, Name: Blin
(Eritrea)
format locale: ID:
byn_ER, Name: Blin
(Eritrea)
default charset: UTF-8
OS Locale: ca_AD
...
...
@@ -705,15 +705,15 @@ format locale: ID: cs_CZ, Name: Czech (Czech Republic)
default charset: UTF-8
OS Locale: csb_PL
default locale: ID:
en_PL, Name: English
(Poland)
display locale: ID:
en_PL, Name: English
(Poland)
format locale: ID:
en_PL, Name: English
(Poland)
default locale: ID:
csb_PL, Name: Kashubian
(Poland)
display locale: ID:
csb_PL, Name: Kashubian
(Poland)
format locale: ID:
csb_PL, Name: Kashubian
(Poland)
default charset: UTF-8
OS Locale: csb_PL.utf8
default locale: ID:
en_PL, Name: English
(Poland)
display locale: ID:
en_PL, Name: English
(Poland)
format locale: ID:
en_PL, Name: English
(Poland)
default locale: ID:
csb_PL, Name: Kashubian
(Poland)
display locale: ID:
csb_PL, Name: Kashubian
(Poland)
format locale: ID:
csb_PL, Name: Kashubian
(Poland)
default charset: UTF-8
OS Locale: cy_GB
...
...
@@ -939,9 +939,9 @@ format locale: ID: dz_BT, Name: Dzongkha (Bhutan)
default charset: UTF-8
OS Locale: eesti
default locale: ID: e
n, Name: English
display locale: ID: e
n, Name: English
format locale: ID: e
n, Name: English
default locale: ID: e
t_EE, Name: Estonian (Estonia)
display locale: ID: e
t_EE, Name: Estonian (Estonia)
format locale: ID: e
t_EE, Name: Estonian (Estonia)
default charset: ISO-8859-1
OS Locale: el_CY
...
...
@@ -1623,9 +1623,9 @@ format locale: ID: es_VE, Name: Spanish (Venezuela)
default charset: UTF-8
OS Locale: estonian
default locale: ID: e
n, Name: English
display locale: ID: e
n, Name: English
format locale: ID: e
n, Name: English
default locale: ID: e
t_EE, Name: Estonian (Estonia)
display locale: ID: e
t_EE, Name: Estonian (Estonia)
format locale: ID: e
t_EE, Name: Estonian (Estonia)
default charset: ISO-8859-1
OS Locale: et_EE
...
...
@@ -1929,15 +1929,15 @@ format locale: ID: ga_IE, Name: Irish (Ireland)
default charset: ISO-8859-15
OS Locale: galego
default locale: ID:
en, Name: English
display locale: ID:
en, Name: English
format locale: ID:
en, Name: English
default locale: ID:
gl_ES, Name: Gallegan (Spain)
display locale: ID:
gl_ES, Name: Gallegan (Spain)
format locale: ID:
gl_ES, Name: Gallegan (Spain)
default charset: ISO-8859-1
OS Locale: galician
default locale: ID:
en, Name: English
display locale: ID:
en, Name: English
format locale: ID:
en, Name: English
default locale: ID:
gl_ES, Name: Gallegan (Spain)
display locale: ID:
gl_ES, Name: Gallegan (Spain)
format locale: ID:
gl_ES, Name: Gallegan (Spain)
default charset: ISO-8859-1
OS Locale: gd_GB
...
...
@@ -1965,51 +1965,51 @@ format locale: ID: de_DE, Name: German (Germany)
default charset: ISO-8859-1
OS Locale: gez_ER
default locale: ID:
en_ER, Name: English
(Eritrea)
display locale: ID:
en_ER, Name: English
(Eritrea)
format locale: ID:
en_ER, Name: English
(Eritrea)
default locale: ID:
gez_ER, Name: Geez
(Eritrea)
display locale: ID:
gez_ER, Name: Geez
(Eritrea)
format locale: ID:
gez_ER, Name: Geez
(Eritrea)
default charset: UTF-8
OS Locale: gez_ER.utf8
default locale: ID:
en_ER, Name: English
(Eritrea)
display locale: ID:
en_ER, Name: English
(Eritrea)
format locale: ID:
en_ER, Name: English
(Eritrea)
default locale: ID:
gez_ER, Name: Geez
(Eritrea)
display locale: ID:
gez_ER, Name: Geez
(Eritrea)
format locale: ID:
gez_ER, Name: Geez
(Eritrea)
default charset: UTF-8
OS Locale: gez_ER.utf8@abegede
default locale: ID:
en_ER, Name: English
(Eritrea)
display locale: ID:
en_ER, Name: English
(Eritrea)
format locale: ID:
en_ER, Name: English
(Eritrea)
default locale: ID:
gez_ER, Name: Geez
(Eritrea)
display locale: ID:
gez_ER, Name: Geez
(Eritrea)
format locale: ID:
gez_ER, Name: Geez
(Eritrea)
default charset: UTF-8
OS Locale: gez_ER@abegede
default locale: ID:
en_ER, Name: English
(Eritrea)
display locale: ID:
en_ER, Name: English
(Eritrea)
format locale: ID:
en_ER, Name: English
(Eritrea)
default locale: ID:
gez_ER, Name: Geez
(Eritrea)
display locale: ID:
gez_ER, Name: Geez
(Eritrea)
format locale: ID:
gez_ER, Name: Geez
(Eritrea)
default charset: UTF-8
OS Locale: gez_ET
default locale: ID:
en_ET, Name: English
(Ethiopia)
display locale: ID:
en_ET, Name: English
(Ethiopia)
format locale: ID:
en_ET, Name: English
(Ethiopia)
default locale: ID:
gez_ET, Name: Geez
(Ethiopia)
display locale: ID:
gez_ET, Name: Geez
(Ethiopia)
format locale: ID:
gez_ET, Name: Geez
(Ethiopia)
default charset: UTF-8
OS Locale: gez_ET.utf8
default locale: ID:
en_ET, Name: English
(Ethiopia)
display locale: ID:
en_ET, Name: English
(Ethiopia)
format locale: ID:
en_ET, Name: English
(Ethiopia)
default locale: ID:
gez_ET, Name: Geez
(Ethiopia)
display locale: ID:
gez_ET, Name: Geez
(Ethiopia)
format locale: ID:
gez_ET, Name: Geez
(Ethiopia)
default charset: UTF-8
OS Locale: gez_ET.utf8@abegede
default locale: ID:
en_ET, Name: English
(Ethiopia)
display locale: ID:
en_ET, Name: English
(Ethiopia)
format locale: ID:
en_ET, Name: English
(Ethiopia)
default locale: ID:
gez_ET, Name: Geez
(Ethiopia)
display locale: ID:
gez_ET, Name: Geez
(Ethiopia)
format locale: ID:
gez_ET, Name: Geez
(Ethiopia)
default charset: UTF-8
OS Locale: gez_ET@abegede
default locale: ID:
en_ET, Name: English
(Ethiopia)
display locale: ID:
en_ET, Name: English
(Ethiopia)
format locale: ID:
en_ET, Name: English
(Ethiopia)
default locale: ID:
gez_ET, Name: Geez
(Ethiopia)
display locale: ID:
gez_ET, Name: Geez
(Ethiopia)
format locale: ID:
gez_ET, Name: Geez
(Ethiopia)
default charset: UTF-8
OS Locale: gl_ES
...
...
@@ -2139,21 +2139,21 @@ format locale: ID: hr_HR, Name: Croatian (Croatia)
default charset: ISO-8859-2
OS Locale: hsb_DE
default locale: ID:
en_DE, Name: English
(Germany)
display locale: ID:
en_DE, Name: English
(Germany)
format locale: ID:
en_DE, Name: English
(Germany)
default locale: ID:
hsb_DE, Name: Upper Sorbian
(Germany)
display locale: ID:
hsb_DE, Name: Upper Sorbian
(Germany)
format locale: ID:
hsb_DE, Name: Upper Sorbian
(Germany)
default charset: ISO-8859-2
OS Locale: hsb_DE.iso88592
default locale: ID:
en_DE, Name: English
(Germany)
display locale: ID:
en_DE, Name: English
(Germany)
format locale: ID:
en_DE, Name: English
(Germany)
default locale: ID:
hsb_DE, Name: Upper Sorbian
(Germany)
display locale: ID:
hsb_DE, Name: Upper Sorbian
(Germany)
format locale: ID:
hsb_DE, Name: Upper Sorbian
(Germany)
default charset: ISO-8859-2
OS Locale: hsb_DE.utf8
default locale: ID:
en_DE, Name: English
(Germany)
display locale: ID:
en_DE, Name: English
(Germany)
format locale: ID:
en_DE, Name: English
(Germany)
default locale: ID:
hsb_DE, Name: Upper Sorbian
(Germany)
display locale: ID:
hsb_DE, Name: Upper Sorbian
(Germany)
format locale: ID:
hsb_DE, Name: Upper Sorbian
(Germany)
default charset: UTF-8
OS Locale: hu_HU
...
...
@@ -2445,15 +2445,15 @@ format locale: ID: ko_KR, Name: Korean (South Korea)
default charset: UTF-8
OS Locale: korean
default locale: ID:
en, Name: English
display locale: ID:
en, Name: English
format locale: ID:
en, Name: English
default locale: ID:
ko_KR, Name: Korean (South Korea)
display locale: ID:
ko_KR, Name: Korean (South Korea)
format locale: ID:
ko_KR, Name: Korean (South Korea)
default charset: EUC-KR
OS Locale: korean.euc
default locale: ID:
en, Name: English
display locale: ID:
en, Name: English
format locale: ID:
en, Name: English
default locale: ID:
ko_KR, Name: Korean (South Korea)
display locale: ID:
ko_KR, Name: Korean (South Korea)
format locale: ID:
ko_KR, Name: Korean (South Korea)
default charset: EUC-KR
OS Locale: ku_TR
...
...
@@ -2523,9 +2523,9 @@ format locale: ID: lg_UG, Name: Ganda (Uganda)
default charset: UTF-8
OS Locale: lithuanian
default locale: ID:
en, Name: English
display locale: ID:
en, Name: English
format locale: ID:
en, Name: English
default locale: ID:
lt_LT, Name: Lithuanian (Lithuania)
display locale: ID:
lt_LT, Name: Lithuanian (Lithuania)
format locale: ID:
lt_LT, Name: Lithuanian (Lithuania)
default charset: ISO-8859-13
OS Locale: lo_LA
...
...
@@ -2577,15 +2577,15 @@ format locale: ID: lv_LV, Name: Latvian (Latvia)
default charset: UTF-8
OS Locale: mai_IN
default locale: ID:
en_IN, Name: English
(India)
display locale: ID:
en_IN, Name: English
(India)
format locale: ID:
en_IN, Name: English
(India)
default locale: ID:
mai_IN, Name: Maithili
(India)
display locale: ID:
mai_IN, Name: Maithili
(India)
format locale: ID:
mai_IN, Name: Maithili
(India)
default charset: UTF-8
OS Locale: mai_IN.utf8
default locale: ID:
en_IN, Name: English
(India)
display locale: ID:
en_IN, Name: English
(India)
format locale: ID:
en_IN, Name: English
(India)
default locale: ID:
mai_IN, Name: Maithili
(India)
display locale: ID:
mai_IN, Name: Maithili
(India)
format locale: ID:
mai_IN, Name: Maithili
(India)
default charset: UTF-8
OS Locale: mg_MG
...
...
@@ -2859,21 +2859,21 @@ format locale: ID: nr_ZA, Name: South Ndebele (South Africa)
default charset: UTF-8
OS Locale: nso_ZA
default locale: ID:
en_ZA, Name: English
(South Africa)
display locale: ID:
en_ZA, Name: English
(South Africa)
format locale: ID:
en_ZA, Name: English
(South Africa)
default locale: ID:
nso_ZA, Name: Pedi
(South Africa)
display locale: ID:
nso_ZA, Name: Pedi
(South Africa)
format locale: ID:
nso_ZA, Name: Pedi
(South Africa)
default charset: UTF-8
OS Locale: nso_ZA.utf8
default locale: ID:
en_ZA, Name: English
(South Africa)
display locale: ID:
en_ZA, Name: English
(South Africa)
format locale: ID:
en_ZA, Name: English
(South Africa)
default locale: ID:
nso_ZA, Name: Pedi
(South Africa)
display locale: ID:
nso_ZA, Name: Pedi
(South Africa)
format locale: ID:
nso_ZA, Name: Pedi
(South Africa)
default charset: UTF-8
OS Locale: nynorsk
default locale: ID:
en, Name: English
display locale: ID:
en, Name: English
format locale: ID:
en, Name: English
default locale: ID:
nn_NO, Name: Norwegian Nynorsk (Norway)
display locale: ID:
nn_NO, Name: Norwegian Nynorsk (Norway)
format locale: ID:
nn_NO, Name: Norwegian Nynorsk (Norway)
default charset: ISO-8859-1
OS Locale: oc_FR
...
...
@@ -3147,15 +3147,15 @@ format locale: ID: si_LK, Name: Sinhalese (Sri Lanka)
default charset: UTF-8
OS Locale: sid_ET
default locale: ID:
en_ET, Name: English
(Ethiopia)
display locale: ID:
en_ET, Name: English
(Ethiopia)
format locale: ID:
en_ET, Name: English
(Ethiopia)
default locale: ID:
sid_ET, Name: Sidamo
(Ethiopia)
display locale: ID:
sid_ET, Name: Sidamo
(Ethiopia)
format locale: ID:
sid_ET, Name: Sidamo
(Ethiopia)
default charset: UTF-8
OS Locale: sid_ET.utf8
default locale: ID:
en_ET, Name: English
(Ethiopia)
display locale: ID:
en_ET, Name: English
(Ethiopia)
format locale: ID:
en_ET, Name: English
(Ethiopia)
default locale: ID:
sid_ET, Name: Sidamo
(Ethiopia)
display locale: ID:
sid_ET, Name: Sidamo
(Ethiopia)
format locale: ID:
sid_ET, Name: Sidamo
(Ethiopia)
default charset: UTF-8
OS Locale: sk_SK
...
...
@@ -3321,39 +3321,39 @@ format locale: ID: sr_CS, Name: Serbian (Serbia and Montenegro)
default charset: UTF-8
OS Locale: sr_ME
default locale: ID: sr
, Name: Serbian
display locale: ID: sr
, Name: Serbian
format locale: ID: sr
, Name: Serbian
default locale: ID: sr
_ME, Name: Serbian (Montenegro)
display locale: ID: sr
_ME, Name: Serbian (Montenegro)
format locale: ID: sr
_ME, Name: Serbian (Montenegro)
default charset: UTF-8
OS Locale: sr_ME.utf8
default locale: ID: sr
, Name: Serbian
display locale: ID: sr
, Name: Serbian
format locale: ID: sr
, Name: Serbian
default locale: ID: sr
_ME, Name: Serbian (Montenegro)
display locale: ID: sr
_ME, Name: Serbian (Montenegro)
format locale: ID: sr
_ME, Name: Serbian (Montenegro)
default charset: UTF-8
OS Locale: sr_RS
default locale: ID: sr
, Name: Serbian
display locale: ID: sr
, Name: Serbian
format locale: ID: sr
, Name: Serbian
default locale: ID: sr
_RS, Name: Serbian (Serbia)
display locale: ID: sr
_RS, Name: Serbian (Serbia)
format locale: ID: sr
_RS, Name: Serbian (Serbia)
default charset: UTF-8
OS Locale: sr_RS.utf8
default locale: ID: sr
, Name: Serbian
display locale: ID: sr
, Name: Serbian
format locale: ID: sr
, Name: Serbian
default locale: ID: sr
_RS, Name: Serbian (Serbia)
display locale: ID: sr
_RS, Name: Serbian (Serbia)
format locale: ID: sr
_RS, Name: Serbian (Serbia)
default charset: UTF-8
OS Locale: sr_RS.utf8@latin
default locale: ID: sr
, Name: Serbian
display locale: ID: sr
, Name: Serbian
format locale: ID: sr
, Name: Serbian
default locale: ID: sr
_RS_#Latn, Name: Serbian (Latin,Serbia)
display locale: ID: sr
_RS_#Latn, Name: Serbian (Latin,Serbia)
format locale: ID: sr
_RS_#Latn, Name: Serbian (Latin,Serbia)
default charset: UTF-8
OS Locale: sr_RS@latin
default locale: ID: sr
, Name: Serbian
display locale: ID: sr
, Name: Serbian
format locale: ID: sr
, Name: Serbian
default locale: ID: sr
_RS_#Latn, Name: Serbian (Latin,Serbia)
display locale: ID: sr
_RS_#Latn, Name: Serbian (Latin,Serbia)
format locale: ID: sr
_RS_#Latn, Name: Serbian (Latin,Serbia)
default charset: UTF-8
OS Locale: ss_ZA
...
...
@@ -3507,9 +3507,9 @@ format locale: ID: th_TH, Name: Thai (Thailand)
default charset: UTF-8
OS Locale: thai
default locale: ID:
en, Name: English
display locale: ID:
en, Name: English
format locale: ID:
en, Name: English
default locale: ID:
th_TH, Name: Thai (Thailand)
display locale: ID:
th_TH, Name: Thai (Thailand)
format locale: ID:
th_TH, Name: Thai (Thailand)
default charset: TIS-620
OS Locale: ti_ER
...
...
@@ -3537,15 +3537,15 @@ format locale: ID: ti_ET, Name: Tigrinya (Ethiopia)
default charset: UTF-8
OS Locale: tig_ER
default locale: ID:
en_ER, Name: English
(Eritrea)
display locale: ID:
en_ER, Name: English
(Eritrea)
format locale: ID:
en_ER, Name: English
(Eritrea)
default locale: ID:
tig_ER, Name: Tigre
(Eritrea)
display locale: ID:
tig_ER, Name: Tigre
(Eritrea)
format locale: ID:
tig_ER, Name: Tigre
(Eritrea)
default charset: UTF-8
OS Locale: tig_ER.utf8
default locale: ID:
en_ER, Name: English
(Eritrea)
display locale: ID:
en_ER, Name: English
(Eritrea)
format locale: ID:
en_ER, Name: English
(Eritrea)
default locale: ID:
tig_ER, Name: Tigre
(Eritrea)
display locale: ID:
tig_ER, Name: Tigre
(Eritrea)
format locale: ID:
tig_ER, Name: Tigre
(Eritrea)
default charset: UTF-8
OS Locale: tl_PH
...
...
@@ -3681,15 +3681,15 @@ format locale: ID: uz_UZ, Name: Uzbek (Uzbekistan)
default charset: ISO-8859-1
OS Locale: uz_UZ.utf8@cyrillic
default locale: ID: uz_UZ
, Name: Uzbek (
Uzbekistan)
display locale: ID: uz_UZ
, Name: Uzbek (
Uzbekistan)
format locale: ID: uz_UZ
, Name: Uzbek (
Uzbekistan)
default locale: ID: uz_UZ
_#Cyrl, Name: Uzbek (Cyrillic,
Uzbekistan)
display locale: ID: uz_UZ
_#Cyrl, Name: Uzbek (Cyrillic,
Uzbekistan)
format locale: ID: uz_UZ
_#Cyrl, Name: Uzbek (Cyrillic,
Uzbekistan)
default charset: UTF-8
OS Locale: uz_UZ@cyrillic
default locale: ID: uz_UZ
, Name: Uzbek (
Uzbekistan)
display locale: ID: uz_UZ
, Name: Uzbek (
Uzbekistan)
format locale: ID: uz_UZ
, Name: Uzbek (
Uzbekistan)
default locale: ID: uz_UZ
_#Cyrl, Name: Uzbek (Cyrillic,
Uzbekistan)
display locale: ID: uz_UZ
_#Cyrl, Name: Uzbek (Cyrillic,
Uzbekistan)
format locale: ID: uz_UZ
_#Cyrl, Name: Uzbek (Cyrillic,
Uzbekistan)
default charset: UTF-8
OS Locale: ve_ZA
...
...
test/java/util/Locale/data/deflocale.rhel5.fmtasdefault
浏览文件 @
b6363f21
此差异已折叠。
点击以展开。
test/java/util/Locale/data/deflocale.sol10
浏览文件 @
b6363f21
...
...
@@ -1128,9 +1128,9 @@ format locale: ID: no_NO_NY, Name: Norwegian (Norway,Nynorsk)
default charset: ISO-8859-1
OS Locale: no_NY
default locale: ID: no_
, Name: Norwegian (
)
display locale: ID: no_
, Name: Norwegian (
)
format locale: ID: no_
, Name: Norwegian (
)
default locale: ID: no_
NO_NY, Name: Norwegian (Norway,Nynorsk
)
display locale: ID: no_
NO_NY, Name: Norwegian (Norway,Nynorsk
)
format locale: ID: no_
NO_NY, Name: Norwegian (Norway,Nynorsk
)
default charset: ISO-8859-1
OS Locale: nr
...
...
@@ -1332,9 +1332,9 @@ format locale: ID: sq_AL, Name: Albanian (Albania)
default charset: ISO-8859-2
OS Locale: sr_SP
default locale: ID: sr
, Name: Serbian
display locale: ID: sr
, Name: Serbian
format locale: ID: sr
, Name: Serbian
default locale: ID: sr
_CS, Name: Serbian (Serbia and Montenegro)
display locale: ID: sr
_CS, Name: Serbian (Serbia and Montenegro)
format locale: ID: sr
_CS, Name: Serbian (Serbia and Montenegro)
default charset: ISO-8859-5
OS Locale: sr_YU
...
...
@@ -1721,5 +1721,5 @@ default charset: UTF-8
OS Locale (LC_CTYPE: C, LC_MESSAGES: zh_CN.UTF-8)
default locale: ID: zh_CN, Name: Chinese (China)
display locale: ID: zh_CN, Name: Chinese (China)
format locale: ID: en
, Name: English
format locale: ID: en
_CN, Name: English (China)
default charset: US-ASCII
test/java/util/Locale/data/deflocale.sol10.fmtasdefault
浏览文件 @
b6363f21
...
...
@@ -1128,9 +1128,9 @@ format locale: ID: no_NO_NY, Name: Norwegian (Norway,Nynorsk)
default charset: ISO-8859-1
OS Locale: no_NY
default locale: ID: no_
, Name: Norwegian (
)
display locale: ID: no_
, Name: Norwegian (
)
format locale: ID: no_
, Name: Norwegian (
)
default locale: ID: no_
NO_NY, Name: Norwegian (Norway,Nynorsk
)
display locale: ID: no_
NO_NY, Name: Norwegian (Norway,Nynorsk
)
format locale: ID: no_
NO_NY, Name: Norwegian (Norway,Nynorsk
)
default charset: ISO-8859-1
OS Locale: nr
...
...
@@ -1332,9 +1332,9 @@ format locale: ID: sq_AL, Name: Albanian (Albania)
default charset: ISO-8859-2
OS Locale: sr_SP
default locale: ID: sr
, Name: Serbian
display locale: ID: sr
, Name: Serbian
format locale: ID: sr
, Name: Serbian
default locale: ID: sr
_CS, Name: Serbian (Serbia and Montenegro)
display locale: ID: sr
_CS, Name: Serbian (Serbia and Montenegro)
format locale: ID: sr
_CS, Name: Serbian (Serbia and Montenegro)
default charset: ISO-8859-5
OS Locale: sr_YU
...
...
test/java/util/Locale/data/deflocale.win7
浏览文件 @
b6363f21
此差异已折叠。
点击以展开。
test/java/util/Locale/data/deflocale.win7.fmtasdefault
浏览文件 @
b6363f21
此差异已折叠。
点击以展开。
test/java/util/ResourceBundle/Bug4168625Test.java
浏览文件 @
b6363f21
...
...
@@ -25,7 +25,7 @@
@summary test Resource Bundle for bug 4168625
@build Bug4168625Class Bug4168625Getter Bug4168625Resource Bug4168625Resource3 Bug4168625Resource3_en Bug4168625Resource3_en_CA Bug4168625Resource3_en_IE Bug4168625Resource3_en_US Bug4168625Resource2_en_US Bug4168625Resource2
@run main/timeout=600 Bug4168625Test
@bug 4168625
@bug 4168625
6993339
*/
/*
*
...
...
@@ -50,9 +50,8 @@ import java.util.*;
import
java.io.*
;
/**
* This test tries to correct three efficiency problems with the caching
* mechanism of ResourceBundle. All tests assume that none of the bundles
* have been previously loaded and cached. It also allows concurrent loads
* This test tries to correct two efficiency problems with the caching
* mechanism of ResourceBundle. It also allows concurrent loads
* of resource bundles to be performed if the bundles are unrelated (ex. a
* load of a local system resource by one thread while another thread is
* doing a slow load over a network).
...
...
@@ -230,83 +229,6 @@ public class Bug4168625Test extends RBTestFmwk {
}
}
/**
* Previous versions of ResourceBundle exhibited the following caching behavior.
* Assume the class Bug4168625Resource_en exists. Bug4168625Resource_en_US does
* not. Two threads, ThreadA and ThreadB both try to get the same bundle.
* <P>
* <pre>
* ThreadA.getBundle("Bug4168625Resource", new Locale("en", "US"));
* A-->try to load Bug4168625Resource_en_US
* ThreadB.getBundle("Bug4168625Resource", new Locale("en", "US"));
* B-->try to load Bug4168625Resource_en_US
* B-->load Bug4168625Resource_en (#1)
* A-->load Bug4168625Resource_en (#2)
* A-->cache Bug4168625Resource_en (#2) as Bug4168625Resource_en
* A-->cache Bug4168625Resource_en (#2) as Bug4168625Resource_en_US
* A-->return Bug4168625Resource_en (#2)
* B-->cache Bug4168625Resource_en (#1) as Bug4168625Resource_en
* B-->cache Bug4168625Resource_en (#1) as Bug4168625Resource_en_US
* B-->return Bug4168625Resource_en (#1)
* </pre>
* <P>
* Both threads try and fail to load Bug4168625Resource_en_US. Both
* threads load Bug4168625Resource_en. Both threads get their own copy
* of the Bug4168625Resource_en resource.
*
* The desired behavior is as follows:
* <P>
* <pre>
* ThreadA.getBundle("Bug4168625Resource", new Locale("en", "US"));
* A-->try to load Bug4168625Resource_en_US
* ThreadB.getBundle("Bug4168625Resource", new Locale("en", "US"));
* B-->try to load Bug4168625Resource_en_US
* B-->load Bug4168625Resource_en
* A-->load Bug4168625Resource_en (block in ResourceBundle.getBundle)
* B-->cache Bug4168625Resource_en as Bug4168625Resource_en
* B-->cache Bug4168625Resource_en as Bug4168625Resource_en_US
* A-->return Bug4168625Resource_en
* B-->return Bug4168625Resource_en
* </pre>
* <P>
* Note that both threads return the same bundle object.
*/
public
void
testConcurrentLoading1
()
throws
Exception
{
final
Loader
loader
=
new
Loader
(
new
String
[]
{
"Bug4168625Class"
},
new
String
[]
{
"Bug4168625Resource3_en_US"
,
"Bug4168625Resource3_en_CA"
});
final
Class
c
=
loader
.
loadClass
(
"Bug4168625Class"
);
final
Bug4168625Getter
test
=
(
Bug4168625Getter
)
c
.
newInstance
();
//both threads want the same resource
ConcurrentLoadingThread
thread1
=
new
ConcurrentLoadingThread
(
loader
,
test
,
new
Locale
(
"en"
,
"US"
));
ConcurrentLoadingThread
thread2
=
new
ConcurrentLoadingThread
(
loader
,
test
,
new
Locale
(
"en"
,
"US"
));
thread1
.
start
();
//start thread 1
loader
.
waitForNotify
(
1
);
//wait for thread1 to do getBundle & block in loader
thread2
.
start
();
//start second thread
loader
.
waitForNotify
(
2
,
1000
);
//wait until thread2 blocks somewhere in getBundle
thread1
.
ping
();
//continue both threads
thread2
.
ping
();
thread1
.
join
();
//wait unitl both threads complete
thread2
.
join
();
//Now, examine the class loads that were done.
loader
.
logClasses
(
"Classes loaded after completion of both threads:"
);
boolean
dups
=
false
;
for
(
int
i
=
loader
.
loadedClasses
.
size
()
-
1
;
i
>=
0
;
i
--)
{
final
Object
item
=
loader
.
loadedClasses
.
elementAt
(
i
);
loader
.
loadedClasses
.
removeElementAt
(
i
);
if
(
loader
.
loadedClasses
.
contains
(
item
))
{
logln
(
"Resource loaded more than once: "
+
item
);
dups
=
true
;
}
}
if
(
dups
)
{
errln
(
"ResourceBundle loaded some classes multiple times"
);
}
}
private
class
ConcurrentLoadingThread
extends
Thread
{
private
Loader
loader
;
public
Object
bundle
;
...
...
@@ -355,7 +277,7 @@ public class Bug4168625Test extends RBTestFmwk {
* This test ensures that multiple resources can be loading at the same
* time as long as they don't depend on each other in some way.
*/
public
void
testConcurrentLoading
2
()
throws
Exception
{
public
void
testConcurrentLoading
()
throws
Exception
{
final
Loader
loader
=
new
Loader
(
new
String
[]
{
"Bug4168625Class"
},
new
String
[]
{
"Bug4168625Resource3_en_US"
,
"Bug4168625Resource3_en_CA"
});
final
Class
c
=
loader
.
loadClass
(
"Bug4168625Class"
);
final
Bug4168625Getter
test
=
(
Bug4168625Getter
)
c
.
newInstance
();
...
...
test/javax/swing/JComponent/6989617/bug6989617.java
0 → 100644
浏览文件 @
b6363f21
/*
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* 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 6989617
@summary Enable JComponent to control repaintings of its children
@author Alexander Potochkin
@run main bug6989617
*/
import
javax.swing.*
;
import
java.awt.*
;
public
class
bug6989617
{
private
boolean
isPaintingOrigin
;
private
boolean
innerPanelRepainted
,
outerPanelRepainted
;
public
bug6989617
()
{
final
JButton
button
=
new
JButton
(
"button"
);
JPanel
innerPanel
=
new
JPanel
()
{
protected
boolean
isPaintingOrigin
()
{
return
isPaintingOrigin
;
}
public
void
repaint
(
long
tm
,
int
x
,
int
y
,
int
width
,
int
height
)
{
if
(
button
.
getParent
()
!=
null
)
{
innerPanelRepainted
=
true
;
if
(!
button
.
getSize
().
equals
(
new
Dimension
(
width
,
height
)))
{
throw
new
RuntimeException
(
"Wrong size of the dirty area"
);
}
if
(!
button
.
getLocation
().
equals
(
new
Point
(
x
,
y
)))
{
throw
new
RuntimeException
(
"Wrong location of the dirty area"
);
}
}
super
.
repaint
(
tm
,
x
,
y
,
width
,
height
);
}
};
JPanel
outerPanel
=
new
JPanel
()
{
protected
boolean
isPaintingOrigin
()
{
return
isPaintingOrigin
;
}
public
void
repaint
(
long
tm
,
int
x
,
int
y
,
int
width
,
int
height
)
{
if
(
button
.
getParent
()
!=
null
)
{
outerPanelRepainted
=
true
;
if
(!
button
.
getSize
().
equals
(
new
Dimension
(
width
,
height
)))
{
throw
new
RuntimeException
(
"Wrong size of the dirty area"
);
}
}
super
.
repaint
(
tm
,
x
,
y
,
width
,
height
);
}
};
outerPanel
.
add
(
innerPanel
);
innerPanel
.
add
(
button
);
outerPanel
.
setSize
(
100
,
100
);
innerPanel
.
setBounds
(
10
,
10
,
50
,
50
);
button
.
setBounds
(
10
,
10
,
20
,
20
);
if
(
innerPanelRepainted
||
outerPanelRepainted
)
{
throw
new
RuntimeException
(
"Repainted flag is unexpectedly on"
);
}
button
.
repaint
();
if
(
innerPanelRepainted
||
outerPanelRepainted
)
{
throw
new
RuntimeException
(
"Repainted flag is unexpectedly on"
);
}
isPaintingOrigin
=
true
;
button
.
repaint
();
if
(!
innerPanelRepainted
||
!
outerPanelRepainted
)
{
throw
new
RuntimeException
(
"Repainted flag is unexpectedly off"
);
}
}
public
static
void
main
(
String
...
args
)
throws
Exception
{
new
bug6989617
();
}
}
test/javax/swing/JTable/6735286/bug6735286.java
0 → 100644
浏览文件 @
b6363f21
此差异已折叠。
点击以展开。
test/javax/swing/plaf/basic/BasicScrollPaneUI/Test6632810.java
0 → 100644
浏览文件 @
b6363f21
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录