Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell11
提交
a0488ba8
D
dragonwell11
项目概览
openanolis
/
dragonwell11
通知
7
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell11
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
a0488ba8
编写于
3月 03, 2016
作者:
L
lana
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
e3b5f1f0
86d46950
变更
17
隐藏空白更改
内联
并排
Showing
17 changed file
with
238 addition
and
21 deletion
+238
-21
langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Check.java
...ompiler/share/classes/com/sun/tools/javac/comp/Check.java
+5
-2
langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Gen.java
...k.compiler/share/classes/com/sun/tools/javac/jvm/Gen.java
+23
-0
langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties
...classes/com/sun/tools/javac/resources/compiler.properties
+8
-0
langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/comp/SjavacImpl.java
...r/share/classes/com/sun/tools/sjavac/comp/SjavacImpl.java
+20
-1
langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/FrameOutputWriter.java
...com/sun/tools/doclets/formats/html/FrameOutputWriter.java
+2
-1
langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlWriter.java
...com/sun/tools/doclets/formats/html/markup/HtmlWriter.java
+5
-1
langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/FrameOutputWriter.java
...adoc/internal/doclets/formats/html/FrameOutputWriter.java
+2
-0
langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlWriter.java
...adoc/internal/doclets/formats/html/markup/HtmlWriter.java
+4
-0
langtools/test/com/sun/javadoc/testHtmlVersion/TestHtmlVersion.java
...test/com/sun/javadoc/testHtmlVersion/TestHtmlVersion.java
+4
-4
langtools/test/com/sun/javadoc/testJavascript/TestJavascript.java
...s/test/com/sun/javadoc/testJavascript/TestJavascript.java
+8
-1
langtools/test/jdk/javadoc/doclet/testHtmlVersion/TestHtmlVersion.java
...t/jdk/javadoc/doclet/testHtmlVersion/TestHtmlVersion.java
+4
-4
langtools/test/jdk/javadoc/doclet/testIncluded/TestIncluded.java
...ls/test/jdk/javadoc/doclet/testIncluded/TestIncluded.java
+1
-1
langtools/test/jdk/javadoc/doclet/testJavascript/TestJavascript.java
...est/jdk/javadoc/doclet/testJavascript/TestJavascript.java
+9
-2
langtools/test/tools/javac/diags/examples/DiamondMethodDoesNotOverride.java
...ls/javac/diags/examples/DiamondMethodDoesNotOverride.java
+37
-0
langtools/test/tools/javac/generics/diamond/neg/Neg15.java
langtools/test/tools/javac/generics/diamond/neg/Neg15.java
+1
-1
langtools/test/tools/javac/generics/diamond/neg/Neg15.out
langtools/test/tools/javac/generics/diamond/neg/Neg15.out
+3
-3
langtools/test/tools/sjavac/OverlappingSrcDst.java
langtools/test/tools/sjavac/OverlappingSrcDst.java
+102
-0
未找到文件。
langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Check.java
浏览文件 @
a0488ba8
...
...
@@ -2001,10 +2001,11 @@ public class Check {
}
}
final
boolean
explicitOverride
=
m
.
attribute
(
syms
.
overrideType
.
tsym
)
!=
null
;
// Check if this method must override a super method due to being annotated with @Override
// or by virtue of being a member of a diamond inferred anonymous class. Latter case is to
// be treated "as if as they were annotated" with @Override.
boolean
mustOverride
=
m
.
attribute
(
syms
.
overrideType
.
tsym
)
!=
null
||
boolean
mustOverride
=
explicitOverride
||
(
env
.
info
.
isAnonymousDiamond
&&
!
m
.
isConstructor
()
&&
!
m
.
isPrivate
());
if
(
mustOverride
&&
!
isOverrider
(
m
))
{
DiagnosticPosition
pos
=
tree
.
pos
();
...
...
@@ -2014,7 +2015,9 @@ public class Check {
break
;
}
}
log
.
error
(
pos
,
"method.does.not.override.superclass"
);
log
.
error
(
pos
,
explicitOverride
?
Errors
.
MethodDoesNotOverrideSuperclass
:
Errors
.
AnonymousDiamondMethodDoesNotOverrideSuperclass
(
Fragments
.
DiamondAnonymousMethodsImplicitlyOverride
));
}
}
...
...
langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Gen.java
浏览文件 @
a0488ba8
...
...
@@ -80,6 +80,11 @@ public class Gen extends JCTree.Visitor {
*/
private
final
Type
methodType
;
/**
* Are we presently traversing a let expression ? Yes if depth != 0
*/
private
int
letExprDepth
;
public
static
Gen
instance
(
Context
context
)
{
Gen
instance
=
context
.
get
(
genKey
);
if
(
instance
==
null
)
...
...
@@ -1006,8 +1011,10 @@ public class Gen extends JCTree.Visitor {
if
(
tree
.
init
!=
null
)
{
checkStringConstant
(
tree
.
init
.
pos
(),
v
.
getConstValue
());
if
(
v
.
getConstValue
()
==
null
||
varDebugInfo
)
{
Assert
.
check
(
letExprDepth
!=
0
||
code
.
state
.
stacksize
==
0
);
genExpr
(
tree
.
init
,
v
.
erasure
(
types
)).
load
();
items
.
makeLocalItem
(
v
).
store
();
Assert
.
check
(
letExprDepth
!=
0
||
code
.
state
.
stacksize
==
0
);
}
}
checkDimension
(
tree
.
pos
(),
v
.
type
);
...
...
@@ -1062,12 +1069,14 @@ public class Gen extends JCTree.Visitor {
CondItem
c
;
if
(
cond
!=
null
)
{
code
.
statBegin
(
cond
.
pos
);
Assert
.
check
(
code
.
state
.
stacksize
==
0
);
c
=
genCond
(
TreeInfo
.
skipParens
(
cond
),
CRT_FLOW_CONTROLLER
);
}
else
{
c
=
items
.
makeCondItem
(
goto_
);
}
Chain
loopDone
=
c
.
jumpFalse
();
code
.
resolve
(
c
.
trueJumps
);
Assert
.
check
(
code
.
state
.
stacksize
==
0
);
genStat
(
body
,
loopEnv
,
CRT_STATEMENT
|
CRT_FLOW_TARGET
);
code
.
resolve
(
loopEnv
.
info
.
cont
);
genStats
(
step
,
loopEnv
);
...
...
@@ -1080,11 +1089,13 @@ public class Gen extends JCTree.Visitor {
CondItem
c
;
if
(
cond
!=
null
)
{
code
.
statBegin
(
cond
.
pos
);
Assert
.
check
(
code
.
state
.
stacksize
==
0
);
c
=
genCond
(
TreeInfo
.
skipParens
(
cond
),
CRT_FLOW_CONTROLLER
);
}
else
{
c
=
items
.
makeCondItem
(
goto_
);
}
code
.
resolve
(
c
.
jumpTrue
(),
startpc
);
Assert
.
check
(
code
.
state
.
stacksize
==
0
);
code
.
resolve
(
c
.
falseJumps
);
}
Chain
exit
=
loopEnv
.
info
.
exit
;
...
...
@@ -1112,6 +1123,7 @@ public class Gen extends JCTree.Visitor {
int
limit
=
code
.
nextreg
;
Assert
.
check
(!
tree
.
selector
.
type
.
hasTag
(
CLASS
));
int
startpcCrt
=
genCrt
?
code
.
curCP
()
:
0
;
Assert
.
check
(
code
.
state
.
stacksize
==
0
);
Item
sel
=
genExpr
(
tree
.
selector
,
syms
.
intType
);
List
<
JCCase
>
cases
=
tree
.
cases
;
if
(
cases
.
isEmpty
())
{
...
...
@@ -1280,6 +1292,7 @@ public class Gen extends JCTree.Visitor {
int
limit
=
code
.
nextreg
;
// Generate code to evaluate lock and save in temporary variable.
final
LocalItem
lockVar
=
makeTemp
(
syms
.
objectType
);
Assert
.
check
(
code
.
state
.
stacksize
==
0
);
genExpr
(
tree
.
lock
,
tree
.
lock
.
type
).
load
().
duplicate
();
lockVar
.
store
();
...
...
@@ -1526,9 +1539,11 @@ public class Gen extends JCTree.Visitor {
public
void
visitIf
(
JCIf
tree
)
{
int
limit
=
code
.
nextreg
;
Chain
thenExit
=
null
;
Assert
.
check
(
code
.
state
.
stacksize
==
0
);
CondItem
c
=
genCond
(
TreeInfo
.
skipParens
(
tree
.
cond
),
CRT_FLOW_CONTROLLER
);
Chain
elseChain
=
c
.
jumpFalse
();
Assert
.
check
(
code
.
state
.
stacksize
==
0
);
if
(!
c
.
isFalse
())
{
code
.
resolve
(
c
.
trueJumps
);
genStat
(
tree
.
thenpart
,
env
,
CRT_STATEMENT
|
CRT_FLOW_TARGET
);
...
...
@@ -1542,6 +1557,7 @@ public class Gen extends JCTree.Visitor {
}
code
.
resolve
(
thenExit
);
code
.
endScopes
(
limit
);
Assert
.
check
(
code
.
state
.
stacksize
==
0
);
}
public
void
visitExec
(
JCExpressionStatement
tree
)
{
...
...
@@ -1555,7 +1571,9 @@ public class Gen extends JCTree.Visitor {
((
JCUnary
)
e
).
setTag
(
PREDEC
);
break
;
}
Assert
.
check
(
code
.
state
.
stacksize
==
0
);
genExpr
(
tree
.
expr
,
tree
.
expr
.
type
).
drop
();
Assert
.
check
(
code
.
state
.
stacksize
==
0
);
}
public
void
visitBreak
(
JCBreak
tree
)
{
...
...
@@ -1581,6 +1599,7 @@ public class Gen extends JCTree.Visitor {
*/
int
tmpPos
=
code
.
pendingStatPos
;
if
(
tree
.
expr
!=
null
)
{
Assert
.
check
(
code
.
state
.
stacksize
==
0
);
Item
r
=
genExpr
(
tree
.
expr
,
pt
).
load
();
if
(
hasFinally
(
env
.
enclMethod
,
env
))
{
r
=
makeTemp
(
pt
);
...
...
@@ -1600,8 +1619,10 @@ public class Gen extends JCTree.Visitor {
}
public
void
visitThrow
(
JCThrow
tree
)
{
Assert
.
check
(
code
.
state
.
stacksize
==
0
);
genExpr
(
tree
.
expr
,
tree
.
expr
.
type
).
load
();
code
.
emitop0
(
athrow
);
Assert
.
check
(
code
.
state
.
stacksize
==
0
);
}
/* ************************************************************************
...
...
@@ -2101,10 +2122,12 @@ public class Gen extends JCTree.Visitor {
}
public
void
visitLetExpr
(
LetExpr
tree
)
{
letExprDepth
++;
int
limit
=
code
.
nextreg
;
genStats
(
tree
.
defs
,
env
);
result
=
genExpr
(
tree
.
expr
,
tree
.
expr
.
type
).
load
();
code
.
endScopes
(
limit
);
letExprDepth
--;
}
private
void
generateReferencesToPrunedTree
(
ClassSymbol
classSymbol
,
Pool
pool
)
{
...
...
langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties
浏览文件 @
a0488ba8
...
...
@@ -214,6 +214,11 @@ compiler.err.bad.functional.intf.anno.1=\
Unexpected @FunctionalInterface annotation
\n\
{0}
# 0: message segment
compiler.err.anonymous.diamond.method.does.not.override.superclass
=
\
method does not override or implement a method from a supertype
\n\
{0}
# 0: symbol
compiler.misc.not.a.functional.intf
=
\
{0} is not a functional interface
...
...
@@ -1196,6 +1201,9 @@ compiler.misc.fatal.err.cant.close=\
## miscellaneous strings
##
compiler.misc.diamond.anonymous.methods.implicitly.override
=
\
(due to <>, every non-private method declared in this anonymous class must override or implement a method from a supertype)
compiler.misc.source.unavailable
=
\
(source unavailable)
...
...
langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/comp/SjavacImpl.java
浏览文件 @
a0488ba8
...
...
@@ -28,7 +28,6 @@ package com.sun.tools.sjavac.comp;
import
java.io.IOException
;
import
java.io.PrintWriter
;
import
java.io.StringWriter
;
import
java.io.Writer
;
import
java.nio.file.Files
;
import
java.nio.file.Path
;
import
java.util.ArrayList
;
...
...
@@ -81,6 +80,10 @@ public class SjavacImpl implements Sjavac {
if
(!
validateOptions
(
options
))
return
RC_FATAL
;
if
(
srcDstOverlap
(
options
.
getSources
(),
options
.
getDestDir
()))
{
return
RC_FATAL
;
}
if
(!
createIfMissing
(
options
.
getDestDir
()))
return
RC_FATAL
;
...
...
@@ -330,6 +333,22 @@ public class SjavacImpl implements Sjavac {
}
private
static
boolean
srcDstOverlap
(
List
<
SourceLocation
>
locs
,
Path
dest
)
{
for
(
SourceLocation
loc
:
locs
)
{
if
(
isOverlapping
(
loc
.
getPath
(),
dest
))
{
Log
.
error
(
"Source location "
+
loc
.
getPath
()
+
" overlaps with destination "
+
dest
);
return
true
;
}
}
return
false
;
}
private
static
boolean
isOverlapping
(
Path
p1
,
Path
p2
)
{
p1
=
p1
.
toAbsolutePath
().
normalize
();
p2
=
p2
.
toAbsolutePath
().
normalize
();
return
p1
.
startsWith
(
p2
)
||
p2
.
startsWith
(
p1
);
}
private
static
boolean
createIfMissing
(
Path
dir
)
{
if
(
Files
.
isDirectory
(
dir
))
...
...
langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/FrameOutputWriter.java
浏览文件 @
a0488ba8
/*
* Copyright (c) 1997, 201
5
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 201
6
, 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
...
...
@@ -96,6 +96,7 @@ public class FrameOutputWriter extends HtmlDocletWriter {
protected
void
generateFrameFile
()
throws
IOException
{
Content
frame
=
getFrameDetails
();
HtmlTree
body
=
new
HtmlTree
(
HtmlTag
.
BODY
);
body
.
addAttr
(
HtmlAttr
.
ONLOAD
,
"loadFrames()"
);
if
(
configuration
.
allowTag
(
HtmlTag
.
MAIN
))
{
HtmlTree
main
=
HtmlTree
.
MAIN
(
frame
);
body
.
addContent
(
main
);
...
...
langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlWriter.java
浏览文件 @
a0488ba8
/*
* Copyright (c) 1997, 201
5
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 201
6
, 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
...
...
@@ -423,6 +423,10 @@ public class HtmlWriter {
" }"
+
DocletConstants
.
NL
+
" }"
+
DocletConstants
.
NL
+
" return true;"
+
DocletConstants
.
NL
+
" }"
+
DocletConstants
.
NL
+
" function loadFrames() {"
+
DocletConstants
.
NL
+
" if (targetPage != \"\" && targetPage != \"undefined\")"
+
DocletConstants
.
NL
+
" top.classFrame.location = top.targetPage;"
+
DocletConstants
.
NL
+
" }"
+
DocletConstants
.
NL
;
RawHtml
scriptContent
=
new
RawHtml
(
scriptCode
);
script
.
addContent
(
scriptContent
);
...
...
langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/FrameOutputWriter.java
浏览文件 @
a0488ba8
...
...
@@ -27,6 +27,7 @@ package jdk.javadoc.internal.doclets.formats.html;
import
java.io.*
;
import
jdk.javadoc.internal.doclets.formats.html.markup.HtmlAttr
;
import
jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle
;
import
jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag
;
import
jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree
;
...
...
@@ -102,6 +103,7 @@ public class FrameOutputWriter extends HtmlDocletWriter {
protected
void
generateFrameFile
()
throws
IOException
{
Content
frame
=
getFrameDetails
();
HtmlTree
body
=
new
HtmlTree
(
HtmlTag
.
BODY
);
body
.
addAttr
(
HtmlAttr
.
ONLOAD
,
"loadFrames()"
);
if
(
configuration
.
allowTag
(
HtmlTag
.
MAIN
))
{
HtmlTree
main
=
HtmlTree
.
MAIN
(
frame
);
body
.
addContent
(
main
);
...
...
langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlWriter.java
浏览文件 @
a0488ba8
...
...
@@ -401,6 +401,10 @@ public class HtmlWriter {
" }"
+
DocletConstants
.
NL
+
" }"
+
DocletConstants
.
NL
+
" return true;"
+
DocletConstants
.
NL
+
" }"
+
DocletConstants
.
NL
+
" function loadFrames() {"
+
DocletConstants
.
NL
+
" if (targetPage != \"\" && targetPage != \"undefined\")"
+
DocletConstants
.
NL
+
" top.classFrame.location = top.targetPage;"
+
DocletConstants
.
NL
+
" }"
+
DocletConstants
.
NL
;
RawHtml
scriptContent
=
new
RawHtml
(
scriptCode
);
script
.
addContent
(
scriptContent
);
...
...
langtools/test/com/sun/javadoc/testHtmlVersion/TestHtmlVersion.java
浏览文件 @
a0488ba8
/*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015,
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
...
...
@@ -23,7 +23,7 @@
/*
* @test
* @bug 8072945 8081854 8141492
* @bug 8072945 8081854 8141492
8148985
* @summary Test the version of HTML generated by the javadoc tool.
* @author bpatel
* @library ../lib
...
...
@@ -688,7 +688,7 @@ public class TestHtmlVersion extends JavadocTester {
checkOutput
(
"index.html"
,
true
,
"<!DOCTYPE HTML>"
,
"<link rel=\"stylesheet\" type=\"text/css\" href=\"stylesheet.css\" title=\"Style\">"
,
"<body>\n"
"<body
onload=\"loadFrames()\"
>\n"
+
"<main role=\"main\">\n"
+
"<div class=\"mainContainer\">\n"
+
"<div class=\"leftContainer\">\n"
...
...
@@ -1599,7 +1599,7 @@ public class TestHtmlVersion extends JavadocTester {
checkOutput
(
"index.html"
,
true
,
"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">"
,
"<link rel=\"stylesheet\" type=\"text/css\" href=\"stylesheet.css\" title=\"Style\">"
,
"<body>\n"
"<body
onload=\"loadFrames()\"
>\n"
+
"<div class=\"mainContainer\">\n"
+
"<div class=\"leftContainer\">\n"
+
"<div class=\"leftTop\">\n"
...
...
langtools/test/com/sun/javadoc/testJavascript/TestJavascript.java
浏览文件 @
a0488ba8
/*
* Copyright (c) 2004, 201
5
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2004, 201
6
, 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
...
...
@@ -100,8 +100,15 @@ public class TestJavascript extends JavadocTester {
+
" }\n"
+
" return true;\n"
+
" }\n"
+
" function loadFrames() {\n"
+
" if (targetPage != \"\" && targetPage != \"undefined\")\n"
+
" top.classFrame.location = top.targetPage;\n"
+
" }\n"
+
"</script>"
);
checkOutput
(
"index.html"
,
true
,
"<body onload=\"loadFrames()\""
);
//Make sure title javascript only runs if is-external is not true
checkOutput
(
"pkg/C.html"
,
true
,
" try {\n"
...
...
langtools/test/jdk/javadoc/doclet/testHtmlVersion/TestHtmlVersion.java
浏览文件 @
a0488ba8
/*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015,
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
...
...
@@ -23,7 +23,7 @@
/*
* @test
* @bug 8072945 8081854 8141492
* @bug 8072945 8081854 8141492
8148985
* @summary Test the version of HTML generated by the javadoc tool.
* @author bpatel
* @library ../lib
...
...
@@ -599,7 +599,7 @@ public class TestHtmlVersion extends JavadocTester {
checkOutput
(
"index.html"
,
true
,
"<!DOCTYPE HTML>"
,
"<link rel=\"stylesheet\" type=\"text/css\" href=\"stylesheet.css\" title=\"Style\">"
,
"<body>\n"
"<body
onload=\"loadFrames()\"
>\n"
+
"<main role=\"main\">\n"
+
"<div class=\"mainContainer\">\n"
+
"<div class=\"leftContainer\">\n"
...
...
@@ -1391,7 +1391,7 @@ public class TestHtmlVersion extends JavadocTester {
checkOutput
(
"index.html"
,
true
,
"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">"
,
"<link rel=\"stylesheet\" type=\"text/css\" href=\"stylesheet.css\" title=\"Style\">"
,
"<body>\n"
"<body
onload=\"loadFrames()\"
>\n"
+
"<div class=\"mainContainer\">\n"
+
"<div class=\"leftContainer\">\n"
+
"<div class=\"leftTop\">\n"
...
...
langtools/test/jdk/javadoc/doclet/testIncluded/TestIncluded.java
浏览文件 @
a0488ba8
...
...
@@ -23,7 +23,7 @@
/*
* @test
* @bug 8149
468
* @bug 8149
842
* @summary Verify that non included classes are not inspected.
* @library ../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
...
...
langtools/test/jdk/javadoc/doclet/testJavascript/TestJavascript.java
浏览文件 @
a0488ba8
/*
* Copyright (c) 2004, 201
5
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2004, 201
6
, 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 4665566 4855876 7025314 8012375 8015997 8016328 8024756
* @bug 4665566 4855876 7025314 8012375 8015997 8016328 8024756
8148985
* @summary Verify that the output has the right javascript.
* @author jamieh
* @library ../lib
...
...
@@ -100,8 +100,15 @@ public class TestJavascript extends JavadocTester {
+
" }\n"
+
" return true;\n"
+
" }\n"
+
" function loadFrames() {\n"
+
" if (targetPage != \"\" && targetPage != \"undefined\")\n"
+
" top.classFrame.location = top.targetPage;\n"
+
" }\n"
+
"</script>"
);
checkOutput
(
"index.html"
,
true
,
"<body onload=\"loadFrames()\""
);
//Make sure title javascript only runs if is-external is not true
checkOutput
(
"pkg/C.html"
,
true
,
" try {\n"
...
...
langtools/test/tools/javac/diags/examples/DiamondMethodDoesNotOverride.java
0 → 100644
浏览文件 @
a0488ba8
/*
* 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.
*
* 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.
*/
// key: compiler.err.anonymous.diamond.method.does.not.override.superclass
// key: compiler.misc.diamond.anonymous.methods.implicitly.override
class
X
{
interface
Foo
<
T
>
{
void
g
(
T
t
);
}
void
m
()
{
Foo
<
String
>
fs
=
new
Foo
<>()
{
public
void
g
(
String
s
)
{
}
void
someMethod
()
{
}
};
}
}
langtools/test/tools/javac/generics/diamond/neg/Neg15.java
浏览文件 @
a0488ba8
/*
* @test /nodynamiccopyright/
* @bug 8062373
* @bug 8062373
8151018
*
* @summary Test that javac complains when a <> inferred class contains a public method that does override a supertype method.
* @author sadayapalam
...
...
langtools/test/tools/javac/generics/diamond/neg/Neg15.out
浏览文件 @
a0488ba8
Neg15.java:48:28: compiler.err.
method.does.not.override.superclass
Neg15.java:52:21: compiler.err.
method.does.not.override.superclass
Neg15.java:56:31: compiler.err.
method.does.not.override.superclass
Neg15.java:48:28: compiler.err.
anonymous.diamond.method.does.not.override.superclass: (compiler.misc.diamond.anonymous.methods.implicitly.override)
Neg15.java:52:21: compiler.err.
anonymous.diamond.method.does.not.override.superclass: (compiler.misc.diamond.anonymous.methods.implicitly.override)
Neg15.java:56:31: compiler.err.
anonymous.diamond.method.does.not.override.superclass: (compiler.misc.diamond.anonymous.methods.implicitly.override)
3 errors
langtools/test/tools/sjavac/OverlappingSrcDst.java
0 → 100644
浏览文件 @
a0488ba8
/*
* 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
* @summary Make sure sjavac doesn't allow overlapping source and destination
* directories.
* @bug 8061320
* @library /tools/lib
* @modules jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.file
* jdk.compiler/com.sun.tools.javac.main
* jdk.compiler/com.sun.tools.sjavac
* @build Wrapper ToolBox
* @run main Wrapper OverlappingSrcDst
*/
import
java.io.File
;
import
java.nio.file.Paths
;
public
class
OverlappingSrcDst
extends
SJavacTester
{
public
static
void
main
(
String
...
args
)
{
new
OverlappingSrcDst
().
run
();
}
public
void
run
()
{
String
abs
=
ToolBox
.
currDir
.
toAbsolutePath
().
toString
();
// Relative vs relative
test
(
"dir"
,
"dir"
,
false
);
test
(
"dir"
,
"dir/dst"
,
false
);
test
(
"dir/src"
,
"dir"
,
false
);
test
(
"src"
,
"dst"
,
true
);
// Absolute vs absolute
test
(
abs
+
"/dir"
,
abs
+
"/dir"
,
false
);
test
(
abs
+
"/dir"
,
abs
+
"/dir/dst"
,
false
);
test
(
abs
+
"/dir/src"
,
abs
+
"/dir"
,
false
);
test
(
abs
+
"/src"
,
abs
+
"/dst"
,
true
);
// Absolute vs relative
test
(
abs
+
"/dir"
,
"dir"
,
false
);
test
(
abs
+
"/dir"
,
"dir/dst"
,
false
);
test
(
abs
+
"/dir/src"
,
"dir"
,
false
);
test
(
abs
+
"/src"
,
"dst"
,
true
);
// Relative vs absolute
test
(
"dir"
,
abs
+
"/dir"
,
false
);
test
(
"dir"
,
abs
+
"/dir/dst"
,
false
);
test
(
"dir/src"
,
abs
+
"/dir"
,
false
);
test
(
"src"
,
abs
+
"/dst"
,
true
);
}
private
void
test
(
String
srcDir
,
String
dstDir
,
boolean
shouldSucceed
)
{
boolean
succeeded
=
testCompilation
(
srcDir
,
dstDir
);
if
(
shouldSucceed
!=
succeeded
)
{
throw
new
AssertionError
(
String
.
format
(
"Test failed for "
+
"srcDir=\"%s\", "
+
"dstDir=\"%s\". "
+
"Compilation was expected to %s but %s."
,
srcDir
,
dstDir
,
shouldSucceed
?
"succeed"
:
"fail"
,
succeeded
?
"succeeded"
:
"failed"
));
}
}
private
boolean
testCompilation
(
String
srcDir
,
String
dstDir
)
{
try
{
srcDir
=
srcDir
.
replace
(
'/'
,
File
.
separatorChar
);
dstDir
=
dstDir
.
replace
(
'/'
,
File
.
separatorChar
);
tb
.
writeFile
(
Paths
.
get
(
srcDir
,
"pkg"
,
"A.java"
),
"package pkg; class A {}"
);
compile
(
"--state-dir=state"
,
"-src"
,
srcDir
,
"-d"
,
dstDir
);
return
true
;
}
catch
(
Exception
e
)
{
return
false
;
}
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录