Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
a2912877
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
a2912877
编写于
1月 08, 2018
作者:
A
asaha
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
1720aa06
450c01f6
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
263 addition
and
24 deletion
+263
-24
.hgtags
.hgtags
+1
-0
make/lib/ServiceabilityLibraries.gmk
make/lib/ServiceabilityLibraries.gmk
+4
-0
src/aix/native/sun/management/AixOperatingSystem.c
src/aix/native/sun/management/AixOperatingSystem.c
+41
-0
src/share/classes/sun/reflect/generics/reflectiveObjects/ParameterizedTypeImpl.java
...ect/generics/reflectiveObjects/ParameterizedTypeImpl.java
+2
-2
src/share/classes/sun/security/tools/KeyStoreUtil.java
src/share/classes/sun/security/tools/KeyStoreUtil.java
+4
-3
src/share/classes/sun/security/tools/keytool/Main.java
src/share/classes/sun/security/tools/keytool/Main.java
+15
-19
test/java/lang/reflect/Generics/TestGenericReturnTypeToString.java
.../lang/reflect/Generics/TestGenericReturnTypeToString.java
+135
-0
test/sun/security/tools/keytool/RealType.java
test/sun/security/tools/keytool/RealType.java
+61
-0
未找到文件。
.hgtags
浏览文件 @
a2912877
...
@@ -853,3 +853,4 @@ c9254e01820639526f803dbe05080fce0d33db98 jdk8u162-b08
...
@@ -853,3 +853,4 @@ c9254e01820639526f803dbe05080fce0d33db98 jdk8u162-b08
ddae5cb11d6c04130b8002b852bc7f80e0c8bcd2 jdk8u162-b12
ddae5cb11d6c04130b8002b852bc7f80e0c8bcd2 jdk8u162-b12
64df143be721d3ef031d765d86277c1e114d627a jdk8u172-b00
64df143be721d3ef031d765d86277c1e114d627a jdk8u172-b00
25f7b0cd25cf13106783050fc8e6f4a78487a7bd jdk8u172-b01
25f7b0cd25cf13106783050fc8e6f4a78487a7bd jdk8u172-b01
db8272cb8c99eea536a66c4c368c4bf2bf013a81 jdk8u172-b02
make/lib/ServiceabilityLibraries.gmk
浏览文件 @
a2912877
...
@@ -290,6 +290,10 @@ BUILD_LIBRARIES += $(BUILD_LIBINSTRUMENT)
...
@@ -290,6 +290,10 @@ BUILD_LIBRARIES += $(BUILD_LIBINSTRUMENT)
BUILD_LIBMANAGEMENT_SRC += $(JDK_TOPDIR)/src/share/native/sun/management \
BUILD_LIBMANAGEMENT_SRC += $(JDK_TOPDIR)/src/share/native/sun/management \
$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/management
$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/management
ifeq ($(OPENJDK_TARGET_OS),aix)
BUILD_LIBMANAGEMENT_SRC += $(JDK_TOPDIR)/src/aix/native/sun/management
endif
BUILD_LIBMANAGEMENT_EXCLUDES :=
BUILD_LIBMANAGEMENT_EXCLUDES :=
BUILD_LIBMANAGEMENT_CFLAGS += -I$(JDK_TOPDIR)/src/share/native/sun/management
BUILD_LIBMANAGEMENT_CFLAGS += -I$(JDK_TOPDIR)/src/share/native/sun/management
...
...
src/aix/native/sun/management/AixOperatingSystem.c
0 → 100644
浏览文件 @
a2912877
/*
* Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright 2017 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
#include "sun_management_OperatingSystemImpl.h"
JNIEXPORT
jdouble
JNICALL
Java_sun_management_OperatingSystemImpl_getSystemCpuLoad
(
JNIEnv
*
env
,
jobject
dummy
)
{
return
-
1
.
0
;
}
JNIEXPORT
jdouble
JNICALL
Java_sun_management_OperatingSystemImpl_getProcessCpuLoad
(
JNIEnv
*
env
,
jobject
dummy
)
{
return
-
1
.
0
;
}
src/share/classes/sun/reflect/generics/reflectiveObjects/ParameterizedTypeImpl.java
浏览文件 @
a2912877
...
@@ -212,7 +212,7 @@ public class ParameterizedTypeImpl implements ParameterizedType {
...
@@ -212,7 +212,7 @@ public class ParameterizedTypeImpl implements ParameterizedType {
else
else
sb
.
append
(
ownerType
.
toString
());
sb
.
append
(
ownerType
.
toString
());
sb
.
append
(
"
.
"
);
sb
.
append
(
"
$
"
);
if
(
ownerType
instanceof
ParameterizedTypeImpl
)
{
if
(
ownerType
instanceof
ParameterizedTypeImpl
)
{
// Find simple name of nested type by removing the
// Find simple name of nested type by removing the
...
@@ -220,7 +220,7 @@ public class ParameterizedTypeImpl implements ParameterizedType {
...
@@ -220,7 +220,7 @@ public class ParameterizedTypeImpl implements ParameterizedType {
sb
.
append
(
rawType
.
getName
().
replace
(
((
ParameterizedTypeImpl
)
ownerType
).
rawType
.
getName
()
+
"$"
,
sb
.
append
(
rawType
.
getName
().
replace
(
((
ParameterizedTypeImpl
)
ownerType
).
rawType
.
getName
()
+
"$"
,
""
));
""
));
}
else
}
else
sb
.
append
(
rawType
.
get
Name
());
sb
.
append
(
rawType
.
getSimple
Name
());
}
else
}
else
sb
.
append
(
rawType
.
getName
());
sb
.
append
(
rawType
.
getName
());
...
...
src/share/classes/sun/security/tools/KeyStoreUtil.java
浏览文件 @
a2912877
/*
/*
* Copyright (c) 2005, 201
2
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 201
7
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
*
* This code is free software; you can redistribute it and/or modify it
* This code is free software; you can redistribute it and/or modify it
...
@@ -63,8 +63,9 @@ public class KeyStoreUtil {
...
@@ -63,8 +63,9 @@ public class KeyStoreUtil {
* MSCAPI KeyStores
* MSCAPI KeyStores
*/
*/
public
static
boolean
isWindowsKeyStore
(
String
storetype
)
{
public
static
boolean
isWindowsKeyStore
(
String
storetype
)
{
return
storetype
.
equalsIgnoreCase
(
"Windows-MY"
)
return
storetype
!=
null
||
storetype
.
equalsIgnoreCase
(
"Windows-ROOT"
);
&&
(
storetype
.
equalsIgnoreCase
(
"Windows-MY"
)
||
storetype
.
equalsIgnoreCase
(
"Windows-ROOT"
));
}
}
/**
/**
...
...
src/share/classes/sun/security/tools/keytool/Main.java
浏览文件 @
a2912877
...
@@ -462,12 +462,12 @@ public final class Main {
...
@@ -462,12 +462,12 @@ public final class Main {
passwords
.
add
(
storePass
);
passwords
.
add
(
storePass
);
}
else
if
(
collator
.
compare
(
flags
,
"-storetype"
)
==
0
||
}
else
if
(
collator
.
compare
(
flags
,
"-storetype"
)
==
0
||
collator
.
compare
(
flags
,
"-deststoretype"
)
==
0
)
{
collator
.
compare
(
flags
,
"-deststoretype"
)
==
0
)
{
storetype
=
args
[++
i
]
;
storetype
=
KeyStoreUtil
.
niceStoreTypeName
(
args
[++
i
])
;
}
else
if
(
collator
.
compare
(
flags
,
"-srcstorepass"
)
==
0
)
{
}
else
if
(
collator
.
compare
(
flags
,
"-srcstorepass"
)
==
0
)
{
srcstorePass
=
getPass
(
modifier
,
args
[++
i
]);
srcstorePass
=
getPass
(
modifier
,
args
[++
i
]);
passwords
.
add
(
srcstorePass
);
passwords
.
add
(
srcstorePass
);
}
else
if
(
collator
.
compare
(
flags
,
"-srcstoretype"
)
==
0
)
{
}
else
if
(
collator
.
compare
(
flags
,
"-srcstoretype"
)
==
0
)
{
srcstoretype
=
args
[++
i
]
;
srcstoretype
=
KeyStoreUtil
.
niceStoreTypeName
(
args
[++
i
])
;
}
else
if
(
collator
.
compare
(
flags
,
"-srckeypass"
)
==
0
)
{
}
else
if
(
collator
.
compare
(
flags
,
"-srckeypass"
)
==
0
)
{
srckeyPass
=
getPass
(
modifier
,
args
[++
i
]);
srckeyPass
=
getPass
(
modifier
,
args
[++
i
]);
passwords
.
add
(
srckeyPass
);
passwords
.
add
(
srckeyPass
);
...
@@ -592,16 +592,6 @@ public final class Main {
...
@@ -592,16 +592,6 @@ public final class Main {
* Execute the commands.
* Execute the commands.
*/
*/
void
doCommands
(
PrintStream
out
)
throws
Exception
{
void
doCommands
(
PrintStream
out
)
throws
Exception
{
if
(
storetype
==
null
)
{
storetype
=
KeyStore
.
getDefaultType
();
}
storetype
=
KeyStoreUtil
.
niceStoreTypeName
(
storetype
);
if
(
srcstoretype
==
null
)
{
srcstoretype
=
KeyStore
.
getDefaultType
();
}
srcstoretype
=
KeyStoreUtil
.
niceStoreTypeName
(
srcstoretype
);
if
(
P11KEYSTORE
.
equalsIgnoreCase
(
storetype
)
||
if
(
P11KEYSTORE
.
equalsIgnoreCase
(
storetype
)
||
KeyStoreUtil
.
isWindowsKeyStore
(
storetype
))
{
KeyStoreUtil
.
isWindowsKeyStore
(
storetype
))
{
token
=
true
;
token
=
true
;
...
@@ -626,11 +616,6 @@ public final class Main {
...
@@ -626,11 +616,6 @@ public final class Main {
(
".storepasswd.and.keypasswd.commands.not.supported.if.storetype.is.{0}"
),
storetype
));
(
".storepasswd.and.keypasswd.commands.not.supported.if.storetype.is.{0}"
),
storetype
));
}
}
if
(
P12KEYSTORE
.
equalsIgnoreCase
(
storetype
)
&&
command
==
KEYPASSWD
)
{
throw
new
UnsupportedOperationException
(
rb
.
getString
(
".keypasswd.commands.not.supported.if.storetype.is.PKCS12"
));
}
if
(
token
&&
(
keyPass
!=
null
||
newPass
!=
null
||
destKeyPass
!=
null
))
{
if
(
token
&&
(
keyPass
!=
null
||
newPass
!=
null
||
destKeyPass
!=
null
))
{
throw
new
IllegalArgumentException
(
MessageFormat
.
format
(
rb
.
getString
throw
new
IllegalArgumentException
(
MessageFormat
.
format
(
rb
.
getString
(
".keypass.and.new.can.not.be.specified.if.storetype.is.{0}"
),
storetype
));
(
".keypass.and.new.can.not.be.specified.if.storetype.is.{0}"
),
storetype
));
...
@@ -802,6 +787,9 @@ public final class Main {
...
@@ -802,6 +787,9 @@ public final class Main {
}
}
// Create new keystore
// Create new keystore
if
(
storetype
==
null
)
{
storetype
=
KeyStore
.
getDefaultType
();
}
if
(
providerName
==
null
)
{
if
(
providerName
==
null
)
{
keyStore
=
KeyStore
.
getInstance
(
storetype
);
keyStore
=
KeyStore
.
getInstance
(
storetype
);
}
else
{
}
else
{
...
@@ -839,6 +827,11 @@ public final class Main {
...
@@ -839,6 +827,11 @@ public final class Main {
}
}
}
}
if
(
P12KEYSTORE
.
equalsIgnoreCase
(
storetype
)
&&
command
==
KEYPASSWD
)
{
throw
new
UnsupportedOperationException
(
rb
.
getString
(
".keypasswd.commands.not.supported.if.storetype.is.PKCS12"
));
}
// All commands that create or modify the keystore require a keystore
// All commands that create or modify the keystore require a keystore
// password.
// password.
...
@@ -2014,6 +2007,9 @@ public final class Main {
...
@@ -2014,6 +2007,9 @@ public final class Main {
KeyStore
store
;
KeyStore
store
;
try
{
try
{
if
(
srcstoretype
==
null
)
{
srcstoretype
=
KeyStore
.
getDefaultType
();
}
if
(
srcProviderName
==
null
)
{
if
(
srcProviderName
==
null
)
{
store
=
KeyStore
.
getInstance
(
srcstoretype
);
store
=
KeyStore
.
getInstance
(
srcstoretype
);
}
else
{
}
else
{
...
@@ -2635,12 +2631,12 @@ public final class Main {
...
@@ -2635,12 +2631,12 @@ public final class Main {
if
(
rfc
)
{
if
(
rfc
)
{
dumpCert
(
cert
,
out
);
dumpCert
(
cert
,
out
);
}
else
{
}
else
{
out
.
println
(
"Certificate #"
+
i
++
);
out
.
println
(
"Certificate #"
+
i
);
out
.
println
(
"===================================="
);
out
.
println
(
"===================================="
);
printX509Cert
((
X509Certificate
)
cert
,
out
);
printX509Cert
((
X509Certificate
)
cert
,
out
);
out
.
println
();
out
.
println
();
}
}
checkWeak
(
oneInMany
(
rb
.
getString
(
"the.certificate"
),
i
,
chain
.
size
()),
cert
);
checkWeak
(
oneInMany
(
rb
.
getString
(
"the.certificate"
),
i
++
,
chain
.
size
()),
cert
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
if
(
debug
)
{
if
(
debug
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
...
...
test/java/lang/reflect/Generics/TestGenericReturnTypeToString.java
0 → 100644
浏览文件 @
a2912877
/*
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 8054213
* @summary Check that toString method works properly for generic return type
* obtained via reflection
* @run main TestGenericReturnTypeToString
*/
import
java.lang.annotation.Retention
;
import
java.lang.annotation.RetentionPolicy
;
import
java.lang.reflect.Method
;
import
java.util.List
;
public
class
TestGenericReturnTypeToString
{
public
static
void
main
(
String
[]
args
)
{
boolean
hasFailures
=
false
;
for
(
Method
method
:
TestGenericReturnTypeToString
.
class
.
getMethods
())
{
if
(
method
.
isAnnotationPresent
(
ExpectedGenericString
.
class
))
{
ExpectedGenericString
es
=
method
.
getAnnotation
(
ExpectedGenericString
.
class
);
String
result
=
method
.
getGenericReturnType
().
toString
();
if
(!
es
.
value
().
equals
(
result
))
{
hasFailures
=
true
;
System
.
err
.
println
(
"Unexpected result of "
+
"getGenericReturnType().toString() "
+
" for "
+
method
.
getName
()
+
" expected: "
+
es
.
value
()
+
" actual: "
+
result
);
}
}
if
(
hasFailures
)
{
throw
new
RuntimeException
(
"Test failed"
);
}
}
}
@ExpectedGenericString
(
"TestGenericReturnTypeToString$"
+
"FirstInnerClassGeneric<Dummy>$SecondInnerClassGeneric<Dummy>"
)
public
FirstInnerClassGeneric
<
Dummy
>.
SecondInnerClassGeneric
<
Dummy
>
foo1
()
{
return
null
;
}
@ExpectedGenericString
(
"TestGenericReturnTypeToString$"
+
"FirstInnerClassGeneric<Dummy>$SecondInnerClass"
)
public
FirstInnerClassGeneric
<
Dummy
>.
SecondInnerClass
foo2
()
{
return
null
;
}
@ExpectedGenericString
(
"TestGenericReturnTypeToString$"
+
"FirstInnerClass$SecondInnerClassGeneric<Dummy>"
)
public
FirstInnerClass
.
SecondInnerClassGeneric
<
Dummy
>
foo3
()
{
return
null
;
}
@ExpectedGenericString
(
"class TestGenericReturnTypeToString$"
+
"FirstInnerClass$SecondInnerClass"
)
public
FirstInnerClass
.
SecondInnerClass
foo4
()
{
return
null
;
}
@ExpectedGenericString
(
"java.util.List<java.lang.String>"
)
public
java
.
util
.
List
<
java
.
lang
.
String
>
foo5
()
{
return
null
;
}
@ExpectedGenericString
(
"interface TestGenericReturnTypeToString$"
+
"FirstInnerClass$Interface"
)
public
FirstInnerClass
.
Interface
foo6
()
{
return
null
;
}
@ExpectedGenericString
(
"TestGenericReturnTypeToString$"
+
"FirstInnerClass$InterfaceGeneric<Dummy>"
)
public
FirstInnerClass
.
InterfaceGeneric
<
Dummy
>
foo7
()
{
return
null
;
}
public
static
class
FirstInnerClass
{
public
class
SecondInnerClassGeneric
<
T
>
{
}
public
class
SecondInnerClass
{
}
interface
Interface
{
}
interface
InterfaceGeneric
<
T
>
{
}
}
public
class
FirstInnerClassGeneric
<
T
>
{
public
class
SecondInnerClassGeneric
<
T
>
{
}
public
class
SecondInnerClass
{
}
}
}
@Retention
(
RetentionPolicy
.
RUNTIME
)
@interface
ExpectedGenericString
{
String
value
();
}
class
Dummy
{
}
test/sun/security/tools/keytool/RealType.java
0 → 100644
浏览文件 @
a2912877
/*
* Copyright (c) 2017, 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 8192987
* @summary keytool should remember real storetype if it is not provided
* @library /lib/testlibrary
* @run main/othervm RealType
*/
import
jdk.testlibrary.SecurityTools
;
import
jdk.testlibrary.OutputAnalyzer
;
import
java.nio.file.Files
;
import
java.nio.file.Paths
;
public
class
RealType
{
public
static
void
main
(
String
[]
args
)
throws
Throwable
{
kt
(
"-genkeypair -alias a -dname CN=A -keypass changeit -storetype jks"
)
.
shouldHaveExitValue
(
0
);
// -keypasswd command should be allowed on JKS
kt
(
"-keypasswd -alias a -new t0ps3cr3t"
)
.
shouldHaveExitValue
(
0
);
Files
.
delete
(
Paths
.
get
(
"ks"
));
kt
(
"-genkeypair -alias a -dname CN=A -keypass changeit -storetype pkcs12"
)
.
shouldHaveExitValue
(
0
);
// A pkcs12 keystore cannot be loaded as a JCEKS keystore
kt
(
"-list -storetype jceks"
).
shouldHaveExitValue
(
1
);
}
static
OutputAnalyzer
kt
(
String
arg
)
throws
Exception
{
return
SecurityTools
.
keytool
(
"-debug -keystore ks -storepass changeit "
+
arg
);
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录