Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_langtools
提交
a17c5631
D
dragonwell8_langtools
项目概览
openanolis
/
dragonwell8_langtools
通知
0
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_langtools
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
a17c5631
编写于
6月 30, 2017
作者:
A
asaha
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
005ecf8f
48a9a04a
变更
15
展开全部
显示空白变更内容
内联
并排
Showing
15 changed file
with
851 addition
and
921 deletion
+851
-921
.hgtags
.hgtags
+32
-0
ASSEMBLY_EXCEPTION
ASSEMBLY_EXCEPTION
+12
-12
THIRD_PARTY_README
THIRD_PARTY_README
+378
-889
src/share/classes/com/sun/tools/javac/jvm/Gen.java
src/share/classes/com/sun/tools/javac/jvm/Gen.java
+7
-2
src/share/classes/com/sun/tools/javac/tree/TreeInfo.java
src/share/classes/com/sun/tools/javac/tree/TreeInfo.java
+12
-3
src/share/classes/com/sun/tools/jdeps/ClassFileReader.java
src/share/classes/com/sun/tools/jdeps/ClassFileReader.java
+15
-1
src/share/classes/com/sun/tools/jdeps/JdepsTask.java
src/share/classes/com/sun/tools/jdeps/JdepsTask.java
+8
-1
src/share/classes/com/sun/tools/jdeps/resources/jdeps.properties
...re/classes/com/sun/tools/jdeps/resources/jdeps.properties
+4
-0
src/share/classes/com/sun/tools/jdeps/resources/jdeps_ja.properties
...classes/com/sun/tools/jdeps/resources/jdeps_ja.properties
+1
-0
src/share/classes/com/sun/tools/jdeps/resources/jdeps_zh_CN.properties
...sses/com/sun/tools/jdeps/resources/jdeps_zh_CN.properties
+1
-0
src/share/classes/com/sun/tools/jdeps/resources/jdkinternals.properties
...ses/com/sun/tools/jdeps/resources/jdkinternals.properties
+30
-7
test/tools/javac/T7008643/InlinedFinallyConfuseDebuggersTest.java
...ls/javac/T7008643/InlinedFinallyConfuseDebuggersTest.java
+2
-1
test/tools/javac/T8180660/MissingLNTEntryForFinalizerTest.java
...tools/javac/T8180660/MissingLNTEntryForFinalizerTest.java
+170
-0
test/tools/javac/linenumbers/FinallyLineNumberTest.java
test/tools/javac/linenumbers/FinallyLineNumberTest.java
+10
-5
test/tools/jdeps/MRJarWarning.java
test/tools/jdeps/MRJarWarning.java
+169
-0
未找到文件。
.hgtags
浏览文件 @
a17c5631
...
...
@@ -704,5 +704,37 @@ bc4f253725f93d9b832ec60d521cd5426a9489ea jdk8u131-b07
5162417b51bdf68b95696198181f2e662a14ff8a jdk8u131-b11
1175fac90fdbbd864f7b1f306397644d26eb9781 jdk8u141-b00
bb163efa3276e129c69bad28299a6283b869caa3 jdk8u141-b01
5864e3781953daa69efd54b329a358a568229268 jdk8u141-b02
4378c8e874a5c13409b651a47b4b388f17904da1 jdk8u141-b03
d89ea3127a93d7ea6f2b89ee3adc673136833933 jdk8u141-b04
b8e0348df792b1c5f95cd7d77d5c05da1d435d32 jdk8u141-b05
13b638c8e005d48be437db11835a63721ca10086 jdk8u141-b06
4d04a70e3207dcb46b71e6f9ad04bf0e130cf389 jdk8u141-b07
e2abef6f10b9b2946ce8f5f851af67a764bbe57d jdk8u141-b08
1df48afb34a0778df6c97a2c96c483a177135431 jdk8u141-b09
479c13a68ca457526d49d8e2c7034a365bf0233d jdk8u141-b10
2cc58a0fdfd6e7e2d21a254f6830ba51c2b3612f jdk8u141-b11
b5259d2465fa61256f485860f986bd575f13fe92 jdk8u141-b12
9a5ddb594b491ec32e9fafa7008631291ab66d6e jdk8u141-b13
553043f3a2319af6fd6bc704bc8fd7fa4500ee80 jdk8u141-b14
4d69601f88c30e9f05e3b56c6d38a2f3eb47d477 jdk8u151-b00
f081adae3486f8728affc89213c2cd1dd0ac9467 jdk8u151-b01
732e1bab2660d21227dce26190d4a31dd9785a7f jdk8u151-b02
9a9ce479b92f1b4d9d436fb857d70c3d2b59a20c jdk8u122-b00
85d9e434701cc7112aaf965b0f5ee4b31ab2a445 jdk8u122-b01
2baeb96fa198f75e9bd50a5f5ef4a19be6cfbc4e jdk8u122-b02
a5da608d17bdc073fd3a4f2e1d4fe7d526567d09 jdk8u122-b03
a5da608d17bdc073fd3a4f2e1d4fe7d526567d09 jdk8u122-b03
0000000000000000000000000000000000000000 jdk8u122-b03
0000000000000000000000000000000000000000 jdk8u122-b03
18bfe5da1f56c6932cce6378f617904db68bedcd jdk8u122-b03
5ce29dae0e3e11bbecbc2173479ccf0a06b7d556 jdk8u122-b04
9229942f9ee2ad7c5b8d57cddcb9011aac6bac23 jdk8u132-b00
03e31cfcd499360c2db8eeccacc77ee040e71bac jdk8u152-b00
f47b61665c6fefb5eba2504d5e312004d59f0483 jdk8u152-b01
a283fc8f44acc956fbc4192d546216c4638e7146 jdk8u152-b02
2783ff53e49dec0e7939b54aeb302605725e1017 jdk8u152-b03
71e344b8e2c237dd7ef7c5f4276030e2880a6e07 jdk8u152-b04
38bb14529d829cc290439a712b9821cd0e272f7e jdk8u152-b05
4d69601f88c30e9f05e3b56c6d38a2f3eb47d477 jdk8u151-b00
af48981bdd47e86656dfdc6b675fbd5caeabd843 jdk8u161-b00
ASSEMBLY_EXCEPTION
浏览文件 @
a17c5631
OPENJDK ASSEMBLY EXCEPTION
The OpenJDK source code made available by
Sun at openjdk.java.net and
openjdk.
dev.java.net ("OpenJDK Code") is distributed under the terms of the
G
NU G
eneral Public License <http://www.gnu.org/copyleft/gpl.html> version 2
The OpenJDK source code made available by
Oracle America, Inc. (Oracle) at
openjdk.
java.net ("OpenJDK Code") is distributed under the terms of the GNU
General Public License <http://www.gnu.org/copyleft/gpl.html> version 2
only ("GPL2"), with the following clarification and special exception.
Linking this OpenJDK Code statically or dynamically with other code
is making a combined work based on this library. Thus, the terms
and conditions of GPL2 cover the whole combination.
As a special exception,
Sun
gives you permission to link this
OpenJDK Code with certain code licensed by
Sun
as indicated at
As a special exception,
Oracle
gives you permission to link this
OpenJDK Code with certain code licensed by
Oracle
as indicated at
http://openjdk.java.net/legal/exception-modules-2007-05-08.html
("Designated Exception Modules") to produce an executable,
regardless of the license terms of the Designated Exception Modules,
and to copy and distribute the resulting executable under GPL2,
provided that the Designated Exception Modules continue to be
governed by the licenses under which they were offered by
Sun
.
governed by the licenses under which they were offered by
Oracle
.
As such, it allows licensees and sublicensees of
Sun's GPL2 OpenJDK Code to
build an executable that includes those portions of necessary code that Sun
could not provide under GPL2 (or that Sun has provided under GPL2 with the
Classpath exception). If you modify or add to the OpenJDK code, that new
GPL2 code may still be combined with Designated Exception Modules if the
new code is made subject to this exception by its copyright holder.
As such, it allows licensees and sublicensees of
Oracle's GPL2 OpenJDK Code
to build an executable that includes those portions of necessary code that
Oracle could not provide under GPL2 (or that Oracle has provided under GPL2
with the Classpath exception). If you modify or add to the OpenJDK code,
that new GPL2 code may still be combined with Designated Exception Modules
if the
new code is made subject to this exception by its copyright holder.
THIRD_PARTY_README
浏览文件 @
a17c5631
此差异已折叠。
点击以展开。
src/share/classes/com/sun/tools/javac/jvm/Gen.java
浏览文件 @
a17c5631
...
...
@@ -27,6 +27,7 @@ package com.sun.tools.javac.jvm;
import
java.util.*
;
import
com.sun.tools.javac.tree.TreeInfo.PosKind
;
import
com.sun.tools.javac.util.*
;
import
com.sun.tools.javac.util.JCDiagnostic.DiagnosticPosition
;
import
com.sun.tools.javac.util.List
;
...
...
@@ -1531,12 +1532,16 @@ public class Gen extends JCTree.Visitor {
catchallpc
,
0
);
startseg
=
env
.
info
.
gaps
.
next
().
intValue
();
}
code
.
statBegin
(
TreeInfo
.
finalizerPos
(
env
.
tree
));
code
.
statBegin
(
TreeInfo
.
finalizerPos
(
env
.
tree
,
PosKind
.
FIRST_STAT_POS
));
code
.
markStatBegin
();
Item
excVar
=
makeTemp
(
syms
.
throwableType
);
excVar
.
store
();
genFinalizer
(
env
);
code
.
resolvePending
();
code
.
statBegin
(
TreeInfo
.
finalizerPos
(
env
.
tree
,
PosKind
.
END_POS
));
code
.
markStatBegin
();
excVar
.
load
();
registerCatch
(
body
.
pos
(),
startseg
,
env
.
info
.
gaps
.
next
().
intValue
(),
...
...
@@ -1550,7 +1555,7 @@ public class Gen extends JCTree.Visitor {
code
.
resolve
(
env
.
info
.
cont
);
// Mark statement line number
code
.
statBegin
(
TreeInfo
.
finalizerPos
(
env
.
tree
));
code
.
statBegin
(
TreeInfo
.
finalizerPos
(
env
.
tree
,
PosKind
.
FIRST_STAT_POS
));
code
.
markStatBegin
();
// Save return address.
...
...
src/share/classes/com/sun/tools/javac/tree/TreeInfo.java
浏览文件 @
a17c5631
/*
* Copyright (c) 1999, 201
4
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 201
7
, 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
...
...
@@ -35,6 +35,7 @@ import com.sun.tools.javac.comp.Env;
import
com.sun.tools.javac.tree.JCTree.*
;
import
com.sun.tools.javac.tree.JCTree.JCPolyExpression.*
;
import
com.sun.tools.javac.util.*
;
import
com.sun.tools.javac.util.JCDiagnostic.DiagnosticPosition
;
import
static
com
.
sun
.
tools
.
javac
.
code
.
Flags
.*;
import
static
com
.
sun
.
tools
.
javac
.
code
.
TypeTag
.
BOT
;
...
...
@@ -611,13 +612,21 @@ public class TreeInfo {
};
}
public
enum
PosKind
{
START_POS
()
{
int
toPos
(
JCTree
tree
)
{
return
TreeInfo
.
getStartPos
(
tree
);
}
},
FIRST_STAT_POS
()
{
int
toPos
(
JCTree
tree
)
{
return
firstStatPos
(
tree
);
}
},
END_POS
()
{
int
toPos
(
JCTree
tree
)
{
return
endPos
(
tree
);
}
};
abstract
int
toPos
(
JCTree
tree
);
}
/** The position of the finalizer of given try/synchronized statement.
*/
public
static
int
finalizerPos
(
JCTree
tree
)
{
public
static
int
finalizerPos
(
JCTree
tree
,
PosKind
posKind
)
{
if
(
tree
.
hasTag
(
TRY
))
{
JCTry
t
=
(
JCTry
)
tree
;
Assert
.
checkNonNull
(
t
.
finalizer
);
return
firstStat
Pos
(
t
.
finalizer
);
return
posKind
.
to
Pos
(
t
.
finalizer
);
}
else
if
(
tree
.
hasTag
(
SYNCHRONIZED
))
{
return
endPos
(((
JCSynchronized
)
tree
).
body
);
}
else
{
...
...
src/share/classes/com/sun/tools/jdeps/ClassFileReader.java
浏览文件 @
a17c5631
/*
* Copyright (c) 2012, 201
4
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 201
7
, 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
...
...
@@ -34,8 +34,10 @@ import java.nio.file.Path;
import
java.nio.file.SimpleFileVisitor
;
import
java.nio.file.attribute.BasicFileAttributes
;
import
java.util.*
;
import
java.util.jar.Attributes
;
import
java.util.jar.JarEntry
;
import
java.util.jar.JarFile
;
import
java.util.jar.Manifest
;
/**
* ClassFileReader reads ClassFile(s) of a given path that can be
...
...
@@ -154,6 +156,8 @@ public class ClassFileReader {
}
}
public
boolean
isMultiReleaseJar
()
throws
IOException
{
return
false
;
}
public
String
toString
()
{
return
path
.
toString
();
}
...
...
@@ -290,6 +294,16 @@ public class ClassFileReader {
}
};
}
@Override
public
boolean
isMultiReleaseJar
()
throws
IOException
{
Manifest
mf
=
this
.
jarfile
.
getManifest
();
if
(
mf
!=
null
)
{
Attributes
atts
=
mf
.
getMainAttributes
();
return
"true"
.
equalsIgnoreCase
(
atts
.
getValue
(
"Multi-Release"
));
}
return
false
;
}
}
class
JarFileIterator
implements
Iterator
<
ClassFile
>
{
...
...
src/share/classes/com/sun/tools/jdeps/JdepsTask.java
浏览文件 @
a17c5631
/*
* Copyright (c) 2012, 201
4
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 201
7
, 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
...
...
@@ -515,6 +515,13 @@ class JdepsTask {
// add all classpath archives to the source locations for reporting
sourceLocations
.
addAll
(
classpaths
);
// warn about Multi-Release jars
for
(
Archive
a
:
sourceLocations
)
{
if
(
a
.
reader
().
isMultiReleaseJar
())
{
warning
(
"warn.mrjar.usejdk9"
,
a
.
getPathName
());
}
}
// Work queue of names of classfiles to be searched.
// Entries will be unique, and for classes that do not yet have
// dependencies in the results map.
...
...
src/share/classes/com/sun/tools/jdeps/resources/jdeps.properties
浏览文件 @
a17c5631
...
...
@@ -99,6 +99,10 @@ subject to be removed or changed incompatibly and could break your application.\
Please modify your code to eliminate dependency on any JDK internal APIs.
\n\
For the most recent update on JDK internal API replacements, please check:
\n\
{0}
warn.mrjar.usejdk9
=
\
{0} is a multi-release jar file.
\n\
All versioned entries are analyzed. To analyze the entries for a specific
\n\
version, use a newer version of jdeps (JDK 9 or later)
\"
--multi-release
\"
option.
artifact.not.found
=
not found
jdeps.wiki.url
=
https://wiki.openjdk.java.net/display/JDK8/Java+Dependency+Analysis+Tool
src/share/classes/com/sun/tools/jdeps/resources/jdeps_ja.properties
浏览文件 @
a17c5631
...
...
@@ -46,6 +46,7 @@ err.invalid.path=\u7121\u52B9\u306A\u30D1\u30B9: {0}
warn.invalid.arg
=
\u7121\u
52B9
\u
306A
\u
30AF
\u
30E9
\u
30B9
\u
540D
\u
307E
\u
305F
\u
306F
\u
30D1
\u
30B9
\u
540D
\u
304C
\u
5B58
\u5728\u3057\u
307E
\u
305B
\u3093
: {0}
warn.split.package
=
\u
30D1
\u
30C3
\u
30B1
\u
30FC
\u
30B8{0}
\u
306F{1} {2}
\u3067\u
5B9A
\u
7FA9
\u3055\u
308C
\u3066\u3044\u
307E
\u3059
warn.replace.useJDKInternals
=
JDK
\u5185\u
90E8API
\u
306F
\u
30B5
\u
30DD
\u
30FC
\u
30C8
\u3055\u
308C
\u3066\u
304A
\u3089\u
305A
\u3001
JDK
\u
5B9F
\u
88C5
\u
5C02
\u7528\u3067\u3059\u
304C
\u3001\u
4E92
\u
63DB
\u6027\u
306A
\u3057\u3067\n\u
524A
\u9664\u
307E
\u
305F
\u
306F
\u5909\u
66F4
\u3055\u
308C
\u
308B
\u5834\u5408\u
304C
\u3042\u
308A
\u3001\u
30A2
\u
30D7
\u
30EA
\u
30B1
\u
30FC
\u
30B7
\u
30E7
\u
30F3
\u3092\u
4E2D
\u
65AD
\u3055\u
305B
\u
308B
\u
53EF
\u
80FD
\u6027\u
304C
\u3042\u
308A
\u
307E
\u3059\u3002\n
JDK
\u5185\u
90E8API
\u
306E
\u
4F9D
\u
5B58
\u6027\u3092\u
524A
\u9664\u3059\u
308B
\u3088\u3046\u
30B3
\u
30FC
\u
30C9
\u3092\u5909\u
66F4
\u3057\u3066\u
304F
\u3060\u3055\u3044\u3002\n
JDK
\u5185\u
90E8API
\u
306E
\u
7F6E
\u
63DB
\u
306B
\u
95A2
\u3059\u
308B
\u6700\u
65B0
\u
306E
\u
66F4
\u
65B0
\u
306B
\u3064\u3044\u3066\u
306F
\u3001\u
6B21
\u3092\u
78BA
\u
8A8D
\u3057\u3066\u
304F
\u3060\u3055\u3044
:
\n
{0}
warn.mrjar.usejdk9
=
{0}
\u
306F
\u
30DE
\u
30EB
\u
30C1
\u
30EA
\u
30EA
\u
30FC
\u
30B9jar
\u
30D5
\u
30A1
\u
30A4
\u
30EB
\u3067\u3059\u3002\n\u3059\u3079\u3066\u
306E
\u
30D0
\u
30FC
\u
30B8
\u
30E7
\u
30CB
\u
30F3
\u
30B0
\u
6E08
\u
30A8
\u
30F3
\u
30C8
\u
30EA
\u3092\u5206\u6790\u3057\u
307E
\u3059\u3002\u7279\u
5B9A
\u
306E
\u
30D0
\u
30FC
\u
30B8
\u
30E7
\u
30F3
\u
306E
\u
30A8
\u
30F3
\u
30C8
\u
30EA
\u3092\u5206\u6790\u3059\u
308B
\u
306B
\u
306F
\u3001\n\u
65B0
\u3057\u3044\u
30D0
\u
30FC
\u
30B8
\u
30E7
\u
30F3
\u
306Ejdeps (JDK 9
\u
4EE5
\u
964D)
\u
306E"--multi-release"
\u
30AA
\u
30D7
\u
30B7
\u
30E7
\u
30F3
\u3092\u
4F7F
\u7528\u3057\u
307E
\u3059\u3002
artifact.not.found
=
\u
898B
\u3064\u
304B
\u
308A
\u
307E
\u
305B
\u3093
jdeps.wiki.url
=
https://wiki.openjdk.java.net/display/JDK8/Java+Dependency+Analysis+Tool
src/share/classes/com/sun/tools/jdeps/resources/jdeps_zh_CN.properties
浏览文件 @
a17c5631
...
...
@@ -46,6 +46,7 @@ err.invalid.path=\u65E0\u6548\u8DEF\u5F84: {0}
warn.invalid.arg
=
\u
7C7B
\u
540D
\u
65E0
\u6548\u6216\u
8DEF
\u
5F84
\u
540D
\u
4E0D
\u
5B58
\u5728
: {0}
warn.split.package
=
\u
5DF2
\u5728
{1} {2}
\u
4E2D
\u
5B9A
\u
4E49
\u
7A0B
\u
5E8F
\u5305
{0}
warn.replace.useJDKInternals
=
\u
4E0D
\u
652F
\u6301
JDK
\u5185\u
90E8 API,
\u
5B83
\u
4EEC
\u
4E13
\u7528\u
4E8E
\u
901A
\u
8FC7
\u
4E0D
\u
517C
\u
5BB9
\u
65B9
\u
5F0F
\u6765\u5220\u9664\n\u6216\u
66F4
\u6539\u7684
JDK
\u
5B9E
\u
73B0,
\u
53EF
\u
80FD
\u
4F1A
\u
635F
\u
574F
\u
60A8
\u7684\u
5E94
\u7528\u
7A0B
\u
5E8F
\u3002\n\u
8BF7
\u
4FEE
\u6539\u
60A8
\u7684\u
4EE3
\u7801
,
\u
6D88
\u9664\u
4E0E
\u
4EFB
\u
4F55 JDK
\u5185\u
90E8 API
\u7684\u
76F8
\u5173\u6027\u3002\n\u6709\u5173
JDK
\u5185\u
90E8 API
\u
66FF
\u6362\u7684\u6700\u
65B0
\u
66F4
\u
65B0,
\u
8BF7
\u
67E5
\u
770B:
\n
{0}
warn.mrjar.usejdk9
=
{0}
\u
662F
\u
591A
\u
53D1
\u
884C
\u7248
jar
\u6587\u
4EF6
\u3002\n\u
5DF2
\u5206\u6790\u6240\u6709\u7248\u
672C
\u5316\u6761\u
76EE
\u3002\u8981\u5206\u6790\u
67D0
\u
4E2A
\u7279\u
5B9A
\u7248\u
672C
\u7684\u6761\u
76EE,
\n\u
8BF7
\u
4F7F
\u7528\u
66F4
\u
65B0
\u7248\u
672C
\u7684
jdeps (JDK 9
\u6216\u
66F4
\u
9AD8
\u7248\u
672C) "--multi-release"
\u9009\u9879\u3002
artifact.not.found
=
\u
627E
\u
4E0D
\u5230
jdeps.wiki.url
=
https://wiki.openjdk.java.net/display/JDK8/Java+Dependency+Analysis+Tool
src/share/classes/com/sun/tools/jdeps/resources/jdkinternals.properties
浏览文件 @
a17c5631
//
No
translation
needed
com.sun.crypto.provider.SunJCE
=
Use java.security.Security.getProvider(provider-name) @since 1.3
com.sun.image.codec
=
Use javax.imageio @since 1.4
com.sun.org.apache.xml.internal.security
=
Use java.xml.crypto @since 1.6
com.sun.org.apache.xml.internal.security.utils.Base64
=
Use java.util.Base64 @since 1.8
com.sun.org.apache.xml.internal.resolver
=
Use javax.xml.catalog @since 9
com.sun.net.ssl
=
Use javax.net.ssl @since 1.4
com.sun.net.ssl.internal.ssl.Provider
=
Use java.security.Security.getProvider(provider-name) @since 1.3
com.sun.rowset
=
Use javax.sql.rowset.RowSetProvider @since 1.7
com.sun.tools.doclets.standard
=
Use jdk.javadoc.doclets.StandardDoclet @since 9.
com.sun.tools.javac.tree
=
Use com.sun.source @since 1.6
com.sun.tools.javac
=
Use javax.tools and javax.lang.model @since 1.6
sun.awt.image.codec
=
Use javax.imageio @since 1.4
sun.misc.BASE64Encoder
=
Use java.util.Base64 @since 1.8
sun.misc.BASE64Decoder
=
Use java.util.Base64 @since 1.8
sun.misc.Cleaner
=
Use java.lang.ref.PhantomReference @since 1.2
sun.misc.Service
=
Use java.util.ServiceLoader @since 1.6
java.awt.peer
=
Should not use. See https://bugs.openjdk.java.net/browse/JDK-8037739
java.awt.dnd.peer
=
Should not use. See https://bugs.openjdk.java.net/browse/JDK-8037739
jdk.internal.ref.Cleaner
=
Use java.lang.ref.PhantomReference @since 1.2 or java.lang.ref.Cleaner @since 9
sun.awt.CausedFocusEvent
=
Use java.awt.event.FocusEvent::getCause @since 9
sun.font.FontUtilities
=
See java.awt.Font.textRequiresLayout @since 9
sun.reflect.Reflection
=
See http://openjdk.java.net/jeps/260
sun.reflect.ReflectionFactory
=
See http://openjdk.java.net/jeps/260
sun.misc.Unsafe
=
See http://openjdk.java.net/jeps/260
sun.misc.Signal
=
See http://openjdk.java.net/jeps/260
sun.misc.SignalHandler
=
See http://openjdk.java.net/jeps/260
sun.security.action
=
Use java.security.PrivilegedAction @since 1.1
sun.security.krb5
=
Use com.sun.security.jgss
sun.security.provider.PolicyFile
=
Use java.security.Policy.getInstance("JavaPolicy", new URIParameter(uri)) @since 1.6
sun.security.provider.Sun
=
Use java.security.Security.getProvider(provider-name) @since 1.3
sun.security.util.HostnameChecker
=
Use javax.net.ssl.SSLParameters.setEndpointIdentificationAlgorithm("HTTPS") @since 1.7
\n\
or javax.net.ssl.HttpsURLConnection.setHostnameVerifier() @since 1.4
sun.security.util.SecurityConstants
=
Use appropriate java.security.Permission subclass @since 1.1
sun.security.x509.X500Name
=
Use javax.security.auth.x500.X500Principal @since 1.4
sun.tools.jar
=
Use java.util.jar or jar tool @since 1.2
sun.tools.jar
=
Use java.util.jar @since 1.2
sun.tools.jar.Main
=
Use java.util.spi.ToolProvider @since 9
# Internal APIs removed in JDK 9
com.apple.eawt
=
Use java.awt.Desktop @since 9. See http://openjdk.java.net/jeps/272
com.apple.concurrent
=
Removed in JDK 9. See https://bugs.openjdk.java.net/browse/JDK-8148187
com.sun.image.codec.jpeg
=
Use javax.imageio @since 1.4
sun.awt.image.codec
=
Use javax.imageio @since 1.4
sun.misc.BASE64Encoder
=
Use java.util.Base64 @since 1.8
sun.misc.BASE64Decoder
=
Use java.util.Base64 @since 1.8
sun.misc.ClassLoaderUtil
=
Use java.net.URLClassLoader.close() @since 1.7
sun.misc.Cleaner
=
Use java.lang.ref.PhantomReference @since 1.2 or java.lang.ref.Cleaner @since 9.
\n\
See http://openjdk.java.net/jeps/260.
sun.misc.Service
=
Use java.util.ServiceLoader @since 1.6
sun.misc
=
Removed in JDK 9. See http://openjdk.java.net/jeps/260
sun.reflect
=
Removed in JDK 9. See http://openjdk.java.net/jeps/260
test/tools/javac/T7008643/InlinedFinallyConfuseDebuggersTest.java
浏览文件 @
a17c5631
/*
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013,
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
...
...
@@ -64,6 +64,7 @@ public class InlinedFinallyConfuseDebuggersTest {
{
9
,
21
},
//System.out.println("finally");
{
10
,
29
},
{
9
,
32
},
//System.out.println("finally");
{
10
,
41
},
//}
{
11
,
43
},
};
...
...
test/tools/javac/T8180660/MissingLNTEntryForFinalizerTest.java
0 → 100644
浏览文件 @
a17c5631
/*
* 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 8180141
* @summary Missing entry in LineNumberTable for break statement that jumps out of try-finally
* @compile -g MissingLNTEntryForFinalizerTest.java
* @run main MissingLNTEntryForFinalizerTest
*/
import
java.io.File
;
import
java.net.URI
;
import
javax.tools.JavaFileObject
;
import
javax.tools.SimpleJavaFileObject
;
import
com.sun.tools.classfile.*
;
import
com.sun.tools.javac.comp.Attr
;
import
com.sun.tools.javac.comp.AttrContext
;
import
com.sun.tools.javac.comp.Env
;
import
com.sun.tools.javac.file.JavacFileManager
;
import
com.sun.tools.javac.main.JavaCompiler
;
import
com.sun.tools.javac.tree.JCTree
;
import
com.sun.tools.javac.tree.JCTree.*
;
import
com.sun.tools.javac.util.Context
;
import
com.sun.tools.javac.util.List
;
import
static
com
.
sun
.
tools
.
javac
.
util
.
List
.
of
;
import
static
com
.
sun
.
tools
.
javac
.
tree
.
JCTree
.
Tag
.*;
public
class
MissingLNTEntryForFinalizerTest
{
protected
ReusableJavaCompiler
tool
;
Context
context
;
MissingLNTEntryForFinalizerTest
()
{
context
=
new
Context
();
JavacFileManager
.
preRegister
(
context
);
MyAttr
.
preRegister
(
context
);
tool
=
new
ReusableJavaCompiler
(
context
);
}
public
static
void
main
(
String
...
args
)
throws
Throwable
{
new
MissingLNTEntryForFinalizerTest
().
test
();
}
void
test
()
throws
Throwable
{
JavaSource
source
=
new
JavaSource
(
"1"
);
tool
.
clear
();
List
<
JavaFileObject
>
inputs
=
of
(
source
);
try
{
tool
.
compile
(
inputs
);
}
catch
(
Throwable
ex
)
{
throw
new
AssertionError
(
ex
);
}
File
testClasses
=
new
File
(
"."
);
File
file
=
new
File
(
testClasses
,
"Test1.class"
);
ClassFile
classFile
=
ClassFile
.
read
(
file
);
for
(
Method
m
:
classFile
.
methods
)
{
if
(
classFile
.
constant_pool
.
getUTF8Value
(
m
.
name_index
).
equals
(
"foo"
))
{
Code_attribute
code
=
(
Code_attribute
)
m
.
attributes
.
get
(
Attribute
.
Code
);
LineNumberTable_attribute
lnt
=
(
LineNumberTable_attribute
)
code
.
attributes
.
get
(
Attribute
.
LineNumberTable
);
checkLNT
(
lnt
,
MyAttr
.
lineNumber
);
}
}
}
void
checkLNT
(
LineNumberTable_attribute
lnt
,
int
lineToCheckFor
)
{
for
(
LineNumberTable_attribute
.
Entry
e:
lnt
.
line_number_table
)
{
if
(
e
.
line_number
==
lineToCheckFor
)
{
return
;
}
}
throw
new
AssertionError
(
"seek line number not found in the LNT for method foo()"
);
}
class
JavaSource
extends
SimpleJavaFileObject
{
String
id
;
String
template
=
"import java.util.*;\n"
+
"class Test#Id {\n"
+
" void foo() {\n"
+
" List<String> l = null;\n"
+
" String first = null;\n"
+
" try {\n"
+
" first = l.get(0);\n"
+
" } finally {\n"
+
" if (first != null) {\n"
+
" System.out.println(\"finalizer\");\n"
+
" }\n"
+
" }\n"
+
" }\n"
+
"}"
;
JavaSource
(
String
id
)
{
super
(
URI
.
create
(
"myfo:/Test.java"
),
JavaFileObject
.
Kind
.
SOURCE
);
this
.
id
=
id
;
}
@Override
public
CharSequence
getCharContent
(
boolean
ignoreEncodingErrors
)
{
return
template
.
replace
(
"#Id"
,
id
);
}
}
/* this class has been set up to do not depend on a fixed line number, this Attr subclass will
* look for 'break' or 'continue' statements in order to find the actual line number they occupy.
* This way the test can find if that line number appears in the LNT generated for a given class.
*/
static
class
MyAttr
extends
Attr
{
static
int
lineNumber
;
static
void
preRegister
(
Context
context
)
{
context
.
put
(
attrKey
,
(
com
.
sun
.
tools
.
javac
.
util
.
Context
.
Factory
<
Attr
>)
c
->
new
MyAttr
(
c
));
}
MyAttr
(
Context
context
)
{
super
(
context
);
}
@Override
public
com
.
sun
.
tools
.
javac
.
code
.
Type
attribStat
(
JCTree
tree
,
Env
<
AttrContext
>
env
)
{
com
.
sun
.
tools
.
javac
.
code
.
Type
result
=
super
.
attribStat
(
tree
,
env
);
if
(
tree
.
hasTag
(
TRY
))
{
JCTry
tryTree
=
(
JCTry
)
tree
;
lineNumber
=
env
.
toplevel
.
lineMap
.
getLineNumber
(
tryTree
.
finalizer
.
endpos
);
}
return
result
;
}
}
static
class
ReusableJavaCompiler
extends
JavaCompiler
{
ReusableJavaCompiler
(
Context
context
)
{
super
(
context
);
}
protected
void
checkReusable
()
{
// do nothing
}
@Override
public
void
close
()
{
//do nothing
}
void
clear
()
{
//do nothing
}
}
}
test/tools/javac/linenumbers/FinallyLineNumberTest.java
浏览文件 @
a17c5631
/*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015,
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
...
...
@@ -36,7 +36,6 @@ import com.sun.tools.classfile.Code_attribute;
import
com.sun.tools.classfile.LineNumberTable_attribute
;
import
com.sun.tools.classfile.LineNumberTable_attribute.Entry
;
import
java.io.File
;
import
java.io.IOException
;
public
class
FinallyLineNumberTest
{
...
...
@@ -46,13 +45,13 @@ public class FinallyLineNumberTest {
if
(
lines
==
null
)
{
throw
new
Exception
(
"finally line number table could not be loaded"
);
}
if
(
lines
.
length
!=
4
)
{
if
(
lines
.
length
!=
5
)
{
// Help debug
System
.
err
.
println
(
"LineTable error, got lines:"
);
for
(
Entry
e
:
lines
)
{
System
.
err
.
println
(
e
.
line_number
);
}
throw
new
Exception
(
"finally line number table incorrect: length="
+
lines
.
length
+
" expected length=
4
"
);
throw
new
Exception
(
"finally line number table incorrect: length="
+
lines
.
length
+
" expected length=
5
"
);
}
// return null line, for the load null operation
...
...
@@ -71,11 +70,17 @@ public class FinallyLineNumberTest {
throw
new
Exception
(
"finally line number table incorrect: got="
+
current
+
" expected="
+
first
);
}
// f
inally line, f
or when exception is thrown
// for when exception is thrown
current
=
lines
[
3
].
line_number
;
if
(
current
!=
first
+
2
)
{
throw
new
Exception
(
"finally line number table incorrect: got="
+
current
+
" expected="
+
(
first
+
2
));
}
// the '}' closing the finally block
current
=
lines
[
4
].
line_number
;
if
(
current
!=
first
+
3
)
{
throw
new
Exception
(
"finally line number table incorrect: got="
+
current
+
" expected="
+
(
first
+
3
));
}
}
static
Entry
[]
findEntries
()
throws
IOException
,
ConstantPoolException
{
...
...
test/tools/jdeps/MRJarWarning.java
0 → 100644
浏览文件 @
a17c5631
/*
* 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 8176329
* @summary Test for jdeps warning when it encounters a multi-release jar
* @run testng MRJarWarning
*/
import
java.io.IOException
;
import
java.io.OutputStream
;
import
java.io.PrintWriter
;
import
java.io.StringWriter
;
import
java.nio.file.Files
;
import
java.nio.file.Path
;
import
java.nio.file.Paths
;
import
java.util.Arrays
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.Locale
;
import
java.util.jar.Attributes
;
import
java.util.jar.JarEntry
;
import
java.util.jar.JarOutputStream
;
import
java.util.jar.Manifest
;
import
org.testng.Assert
;
import
org.testng.annotations.BeforeSuite
;
import
org.testng.annotations.DataProvider
;
import
org.testng.annotations.Test
;
public
class
MRJarWarning
{
private
static
final
String
WARNING
=
" is a multi-release jar file"
;
private
static
final
String
MRJAR_ATTR
=
"Multi-Release"
;
Path
mrjar1
;
Path
mrjar2
;
Path
nonMRjar
;
Path
mrjarAllCaps
;
private
Attributes
defaultAttributes
;
@BeforeSuite
public
void
setup
()
throws
IOException
{
defaultAttributes
=
new
Attributes
();
defaultAttributes
.
putValue
(
"Manifest-Version"
,
"1.0"
);
defaultAttributes
.
putValue
(
"Created-By"
,
"1.8.0-internal"
);
mrjar1
=
Paths
.
get
(
"mrjar1.jar"
);
mrjar2
=
Paths
.
get
(
"mrjar2.jar"
);
nonMRjar
=
Paths
.
get
(
"nonMRjar.jar"
);
mrjarAllCaps
=
Paths
.
get
(
"mrjarAllCaps.jar"
);
Attributes
mrJarAttrs
=
new
Attributes
(
defaultAttributes
);
mrJarAttrs
.
putValue
(
MRJAR_ATTR
,
"true"
);
build
(
mrjar1
,
mrJarAttrs
);
build
(
mrjar2
,
mrJarAttrs
);
build
(
nonMRjar
,
defaultAttributes
);
// JEP 238 - "Multi-Release JAR Files" states that the attribute name
// and value are case insensitive. Try with all caps to ensure that
// jdeps still recognizes a multi-release jar.
Attributes
allCapsAttrs
=
new
Attributes
(
defaultAttributes
);
allCapsAttrs
.
putValue
(
MRJAR_ATTR
.
toUpperCase
(),
"TRUE"
);
build
(
mrjarAllCaps
,
allCapsAttrs
);
}
@DataProvider
(
name
=
"provider"
)
private
Object
[][]
args
()
{
// jdeps warning messages may be localized.
// This test only checks for the English version. Return an empty
// array (skip testing) if the default language is not English.
String
language
=
Locale
.
getDefault
().
getLanguage
();
System
.
out
.
println
(
"Language: "
+
language
);
if
(
"en"
.
equals
(
language
))
{
return
new
Object
[][]
{
// one mrjar arg
{
Arrays
.
asList
(
mrjar1
.
toString
()),
Arrays
.
asList
(
mrjar1
)},
// two mrjar args
{
Arrays
.
asList
(
mrjar1
.
toString
(),
mrjar2
.
toString
()),
Arrays
.
asList
(
mrjar1
,
mrjar2
)},
// one mrjar arg, with mrjar on classpath
{
Arrays
.
asList
(
"-cp"
,
mrjar2
.
toString
(),
mrjar1
.
toString
()),
Arrays
.
asList
(
mrjar1
,
mrjar2
)},
// non-mrjar arg, with mrjar on classpath
{
Arrays
.
asList
(
"-cp"
,
mrjar1
.
toString
(),
nonMRjar
.
toString
()),
Arrays
.
asList
(
mrjar1
)},
// mrjar arg with jar attribute name/value in ALL CAPS
{
Arrays
.
asList
(
mrjarAllCaps
.
toString
()),
Arrays
.
asList
(
mrjarAllCaps
)},
// non-mrjar arg
{
Arrays
.
asList
(
nonMRjar
.
toString
()),
Collections
.
emptyList
()}
};
}
else
{
System
.
out
.
println
(
"Non-English language \""
+
language
+
"\"; test passes superficially"
);
return
new
Object
[][]{};
}
}
/* Run jdeps with the arguments given in 'args', and confirm that a warning
* is issued for each Multi-Release jar in 'expectedMRpaths'.
*/
@Test
(
dataProvider
=
"provider"
)
public
void
checkWarning
(
List
<
String
>
args
,
List
<
Path
>
expectedMRpaths
)
{
StringWriter
sw
=
new
StringWriter
();
PrintWriter
pw
=
new
PrintWriter
(
sw
);
int
rc
=
com
.
sun
.
tools
.
jdeps
.
Main
.
run
(
args
.
toArray
(
new
String
[
args
.
size
()]),
pw
);
pw
.
close
();
expectedMRJars
(
sw
.
toString
(),
expectedMRpaths
);
Assert
.
assertEquals
(
rc
,
0
,
"non-zero exit code from jdeps"
);
}
/* Confirm that warnings for the specified paths are in the output (or that
* warnings are absent if 'paths' is empty).
* Doesn't check for extra, unexpected warnings.
*/
private
static
void
expectedMRJars
(
String
output
,
List
<
Path
>
paths
)
{
if
(
paths
.
isEmpty
())
{
Assert
.
assertFalse
(
output
.
contains
(
WARNING
),
"Expected no mrjars, but found:\n"
+
output
);
}
else
{
for
(
Path
path
:
paths
)
{
String
expect
=
"Warning: "
+
path
.
toString
()
+
WARNING
;
Assert
.
assertTrue
(
output
.
contains
(
expect
),
"Did not find:\n"
+
expect
+
"\nin:\n"
+
output
+
"\n"
);
}
}
}
/* Build a jar at the expected path, containing the given attributes */
private
static
void
build
(
Path
path
,
Attributes
attributes
)
throws
IOException
{
try
(
OutputStream
os
=
Files
.
newOutputStream
(
path
);
JarOutputStream
jos
=
new
JarOutputStream
(
os
))
{
JarEntry
me
=
new
JarEntry
(
"META-INF/MANIFEST.MF"
);
jos
.
putNextEntry
(
me
);
Manifest
manifest
=
new
Manifest
();
manifest
.
getMainAttributes
().
putAll
(
attributes
);
manifest
.
write
(
jos
);
jos
.
closeEntry
();
}
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录