Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
830d7a16
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看板
提交
830d7a16
编写于
3月 24, 2014
作者:
L
lana
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
28ea77aa
ff452e1e
变更
31
隐藏空白更改
内联
并排
Showing
31 changed file
with
841 addition
and
202 deletion
+841
-202
src/macosx/classes/sun/lwawt/macosx/CPrinterJob.java
src/macosx/classes/sun/lwawt/macosx/CPrinterJob.java
+1
-1
src/share/classes/java/util/Spliterators.java
src/share/classes/java/util/Spliterators.java
+1
-1
src/share/classes/jdk/internal/org/objectweb/asm/ByteVector.java
...re/classes/jdk/internal/org/objectweb/asm/ByteVector.java
+62
-35
src/share/classes/jdk/internal/org/objectweb/asm/ClassWriter.java
...e/classes/jdk/internal/org/objectweb/asm/ClassWriter.java
+5
-4
src/share/classes/jdk/internal/org/objectweb/asm/Frame.java
src/share/classes/jdk/internal/org/objectweb/asm/Frame.java
+11
-6
src/share/classes/jdk/internal/org/objectweb/asm/commons/AnalyzerAdapter.java
...k/internal/org/objectweb/asm/commons/AnalyzerAdapter.java
+3
-2
src/share/classes/jdk/internal/org/objectweb/asm/tree/InsnList.java
...classes/jdk/internal/org/objectweb/asm/tree/InsnList.java
+16
-2
src/share/classes/jdk/internal/org/objectweb/asm/tree/analysis/Analyzer.java
...dk/internal/org/objectweb/asm/tree/analysis/Analyzer.java
+1
-1
src/share/classes/jdk/internal/org/objectweb/asm/tree/analysis/Interpreter.java
...internal/org/objectweb/asm/tree/analysis/Interpreter.java
+7
-7
src/share/classes/jdk/internal/org/objectweb/asm/util/CheckAnnotationAdapter.java
...ternal/org/objectweb/asm/util/CheckAnnotationAdapter.java
+1
-1
src/share/classes/jdk/internal/org/objectweb/asm/util/Textifier.java
...lasses/jdk/internal/org/objectweb/asm/util/Textifier.java
+36
-8
src/share/classes/jdk/internal/org/objectweb/asm/version.txt
src/share/classes/jdk/internal/org/objectweb/asm/version.txt
+6
-6
src/share/classes/sun/java2d/SunGraphics2D.java
src/share/classes/sun/java2d/SunGraphics2D.java
+2
-0
src/share/classes/sun/security/krb5/Config.java
src/share/classes/sun/security/krb5/Config.java
+4
-5
src/share/classes/sun/security/provider/certpath/PKIXCertPathValidator.java
...sun/security/provider/certpath/PKIXCertPathValidator.java
+0
-3
src/windows/native/sun/windows/awt_DesktopProperties.cpp
src/windows/native/sun/windows/awt_DesktopProperties.cpp
+162
-64
src/windows/native/sun/windows/awt_Event.cpp
src/windows/native/sun/windows/awt_Event.cpp
+8
-4
src/windows/native/sun/windows/awt_MouseEvent.cpp
src/windows/native/sun/windows/awt_MouseEvent.cpp
+8
-4
test/ProblemList.txt
test/ProblemList.txt
+0
-9
test/java/awt/FileDialog/SaveFileNameOverrideTest/SaveFileNameOverrideTest.java
...og/SaveFileNameOverrideTest/SaveFileNameOverrideTest.java
+4
-3
test/java/awt/Toolkit/Headless/WrappedToolkitTest/WrappedToolkitTest.sh
...Toolkit/Headless/WrappedToolkitTest/WrappedToolkitTest.sh
+6
-23
test/java/awt/event/KeyEvent/SwallowKeyEvents/SwallowKeyEvents.java
...awt/event/KeyEvent/SwallowKeyEvents/SwallowKeyEvents.java
+7
-2
test/java/util/Arrays/StreamAndSpliterator.java
test/java/util/Arrays/StreamAndSpliterator.java
+148
-0
test/sun/java2d/DrawXORModeTest.java
test/sun/java2d/DrawXORModeTest.java
+110
-0
test/sun/security/krb5/auto/BadKdc.java
test/sun/security/krb5/auto/BadKdc.java
+26
-3
test/sun/security/krb5/auto/BadKdc1.java
test/sun/security/krb5/auto/BadKdc1.java
+9
-2
test/sun/security/krb5/auto/BadKdc2.java
test/sun/security/krb5/auto/BadKdc2.java
+6
-1
test/sun/security/krb5/auto/MaxRetries.java
test/sun/security/krb5/auto/MaxRetries.java
+4
-4
test/sun/security/krb5/auto/TcpTimeout.java
test/sun/security/krb5/auto/TcpTimeout.java
+1
-1
test/sun/security/krb5/config/ExtraLines.java
test/sun/security/krb5/config/ExtraLines.java
+52
-0
test/sun/security/provider/certpath/PKIXCertPathValidator/Validity.java
...ity/provider/certpath/PKIXCertPathValidator/Validity.java
+134
-0
未找到文件。
src/macosx/classes/sun/lwawt/macosx/CPrinterJob.java
浏览文件 @
830d7a16
...
...
@@ -41,7 +41,7 @@ import javax.print.attribute.standard.PageRanges;
import
sun.java2d.*
;
import
sun.print.*
;
final
class
CPrinterJob
extends
RasterPrinterJob
{
public
final
class
CPrinterJob
extends
RasterPrinterJob
{
// NOTE: This uses RasterPrinterJob as a base, but it doesn't use
// all of the RasterPrinterJob functions. RasterPrinterJob will
// break down printing to pieces that aren't necessary under MacOSX
...
...
src/share/classes/java/util/Spliterators.java
浏览文件 @
830d7a16
...
...
@@ -384,7 +384,7 @@ public final class Spliterators {
*/
private
static
void
checkFromToBounds
(
int
arrayLength
,
int
origin
,
int
fence
)
{
if
(
origin
>
fence
)
{
throw
new
IllegalArgument
Exception
(
throw
new
ArrayIndexOutOfBounds
Exception
(
"origin("
+
origin
+
") > fence("
+
fence
+
")"
);
}
if
(
origin
<
0
)
{
...
...
src/share/classes/jdk/internal/org/objectweb/asm/ByteVector.java
浏览文件 @
830d7a16
...
...
@@ -259,41 +259,68 @@ public class ByteVector {
if
(
c
>=
'\
001
'
&&
c
<=
'\
177
'
)
{
data
[
len
++]
=
(
byte
)
c
;
}
else
{
int
byteLength
=
i
;
for
(
int
j
=
i
;
j
<
charLength
;
++
j
)
{
c
=
s
.
charAt
(
j
);
if
(
c
>=
'\
001
'
&&
c
<=
'\
177
'
)
{
byteLength
++;
}
else
if
(
c
>
'\
u07FF
'
)
{
byteLength
+=
3
;
}
else
{
byteLength
+=
2
;
}
}
if
(
byteLength
>
65535
)
{
throw
new
IllegalArgumentException
();
}
data
[
length
]
=
(
byte
)
(
byteLength
>>>
8
);
data
[
length
+
1
]
=
(
byte
)
byteLength
;
if
(
length
+
2
+
byteLength
>
data
.
length
)
{
length
=
len
;
enlarge
(
2
+
byteLength
);
data
=
this
.
data
;
}
for
(
int
j
=
i
;
j
<
charLength
;
++
j
)
{
c
=
s
.
charAt
(
j
);
if
(
c
>=
'\
001
'
&&
c
<=
'\
177
'
)
{
data
[
len
++]
=
(
byte
)
c
;
}
else
if
(
c
>
'\
u07FF
'
)
{
data
[
len
++]
=
(
byte
)
(
0xE0
|
c
>>
12
&
0xF
);
data
[
len
++]
=
(
byte
)
(
0x80
|
c
>>
6
&
0x3F
);
data
[
len
++]
=
(
byte
)
(
0x80
|
c
&
0x3F
);
}
else
{
data
[
len
++]
=
(
byte
)
(
0xC0
|
c
>>
6
&
0x1F
);
data
[
len
++]
=
(
byte
)
(
0x80
|
c
&
0x3F
);
}
}
break
;
length
=
len
;
return
encodeUTF8
(
s
,
i
,
65535
);
}
}
length
=
len
;
return
this
;
}
/**
* Puts an UTF8 string into this byte vector. The byte vector is
* automatically enlarged if necessary. The string length is encoded in two
* bytes before the encoded characters, if there is space for that (i.e. if
* this.length - i - 2 >= 0).
*
* @param s
* the String to encode.
* @param i
* the index of the first character to encode. The previous
* characters are supposed to have already been encoded, using
* only one byte per character.
* @param maxByteLength
* the maximum byte length of the encoded string, including the
* already encoded characters.
* @return this byte vector.
*/
ByteVector
encodeUTF8
(
final
String
s
,
int
i
,
int
maxByteLength
)
{
int
charLength
=
s
.
length
();
int
byteLength
=
i
;
char
c
;
for
(
int
j
=
i
;
j
<
charLength
;
++
j
)
{
c
=
s
.
charAt
(
j
);
if
(
c
>=
'\
001
'
&&
c
<=
'\
177
'
)
{
byteLength
++;
}
else
if
(
c
>
'\
u07FF
'
)
{
byteLength
+=
3
;
}
else
{
byteLength
+=
2
;
}
}
if
(
byteLength
>
maxByteLength
)
{
throw
new
IllegalArgumentException
();
}
int
start
=
length
-
i
-
2
;
if
(
start
>=
0
)
{
data
[
start
]
=
(
byte
)
(
byteLength
>>>
8
);
data
[
start
+
1
]
=
(
byte
)
byteLength
;
}
if
(
length
+
byteLength
-
i
>
data
.
length
)
{
enlarge
(
byteLength
-
i
);
}
int
len
=
length
;
for
(
int
j
=
i
;
j
<
charLength
;
++
j
)
{
c
=
s
.
charAt
(
j
);
if
(
c
>=
'\
001
'
&&
c
<=
'\
177
'
)
{
data
[
len
++]
=
(
byte
)
c
;
}
else
if
(
c
>
'\
u07FF
'
)
{
data
[
len
++]
=
(
byte
)
(
0xE0
|
c
>>
12
&
0xF
);
data
[
len
++]
=
(
byte
)
(
0x80
|
c
>>
6
&
0x3F
);
data
[
len
++]
=
(
byte
)
(
0x80
|
c
&
0x3F
);
}
else
{
data
[
len
++]
=
(
byte
)
(
0xC0
|
c
>>
6
&
0x1F
);
data
[
len
++]
=
(
byte
)
(
0x80
|
c
&
0x3F
);
}
}
length
=
len
;
...
...
src/share/classes/jdk/internal/org/objectweb/asm/ClassWriter.java
浏览文件 @
830d7a16
...
...
@@ -716,7 +716,8 @@ public class ClassWriter extends ClassVisitor {
sourceFile
=
newUTF8
(
file
);
}
if
(
debug
!=
null
)
{
sourceDebug
=
new
ByteVector
().
putUTF8
(
debug
);
sourceDebug
=
new
ByteVector
().
encodeUTF8
(
debug
,
0
,
Integer
.
MAX_VALUE
);
}
}
...
...
@@ -857,7 +858,7 @@ public class ClassWriter extends ClassVisitor {
}
if
(
sourceDebug
!=
null
)
{
++
attributeCount
;
size
+=
sourceDebug
.
length
+
4
;
size
+=
sourceDebug
.
length
+
6
;
newUTF8
(
"SourceDebugExtension"
);
}
if
(
enclosingMethodOwner
!=
0
)
{
...
...
@@ -946,9 +947,9 @@ public class ClassWriter extends ClassVisitor {
out
.
putShort
(
newUTF8
(
"SourceFile"
)).
putInt
(
2
).
putShort
(
sourceFile
);
}
if
(
sourceDebug
!=
null
)
{
int
len
=
sourceDebug
.
length
-
2
;
int
len
=
sourceDebug
.
length
;
out
.
putShort
(
newUTF8
(
"SourceDebugExtension"
)).
putInt
(
len
);
out
.
putByteArray
(
sourceDebug
.
data
,
2
,
len
);
out
.
putByteArray
(
sourceDebug
.
data
,
0
,
len
);
}
if
(
enclosingMethodOwner
!=
0
)
{
out
.
putShort
(
newUTF8
(
"EnclosingMethod"
)).
putInt
(
4
);
...
...
src/share/classes/jdk/internal/org/objectweb/asm/Frame.java
浏览文件 @
830d7a16
...
...
@@ -99,8 +99,8 @@ final class Frame {
* stack types. VALUE depends on KIND. For LOCAL types, it is an index in
* the input local variable types. For STACK types, it is a position
* relatively to the top of input frame stack. For BASE types, it is either
* one of the constants defined
in FrameVisitor, or for OBJECT and
*
UNINITIALIZED
types, a tag and an index in the type table.
* one of the constants defined
below, or for OBJECT and UNINITIALIZED
* types, a tag and an index in the type table.
*
* Output frames can contain types of any kind and with a positive or
* negative dimension (and even unassigned types, represented by 0 - which
...
...
@@ -537,7 +537,7 @@ final class Frame {
/**
* The types that are initialized in the basic block. A constructor
* invocation on an UNINITIALIZED or UNINITIALIZED_THIS type must replace
* <i>every occur
r
ence</i> of this type in the local variables and in the
* <i>every occurence</i> of this type in the local variables and in the
* operand stack. This cannot be done during the first phase of the
* algorithm since, during this phase, the local variables and the operand
* stack are not completely computed. It is therefore necessary to store the
...
...
@@ -1446,6 +1446,7 @@ final class Frame {
// if t is the NULL type, merge(u,t)=u, so there is no change
return
false
;
}
else
if
((
t
&
(
DIM
|
BASE_KIND
))
==
(
u
&
(
DIM
|
BASE_KIND
)))
{
// if t and u have the same dimension and same base kind
if
((
u
&
BASE_KIND
)
==
OBJECT
)
{
// if t is also a reference type, and if u and t have the
// same dimension merge(u,t) = dim(t) | common parent of the
...
...
@@ -1458,9 +1459,13 @@ final class Frame {
v
=
OBJECT
|
cw
.
addType
(
"java/lang/Object"
);
}
}
else
if
((
t
&
BASE_KIND
)
==
OBJECT
||
(
t
&
DIM
)
!=
0
)
{
// if t is any other reference or array type,
// merge(u,t)=java/lang/Object
v
=
OBJECT
|
cw
.
addType
(
"java/lang/Object"
);
// if t is any other reference or array type, the merged type
// is Object, or min(dim(u), dim(t)) | java/lang/Object is u
// and t have different array dimensions
int
tdim
=
t
&
DIM
;
int
udim
=
u
&
DIM
;
v
=
(
udim
!=
tdim
?
Math
.
min
(
tdim
,
udim
)
:
0
)
|
OBJECT
|
cw
.
addType
(
"java/lang/Object"
);
}
else
{
// if t is any other type, merge(u,t)=TOP
v
=
TOP
;
...
...
src/share/classes/jdk/internal/org/objectweb/asm/commons/AnalyzerAdapter.java
浏览文件 @
830d7a16
...
...
@@ -240,6 +240,7 @@ public class AnalyzerAdapter extends MethodVisitor {
locals
.
add
(
types
[
i
].
getInternalName
());
}
}
maxLocals
=
locals
.
size
();
}
@Override
...
...
@@ -519,12 +520,12 @@ public class AnalyzerAdapter extends MethodVisitor {
// ------------------------------------------------------------------------
private
Object
get
(
final
int
local
)
{
maxLocals
=
Math
.
max
(
maxLocals
,
local
);
maxLocals
=
Math
.
max
(
maxLocals
,
local
+
1
);
return
local
<
locals
.
size
()
?
locals
.
get
(
local
)
:
Opcodes
.
TOP
;
}
private
void
set
(
final
int
local
,
final
Object
type
)
{
maxLocals
=
Math
.
max
(
maxLocals
,
local
);
maxLocals
=
Math
.
max
(
maxLocals
,
local
+
1
);
while
(
local
>=
locals
.
size
())
{
locals
.
add
(
Opcodes
.
TOP
);
}
...
...
src/share/classes/jdk/internal/org/objectweb/asm/tree/InsnList.java
浏览文件 @
830d7a16
...
...
@@ -556,6 +556,8 @@ public class InsnList {
AbstractInsnNode
prev
;
AbstractInsnNode
remove
;
InsnListIterator
(
int
index
)
{
if
(
index
==
size
())
{
next
=
null
;
...
...
@@ -577,12 +579,22 @@ public class InsnList {
AbstractInsnNode
result
=
next
;
prev
=
result
;
next
=
result
.
next
;
remove
=
result
;
return
result
;
}
public
void
remove
()
{
InsnList
.
this
.
remove
(
prev
);
prev
=
prev
.
prev
;
if
(
remove
!=
null
)
{
if
(
remove
==
next
)
{
next
=
next
.
next
;
}
else
{
prev
=
prev
.
prev
;
}
InsnList
.
this
.
remove
(
remove
);
remove
=
null
;
}
else
{
throw
new
IllegalStateException
();
}
}
public
boolean
hasPrevious
()
{
...
...
@@ -593,6 +605,7 @@ public class InsnList {
AbstractInsnNode
result
=
prev
;
next
=
result
;
prev
=
result
.
prev
;
remove
=
result
;
return
result
;
}
...
...
@@ -619,6 +632,7 @@ public class InsnList {
public
void
add
(
Object
o
)
{
InsnList
.
this
.
insertBefore
(
next
,
(
AbstractInsnNode
)
o
);
prev
=
(
AbstractInsnNode
)
o
;
remove
=
null
;
}
public
void
set
(
Object
o
)
{
...
...
src/share/classes/jdk/internal/org/objectweb/asm/tree/analysis/Analyzer.java
浏览文件 @
830d7a16
...
...
@@ -404,7 +404,7 @@ public class Analyzer<V extends Value> implements Opcodes {
* instruction of the method. The size of the returned array is
* equal to the number of instructions (and labels) of the method. A
* given frame is <tt>null</tt> if the corresponding instruction
* cannot be reached, or if an error occur
r
ed during the analysis of
* cannot be reached, or if an error occured during the analysis of
* the method.
*/
public
Frame
<
V
>[]
getFrames
()
{
...
...
src/share/classes/jdk/internal/org/objectweb/asm/tree/analysis/Interpreter.java
浏览文件 @
830d7a16
...
...
@@ -111,7 +111,7 @@ public abstract class Interpreter<V extends Value> {
* the bytecode instruction to be interpreted.
* @return the result of the interpretation of the given instruction.
* @throws AnalyzerException
* if an error occur
r
ed during the interpretation.
* if an error occured during the interpretation.
*/
public
abstract
V
newOperation
(
AbstractInsnNode
insn
)
throws
AnalyzerException
;
...
...
@@ -130,7 +130,7 @@ public abstract class Interpreter<V extends Value> {
* @return the result of the interpretation of the given instruction. The
* returned value must be <tt>equal</tt> to the given value.
* @throws AnalyzerException
* if an error occur
r
ed during the interpretation.
* if an error occured during the interpretation.
*/
public
abstract
V
copyOperation
(
AbstractInsnNode
insn
,
V
value
)
throws
AnalyzerException
;
...
...
@@ -151,7 +151,7 @@ public abstract class Interpreter<V extends Value> {
* the argument of the instruction to be interpreted.
* @return the result of the interpretation of the given instruction.
* @throws AnalyzerException
* if an error occur
r
ed during the interpretation.
* if an error occured during the interpretation.
*/
public
abstract
V
unaryOperation
(
AbstractInsnNode
insn
,
V
value
)
throws
AnalyzerException
;
...
...
@@ -175,7 +175,7 @@ public abstract class Interpreter<V extends Value> {
* the second argument of the instruction to be interpreted.
* @return the result of the interpretation of the given instruction.
* @throws AnalyzerException
* if an error occur
r
ed during the interpretation.
* if an error occured during the interpretation.
*/
public
abstract
V
binaryOperation
(
AbstractInsnNode
insn
,
V
value1
,
V
value2
)
throws
AnalyzerException
;
...
...
@@ -196,7 +196,7 @@ public abstract class Interpreter<V extends Value> {
* the third argument of the instruction to be interpreted.
* @return the result of the interpretation of the given instruction.
* @throws AnalyzerException
* if an error occur
r
ed during the interpretation.
* if an error occured during the interpretation.
*/
public
abstract
V
ternaryOperation
(
AbstractInsnNode
insn
,
V
value1
,
V
value2
,
V
value3
)
throws
AnalyzerException
;
...
...
@@ -214,7 +214,7 @@ public abstract class Interpreter<V extends Value> {
* the arguments of the instruction to be interpreted.
* @return the result of the interpretation of the given instruction.
* @throws AnalyzerException
* if an error occur
r
ed during the interpretation.
* if an error occured during the interpretation.
*/
public
abstract
V
naryOperation
(
AbstractInsnNode
insn
,
List
<?
extends
V
>
values
)
throws
AnalyzerException
;
...
...
@@ -232,7 +232,7 @@ public abstract class Interpreter<V extends Value> {
* @param expected
* the expected return type of the analyzed method.
* @throws AnalyzerException
* if an error occur
r
ed during the interpretation.
* if an error occured during the interpretation.
*/
public
abstract
void
returnOperation
(
AbstractInsnNode
insn
,
V
value
,
V
expected
)
throws
AnalyzerException
;
...
...
src/share/classes/jdk/internal/org/objectweb/asm/util/CheckAnnotationAdapter.java
浏览文件 @
830d7a16
...
...
@@ -99,7 +99,7 @@ public class CheckAnnotationAdapter extends AnnotationVisitor {
}
if
(
value
instanceof
Type
)
{
int
sort
=
((
Type
)
value
).
getSort
();
if
(
sort
!=
Type
.
OBJECT
&&
sort
!=
Type
.
ARRAY
)
{
if
(
sort
==
Type
.
METHOD
)
{
throw
new
IllegalArgumentException
(
"Invalid annotation value"
);
}
}
...
...
src/share/classes/jdk/internal/org/objectweb/asm/util/Textifier.java
浏览文件 @
830d7a16
...
...
@@ -166,6 +166,11 @@ public class Textifier extends Printer {
*/
protected
Map
<
Label
,
String
>
labelNames
;
/**
* Class access flags
*/
private
int
access
;
private
int
valueNumber
=
0
;
/**
...
...
@@ -245,6 +250,7 @@ public class Textifier extends Printer {
public
void
visit
(
final
int
version
,
final
int
access
,
final
String
name
,
final
String
signature
,
final
String
superName
,
final
String
[]
interfaces
)
{
this
.
access
=
access
;
int
major
=
version
&
0xFFFF
;
int
minor
=
version
>>>
16
;
buf
.
setLength
(
0
);
...
...
@@ -447,6 +453,11 @@ public class Textifier extends Printer {
if
((
access
&
Opcodes
.
ACC_BRIDGE
)
!=
0
)
{
buf
.
append
(
"bridge "
);
}
if
((
this
.
access
&
Opcodes
.
ACC_INTERFACE
)
!=
0
&&
(
access
&
Opcodes
.
ACC_ABSTRACT
)
==
0
&&
(
access
&
Opcodes
.
ACC_STATIC
)
==
0
)
{
buf
.
append
(
"default "
);
}
buf
.
append
(
name
);
appendDescriptor
(
METHOD_DESCRIPTOR
,
desc
);
...
...
@@ -856,7 +867,6 @@ public class Textifier extends Printer {
appendDescriptor
(
INTERNAL_NAME
,
owner
);
buf
.
append
(
'.'
).
append
(
name
).
append
(
' '
);
appendDescriptor
(
METHOD_DESCRIPTOR
,
desc
);
buf
.
append
(
' '
).
append
(
itf
?
"itf"
:
""
);
buf
.
append
(
'\n'
);
text
.
add
(
buf
.
toString
());
}
...
...
@@ -869,26 +879,35 @@ public class Textifier extends Printer {
buf
.
append
(
name
);
appendDescriptor
(
METHOD_DESCRIPTOR
,
desc
);
buf
.
append
(
" ["
);
buf
.
append
(
'\n'
);
buf
.
append
(
tab3
);
appendHandle
(
bsm
);
buf
.
append
(
'\n'
);
buf
.
append
(
tab3
).
append
(
"// arguments:"
);
if
(
bsmArgs
.
length
==
0
)
{
buf
.
append
(
" none"
);
}
else
{
buf
.
append
(
'\n'
)
.
append
(
tab3
)
;
buf
.
append
(
'\n'
);
for
(
int
i
=
0
;
i
<
bsmArgs
.
length
;
i
++)
{
buf
.
append
(
tab3
);
Object
cst
=
bsmArgs
[
i
];
if
(
cst
instanceof
String
)
{
Printer
.
appendString
(
buf
,
(
String
)
cst
);
}
else
if
(
cst
instanceof
Type
)
{
buf
.
append
(((
Type
)
cst
).
getDescriptor
()).
append
(
".class"
);
Type
type
=
(
Type
)
cst
;
if
(
type
.
getSort
()
==
Type
.
METHOD
){
appendDescriptor
(
METHOD_DESCRIPTOR
,
type
.
getDescriptor
());
}
else
{
buf
.
append
(
type
.
getDescriptor
()).
append
(
".class"
);
}
}
else
if
(
cst
instanceof
Handle
)
{
appendHandle
((
Handle
)
cst
);
}
else
{
buf
.
append
(
cst
);
}
buf
.
append
(
", "
);
buf
.
append
(
",
\n
"
);
}
buf
.
setLength
(
buf
.
length
()
-
2
);
buf
.
setLength
(
buf
.
length
()
-
3
);
}
buf
.
append
(
'\n'
);
buf
.
append
(
tab2
).
append
(
"]\n"
);
...
...
@@ -1234,10 +1253,10 @@ public class Textifier extends Printer {
* a handle, non null.
*/
protected
void
appendHandle
(
final
Handle
h
)
{
buf
.
append
(
'\n'
).
append
(
tab3
);
int
tag
=
h
.
getTag
();
buf
.
append
(
"// handle kind 0x"
).
append
(
Integer
.
toHexString
(
tag
))
.
append
(
" : "
);
boolean
isMethodHandle
=
false
;
switch
(
tag
)
{
case
Opcodes
.
H_GETFIELD
:
buf
.
append
(
"GETFIELD"
);
...
...
@@ -1253,18 +1272,23 @@ public class Textifier extends Printer {
break
;
case
Opcodes
.
H_INVOKEINTERFACE
:
buf
.
append
(
"INVOKEINTERFACE"
);
isMethodHandle
=
true
;
break
;
case
Opcodes
.
H_INVOKESPECIAL
:
buf
.
append
(
"INVOKESPECIAL"
);
isMethodHandle
=
true
;
break
;
case
Opcodes
.
H_INVOKESTATIC
:
buf
.
append
(
"INVOKESTATIC"
);
isMethodHandle
=
true
;
break
;
case
Opcodes
.
H_INVOKEVIRTUAL
:
buf
.
append
(
"INVOKEVIRTUAL"
);
isMethodHandle
=
true
;
break
;
case
Opcodes
.
H_NEWINVOKESPECIAL
:
buf
.
append
(
"NEWINVOKESPECIAL"
);
isMethodHandle
=
true
;
break
;
}
buf
.
append
(
'\n'
);
...
...
@@ -1272,9 +1296,13 @@ public class Textifier extends Printer {
appendDescriptor
(
INTERNAL_NAME
,
h
.
getOwner
());
buf
.
append
(
'.'
);
buf
.
append
(
h
.
getName
());
buf
.
append
(
'('
);
if
(!
isMethodHandle
){
buf
.
append
(
'('
);
}
appendDescriptor
(
HANDLE_DESCRIPTOR
,
h
.
getDesc
());
buf
.
append
(
')'
).
append
(
'\n'
);
if
(!
isMethodHandle
){
buf
.
append
(
')'
);
}
}
/**
...
...
src/share/classes/jdk/internal/org/objectweb/asm/version.txt
浏览文件 @
830d7a16
Path: .
Working Copy Root Path: /hudson/jobs/objectweb-pull/workspace/
ASM_5_0_BETA
URL:
svn://svn.forge.objectweb.org
/svnroot/asm/trunk/asm
Repository Root:
svn://svn.forge.objectweb.org
/svnroot/asm
Working Copy Root Path: /hudson/jobs/objectweb-pull/workspace/
asm-svn-2014-03-12
URL:
file://
/svnroot/asm/trunk/asm
Repository Root:
file://
/svnroot/asm
Repository UUID: 271bd773-ee82-43a6-9b2b-1890ed8ce7f9
Revision: 17
00
Revision: 17
21
Node Kind: directory
Schedule: normal
Last Changed Author: ebruneton
Last Changed Rev: 17
00
Last Changed Date: 201
3-10-29 20:22:52 +0100 (Tue, 29 Oct 2013
)
Last Changed Rev: 17
21
Last Changed Date: 201
4-03-02 17:25:35 +0100 (Sun, 02 Mar 2014
)
src/share/classes/sun/java2d/SunGraphics2D.java
浏览文件 @
830d7a16
...
...
@@ -2430,6 +2430,8 @@ public final class SunGraphics2D
surfaceData
=
NullSurfaceData
.
theInstance
;
}
invalidatePipe
();
// this will recalculate the composite clip
setDevClip
(
surfaceData
.
getBounds
());
...
...
src/share/classes/sun/security/krb5/Config.java
浏览文件 @
830d7a16
...
...
@@ -549,12 +549,11 @@ public class Config {
previous
=
line
.
substring
(
1
).
trim
();
}
}
else
{
if
(
previous
==
null
)
{
throw
new
KrbException
(
"Config file must starts with a section"
);
// Lines before the first section are ignored
if
(
previous
!=
null
)
{
v
.
add
(
previous
);
previous
=
line
;
}
v
.
add
(
previous
);
previous
=
line
;
}
}
if
(
previous
!=
null
)
{
...
...
src/share/classes/sun/security/provider/certpath/PKIXCertPathValidator.java
浏览文件 @
830d7a16
...
...
@@ -94,9 +94,6 @@ public final class PKIXCertPathValidator extends CertPathValidatorSpi {
X509Certificate
firstCert
=
certList
.
get
(
0
);
// check trusted certificate's subject
selector
.
setSubject
(
firstCert
.
getIssuerX500Principal
());
// check the validity period
selector
.
setValidityPeriod
(
firstCert
.
getNotBefore
(),
firstCert
.
getNotAfter
());
/*
* Facilitate certification path construction with authority
* key identifier and subject key identifier.
...
...
src/windows/native/sun/windows/awt_DesktopProperties.cpp
浏览文件 @
830d7a16
/*
* Copyright (c) 1999, 201
3
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 201
4
, 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
...
...
@@ -83,13 +83,19 @@ void AwtDesktopProperties::GetSystemProperties() {
HDC
dc
=
CreateDC
(
TEXT
(
"DISPLAY"
),
NULL
,
NULL
,
NULL
);
if
(
dc
!=
NULL
)
{
SetFontProperty
(
dc
,
ANSI_FIXED_FONT
,
TEXT
(
"win.ansiFixed.font"
));
SetFontProperty
(
dc
,
ANSI_VAR_FONT
,
TEXT
(
"win.ansiVar.font"
));
SetFontProperty
(
dc
,
DEVICE_DEFAULT_FONT
,
TEXT
(
"win.deviceDefault.font"
));
SetFontProperty
(
dc
,
DEFAULT_GUI_FONT
,
TEXT
(
"win.defaultGUI.font"
));
SetFontProperty
(
dc
,
OEM_FIXED_FONT
,
TEXT
(
"win.oemFixed.font"
));
SetFontProperty
(
dc
,
SYSTEM_FONT
,
TEXT
(
"win.system.font"
));
SetFontProperty
(
dc
,
SYSTEM_FIXED_FONT
,
TEXT
(
"win.systemFixed.font"
));
try
{
SetFontProperty
(
dc
,
ANSI_FIXED_FONT
,
TEXT
(
"win.ansiFixed.font"
));
SetFontProperty
(
dc
,
ANSI_VAR_FONT
,
TEXT
(
"win.ansiVar.font"
));
SetFontProperty
(
dc
,
DEVICE_DEFAULT_FONT
,
TEXT
(
"win.deviceDefault.font"
));
SetFontProperty
(
dc
,
DEFAULT_GUI_FONT
,
TEXT
(
"win.defaultGUI.font"
));
SetFontProperty
(
dc
,
OEM_FIXED_FONT
,
TEXT
(
"win.oemFixed.font"
));
SetFontProperty
(
dc
,
SYSTEM_FONT
,
TEXT
(
"win.system.font"
));
SetFontProperty
(
dc
,
SYSTEM_FIXED_FONT
,
TEXT
(
"win.systemFixed.font"
));
}
catch
(
std
::
bad_alloc
&
)
{
DeleteDC
(
dc
);
throw
;
}
DeleteDC
(
dc
);
}
}
...
...
@@ -206,24 +212,35 @@ void AwtDesktopProperties::GetXPStyleProperties() {
LPTSTR
value
;
value
=
getXPStylePropFromReg
(
TEXT
(
"ThemeActive"
));
SetBooleanProperty
(
TEXT
(
"win.xpstyle.themeActive"
),
(
value
!=
NULL
&&
*
value
==
_T
(
'1'
)));
if
(
value
!=
NULL
)
{
free
(
value
);
}
value
=
getXPStylePropFromReg
(
TEXT
(
"DllName"
));
if
(
value
!=
NULL
)
{
SetStringProperty
(
TEXT
(
"win.xpstyle.dllName"
),
value
);
free
(
value
);
}
value
=
getXPStylePropFromReg
(
TEXT
(
"SizeName"
));
if
(
value
!=
NULL
)
{
SetStringProperty
(
TEXT
(
"win.xpstyle.sizeName"
),
value
);
free
(
value
);
try
{
SetBooleanProperty
(
TEXT
(
"win.xpstyle.themeActive"
),
(
value
!=
NULL
&&
*
value
==
_T
(
'1'
)));
if
(
value
!=
NULL
)
{
free
(
value
);
value
=
NULL
;
}
value
=
getXPStylePropFromReg
(
TEXT
(
"DllName"
));
if
(
value
!=
NULL
)
{
SetStringProperty
(
TEXT
(
"win.xpstyle.dllName"
),
value
);
free
(
value
);
value
=
NULL
;
}
value
=
getXPStylePropFromReg
(
TEXT
(
"SizeName"
));
if
(
value
!=
NULL
)
{
SetStringProperty
(
TEXT
(
"win.xpstyle.sizeName"
),
value
);
free
(
value
);
value
=
NULL
;
}
value
=
getXPStylePropFromReg
(
TEXT
(
"ColorName"
));
if
(
value
!=
NULL
)
{
SetStringProperty
(
TEXT
(
"win.xpstyle.colorName"
),
value
);
free
(
value
);
}
}
value
=
getXPStylePropFromReg
(
TEXT
(
"ColorName"
));
if
(
value
!=
NULL
)
{
SetStringProperty
(
TEXT
(
"win.xpstyle.colorName"
),
value
);
free
(
value
);
catch
(
std
::
bad_alloc
&
)
{
if
(
value
!=
NULL
)
{
free
(
value
);
}
throw
;
}
}
...
...
@@ -564,27 +581,37 @@ void AwtDesktopProperties::GetOtherParameters() {
// Shell Icon BPP - only honored on platforms before XP
value
=
getWindowsPropFromReg
(
TEXT
(
"Control Panel
\\
Desktop
\\
WindowMetrics"
),
TEXT
(
"Shell Icon BPP"
),
&
valueType
);
if
(
value
!=
NULL
)
{
if
(
valueType
==
REG_SZ
)
{
SetStringProperty
(
TEXT
(
"win.icon.shellIconBPP"
),
value
);
try
{
if
(
value
!=
NULL
)
{
if
(
valueType
==
REG_SZ
)
{
SetStringProperty
(
TEXT
(
"win.icon.shellIconBPP"
),
value
);
}
free
(
value
);
value
=
NULL
;
}
free
(
value
);
}
// The following registry settings control the file chooser places bar
// under the Windows L&F. These settings are not present by default, but
// can be enabled using the TweakUI tool from Microsoft. For more info,
// see http://msdn.microsoft.com/msdnmag/issues/1100/Registry/
// The following registry settings control the file chooser places bar
// under the Windows L&F. These settings are not present by default, but
// can be enabled using the TweakUI tool from Microsoft. For more info,
// see http://msdn.microsoft.com/msdnmag/issues/1100/Registry/
// NoPlacesBar is a REG_DWORD, with values 0 or 1
value
=
getWindowsPropFromReg
(
TEXT
(
"Software
\\
Microsoft
\\
Windows
\\
CurrentVersion
\\
Policies
\\
comdlg32"
),
TEXT
(
"NoPlacesBar"
),
&
valueType
);
if
(
value
!=
NULL
)
{
if
(
valueType
==
REG_DWORD
)
{
SetBooleanProperty
(
TEXT
(
"win.comdlg.noPlacesBar"
),
(
BOOL
)((
int
)
*
value
!=
0
));
// NoPlacesBar is a REG_DWORD, with values 0 or 1
value
=
getWindowsPropFromReg
(
TEXT
(
"Software
\\
Microsoft
\\
Windows
\\
CurrentVersion
\\
Policies
\\
comdlg32"
),
TEXT
(
"NoPlacesBar"
),
&
valueType
);
if
(
value
!=
NULL
)
{
if
(
valueType
==
REG_DWORD
)
{
SetBooleanProperty
(
TEXT
(
"win.comdlg.noPlacesBar"
),
(
BOOL
)((
int
)
*
value
!=
0
));
}
free
(
value
);
}
free
(
value
);
}
catch
(
std
::
bad_alloc
&
)
{
if
(
value
!=
NULL
)
{
free
(
value
);
}
throw
;
}
LPTSTR
valueName
=
TEXT
(
"PlaceN"
);
...
...
@@ -592,7 +619,15 @@ void AwtDesktopProperties::GetOtherParameters() {
lstrcpy
(
valueNameBuf
,
valueName
);
LPTSTR
propKey
=
TEXT
(
"win.comdlg.placesBarPlaceN"
);
LPTSTR
propKeyBuf
=
(
LPTSTR
)
SAFE_SIZE_ARRAY_ALLOC
(
safe_Malloc
,
(
lstrlen
(
propKey
)
+
1
),
sizeof
(
TCHAR
));
LPTSTR
propKeyBuf
;
try
{
propKeyBuf
=
(
LPTSTR
)
SAFE_SIZE_ARRAY_ALLOC
(
safe_Malloc
,
(
lstrlen
(
propKey
)
+
1
),
sizeof
(
TCHAR
));
}
catch
(
std
::
bad_alloc
&
)
{
free
(
valueNameBuf
);
throw
;
}
lstrcpy
(
propKeyBuf
,
propKey
);
int
i
=
0
;
...
...
@@ -601,20 +636,31 @@ void AwtDesktopProperties::GetOtherParameters() {
propKeyBuf
[
25
]
=
valueNameBuf
[
5
];
LPTSTR
key
=
TEXT
(
"Software
\\
Microsoft
\\
Windows
\\
CurrentVersion
\\
Policies
\\
comdlg32
\\
PlacesBar"
);
if
((
value
=
getWindowsPropFromReg
(
key
,
valueNameBuf
,
&
valueType
))
!=
NULL
)
{
if
(
valueType
==
REG_DWORD
)
{
// Value is a CSIDL
SetIntegerProperty
(
propKeyBuf
,
(
int
)
*
value
);
}
else
{
// Value is a path
SetStringProperty
(
propKeyBuf
,
value
);
try
{
value
=
NULL
;
if
((
value
=
getWindowsPropFromReg
(
key
,
valueNameBuf
,
&
valueType
))
!=
NULL
)
{
if
(
valueType
==
REG_DWORD
)
{
// Value is a CSIDL
SetIntegerProperty
(
propKeyBuf
,
(
int
)
*
value
);
}
else
{
// Value is a path
SetStringProperty
(
propKeyBuf
,
value
);
}
free
(
value
);
}
free
(
value
);
}
catch
(
std
::
bad_alloc
&
)
{
if
(
value
!=
NULL
)
{
free
(
value
);
}
free
(
propKeyBuf
);
free
(
valueNameBuf
);
throw
;
}
}
while
(
value
!=
NULL
);
free
(
valueNameBuf
);
free
(
propKeyBuf
);
free
(
valueNameBuf
);
}
void
AwtDesktopProperties
::
GetSoundEvents
()
{
...
...
@@ -656,14 +702,26 @@ UINT AwtDesktopProperties::GetIntegerParameter(UINT spi) {
void
AwtDesktopProperties
::
SetStringProperty
(
LPCTSTR
propName
,
LPTSTR
value
)
{
jstring
key
=
JNU_NewStringPlatform
(
GetEnv
(),
propName
);
if
(
key
==
NULL
)
{
throw
std
::
bad_alloc
();
}
jstring
jValue
=
JNU_NewStringPlatform
(
GetEnv
(),
value
);
if
(
jValue
==
NULL
)
{
GetEnv
()
->
DeleteLocalRef
(
key
);
throw
std
::
bad_alloc
();
}
GetEnv
()
->
CallVoidMethod
(
self
,
AwtDesktopProperties
::
setStringPropertyID
,
key
,
JNU_NewStringPlatform
(
GetEnv
(),
value
));
key
,
jValue
);
GetEnv
()
->
DeleteLocalRef
(
jValue
);
GetEnv
()
->
DeleteLocalRef
(
key
);
}
void
AwtDesktopProperties
::
SetIntegerProperty
(
LPCTSTR
propName
,
int
value
)
{
jstring
key
=
JNU_NewStringPlatform
(
GetEnv
(),
propName
);
if
(
key
==
NULL
)
{
throw
std
::
bad_alloc
();
}
GetEnv
()
->
CallVoidMethod
(
self
,
AwtDesktopProperties
::
setIntegerPropertyID
,
key
,
(
jint
)
value
);
...
...
@@ -672,6 +730,9 @@ void AwtDesktopProperties::SetIntegerProperty(LPCTSTR propName, int value) {
void
AwtDesktopProperties
::
SetBooleanProperty
(
LPCTSTR
propName
,
BOOL
value
)
{
jstring
key
=
JNU_NewStringPlatform
(
GetEnv
(),
propName
);
if
(
key
==
NULL
)
{
throw
std
::
bad_alloc
();
}
GetEnv
()
->
CallVoidMethod
(
self
,
AwtDesktopProperties
::
setBooleanPropertyID
,
key
,
value
?
JNI_TRUE
:
JNI_FALSE
);
...
...
@@ -680,6 +741,9 @@ void AwtDesktopProperties::SetBooleanProperty(LPCTSTR propName, BOOL value) {
void
AwtDesktopProperties
::
SetColorProperty
(
LPCTSTR
propName
,
DWORD
value
)
{
jstring
key
=
JNU_NewStringPlatform
(
GetEnv
(),
propName
);
if
(
key
==
NULL
)
{
throw
std
::
bad_alloc
();
}
GetEnv
()
->
CallVoidMethod
(
self
,
AwtDesktopProperties
::
setColorPropertyID
,
key
,
GetRValue
(
value
),
GetGValue
(
value
),
...
...
@@ -720,6 +784,11 @@ void AwtDesktopProperties::SetFontProperty(HDC dc, int fontID,
else
{
fontName
=
JNU_NewStringPlatform
(
GetEnv
(),
face
);
}
if
(
fontName
==
NULL
)
{
delete
[]
face
;
throw
std
::
bad_alloc
();
}
jint
pointSize
=
metrics
.
tmHeight
-
metrics
.
tmInternalLeading
;
jint
style
=
java_awt_Font_PLAIN
;
...
...
@@ -732,11 +801,16 @@ void AwtDesktopProperties::SetFontProperty(HDC dc, int fontID,
}
jstring
key
=
JNU_NewStringPlatform
(
GetEnv
(),
propName
);
if
(
key
==
NULL
)
{
GetEnv
()
->
DeleteLocalRef
(
fontName
);
delete
[]
face
;
throw
std
::
bad_alloc
();
}
GetEnv
()
->
CallVoidMethod
(
self
,
AwtDesktopProperties
::
setFontPropertyID
,
key
,
fontName
,
style
,
pointSize
);
GetEnv
()
->
DeleteLocalRef
(
fontName
);
GetEnv
()
->
DeleteLocalRef
(
key
);
GetEnv
()
->
DeleteLocalRef
(
fontName
);
}
}
delete
[]
face
;
...
...
@@ -750,7 +824,9 @@ void AwtDesktopProperties::SetFontProperty(LPCTSTR propName, const LOGFONT & fon
jint
style
;
fontName
=
JNU_NewStringPlatform
(
GetEnv
(),
font
.
lfFaceName
);
if
(
fontName
==
NULL
)
{
throw
std
::
bad_alloc
();
}
#if 0
HDC hdc;
int pixelsPerInch = GetDeviceCaps(hdc, LOGPIXELSY);
...
...
@@ -773,22 +849,31 @@ void AwtDesktopProperties::SetFontProperty(LPCTSTR propName, const LOGFONT & fon
}
jstring
key
=
JNU_NewStringPlatform
(
GetEnv
(),
propName
);
if
(
key
==
NULL
)
{
GetEnv
()
->
DeleteLocalRef
(
fontName
);
throw
std
::
bad_alloc
();
}
GetEnv
()
->
CallVoidMethod
(
self
,
AwtDesktopProperties
::
setFontPropertyID
,
key
,
fontName
,
style
,
pointSize
);
GetEnv
()
->
DeleteLocalRef
(
fontName
);
GetEnv
()
->
DeleteLocalRef
(
key
);
GetEnv
()
->
DeleteLocalRef
(
fontName
);
}
void
AwtDesktopProperties
::
SetSoundProperty
(
LPCTSTR
propName
,
LPCTSTR
winEventName
)
{
jstring
key
=
JNU_NewStringPlatform
(
GetEnv
(),
propName
);
if
(
key
==
NULL
)
{
throw
std
::
bad_alloc
();
}
jstring
event
=
JNU_NewStringPlatform
(
GetEnv
(),
winEventName
);
if
(
event
==
NULL
)
{
GetEnv
()
->
DeleteLocalRef
(
key
);
throw
std
::
bad_alloc
();
}
GetEnv
()
->
CallVoidMethod
(
self
,
AwtDesktopProperties
::
setSoundPropertyID
,
key
,
event
);
GetEnv
()
->
DeleteLocalRef
(
key
);
GetEnv
()
->
DeleteLocalRef
(
event
);
GetEnv
()
->
DeleteLocalRef
(
key
);
}
void
AwtDesktopProperties
::
PlayWindowsSound
(
LPCTSTR
event
)
{
...
...
@@ -814,24 +899,37 @@ Java_sun_awt_windows_WDesktopProperties_initIDs(JNIEnv *env, jclass cls) {
AwtDesktopProperties
::
pDataID
=
env
->
GetFieldID
(
cls
,
"pData"
,
"J"
);
DASSERT
(
AwtDesktopProperties
::
pDataID
!=
0
);
CHECK_NULL
(
AwtDesktopProperties
::
pDataID
);
AwtDesktopProperties
::
setBooleanPropertyID
=
env
->
GetMethodID
(
cls
,
"setBooleanProperty"
,
"(Ljava/lang/String;Z)V"
);
AwtDesktopProperties
::
setBooleanPropertyID
=
env
->
GetMethodID
(
cls
,
"setBooleanProperty"
,
"(Ljava/lang/String;Z)V"
);
DASSERT
(
AwtDesktopProperties
::
setBooleanPropertyID
!=
0
);
CHECK_NULL
(
AwtDesktopProperties
::
setBooleanPropertyID
);
AwtDesktopProperties
::
setIntegerPropertyID
=
env
->
GetMethodID
(
cls
,
"setIntegerProperty"
,
"(Ljava/lang/String;I)V"
);
AwtDesktopProperties
::
setIntegerPropertyID
=
env
->
GetMethodID
(
cls
,
"setIntegerProperty"
,
"(Ljava/lang/String;I)V"
);
DASSERT
(
AwtDesktopProperties
::
setIntegerPropertyID
!=
0
);
CHECK_NULL
(
AwtDesktopProperties
::
setIntegerPropertyID
);
AwtDesktopProperties
::
setStringPropertyID
=
env
->
GetMethodID
(
cls
,
"setStringProperty"
,
"(Ljava/lang/String;Ljava/lang/String;)V"
);
AwtDesktopProperties
::
setStringPropertyID
=
env
->
GetMethodID
(
cls
,
"setStringProperty"
,
"(Ljava/lang/String;Ljava/lang/String;)V"
);
DASSERT
(
AwtDesktopProperties
::
setStringPropertyID
!=
0
);
CHECK_NULL
(
AwtDesktopProperties
::
setStringPropertyID
);
AwtDesktopProperties
::
setColorPropertyID
=
env
->
GetMethodID
(
cls
,
"setColorProperty"
,
"(Ljava/lang/String;III)V"
);
AwtDesktopProperties
::
setColorPropertyID
=
env
->
GetMethodID
(
cls
,
"setColorProperty"
,
"(Ljava/lang/String;III)V"
);
DASSERT
(
AwtDesktopProperties
::
setColorPropertyID
!=
0
);
CHECK_NULL
(
AwtDesktopProperties
::
setColorPropertyID
);
AwtDesktopProperties
::
setFontPropertyID
=
env
->
GetMethodID
(
cls
,
"setFontProperty"
,
"(Ljava/lang/String;Ljava/lang/String;II)V"
);
AwtDesktopProperties
::
setFontPropertyID
=
env
->
GetMethodID
(
cls
,
"setFontProperty"
,
"(Ljava/lang/String;Ljava/lang/String;II)V"
);
DASSERT
(
AwtDesktopProperties
::
setFontPropertyID
!=
0
);
CHECK_NULL
(
AwtDesktopProperties
::
setFontPropertyID
);
AwtDesktopProperties
::
setSoundPropertyID
=
env
->
GetMethodID
(
cls
,
"setSoundProperty"
,
"(Ljava/lang/String;Ljava/lang/String;)V"
);
AwtDesktopProperties
::
setSoundPropertyID
=
env
->
GetMethodID
(
cls
,
"setSoundProperty"
,
"(Ljava/lang/String;Ljava/lang/String;)V"
);
DASSERT
(
AwtDesktopProperties
::
setSoundPropertyID
!=
0
);
CHECK_NULL
(
AwtDesktopProperties
::
setSoundPropertyID
);
CATCH_BAD_ALLOC
;
}
...
...
src/windows/native/sun/windows/awt_Event.cpp
浏览文件 @
830d7a16
/*
* Copyright (c) 1998,
1999
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998,
2014
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
...
...
@@ -45,12 +45,16 @@ Java_java_awt_Event_initIDs(JNIEnv *env, jclass cls) {
TRY
;
AwtEvent
::
targetID
=
env
->
GetFieldID
(
cls
,
"target"
,
"Ljava/lang/Object;"
);
AwtEvent
::
xID
=
env
->
GetFieldID
(
cls
,
"x"
,
"I"
);
AwtEvent
::
yID
=
env
->
GetFieldID
(
cls
,
"y"
,
"I"
);
DASSERT
(
AwtEvent
::
targetID
!=
NULL
);
CHECK_NULL
(
AwtEvent
::
targetID
);
AwtEvent
::
xID
=
env
->
GetFieldID
(
cls
,
"x"
,
"I"
);
DASSERT
(
AwtEvent
::
xID
!=
NULL
);
CHECK_NULL
(
AwtEvent
::
xID
);
AwtEvent
::
yID
=
env
->
GetFieldID
(
cls
,
"y"
,
"I"
);
DASSERT
(
AwtEvent
::
yID
!=
NULL
);
CHECK_NULL
(
AwtEvent
::
yID
);
CATCH_BAD_ALLOC
;
}
...
...
src/windows/native/sun/windows/awt_MouseEvent.cpp
浏览文件 @
830d7a16
/*
* Copyright (c) 1998, 20
01
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 20
14
, 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
...
...
@@ -45,12 +45,16 @@ Java_java_awt_event_MouseEvent_initIDs(JNIEnv *env, jclass cls) {
TRY
;
AwtMouseEvent
::
xID
=
env
->
GetFieldID
(
cls
,
"x"
,
"I"
);
AwtMouseEvent
::
yID
=
env
->
GetFieldID
(
cls
,
"y"
,
"I"
);
AwtMouseEvent
::
buttonID
=
env
->
GetFieldID
(
cls
,
"button"
,
"I"
);
DASSERT
(
AwtMouseEvent
::
xID
!=
NULL
);
CHECK_NULL
(
AwtMouseEvent
::
xID
);
AwtMouseEvent
::
yID
=
env
->
GetFieldID
(
cls
,
"y"
,
"I"
);
DASSERT
(
AwtMouseEvent
::
yID
!=
NULL
);
CHECK_NULL
(
AwtMouseEvent
::
yID
);
AwtMouseEvent
::
buttonID
=
env
->
GetFieldID
(
cls
,
"button"
,
"I"
);
DASSERT
(
AwtMouseEvent
::
buttonID
!=
NULL
);
CHECK_NULL
(
AwtMouseEvent
::
buttonID
);
CATCH_BAD_ALLOC
;
}
...
...
test/ProblemList.txt
浏览文件 @
830d7a16
...
...
@@ -229,15 +229,6 @@ sun/security/pkcs11/sslecc/ClientJSSEServerJSSE.java solaris-all
java/security/KeyPairGenerator/SolarisShortDSA.java solaris-all
sun/security/tools/keytool/standard.sh solaris-all
# 8000439: NPG: REGRESSION : sun/security/krb5/auto/MaxRetries.java fails with timeout
sun/security/krb5/auto/MaxRetries.java solaris-sparcv9
# 8006690: sun/security/krb5/auto/BadKdc1.java fails intermittently
sun/security/krb5/auto/BadKdc1.java solaris-sparcv9
sun/security/krb5/auto/BadKdc2.java solaris-sparcv9
sun/security/krb5/auto/BadKdc3.java solaris-sparcv9
sun/security/krb5/auto/BadKdc4.java solaris-sparcv9
############################################################################
# jdk_sound
...
...
test/java/awt/FileDialog/SaveFileNameOverrideTest/SaveFileNameOverrideTest.java
浏览文件 @
830d7a16
/*
* Copyright (c) 2011, 201
3
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 201
4
, 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
...
...
@@ -23,7 +23,7 @@
/*
test
@bug 6998877
@bug 6998877
8022531
@summary After double-click on the folder names, FileNameOverrideTest FAILED
@author Sergey.Bylokhov@oracle.com area=awt.filedialog
@library ../../regtesthelpers
...
...
@@ -59,7 +59,8 @@ public class SaveFileNameOverrideTest extends Applet implements ActionListener {
String
[]
instructions
=
{
"1) Click on 'Show File Dialog' button. A file dialog will come up."
,
"2) Double-click on '"
+
clickDirName
+
"' and click OK."
,
"2) Double-click on '"
+
clickDirName
+
"' and click a confirmation"
,
" button, it can be 'OK', 'Save' or any other platform-dependent name."
,
"3) See result of the test below"
};
...
...
test/java/awt/Toolkit/Headless/WrappedToolkitTest/WrappedToolkitTest.sh
浏览文件 @
830d7a16
#!/bin/ksh -p
#
# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2012,
2014,
Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
...
...
@@ -25,7 +25,7 @@
#
# @test
# @bug 6282388
# @bug 6282388
8030640
# @summary Tests that AWT use correct toolkit to be wrapped into HeadlessToolkit
# @author artem.ananiev@sun.com: area=awt.headless
# @compile TestWrapped.java
...
...
@@ -59,30 +59,14 @@ pass()
# Checking for proper OS
OS
=
`
uname
-s
`
case
"
$OS
"
in
SunOS
)
VAR
=
"One value for Sun"
DEFAULT_JDK
=
/usr/local/java/jdk1.2/solaris
SunOS
|
Linux
|
Darwin
|
CYGWIN
*
)
FILESEP
=
"/"
;;
Linux
)
VAR
=
"A different value for Linux"
DEFAULT_JDK
=
/usr/local/java/jdk1.4/linux-i386
FILESEP
=
"/"
;;
Windows
*
|
CYGWIN
*
)
VAR
=
"A different value for Win32"
DEFAULT_JDK
=
/usr/local/java/jdk1.2/win32
Windows
*
)
FILESEP
=
"
\\
"
;;
Darwin
)
VAR
=
"Lets not forget about Mac"
DEFAULT_JDK
=
$(
/usr/libexec/java_home
)
FILESEP
=
"/"
;;
# catch all other OSs
*
)
echo
"Unrecognized system!
$OS
"
...
...
@@ -113,8 +97,7 @@ if [ -z "${TESTJAVA}" ] ; then
# THIS IS THE JDK BEING TESTED.
if
[
-n
"
$1
"
]
;
then
TESTJAVA
=
$1
else
echo
"no JDK specified on command line so using default!"
TESTJAVA
=
$DEFAULT_JDK
else
fail
"no JDK specified on command line!"
fi
TESTSRC
=
.
TESTCLASSES
=
.
...
...
test/java/awt/event/KeyEvent/SwallowKeyEvents/SwallowKeyEvents.java
浏览文件 @
830d7a16
/*
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012,
2014,
Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
...
...
@@ -23,7 +23,7 @@
/*
@test
@bug 7154072
@bug 7154072
7161320
@summary Tests that key events with modifiers are not swallowed.
@author anton.tarasov: area=awt.focus
@library ../../../regtesthelpers
...
...
@@ -49,6 +49,11 @@ public class SwallowKeyEvents {
static
Robot
r
;
public
static
void
main
(
String
[]
args
)
{
if
(
sun
.
awt
.
OSInfo
.
getOSType
()
==
sun
.
awt
.
OSInfo
.
OSType
.
WINDOWS
)
{
System
.
out
.
println
(
"Skipped. Test not for MS Windows."
);
return
;
}
f
.
add
(
t
);
f
.
pack
();
f
.
setVisible
(
true
);
...
...
test/java/util/Arrays/StreamAndSpliterator.java
0 → 100644
浏览文件 @
830d7a16
/*
* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* 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 8037857
* @summary tests for stream and spliterator factory methods
* @run testng StreamAndSpliterator
*/
import
org.testng.annotations.Test
;
import
java.util.Arrays
;
import
java.util.Spliterators
;
import
static
org
.
testng
.
Assert
.
assertNotNull
;
public
class
StreamAndSpliterator
{
@Test
public
void
testStreamNPEs
()
{
assertThrowsNPE
(()
->
Arrays
.
stream
((
int
[])
null
,
0
,
0
));
assertThrowsNPE
(()
->
Arrays
.
stream
((
long
[])
null
,
0
,
0
));
assertThrowsNPE
(()
->
Arrays
.
stream
((
double
[])
null
,
0
,
0
));
assertThrowsNPE
(()
->
Arrays
.
stream
((
String
[])
null
,
0
,
0
));
}
@Test
public
void
testStreamAIOBEs
()
{
// origin > fence
assertThrowsAIOOB
(()
->
Arrays
.
stream
(
new
int
[]{},
1
,
0
));
assertThrowsAIOOB
(()
->
Arrays
.
stream
(
new
long
[]{},
1
,
0
));
assertThrowsAIOOB
(()
->
Arrays
.
stream
(
new
double
[]{},
1
,
0
));
assertThrowsAIOOB
(()
->
Arrays
.
stream
(
new
String
[]{},
1
,
0
));
// bad origin
assertThrowsAIOOB
(()
->
Arrays
.
stream
(
new
int
[]{},
-
1
,
0
));
assertThrowsAIOOB
(()
->
Arrays
.
stream
(
new
long
[]{},
-
1
,
0
));
assertThrowsAIOOB
(()
->
Arrays
.
stream
(
new
double
[]{},
-
1
,
0
));
assertThrowsAIOOB
(()
->
Arrays
.
stream
(
new
String
[]{},
-
1
,
0
));
// bad fence
assertThrowsAIOOB
(()
->
Arrays
.
stream
(
new
int
[]{},
0
,
1
));
assertThrowsAIOOB
(()
->
Arrays
.
stream
(
new
long
[]{},
0
,
1
));
assertThrowsAIOOB
(()
->
Arrays
.
stream
(
new
double
[]{},
0
,
1
));
assertThrowsAIOOB
(()
->
Arrays
.
stream
(
new
String
[]{},
0
,
1
));
}
@Test
public
void
testSpliteratorNPEs
()
{
assertThrowsNPE
(()
->
Arrays
.
spliterator
((
int
[])
null
,
0
,
0
));
assertThrowsNPE
(()
->
Arrays
.
spliterator
((
long
[])
null
,
0
,
0
));
assertThrowsNPE
(()
->
Arrays
.
spliterator
((
double
[])
null
,
0
,
0
));
assertThrowsNPE
(()
->
Arrays
.
spliterator
((
String
[])
null
,
0
,
0
));
}
@Test
public
void
testSpliteratorAIOBEs
()
{
// origin > fence
assertThrowsAIOOB
(()
->
Arrays
.
spliterator
(
new
int
[]{},
1
,
0
));
assertThrowsAIOOB
(()
->
Arrays
.
spliterator
(
new
long
[]{},
1
,
0
));
assertThrowsAIOOB
(()
->
Arrays
.
spliterator
(
new
double
[]{},
1
,
0
));
assertThrowsAIOOB
(()
->
Arrays
.
spliterator
(
new
String
[]{},
1
,
0
));
// bad origin
assertThrowsAIOOB
(()
->
Arrays
.
spliterator
(
new
int
[]{},
-
1
,
0
));
assertThrowsAIOOB
(()
->
Arrays
.
spliterator
(
new
long
[]{},
-
1
,
0
));
assertThrowsAIOOB
(()
->
Arrays
.
spliterator
(
new
double
[]{},
-
1
,
0
));
assertThrowsAIOOB
(()
->
Arrays
.
spliterator
(
new
String
[]{},
-
1
,
0
));
// bad fence
assertThrowsAIOOB
(()
->
Arrays
.
spliterator
(
new
int
[]{},
0
,
1
));
assertThrowsAIOOB
(()
->
Arrays
.
spliterator
(
new
long
[]{},
0
,
1
));
assertThrowsAIOOB
(()
->
Arrays
.
spliterator
(
new
double
[]{},
0
,
1
));
assertThrowsAIOOB
(()
->
Arrays
.
spliterator
(
new
String
[]{},
0
,
1
));
}
@Test
public
void
testSpliteratorNPEsFromSpliterators
()
{
assertThrowsNPE
(()
->
Spliterators
.
spliterator
((
int
[])
null
,
0
,
0
,
0
));
assertThrowsNPE
(()
->
Spliterators
.
spliterator
((
long
[])
null
,
0
,
0
,
0
));
assertThrowsNPE
(()
->
Spliterators
.
spliterator
((
double
[])
null
,
0
,
0
,
0
));
assertThrowsNPE
(()
->
Spliterators
.
spliterator
((
String
[])
null
,
0
,
0
,
0
));
}
@Test
public
void
testSpliteratorAIOBEsFromSpliterators
()
{
// origin > fence
assertThrowsAIOOB
(()
->
Spliterators
.
spliterator
(
new
int
[]{},
1
,
0
,
0
));
assertThrowsAIOOB
(()
->
Spliterators
.
spliterator
(
new
long
[]{},
1
,
0
,
0
));
assertThrowsAIOOB
(()
->
Spliterators
.
spliterator
(
new
double
[]{},
1
,
0
,
0
));
assertThrowsAIOOB
(()
->
Spliterators
.
spliterator
(
new
String
[]{},
1
,
0
,
0
));
// bad origin
assertThrowsAIOOB
(()
->
Spliterators
.
spliterator
(
new
int
[]{},
-
1
,
0
,
0
));
assertThrowsAIOOB
(()
->
Spliterators
.
spliterator
(
new
long
[]{},
-
1
,
0
,
0
));
assertThrowsAIOOB
(()
->
Spliterators
.
spliterator
(
new
double
[]{},
-
1
,
0
,
0
));
assertThrowsAIOOB
(()
->
Spliterators
.
spliterator
(
new
String
[]{},
-
1
,
0
,
0
));
// bad fence
assertThrowsAIOOB
(()
->
Spliterators
.
spliterator
(
new
int
[]{},
0
,
1
,
0
));
assertThrowsAIOOB
(()
->
Spliterators
.
spliterator
(
new
long
[]{},
0
,
1
,
0
));
assertThrowsAIOOB
(()
->
Spliterators
.
spliterator
(
new
double
[]{},
0
,
1
,
0
));
assertThrowsAIOOB
(()
->
Spliterators
.
spliterator
(
new
String
[]{},
0
,
1
,
0
));
}
void
assertThrowsNPE
(
Runnable
r
)
{
NullPointerException
caught
=
null
;
try
{
r
.
run
();
}
catch
(
NullPointerException
e
)
{
caught
=
e
;
}
assertNotNull
(
caught
,
"NullPointerException not thrown"
);
}
void
assertThrowsAIOOB
(
Runnable
r
)
{
ArrayIndexOutOfBoundsException
caught
=
null
;
try
{
r
.
run
();
}
catch
(
ArrayIndexOutOfBoundsException
e
)
{
caught
=
e
;
}
assertNotNull
(
caught
,
"ArrayIndexOutOfBoundsException not thrown"
);
}
}
test/sun/java2d/DrawXORModeTest.java
0 → 100644
浏览文件 @
830d7a16
/*
* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* 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 8036022
* @summary Test verifies that drawing shapes with XOR composite
* does not trigger an InternalError in GDI surface data.
* @run main/othervm -Dsun.java2d.d3d=True DrawXORModeTest
*/
import
java.awt.BasicStroke
;
import
java.awt.Color
;
import
java.awt.Component
;
import
java.awt.Dimension
;
import
java.awt.Frame
;
import
java.awt.Graphics
;
import
java.awt.Graphics2D
;
import
java.awt.Stroke
;
import
java.awt.geom.Line2D
;
import
java.util.concurrent.CountDownLatch
;
public
class
DrawXORModeTest
extends
Component
{
public
static
void
main
(
String
[]
args
)
{
final
DrawXORModeTest
c
=
new
DrawXORModeTest
();
final
Frame
f
=
new
Frame
(
"XOR mode test"
);
f
.
add
(
c
);
f
.
pack
();
f
.
setVisible
(
true
);
try
{
c
.
checkResult
();
}
finally
{
f
.
dispose
();
}
}
@Override
public
void
paint
(
Graphics
g
)
{
if
(
g
==
null
||
!(
g
instanceof
Graphics2D
))
{
return
;
}
g
.
setColor
(
Color
.
white
);
g
.
setXORMode
(
Color
.
black
);
Graphics2D
dg
=
(
Graphics2D
)
g
;
Stroke
stroke
=
new
BasicStroke
(
1
,
BasicStroke
.
CAP_BUTT
,
BasicStroke
.
JOIN_MITER
,
10.0f
,
new
float
[]{
1.0f
,
1.0f
},
0.0f
);
dg
.
setStroke
(
stroke
);
try
{
dg
.
draw
(
new
Line2D
.
Float
(
10
,
10
,
20
,
20
));
}
catch
(
Throwable
e
)
{
synchronized
(
this
)
{
theError
=
e
;
}
}
finally
{
didDraw
.
countDown
();
}
}
@Override
public
Dimension
getPreferredSize
()
{
return
new
Dimension
(
400
,
100
);
}
public
void
checkResult
()
{
try
{
didDraw
.
await
();
}
catch
(
InterruptedException
e
)
{
}
synchronized
(
this
)
{
if
(
theError
!=
null
)
{
System
.
out
.
println
(
"Error: "
+
theError
);
throw
new
RuntimeException
(
"Test FAILED."
);
}
}
System
.
out
.
println
(
"Test PASSED."
);
}
private
Throwable
theError
=
null
;
private
final
CountDownLatch
didDraw
=
new
CountDownLatch
(
1
);
}
test/sun/security/krb5/auto/BadKdc.java
浏览文件 @
830d7a16
...
...
@@ -39,7 +39,29 @@ public class BadKdc {
// ^ kdc# ^ timeout
static
final
Pattern
re
=
Pattern
.
compile
(
">>> KDCCommunication: kdc=kdc.rabbit.hole UDP:(\\d)...., "
+
"timeout=(\\d)000,"
);
"timeout=(\\d+),"
);
// Ratio for timeout values of all timeout tests. Not final so that
// each test can choose their own.
static
float
ratio
=
2
f
;
static
void
setRatio
(
float
ratio
)
{
BadKdc
.
ratio
=
ratio
;
}
static
float
getRatio
()
{
return
ratio
;
}
// Gets real timeout value. This method is called when writing krb5.conf
static
int
toReal
(
int
from
)
{
return
(
int
)(
from
*
ratio
+
.
5
);
}
// De-ratio a millisecond value to second
static
int
toSymbolicSec
(
int
from
)
{
return
(
int
)(
from
/
ratio
/
1000
f
+
0.5
);
}
/*
* There are several cases this test fails:
...
...
@@ -101,7 +123,7 @@ public class BadKdc {
fw
.
write
(
"[libdefaults]\n"
+
"default_realm = "
+
OneKDC
.
REALM
+
"\n"
+
"kdc_timeout =
2000
\n"
);
"kdc_timeout =
"
+
toReal
(
2000
)
+
"
\n"
);
fw
.
write
(
"[realms]\n"
+
OneKDC
.
REALM
+
" = {\n"
+
"kdc = "
+
OneKDC
.
KDCHOST
+
":"
+
p1
+
"\n"
+
"kdc = "
+
OneKDC
.
KDCHOST
+
":"
+
p2
+
"\n"
+
...
...
@@ -184,7 +206,8 @@ public class BadKdc {
Matcher
m
=
re
.
matcher
(
line
);
if
(
m
.
find
())
{
System
.
out
.
println
(
line
);
sb
.
append
(
m
.
group
(
1
)).
append
(
m
.
group
(
2
));
sb
.
append
(
m
.
group
(
1
))
.
append
(
toSymbolicSec
(
Integer
.
parseInt
(
m
.
group
(
2
))));
}
}
if
(
failed
)
sb
.
append
(
'-'
);
...
...
test/sun/security/krb5/auto/BadKdc1.java
浏览文件 @
830d7a16
...
...
@@ -28,14 +28,21 @@
* @summary krb5 should not try to access unavailable kdc too often
*/
import
java.io.*
;
import
java.security.Security
;
public
class
BadKdc1
{
public
static
void
main
(
String
[]
args
)
throws
Exception
{
Security
.
setProperty
(
"krb5.kdc.bad.policy"
,
"tryLess"
);
// 5 sec is default timeout for tryLess
if
(
BadKdc
.
getRatio
()
>
2.5
)
{
Security
.
setProperty
(
"krb5.kdc.bad.policy"
,
"tryLess:1,"
+
BadKdc
.
toReal
(
2000
));
}
else
{
Security
.
setProperty
(
"krb5.kdc.bad.policy"
,
"tryLess"
);
}
BadKdc
.
go
(
"121212222222(32){1,2}1222(32){1,2}"
,
// 1 2
// The above line means try kdc1 for 2 seconds then kdc1
...
...
test/sun/security/krb5/auto/BadKdc2.java
浏览文件 @
830d7a16
...
...
@@ -35,7 +35,12 @@ public class BadKdc2 {
public
static
void
main
(
String
[]
args
)
throws
Exception
{
Security
.
setProperty
(
"krb5.kdc.bad.policy"
,
"tryLess:2,1000"
);
// 1 sec is too short.
BadKdc
.
setRatio
(
3.0f
);
Security
.
setProperty
(
"krb5.kdc.bad.policy"
,
"tryLess:2,"
+
BadKdc
.
toReal
(
1000
));
BadKdc
.
go
(
"121212222222(32){1,2}11112121(32){1,2}"
,
// 1 2
"11112121(32){1,2}11112121(32){1,2}"
,
// 1 2
...
...
test/sun/security/krb5/auto/MaxRetries.java
浏览文件 @
830d7a16
...
...
@@ -60,7 +60,7 @@ public class MaxRetries {
test1
(
5000
,
2
);
// 2 2
// For tryLess
Security
.
setProperty
(
"krb5.kdc.bad.policy"
,
"tryless
"
);
Security
.
setProperty
(
"krb5.kdc.bad.policy"
,
"tryless
:1,"
+
BadKdc
.
toReal
(
5000
)
);
rewriteMaxRetries
(
4
);
test1
(
4000
,
7
);
// 1 1 1 1 2 1 2
test1
(
4000
,
4
);
// 1 2 1 2
...
...
@@ -94,7 +94,7 @@ public class MaxRetries {
* @param count the expected total try
*/
private
static
void
test1
(
int
timeout
,
int
count
)
throws
Exception
{
String
timeoutTag
=
"timeout="
+
timeout
;
String
timeoutTag
=
"timeout="
+
BadKdc
.
toReal
(
timeout
)
;
ByteArrayOutputStream
bo
=
new
ByteArrayOutputStream
();
PrintStream
oldout
=
System
.
out
;
System
.
setOut
(
new
PrintStream
(
bo
));
...
...
@@ -192,12 +192,12 @@ public class MaxRetries {
if
(
s
.
startsWith
(
"[realms]"
))
{
// Reconfig global setting
fw
.
write
(
"max_retries = 2\n"
);
fw
.
write
(
"kdc_timeout =
5000
\n"
);
fw
.
write
(
"kdc_timeout =
"
+
BadKdc
.
toReal
(
5000
)
+
"
\n"
);
}
else
if
(
s
.
trim
().
startsWith
(
"kdc = "
))
{
if
(
value
!=
-
1
)
{
// Reconfig for realm
fw
.
write
(
" max_retries = "
+
value
+
"\n"
);
fw
.
write
(
" kdc_timeout = "
+
(
value
*
1000
)
+
"\n"
);
fw
.
write
(
" kdc_timeout = "
+
BadKdc
.
toReal
(
value
*
1000
)
+
"\n"
);
}
// Add a bad KDC as the first candidate
fw
.
write
(
" kdc = localhost:33333\n"
);
...
...
test/sun/security/krb5/auto/TcpTimeout.java
浏览文件 @
830d7a16
...
...
@@ -63,7 +63,7 @@ public class TcpTimeout {
"udp_preference_limit = 1\n"
+
"max_retries = 2\n"
+
"default_realm = "
+
OneKDC
.
REALM
+
"\n"
+
"kdc_timeout =
5000
\n"
);
"kdc_timeout =
"
+
BadKdc
.
toReal
(
5000
)
+
"
\n"
);
fw
.
write
(
"[realms]\n"
+
OneKDC
.
REALM
+
" = {\n"
+
"kdc = "
+
OneKDC
.
KDCHOST
+
":"
+
p1
+
"\n"
+
"kdc = "
+
OneKDC
.
KDCHOST
+
":"
+
p2
+
"\n"
+
...
...
test/sun/security/krb5/config/ExtraLines.java
0 → 100644
浏览文件 @
830d7a16
/*
* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* 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 8036971
* @compile -XDignore.symbol.file ExtraLines.java
* @run main/othervm ExtraLines
* @summary krb5.conf does not accept directive lines before the first section
*/
import
sun.security.krb5.Config
;
import
java.nio.file.*
;
import
java.util.Objects
;
public
class
ExtraLines
{
public
static
void
main
(
String
[]
args
)
throws
Exception
{
Path
base
=
Paths
.
get
(
"krb5.conf"
);
Path
include
=
Paths
.
get
(
"included.conf"
);
String
baseConf
=
"include "
+
include
.
toAbsolutePath
().
toString
()
+
"\n[x]\na = b\n"
;
String
includeConf
=
"[y]\nc = d\n"
;
Files
.
write
(
include
,
includeConf
.
getBytes
());
Files
.
write
(
base
,
baseConf
.
getBytes
());
System
.
setProperty
(
"java.security.krb5.conf"
,
base
.
toString
());
Config
.
refresh
();
if
(!
Objects
.
equals
(
Config
.
getInstance
().
get
(
"x"
,
"a"
),
"b"
))
{
throw
new
Exception
(
"Failed"
);
}
}
}
test/sun/security/provider/certpath/PKIXCertPathValidator/Validity.java
0 → 100644
浏览文件 @
830d7a16
/*
* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* 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 8021804
* @summary CertPath should validate even if the validity period of the
* root cert does not include the validity period of a subordinate
* cert.
*/
import
java.io.ByteArrayInputStream
;
import
java.security.cert.*
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.HashSet
;
import
java.util.Set
;
public
class
Validity
{
/*
* Subject: OU=TestOrg, CN=TestCA
* Issuer: OU=TestOrg, CN=TestCA
* Validity
* Not Before: Feb 26 21:33:55 2014 GMT
Not After : Feb 26 21:33:55 2024 GMT
* Version 1
*/
static
String
CACertStr
=
"-----BEGIN CERTIFICATE-----\n"
+
"MIIBvTCCASYCCQCQRiTo4lBCFjANBgkqhkiG9w0BAQUFADAjMRAwDgYDVQQLDAdU\n"
+
"ZXN0T3JnMQ8wDQYDVQQDDAZUZXN0Q0EwHhcNMTQwMjI2MjEzMzU1WhcNMjQwMjI2\n"
+
"MjEzMzU1WjAjMRAwDgYDVQQLDAdUZXN0T3JnMQ8wDQYDVQQDDAZUZXN0Q0EwgZ8w\n"
+
"DQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAOtKS4ZrsM3ansd61ZxitcrN0w184I+A\n"
+
"z0kyrSP1eMtlam+cC2U91NpTz11FYV4XUfBhqqxaXW043AWTUer8pS90Pt4sCrUX\n"
+
"COx1+QA1M3ZhbZ4sTM7XQ90JbGaBJ/sEza9mlQP7hQ2yQO/hATKbP6J5qvgG2sT2\n"
+
"S2WYjEgwNwmFAgMBAAEwDQYJKoZIhvcNAQEFBQADgYEAQ/CXEpnx2WY4LJtv4jwE\n"
+
"4jIVirur3pdzV5oBhPyqqHMsyhQBkukCfX7uD7L5wN1+xuM81DfANpIxlnUfybp5\n"
+
"CpjcmktLpmyK4kJ6XnSd2blbLOIpsr9x6FqxPxpVDlyw/ySHYrIG/GZdsLHgmzGn\n"
+
"B06jeYzH8OLf879VxAxSsPc=\n"
+
"-----END CERTIFICATE-----"
;
/*
* Subject: OU=TestOrg, CN=TestEE0
* Issuer: OU=TestOrg, CN=TestCA
* Validity
* Not Before: Feb 26 22:55:12 2014 GMT
* Not After : Feb 25 22:55:12 2025 GMT
* Version 1
*/
static
String
EECertStr
=
"-----BEGIN CERTIFICATE-----\n"
+
"MIIBtjCCAR8CAQQwDQYJKoZIhvcNAQEFBQAwIzEQMA4GA1UECwwHVGVzdE9yZzEP\n"
+
"MA0GA1UEAwwGVGVzdENBMB4XDTE0MDIyNjIyNTUxMloXDTI1MDIyNTIyNTUxMlow\n"
+
"JDEQMA4GA1UECwwHVGVzdE9yZzEQMA4GA1UEAwwHVGVzdEVFMDCBnzANBgkqhkiG\n"
+
"9w0BAQEFAAOBjQAwgYkCgYEAt8xz9W3ruCTHjSOtTX6cxsUZ0nRP6EavEfzgcOYh\n"
+
"CXGA0gr+viSHq3c2vQBxiRny2hm5rLcqpPo+2OxZtw/ajxfyrV6d/r8YyQLBvyl3\n"
+
"xdCZdOkG1DCM1oFAQDaSRt9wN5Zm5kyg7uMig5Y4L45fP9Yee4x6Xyh36qYbsR89\n"
+
"rFMCAwEAATANBgkqhkiG9w0BAQUFAAOBgQDZrPqSo08va1m9TOWOztTuWilGdjK/\n"
+
"2Ed2WXg8utIpy6uAV+NaOYtHQ7ULQBVRNmwg9nKghbVbh+E/xpoihjl1x7OXass4\n"
+
"TbwXA5GKFIFpNtDvATQ/QQZoCuCzw1FW/mH0Q7UEQ/9/iJdDad6ebkapeMwtj/8B\n"
+
"s2IZV7s85CEOXw==\n"
+
"-----END CERTIFICATE-----"
;
public
static
void
main
(
String
[]
args
)
throws
Exception
{
String
[]
certStrs
=
{
EECertStr
};
String
[]
trustedCertStrs
=
{
CACertStr
};
runTest
(
certStrs
,
trustedCertStrs
);
System
.
out
.
println
(
"Test passed."
);
}
private
static
void
runTest
(
String
[]
certStrs
,
String
[]
trustedCertStrs
)
throws
Exception
{
CertificateFactory
cf
=
CertificateFactory
.
getInstance
(
"X509"
);
// Generate the CertPath from the certs named in certStrs
ArrayList
<
X509Certificate
>
certs
=
new
ArrayList
<>();
for
(
String
certStr
:
certStrs
)
{
certs
.
add
(
generateCert
(
certStr
,
cf
));
}
CertPath
cp
=
cf
.
generateCertPath
(
certs
);
// Generate the set of Trust Anchors from the certs named in
// trustedCertStrs
Set
<
TrustAnchor
>
trustAnchors
=
new
HashSet
<>();
for
(
String
trustedCertStr
:
trustedCertStrs
)
{
TrustAnchor
ta
=
new
TrustAnchor
(
generateCert
(
trustedCertStr
,
cf
),
null
);
trustAnchors
.
add
(
ta
);
}
PKIXParameters
params
=
new
PKIXParameters
(
trustAnchors
);
params
.
setDate
(
new
Date
(
114
,
3
,
1
));
// 2014-03-01
params
.
setRevocationEnabled
(
false
);
// Attempt to validate the CertPath. If no exception thrown, successful.
CertPathValidator
cpv
=
CertPathValidator
.
getInstance
(
"PKIX"
);
cpv
.
validate
(
cp
,
params
);
System
.
out
.
println
(
"CertPath validation successful."
);
}
private
static
X509Certificate
generateCert
(
String
certStr
,
CertificateFactory
cf
)
throws
Exception
{
ByteArrayInputStream
stream
=
new
ByteArrayInputStream
(
certStr
.
getBytes
());
return
(
X509Certificate
)
cf
.
generateCertificate
(
stream
);
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录