Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
e541d267
D
dragonwell8_jdk
项目概览
openanolis
/
dragonwell8_jdk
通知
3
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
e541d267
编写于
9月 09, 2009
作者:
M
mullan
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
f59948e7
765274e2
变更
27
隐藏空白更改
内联
并排
Showing
27 changed file
with
373 addition
and
138 deletion
+373
-138
.hgtags
.hgtags
+1
-0
make/common/shared/Defs-java.gmk
make/common/shared/Defs-java.gmk
+4
-1
make/tools/freetypecheck/Makefile
make/tools/freetypecheck/Makefile
+18
-6
make/tools/freetypecheck/freetypecheck.c
make/tools/freetypecheck/freetypecheck.c
+39
-0
src/share/bin/java.h
src/share/bin/java.h
+1
-4
src/share/classes/java/lang/Character.java
src/share/classes/java/lang/Character.java
+3
-3
src/share/classes/java/lang/ClassLoader.java
src/share/classes/java/lang/ClassLoader.java
+20
-8
src/share/classes/java/nio/file/Files.java
src/share/classes/java/nio/file/Files.java
+5
-4
src/share/classes/java/nio/file/SimpleFileVisitor.java
src/share/classes/java/nio/file/SimpleFileVisitor.java
+2
-2
src/share/classes/sun/security/tools/JarSigner.java
src/share/classes/sun/security/tools/JarSigner.java
+24
-9
src/share/classes/sun/security/x509/AlgorithmId.java
src/share/classes/sun/security/x509/AlgorithmId.java
+13
-1
src/share/javavm/export/jvm.h
src/share/javavm/export/jvm.h
+6
-0
src/share/native/java/lang/ClassLoader.c
src/share/native/java/lang/ClassLoader.c
+4
-3
src/share/sample/nio/file/Xdd.java
src/share/sample/nio/file/Xdd.java
+2
-2
src/share/transport/socket/socketTransport.c
src/share/transport/socket/socketTransport.c
+16
-16
src/solaris/bin/java_md.c
src/solaris/bin/java_md.c
+3
-3
src/solaris/classes/sun/nio/fs/LinuxFileStore.java
src/solaris/classes/sun/nio/fs/LinuxFileStore.java
+13
-2
src/solaris/classes/sun/nio/fs/SolarisFileStore.java
src/solaris/classes/sun/nio/fs/SolarisFileStore.java
+27
-14
src/solaris/classes/sun/nio/fs/UnixFileStore.java
src/solaris/classes/sun/nio/fs/UnixFileStore.java
+2
-3
src/windows/bin/java_md.c
src/windows/bin/java_md.c
+3
-9
src/windows/classes/sun/nio/fs/WindowsFileStore.java
src/windows/classes/sun/nio/fs/WindowsFileStore.java
+1
-1
test/com/sun/jdi/BadHandshakeTest.java
test/com/sun/jdi/BadHandshakeTest.java
+1
-1
test/java/lang/ProcessBuilder/Basic.java
test/java/lang/ProcessBuilder/Basic.java
+25
-1
test/java/lang/reflect/Generics/Probe.java
test/java/lang/reflect/Generics/Probe.java
+25
-44
test/java/nio/file/FileStore/Basic.java
test/java/nio/file/FileStore/Basic.java
+10
-1
test/sun/security/tools/jarsigner/nameclash.sh
test/sun/security/tools/jarsigner/nameclash.sh
+66
-0
test/sun/security/x509/AlgorithmId/SHA256withECDSA.java
test/sun/security/x509/AlgorithmId/SHA256withECDSA.java
+39
-0
未找到文件。
.hgtags
浏览文件 @
e541d267
...
...
@@ -45,3 +45,4 @@ a952aafd5181af953b0ef3010dbd2fcc28460e8a jdk7-b67
b23d905cb5d3b382295240d28ab0bfb266b4503c jdk7-b68
226b20019b1f020c09ea97d137d98e011ce65d76 jdk7-b69
893bcca951b747ddcf6986362b877f0e1dbb835b jdk7-b70
b3f3240135f0c10b9f2481c174b81b7fcf0daa60 jdk7-b71
make/common/shared/Defs-java.gmk
浏览文件 @
e541d267
...
...
@@ -201,7 +201,10 @@ endif
ifeq ($(JAVAC_WARNINGS_FATAL), true)
BOOT_JAVACFLAGS += -Werror
endif
BOOT_JAVACFLAGS += -encoding ascii
BOOT_SOURCE_LANGUAGE_VERSION = 6
BOOT_TARGET_CLASS_VERSION = 6
BOOT_JAVACFLAGS += -encoding ascii -source $(BOOT_SOURCE_LANGUAGE_VERSION) -target $(BOOT_TARGET_CLASS_VERSION)
BOOT_JAR_JFLAGS += $(JAR_JFLAGS)
BOOT_JAVACFLAGS += $(NO_PROPRIETARY_API_WARNINGS)
...
...
make/tools/freetypecheck/Makefile
浏览文件 @
e541d267
...
...
@@ -28,16 +28,21 @@ BUILDDIR = ../..
include
$(BUILDDIR)/common/Defs.gmk
# Default name
FT_TEST
=
$(BUILDTOOLBINDIR)
/freetype_versioncheck
$(EXE_SUFFIX)
PROGRAM
=
freetype_versioncheck
FT_OBJ
=
$(BUILDTOOLBINDIR)
/
$(PROGRAM)
.
$(OBJECT_SUFFIX)
FT_TEST
=
$(BUILDTOOLBINDIR)
/
$(PROGRAM)$(EXE_SUFFIX)
# Used on openjdk only
ifeq
($(OPENJDK),true)
# Start with CFLAGS (which gets us the required -xarch setting on solaris)
ifeq
($(PLATFORM), windows)
FT_OPTIONS
=
/nologo
$(CC_OBJECT_OUTPUT_FLAG)$(TEMPDIR)
FT_OPTIONS
=
/nologo
/c
FREETYPE_DLL
=
$(FREETYPE_LIB_PATH)
/freetype.dll
FT_LD_OPTIONS
=
$(FREETYPE_LIB_PATH)
/freetype.lib
ifdef
MT
FT_LD_OPTIONS
+=
/manifest
endif
else
FT_OPTIONS
=
$(CFLAGS)
FT_LD_OPTIONS
=
-L
$(FREETYPE_LIB_PATH)
...
...
@@ -55,15 +60,22 @@ FT_LD_OPTIONS += $(LFLAGS_$(COMPILER_VERSION))
# Create test program
all
:
$(FT_TEST)
@
$(FT_TEST)
$(FT_TEST)
# On windows we need to copy dll to test dir to ensure it will be found
# at runtime
$(FT_TEST)
:
freetypecheck.c
@
$
(
prep-target
)
@
$(CC)
$(FT_OPTIONS)
$(CC_PROGRAM_OUTPUT_FLAG)$@
$<
$(FT_LD_OPTIONS)
$
(
prep-target
)
ifeq
($(PLATFORM), windows)
@
$(CP)
$(FREETYPE_DLL)
`
dirname
$@
`
$(CC)
$(FT_OPTIONS)
$(CC_OBJECT_OUTPUT_FLAG)$(FT_OBJ)
$<
$(LINK)
$(FT_LD_OPTIONS)
/OUT:
$(FT_TEST)
$(FT_OBJ)
$(CP)
$(FREETYPE_DLL)
$
(
@D
)
/
ifdef
MT
$(CP)
$(MSVCRNN_DLL_PATH)
/
$(MSVCRNN_DLL)
$
(
@D
)
/
$(MT)
/manifest
$(FT_TEST)
.manifest /outputresource:
$(FT_TEST)
;
#1
endif
else
@
$(CC)
$(FT_OPTIONS)
$(CC_PROGRAM_OUTPUT_FLAG)$@
$<
$(FT_LD_OPTIONS)
endif
else
...
...
make/tools/freetypecheck/freetypecheck.c
浏览文件 @
e541d267
...
...
@@ -32,6 +32,45 @@
#include "ft2build.h"
#include FT_FREETYPE_H
#ifdef _MSC_VER
#if _MSC_VER > 1400
/*
* When building for Microsoft Windows, your program has a dependency
* on msvcr??.dll.
*
* When using Visual Studio 2005 or later, that must be recorded in
* the <program>.exe.manifest file.
*
* Reference:
* C:/Program Files/Microsoft SDKs/Windows/v6.1/include/crtdefs.h
*/
#include <crtassem.h>
#ifdef _M_IX86
#pragma comment(linker,"/manifestdependency:\"type='win32' " \
"name='" __LIBRARIES_ASSEMBLY_NAME_PREFIX ".CRT' " \
"version='" _CRT_ASSEMBLY_VERSION "' " \
"processorArchitecture='x86' " \
"publicKeyToken='" _VC_ASSEMBLY_PUBLICKEYTOKEN "'\"")
#endif
/* _M_IX86 */
//This may not be necessary yet for the Windows 64-bit build, but it
//will be when that build environment is updated. Need to test to see
//if it is harmless:
#ifdef _M_AMD64
#pragma comment(linker,"/manifestdependency:\"type='win32' " \
"name='" __LIBRARIES_ASSEMBLY_NAME_PREFIX ".CRT' " \
"version='" _CRT_ASSEMBLY_VERSION "' " \
"processorArchitecture='amd64' " \
"publicKeyToken='" _VC_ASSEMBLY_PUBLICKEYTOKEN "'\"")
#endif
/* _M_AMD64 */
#endif
/* _MSC_VER > 1400 */
#endif
/* _MSC_VER */
#define QUOTEMACRO(x) QUOTEME(x)
#define QUOTEME(x) #x
...
...
src/share/bin/java.h
浏览文件 @
e541d267
...
...
@@ -187,9 +187,6 @@ void InitLauncher(jboolean javaw);
*
*/
typedef
jclass
(
JNICALL
FindClassFromBootLoader_t
(
JNIEnv
*
env
,
const
char
*
name
,
jboolean
init
,
jobject
loader
,
jboolean
throwError
));
const
char
*
name
));
jclass
FindBootStrapClass
(
JNIEnv
*
env
,
const
char
*
classname
);
#endif
/* _JAVA_H_ */
src/share/classes/java/lang/Character.java
浏览文件 @
e541d267
...
...
@@ -2587,9 +2587,9 @@ class Character extends Object implements java.io.Serializable, Comparable<Chara
* significantly better space and time performance by caching
* frequently requested values.
*
* This method will always cache values in the range
'\u0000'
*
to '\u007f'", inclusive, and may cache other values outside
* of this range.
* This method will always cache values in the range
{@code
*
'\u005Cu0000'} to {@code '\u005Cu007f'}, inclusive, and may
*
cache other values outside
of this range.
*
* @param c a char value.
* @return a <tt>Character</tt> instance representing <tt>c</tt>.
...
...
src/share/classes/java/lang/ClassLoader.java
浏览文件 @
e541d267
...
...
@@ -384,9 +384,14 @@ public abstract class ClassLoader {
if
(
parent
!=
null
)
{
c
=
parent
.
loadClass
(
name
,
false
);
}
else
{
c
=
findBootstrapClass
0
(
name
);
c
=
findBootstrapClass
OrNull
(
name
);
}
}
catch
(
ClassNotFoundException
e
)
{
// ClassNotFoundException thrown if class not found
// from the non-null parent class loader
}
if
(
c
==
null
)
{
// If still not found, then invoke findClass in order
// to find the class.
c
=
findClass
(
name
);
...
...
@@ -1008,22 +1013,29 @@ public abstract class ClassLoader {
if
(
system
==
null
)
{
if
(!
checkName
(
name
))
throw
new
ClassNotFoundException
(
name
);
return
findBootstrapClass
(
name
);
Class
cls
=
findBootstrapClass
(
name
);
if
(
cls
==
null
)
{
throw
new
ClassNotFoundException
(
name
);
}
return
cls
;
}
return
system
.
loadClass
(
name
);
}
private
Class
findBootstrapClass0
(
String
name
)
throws
ClassNotFoundException
/**
* Returns a class loaded by the bootstrap class loader;
* or return null if not found.
*/
private
Class
findBootstrapClassOrNull
(
String
name
)
{
check
();
if
(!
checkName
(
name
))
throw
new
ClassNotFoundException
(
name
);
if
(!
checkName
(
name
))
return
null
;
return
findBootstrapClass
(
name
);
}
private
native
Class
findBootstrapClass
(
String
name
)
throws
ClassNotFoundException
;
// return null if not found
private
native
Class
findBootstrapClass
(
String
name
)
;
// Check to make sure the class loader has been initialized.
private
void
check
()
{
...
...
src/share/classes/java/nio/file/Files.java
浏览文件 @
e541d267
...
...
@@ -133,10 +133,11 @@ public final class Files {
* <p> This method walks a file tree rooted at a given starting file. The
* file tree traversal is <em>depth-first</em> with the given {@link
* FileVisitor} invoked for each file encountered. File tree traversal
* completes when all accessible files in the tree have been visited, a
* visitor returns a result of {@link FileVisitResult#TERMINATE TERMINATE},
* or the visitor terminates due to an uncaught {@code Error} or {@code
* RuntimeException}.
* completes when all accessible files in the tree have been visited, or a
* visit method returns a result of {@link FileVisitResult#TERMINATE
* TERMINATE}. Where a visit method terminates due an uncaught error or
* runtime exception then the traversal is terminated and the error or
* exception is propagated to the caller of this method.
*
* <p> For each file encountered this method attempts to gets its {@link
* java.nio.file.attribute.BasicFileAttributes}. If the file is not a
...
...
src/share/classes/java/nio/file/SimpleFileVisitor.java
浏览文件 @
e541d267
...
...
@@ -124,8 +124,8 @@ public class SimpleFileVisitor<T> implements FileVisitor<T> {
* cause.
*
* @throws IOError
*
if iteration of the directory completed prematurely due to an
* I/O error
*
with the I/O exception thrown when iteration of the directory
*
completed prematurely due to an
I/O error
*/
@Override
public
FileVisitResult
postVisitDirectory
(
T
dir
,
IOException
exc
)
{
...
...
src/share/classes/sun/security/tools/JarSigner.java
浏览文件 @
e541d267
...
...
@@ -1978,20 +1978,35 @@ public class JarSigner {
String
[]
base64Digests
=
getDigests
(
ze
,
zf
,
digests
,
encoder
);
for
(
int
i
=
0
;
i
<
digests
.
length
;
i
++)
{
String
name
=
digests
[
i
].
getAlgorithm
()+
"-Digest"
;
String
mfDigest
=
attrs
.
getValue
(
name
);
if
(
mfDigest
==
null
&&
digests
[
i
].
getAlgorithm
().
equalsIgnoreCase
(
"SHA"
))
{
// treat "SHA" and "SHA1" the same
mfDigest
=
attrs
.
getValue
(
"SHA-Digest"
);
}
if
(
mfDigest
==
null
)
{
// compute digest and add it to list of attributes
// The entry name to be written into attrs
String
name
=
null
;
try
{
// Find if the digest already exists
AlgorithmId
aid
=
AlgorithmId
.
get
(
digests
[
i
].
getAlgorithm
());
for
(
Object
key:
attrs
.
keySet
())
{
if
(
key
instanceof
Attributes
.
Name
)
{
String
n
=
((
Attributes
.
Name
)
key
).
toString
();
if
(
n
.
toUpperCase
(
Locale
.
ENGLISH
).
endsWith
(
"-DIGEST"
))
{
String
tmp
=
n
.
substring
(
0
,
n
.
length
()
-
7
);
if
(
AlgorithmId
.
get
(
tmp
).
equals
(
aid
))
{
name
=
n
;
break
;
}
}
}
}
}
catch
(
NoSuchAlgorithmException
nsae
)
{
// Ignored. Writing new digest entry.
}
if
(
name
==
null
)
{
name
=
digests
[
i
].
getAlgorithm
()+
"-Digest"
;
attrs
.
putValue
(
name
,
base64Digests
[
i
]);
update
=
true
;
}
else
{
// compare digests, and replace the one in the manifest
// if they are different
String
mfDigest
=
attrs
.
getValue
(
name
);
if
(!
mfDigest
.
equalsIgnoreCase
(
base64Digests
[
i
]))
{
attrs
.
putValue
(
name
,
base64Digests
[
i
]);
update
=
true
;
...
...
src/share/classes/sun/security/x509/AlgorithmId.java
浏览文件 @
e541d267
/*
* Copyright 1996-200
6
Sun Microsystems, Inc. All Rights Reserved.
* Copyright 1996-200
9
Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
...
...
@@ -531,6 +531,18 @@ public class AlgorithmId implements Serializable, DerEncoder {
||
name
.
equalsIgnoreCase
(
"ECDSA"
))
{
return
AlgorithmId
.
sha1WithECDSA_oid
;
}
if
(
name
.
equalsIgnoreCase
(
"SHA224withECDSA"
))
{
return
AlgorithmId
.
sha224WithECDSA_oid
;
}
if
(
name
.
equalsIgnoreCase
(
"SHA256withECDSA"
))
{
return
AlgorithmId
.
sha256WithECDSA_oid
;
}
if
(
name
.
equalsIgnoreCase
(
"SHA384withECDSA"
))
{
return
AlgorithmId
.
sha384WithECDSA_oid
;
}
if
(
name
.
equalsIgnoreCase
(
"SHA512withECDSA"
))
{
return
AlgorithmId
.
sha512WithECDSA_oid
;
}
// See if any of the installed providers supply a mapping from
// the given algorithm name to an OID string
...
...
src/share/javavm/export/jvm.h
浏览文件 @
e541d267
...
...
@@ -374,6 +374,12 @@ JVM_FindPrimitiveClass(JNIEnv *env, const char *utf);
JNIEXPORT
void
JNICALL
JVM_ResolveClass
(
JNIEnv
*
env
,
jclass
cls
);
/*
* Find a class from a boot class loader. Returns NULL if class not found.
*/
JNIEXPORT
jclass
JNICALL
JVM_FindClassFromBootLoader
(
JNIEnv
*
env
,
const
char
*
name
);
/*
* Find a class from a given class loader. Throw ClassNotFoundException
* or NoClassDefFoundError depending on the value of the last
...
...
src/share/native/java/lang/ClassLoader.c
浏览文件 @
e541d267
...
...
@@ -237,6 +237,9 @@ Java_java_lang_ClassLoader_resolveClass0(JNIEnv *env, jobject this,
JVM_ResolveClass
(
env
,
cls
);
}
/*
* Returns NULL if class not found.
*/
JNIEXPORT
jclass
JNICALL
Java_java_lang_ClassLoader_findBootstrapClass
(
JNIEnv
*
env
,
jobject
loader
,
jstring
classname
)
...
...
@@ -246,7 +249,6 @@ Java_java_lang_ClassLoader_findBootstrapClass(JNIEnv *env, jobject loader,
char
buf
[
128
];
if
(
classname
==
NULL
)
{
JNU_ThrowClassNotFoundException
(
env
,
0
);
return
0
;
}
...
...
@@ -258,11 +260,10 @@ Java_java_lang_ClassLoader_findBootstrapClass(JNIEnv *env, jobject loader,
VerifyFixClassname
(
clname
);
if
(
!
VerifyClassname
(
clname
,
JNI_TRUE
))
{
/* expects slashed name */
JNU_ThrowClassNotFoundException
(
env
,
clname
);
goto
done
;
}
cls
=
JVM_FindClassFrom
ClassLoader
(
env
,
clname
,
JNI_FALSE
,
0
,
JNI_FALSE
);
cls
=
JVM_FindClassFrom
BootLoader
(
env
,
clname
);
done:
if
(
clname
!=
buf
)
{
...
...
src/share/sample/nio/file/Xdd.java
浏览文件 @
e541d267
...
...
@@ -57,9 +57,9 @@ public class Xdd {
Path
file
=
(
args
.
length
==
1
)
?
Paths
.
get
(
args
[
0
])
:
Paths
.
get
(
args
[
2
]);
// check that user defined attributes are supported by the file s
ystem
// check that user defined attributes are supported by the file s
tore
FileStore
store
=
file
.
getFileStore
();
if
(!
store
.
supportsFileAttributeView
(
"user"
))
{
if
(!
store
.
supportsFileAttributeView
(
UserDefinedFileAttributeView
.
class
))
{
System
.
err
.
format
(
"UserDefinedFileAttributeView not supported on %s\n"
,
store
);
System
.
exit
(-
1
);
...
...
src/share/transport/socket/socketTransport.c
浏览文件 @
e541d267
...
...
@@ -134,15 +134,16 @@ setOptions(int fd)
static
jdwpTransportError
handshake
(
int
fd
,
jlong
timeout
)
{
char
*
hello
=
"JDWP-Handshake"
;
c
onst
c
har
*
hello
=
"JDWP-Handshake"
;
char
b
[
16
];
int
rv
,
received
,
i
;
int
rv
,
helloLen
,
received
;
if
(
timeout
>
0
)
{
dbgsysConfigureBlocking
(
fd
,
JNI_FALSE
);
}
helloLen
=
(
int
)
strlen
(
hello
);
received
=
0
;
while
(
received
<
(
int
)
strlen
(
hello
)
)
{
while
(
received
<
helloLen
)
{
int
n
;
char
*
buf
;
if
(
timeout
>
0
)
{
...
...
@@ -154,7 +155,7 @@ handshake(int fd, jlong timeout) {
}
buf
=
b
;
buf
+=
received
;
n
=
dbgsysRecv
(
fd
,
buf
,
(
int
)
strlen
(
hello
)
-
received
,
0
);
n
=
dbgsysRecv
(
fd
,
buf
,
helloLen
-
received
,
0
);
if
(
n
==
0
)
{
setLastError
(
0
,
"handshake failed - connection prematurally closed"
);
return
JDWPTRANSPORT_ERROR_IO_ERROR
;
...
...
@@ -167,20 +168,19 @@ handshake(int fd, jlong timeout) {
if
(
timeout
>
0
)
{
dbgsysConfigureBlocking
(
fd
,
JNI_TRUE
);
}
for
(
i
=
0
;
i
<
(
int
)
strlen
(
hello
);
i
++
)
{
if
(
b
[
i
]
!=
hello
[
i
])
{
char
msg
[
64
];
strcpy
(
msg
,
"handshake failed - received >"
);
strncat
(
msg
,
b
,
strlen
(
hello
));
strcat
(
msg
,
"< - excepted >"
);
strcat
(
msg
,
hello
);
strcat
(
msg
,
"<"
);
setLastError
(
0
,
msg
);
return
JDWPTRANSPORT_ERROR_IO_ERROR
;
}
if
(
strncmp
(
b
,
hello
,
received
)
!=
0
)
{
char
msg
[
80
+
2
*
16
];
b
[
received
]
=
'\0'
;
/*
* We should really use snprintf here but it's not available on Windows.
* We can't use jio_snprintf without linking the transport against the VM.
*/
sprintf
(
msg
,
"handshake failed - received >%s< - expected >%s<"
,
b
,
hello
);
setLastError
(
0
,
msg
);
return
JDWPTRANSPORT_ERROR_IO_ERROR
;
}
if
(
dbgsysSend
(
fd
,
hello
,
(
int
)
strlen
(
hello
),
0
)
!=
(
int
)
strlen
(
hello
)
)
{
if
(
dbgsysSend
(
fd
,
(
char
*
)
hello
,
helloLen
,
0
)
!=
helloLen
)
{
RETURN_IO_ERROR
(
"send failed during handshake"
);
}
return
JDWPTRANSPORT_ERROR_NONE
;
...
...
src/solaris/bin/java_md.c
浏览文件 @
e541d267
...
...
@@ -1324,12 +1324,12 @@ FindBootStrapClass(JNIEnv *env, const char* classname)
{
if
(
findBootClass
==
NULL
)
{
findBootClass
=
(
FindClassFromBootLoader_t
*
)
dlsym
(
RTLD_DEFAULT
,
"JVM_FindClassFrom
Class
Loader"
);
"JVM_FindClassFrom
Boot
Loader"
);
if
(
findBootClass
==
NULL
)
{
JLI_ReportErrorMessage
(
DLL_ERROR4
,
"JVM_FindClassFrom
Class
Loader"
);
"JVM_FindClassFrom
Boot
Loader"
);
return
NULL
;
}
}
return
findBootClass
(
env
,
classname
,
JNI_FALSE
,
(
jobject
)
NULL
,
JNI_FALSE
);
return
findBootClass
(
env
,
classname
);
}
src/solaris/classes/sun/nio/fs/LinuxFileStore.java
浏览文件 @
e541d267
...
...
@@ -25,6 +25,7 @@
package
sun.nio.fs
;
import
java.nio.file.attribute.*
;
import
java.util.*
;
import
java.io.IOException
;
...
...
@@ -113,10 +114,12 @@ class LinuxFileStore
}
@Override
public
boolean
supportsFileAttributeView
(
String
nam
e
)
{
public
boolean
supportsFileAttributeView
(
Class
<?
extends
FileAttributeView
>
typ
e
)
{
// support DosFileAttributeView and UserDefinedAttributeView if extended
// attributes enabled
if
(
name
.
equals
(
"dos"
)
||
name
.
equals
(
"user"
))
{
if
(
type
==
DosFileAttributeView
.
class
||
type
==
UserDefinedFileAttributeView
.
class
)
{
// lookup fstypes.properties
FeatureStatus
status
=
checkIfFeaturePresent
(
"user_xattr"
);
if
(
status
==
FeatureStatus
.
PRESENT
)
...
...
@@ -142,7 +145,15 @@ class LinuxFileStore
}
return
xattrEnabled
;
}
return
super
.
supportsFileAttributeView
(
type
);
}
@Override
public
boolean
supportsFileAttributeView
(
String
name
)
{
if
(
name
.
equals
(
"dos"
))
return
supportsFileAttributeView
(
DosFileAttributeView
.
class
);
if
(
name
.
equals
(
"user"
))
return
supportsFileAttributeView
(
UserDefinedFileAttributeView
.
class
);
return
super
.
supportsFileAttributeView
(
name
);
}
...
...
src/solaris/classes/sun/nio/fs/SolarisFileStore.java
浏览文件 @
e541d267
...
...
@@ -25,6 +25,7 @@
package
sun.nio.fs
;
import
java.nio.file.attribute.*
;
import
java.io.IOException
;
import
static
sun
.
nio
.
fs
.
UnixNativeDispatcher
.*;
...
...
@@ -72,27 +73,39 @@ class SolarisFileStore
}
@Override
public
boolean
supportsFileAttributeView
(
String
nam
e
)
{
if
(
name
.
equals
(
"acl"
)
)
{
public
boolean
supportsFileAttributeView
(
Class
<?
extends
FileAttributeView
>
typ
e
)
{
if
(
type
==
AclFileAttributeView
.
class
)
{
// lookup fstypes.properties
FeatureStatus
status
=
checkIfFeaturePresent
(
"nfsv4acl"
);
if
(
status
==
FeatureStatus
.
PRESENT
)
return
true
;
if
(
status
==
FeatureStatus
.
NOT_PRESENT
)
return
false
;
// AclFileAttributeView available on ZFS
return
(
type
().
equals
(
"zfs"
));
switch
(
status
)
{
case
PRESENT
:
return
true
;
case
NOT_PRESENT
:
return
false
;
default
:
// AclFileAttributeView available on ZFS
return
(
type
().
equals
(
"zfs"
));
}
}
if
(
name
.
equals
(
"user"
)
)
{
if
(
type
==
UserDefinedFileAttributeView
.
class
)
{
// lookup fstypes.properties
FeatureStatus
status
=
checkIfFeaturePresent
(
"xattr"
);
if
(
status
==
FeatureStatus
.
PRESENT
)
return
true
;
if
(
status
==
FeatureStatus
.
NOT_PRESENT
)
return
false
;
return
xattrEnabled
;
switch
(
status
)
{
case
PRESENT
:
return
true
;
case
NOT_PRESENT
:
return
false
;
default
:
// UserDefinedFileAttributeView available if extended
// attributes supported
return
xattrEnabled
;
}
}
return
super
.
supportsFileAttributeView
(
type
);
}
@Override
public
boolean
supportsFileAttributeView
(
String
name
)
{
if
(
name
.
equals
(
"acl"
))
return
supportsFileAttributeView
(
AclFileAttributeView
.
class
);
if
(
name
.
equals
(
"user"
))
return
supportsFileAttributeView
(
UserDefinedFileAttributeView
.
class
);
return
super
.
supportsFileAttributeView
(
name
);
}
...
...
src/solaris/classes/sun/nio/fs/UnixFileStore.java
浏览文件 @
e541d267
...
...
@@ -145,9 +145,8 @@ abstract class UnixFileStore
{
// lookup fstypes.properties
FeatureStatus
status
=
checkIfFeaturePresent
(
"posix"
);
if
(
status
==
FeatureStatus
.
NOT_PRESENT
)
return
false
;
return
true
;
// assume supported if UNKNOWN
return
(
status
!=
FeatureStatus
.
NOT_PRESENT
);
}
return
false
;
}
...
...
src/windows/bin/java_md.c
浏览文件 @
e541d267
...
...
@@ -1093,12 +1093,6 @@ void SetJavaLauncherPlatformProps() {}
*/
static
FindClassFromBootLoader_t
*
findBootClass
=
NULL
;
#ifdef _M_AMD64
#define JVM_BCLOADER "JVM_FindClassFromClassLoader"
#else
#define JVM_BCLOADER "_JVM_FindClassFromClassLoader@20"
#endif
/* _M_AMD64 */
jclass
FindBootStrapClass
(
JNIEnv
*
env
,
const
char
*
classname
)
{
HMODULE
hJvm
;
...
...
@@ -1108,13 +1102,13 @@ jclass FindBootStrapClass(JNIEnv *env, const char *classname)
if
(
hJvm
==
NULL
)
return
NULL
;
/* need to use the demangled entry point */
findBootClass
=
(
FindClassFromBootLoader_t
*
)
GetProcAddress
(
hJvm
,
JVM_BCLOADER
);
"JVM_FindClassFromBootLoader"
);
if
(
findBootClass
==
NULL
)
{
JLI_ReportErrorMessage
(
DLL_ERROR4
,
JVM_BCLOADER
);
JLI_ReportErrorMessage
(
DLL_ERROR4
,
"JVM_FindClassFromBootLoader"
);
return
NULL
;
}
}
return
findBootClass
(
env
,
classname
,
JNI_FALSE
,
(
jobject
)
NULL
,
JNI_FALSE
);
return
findBootClass
(
env
,
classname
);
}
void
...
...
src/windows/classes/sun/nio/fs/WindowsFileStore.java
浏览文件 @
e541d267
...
...
@@ -153,7 +153,7 @@ class WindowsFileStore
public
boolean
supportsFileAttributeView
(
Class
<?
extends
FileAttributeView
>
type
)
{
if
(
type
==
null
)
throw
new
NullPointerException
();
if
(
type
==
BasicFileAttributeView
.
class
)
if
(
type
==
BasicFileAttributeView
.
class
||
type
==
DosFileAttributeView
.
class
)
return
true
;
if
(
type
==
AclFileAttributeView
.
class
||
type
==
FileOwnerAttributeView
.
class
)
return
((
volInfo
.
flags
()
&
FILE_PERSISTENT_ACLS
)
!=
0
);
...
...
test/com/sun/jdi/BadHandshakeTest.java
浏览文件 @
e541d267
...
...
@@ -22,7 +22,7 @@
*/
/* @test
* @bug 6306165
* @bug 6306165
6432567
* @summary Check that a bad handshake doesn't cause a debuggee to abort
*
* @build VMConnection BadHandshakeTest Exit0
...
...
test/java/lang/ProcessBuilder/Basic.java
浏览文件 @
e541d267
...
...
@@ -25,7 +25,7 @@
* @test
* @bug 4199068 4738465 4937983 4930681 4926230 4931433 4932663 4986689
* 5026830 5023243 5070673 4052517 4811767 6192449 6397034 6413313
* 6464154 6523983 6206031 4960438 6631352 6631966
* 6464154 6523983 6206031 4960438 6631352 6631966
6850957 6850958
* @summary Basic tests for Process and Environment Variable code
* @run main/othervm Basic
* @author Martin Buchholz
...
...
@@ -302,6 +302,14 @@ public class Basic {
printUTF8
(
val
==
null
?
"null"
:
val
);
}
else
if
(
action
.
equals
(
"System.getenv()"
))
{
printUTF8
(
getenvAsString
(
System
.
getenv
()));
}
else
if
(
action
.
equals
(
"ArrayOOME"
))
{
Object
dummy
;
switch
(
new
Random
().
nextInt
(
3
))
{
case
0
:
dummy
=
new
Integer
[
Integer
.
MAX_VALUE
];
break
;
case
1
:
dummy
=
new
double
[
Integer
.
MAX_VALUE
];
break
;
case
2
:
dummy
=
new
byte
[
Integer
.
MAX_VALUE
][];
break
;
default
:
throw
new
InternalError
();
}
}
else
if
(
action
.
equals
(
"pwd"
))
{
printUTF8
(
new
File
(
System
.
getProperty
(
"user.dir"
))
.
getCanonicalPath
());
...
...
@@ -1472,6 +1480,22 @@ public class Basic {
}
}
catch
(
Throwable
t
)
{
unexpected
(
t
);
}
//----------------------------------------------------------------
// OOME in child allocating maximally sized array
// Test for hotspot/jvmti bug 6850957
//----------------------------------------------------------------
try
{
List
<
String
>
list
=
new
ArrayList
<
String
>(
javaChildArgs
);
list
.
add
(
1
,
String
.
format
(
"-XX:OnOutOfMemoryError=%s -version"
,
javaExe
));
list
.
add
(
"ArrayOOME"
);
ProcessResults
r
=
run
(
new
ProcessBuilder
(
list
));
check
(
r
.
out
().
contains
(
"java.lang.OutOfMemoryError:"
));
check
(
r
.
out
().
contains
(
javaExe
));
check
(
r
.
err
().
contains
(
System
.
getProperty
(
"java.version"
)));
equal
(
r
.
exitValue
(),
1
);
}
catch
(
Throwable
t
)
{
unexpected
(
t
);
}
//----------------------------------------------------------------
// Windows has tricky semi-case-insensitive semantics
//----------------------------------------------------------------
...
...
test/java/lang/reflect/Generics/Probe.java
浏览文件 @
e541d267
...
...
@@ -23,11 +23,9 @@
/*
* @test
* @bug 5003916 6704655
* @bug 5003916 6704655
6873951
* @summary Testing parsing of signatures attributes of nested classes
* @author Joseph D. Darcy
* @compile -source 1.5 Probe.java
* @run main Probe
*/
import
java.lang.reflect.*
;
...
...
@@ -35,51 +33,35 @@ import java.lang.annotation.*;
import
java.util.*
;
import
static
java
.
util
.
Arrays
.*;
@Classes
(
value
={
"java.util.concurrent.FutureTask"
,
"java.util.concurrent.ConcurrentHashMap$EntryIterator"
,
"java.util.concurrent.ConcurrentHashMap$KeyIterator"
,
"java.util.concurrent.ConcurrentHashMap$ValueIterator"
,
"java.util.AbstractList$ListItr"
,
"java.util.EnumMap$EntryIterator"
,
"java.util.EnumMap$KeyIterator"
,
"java.util.EnumMap$ValueIterator"
,
"java.util.IdentityHashMap$EntryIterator"
,
"java.util.IdentityHashMap$KeyIterator"
,
"java.util.IdentityHashMap$ValueIterator"
,
"java.util.WeakHashMap$EntryIterator"
,
"java.util.WeakHashMap$KeyIterator"
,
"java.util.WeakHashMap$ValueIterator"
,
"java.util.TreeMap$EntryIterator"
,
"java.util.TreeMap$KeyIterator"
,
"java.util.TreeMap$ValueIterator"
,
"java.util.HashMap$EntryIterator"
,
"java.util.HashMap$KeyIterator"
,
"java.util.HashMap$ValueIterator"
,
"java.util.LinkedHashMap$EntryIterator"
,
"java.util.LinkedHashMap$KeyIterator"
,
"java.util.LinkedHashMap$ValueIterator"
},
sunClasses
={
"javax.crypto.SunJCE_c"
,
"javax.crypto.SunJCE_e"
,
"javax.crypto.SunJCE_f"
,
"javax.crypto.SunJCE_j"
,
"javax.crypto.SunJCE_k"
,
"javax.crypto.SunJCE_l"
})
@Classes
({
"java.util.concurrent.FutureTask"
,
"java.util.concurrent.ConcurrentHashMap$EntryIterator"
,
"java.util.concurrent.ConcurrentHashMap$KeyIterator"
,
"java.util.concurrent.ConcurrentHashMap$ValueIterator"
,
"java.util.AbstractList$ListItr"
,
"java.util.EnumMap$EntryIterator"
,
"java.util.EnumMap$KeyIterator"
,
"java.util.EnumMap$ValueIterator"
,
"java.util.IdentityHashMap$EntryIterator"
,
"java.util.IdentityHashMap$KeyIterator"
,
"java.util.IdentityHashMap$ValueIterator"
,
"java.util.WeakHashMap$EntryIterator"
,
"java.util.WeakHashMap$KeyIterator"
,
"java.util.WeakHashMap$ValueIterator"
,
"java.util.TreeMap$EntryIterator"
,
"java.util.TreeMap$KeyIterator"
,
"java.util.TreeMap$ValueIterator"
,
"java.util.HashMap$EntryIterator"
,
"java.util.HashMap$KeyIterator"
,
"java.util.HashMap$ValueIterator"
,
"java.util.LinkedHashMap$EntryIterator"
,
"java.util.LinkedHashMap$KeyIterator"
,
"java.util.LinkedHashMap$ValueIterator"
})
public
class
Probe
{
public
static
void
main
(
String
[]
args
)
throws
Throwable
{
public
static
void
main
(
String
...
args
)
throws
Throwable
{
Classes
classesAnnotation
=
(
Probe
.
class
).
getAnnotation
(
Classes
.
class
);
List
<
String
>
names
=
new
ArrayList
<
String
>(
asList
(
classesAnnotation
.
value
()));
if
(
System
.
getProperty
(
"java.runtime.name"
).
startsWith
(
"Java(TM)"
))
{
// Sun production JDK; test crypto classes too
for
(
String
name:
classesAnnotation
.
sunClasses
())
names
.
add
(
name
);
}
int
errs
=
0
;
for
(
String
name:
names
)
{
System
.
out
.
println
(
"\nCLASS "
+
name
);
...
...
@@ -152,5 +134,4 @@ public class Probe {
@Retention
(
RetentionPolicy
.
RUNTIME
)
@interface
Classes
{
String
[]
value
();
// list of classes to probe
String
[]
sunClasses
();
// list of Sun-production JDK specific classes to probe
}
test/java/nio/file/FileStore/Basic.java
浏览文件 @
e541d267
...
...
@@ -22,7 +22,7 @@
*/
/* @test
* @bug 4313887
* @bug 4313887
6873621
* @summary Unit test for java.nio.file.FileStore
* @library ..
*/
...
...
@@ -67,6 +67,15 @@ public class Basic {
* Test: File and FileStore attributes
*/
assertTrue
(
store1
.
supportsFileAttributeView
(
"basic"
));
assertTrue
(
store1
.
supportsFileAttributeView
(
BasicFileAttributeView
.
class
));
assertTrue
(
store1
.
supportsFileAttributeView
(
"posix"
)
==
store1
.
supportsFileAttributeView
(
PosixFileAttributeView
.
class
));
assertTrue
(
store1
.
supportsFileAttributeView
(
"dos"
)
==
store1
.
supportsFileAttributeView
(
DosFileAttributeView
.
class
));
assertTrue
(
store1
.
supportsFileAttributeView
(
"acl"
)
==
store1
.
supportsFileAttributeView
(
AclFileAttributeView
.
class
));
assertTrue
(
store1
.
supportsFileAttributeView
(
"user"
)
==
store1
.
supportsFileAttributeView
(
UserDefinedFileAttributeView
.
class
));
/**
* Test: Enumerate all FileStores
...
...
test/sun/security/tools/jarsigner/nameclash.sh
0 → 100644
浏览文件 @
e541d267
#
# Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation.
#
# 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
# CA 95054 USA or visit www.sun.com if you need additional information or
# have any questions.
#
# @test
# @bug 6876328
# @summary different names for the same digest algorithms breaks jarsigner
#
if
[
"
${
TESTJAVA
}
"
=
""
]
;
then
JAVAC_CMD
=
`
which javac
`
TESTJAVA
=
`
dirname
$JAVAC_CMD
`
/..
fi
# set platform-dependent variables
OS
=
`
uname
-s
`
case
"
$OS
"
in
Windows_
*
)
FS
=
"
\\
"
;;
*
)
FS
=
"/"
;;
esac
KS
=
nc.jks
JFILE
=
nc.jar
KT
=
"
$TESTJAVA
${
FS
}
bin
${
FS
}
keytool -storepass changeit -keypass changeit -keystore
$KS
"
JAR
=
$TESTJAVA
${
FS
}
bin
${
FS
}
jar
JARSIGNER
=
$TESTJAVA
${
FS
}
bin
${
FS
}
jarsigner
rm
$KS
$JFILE
$KT
-alias
a
-dname
CN
=
a
-keyalg
rsa
-genkey
-validity
300
$KT
-alias
b
-dname
CN
=
b
-keyalg
rsa
-genkey
-validity
300
echo
A
>
A
$JAR
cvf
$JFILE
A
$JARSIGNER
-keystore
$KS
-storepass
changeit
$JFILE
a
-digestalg
SHA1
||
exit
1
$JARSIGNER
-keystore
$KS
-storepass
changeit
$JFILE
b
-digestalg
SHA-1
||
exit
2
$JARSIGNER
-keystore
$KS
-verify
-debug
-strict
$JFILE
||
exit
3
exit
0
test/sun/security/x509/AlgorithmId/SHA256withECDSA.java
0 → 100644
浏览文件 @
e541d267
/*
* Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
/*
* @test
* @bug 6871847
* @summary AlgorithmId.get("SHA256withECDSA") not available
*/
import
sun.security.x509.*
;
public
class
SHA256withECDSA
{
public
static
void
main
(
String
[]
args
)
throws
Exception
{
AlgorithmId
.
get
(
"SHA224withECDSA"
);
AlgorithmId
.
get
(
"SHA256withECDSA"
);
AlgorithmId
.
get
(
"SHA384withECDSA"
);
AlgorithmId
.
get
(
"SHA512withECDSA"
);
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录