Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_langtools
提交
4246329f
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看板
提交
4246329f
编写于
1月 16, 2014
作者:
C
coffeys
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
cb90d376
73884287
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
59 addition
and
14 deletion
+59
-14
src/share/classes/com/sun/javadoc/ClassDoc.java
src/share/classes/com/sun/javadoc/ClassDoc.java
+1
-7
src/share/classes/com/sun/tools/doclets/formats/html/ClassWriterImpl.java
...s/com/sun/tools/doclets/formats/html/ClassWriterImpl.java
+15
-1
src/share/classes/com/sun/tools/javadoc/ClassDocImpl.java
src/share/classes/com/sun/tools/javadoc/ClassDocImpl.java
+0
-4
src/share/classes/com/sun/tools/javadoc/RootDocImpl.java
src/share/classes/com/sun/tools/javadoc/RootDocImpl.java
+5
-0
test/com/sun/javadoc/testLambdaFeature/TestLambdaFeature.java
.../com/sun/javadoc/testLambdaFeature/TestLambdaFeature.java
+6
-1
test/com/sun/javadoc/testLambdaFeature/pkg/A.java
test/com/sun/javadoc/testLambdaFeature/pkg/A.java
+2
-1
test/com/sun/javadoc/testLambdaFeature/pkg1/FuncInf.java
test/com/sun/javadoc/testLambdaFeature/pkg1/FuncInf.java
+1
-0
test/com/sun/javadoc/testLambdaFeature/pkg1/NotAFuncInf.java
test/com/sun/javadoc/testLambdaFeature/pkg1/NotAFuncInf.java
+29
-0
未找到文件。
src/share/classes/com/sun/javadoc/ClassDoc.java
浏览文件 @
4246329f
/*
/*
* Copyright (c) 1998, 201
2
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 201
3
, 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
...
@@ -65,12 +65,6 @@ public interface ClassDoc extends ProgramElementDoc, Type {
...
@@ -65,12 +65,6 @@ public interface ClassDoc extends ProgramElementDoc, Type {
*/
*/
boolean
isExternalizable
();
boolean
isExternalizable
();
/**
* Return true if this class can be used as a target type of a lambda expression
* or method reference.
*/
boolean
isFunctionalInterface
();
/**
/**
* Return the serialization methods for this class or
* Return the serialization methods for this class or
* interface.
* interface.
...
...
src/share/classes/com/sun/tools/doclets/formats/html/ClassWriterImpl.java
浏览文件 @
4246329f
...
@@ -29,6 +29,7 @@ import java.util.*;
...
@@ -29,6 +29,7 @@ import java.util.*;
import
com.sun.javadoc.*
;
import
com.sun.javadoc.*
;
import
com.sun.tools.javac.jvm.Profile
;
import
com.sun.tools.javac.jvm.Profile
;
import
com.sun.tools.javadoc.RootDocImpl
;
import
com.sun.tools.doclets.formats.html.markup.*
;
import
com.sun.tools.doclets.formats.html.markup.*
;
import
com.sun.tools.doclets.internal.toolkit.*
;
import
com.sun.tools.doclets.internal.toolkit.*
;
import
com.sun.tools.doclets.internal.toolkit.builders.*
;
import
com.sun.tools.doclets.internal.toolkit.builders.*
;
...
@@ -529,7 +530,7 @@ public class ClassWriterImpl extends SubWriterHolderWriter
...
@@ -529,7 +530,7 @@ public class ClassWriterImpl extends SubWriterHolderWriter
* {@inheritDoc}
* {@inheritDoc}
*/
*/
public
void
addFunctionalInterfaceInfo
(
Content
classInfoTree
)
{
public
void
addFunctionalInterfaceInfo
(
Content
classInfoTree
)
{
if
(
classDoc
.
isFunctionalInterface
())
{
if
(
isFunctionalInterface
())
{
Content
dt
=
HtmlTree
.
DT
(
getResource
(
"doclet.Functional_Interface"
));
Content
dt
=
HtmlTree
.
DT
(
getResource
(
"doclet.Functional_Interface"
));
Content
dl
=
HtmlTree
.
DL
(
dt
);
Content
dl
=
HtmlTree
.
DL
(
dt
);
Content
dd
=
new
HtmlTree
(
HtmlTag
.
DD
);
Content
dd
=
new
HtmlTree
(
HtmlTag
.
DD
);
...
@@ -539,6 +540,19 @@ public class ClassWriterImpl extends SubWriterHolderWriter
...
@@ -539,6 +540,19 @@ public class ClassWriterImpl extends SubWriterHolderWriter
}
}
}
}
public
boolean
isFunctionalInterface
()
{
if
(
configuration
.
root
instanceof
RootDocImpl
)
{
RootDocImpl
root
=
(
RootDocImpl
)
configuration
.
root
;
AnnotationDesc
[]
annotationDescList
=
classDoc
.
annotations
();
for
(
AnnotationDesc
annoDesc
:
annotationDescList
)
{
if
(
root
.
isFunctionalInterface
(
annoDesc
))
{
return
true
;
}
}
}
return
false
;
}
/**
/**
* {@inheritDoc}
* {@inheritDoc}
*/
*/
...
...
src/share/classes/com/sun/tools/javadoc/ClassDocImpl.java
浏览文件 @
4246329f
...
@@ -288,10 +288,6 @@ public class ClassDocImpl extends ProgramElementDocImpl implements ClassDoc {
...
@@ -288,10 +288,6 @@ public class ClassDocImpl extends ProgramElementDocImpl implements ClassDoc {
return
false
;
return
false
;
}
}
public
boolean
isFunctionalInterface
()
{
return
env
.
types
.
isFunctionalInterface
(
tsym
)
&&
env
.
source
.
allowLambda
();
}
/**
/**
* Return the package that this class is contained in.
* Return the package that this class is contained in.
*/
*/
...
...
src/share/classes/com/sun/tools/javadoc/RootDocImpl.java
浏览文件 @
4246329f
...
@@ -381,6 +381,11 @@ public class RootDocImpl extends DocImpl implements RootDoc {
...
@@ -381,6 +381,11 @@ public class RootDocImpl extends DocImpl implements RootDoc {
env
.
initDoclint
(
opts
,
customTagNames
);
env
.
initDoclint
(
opts
,
customTagNames
);
}
}
public
boolean
isFunctionalInterface
(
AnnotationDesc
annotationDesc
)
{
return
annotationDesc
.
annotationType
().
qualifiedName
().
equals
(
env
.
syms
.
functionalInterfaceType
.
toString
())
&&
env
.
source
.
allowLambda
();
}
public
boolean
showTagMessages
()
{
public
boolean
showTagMessages
()
{
return
env
.
showTagMessages
();
return
env
.
showTagMessages
();
}
}
...
...
test/com/sun/javadoc/testLambdaFeature/TestLambdaFeature.java
浏览文件 @
4246329f
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
/*
/*
* @test
* @test
* @bug 8004893 8022738
* @bug 8004893 8022738
8029143
* @summary Make sure that the lambda feature changes work fine in
* @summary Make sure that the lambda feature changes work fine in
* javadoc.
* javadoc.
* @author bpatel
* @author bpatel
...
@@ -81,6 +81,11 @@ public class TestLambdaFeature extends JavadocTester {
...
@@ -81,6 +81,11 @@ public class TestLambdaFeature extends JavadocTester {
"<pre>default default void defaultMethod()</pre>"
},
"<pre>default default void defaultMethod()</pre>"
},
{
BUG_ID
+
FS
+
"pkg"
+
FS
+
"B.html"
,
{
BUG_ID
+
FS
+
"pkg"
+
FS
+
"B.html"
,
"<td class=\"colFirst\"><code>default void</code></td>"
},
"<td class=\"colFirst\"><code>default void</code></td>"
},
{
BUG_ID
+
FS
+
"pkg1"
+
FS
+
"NotAFuncInf.html"
,
"<dl>"
+
NL
+
"<dt>Functional Interface:</dt>"
+
NL
+
"<dd>This is a functional interface and can therefore be used as "
+
"the assignment target for a lambda expression or method "
+
"reference.</dd>"
+
NL
+
"</dl>"
},
{
BUG_ID
+
FS
+
"pkg"
+
FS
+
"B.html"
,
{
BUG_ID
+
FS
+
"pkg"
+
FS
+
"B.html"
,
"<dl>"
+
NL
+
"<dt>Functional Interface:</dt>"
}
"<dl>"
+
NL
+
"<dt>Functional Interface:</dt>"
}
};
};
...
...
test/com/sun/javadoc/testLambdaFeature/pkg/A.java
浏览文件 @
4246329f
/*
/*
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012,
2013,
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
...
@@ -23,6 +23,7 @@
...
@@ -23,6 +23,7 @@
package
pkg
;
package
pkg
;
@FunctionalInterface
public
interface
A
{
public
interface
A
{
public
void
method1
();
public
void
method1
();
...
...
test/com/sun/javadoc/testLambdaFeature/pkg1/FuncInf.java
浏览文件 @
4246329f
...
@@ -23,6 +23,7 @@
...
@@ -23,6 +23,7 @@
package
pkg1
;
package
pkg1
;
@FunctionalInterface
public
interface
FuncInf
<
V
>
{
public
interface
FuncInf
<
V
>
{
V
call
()
throws
Exception
;
V
call
()
throws
Exception
;
...
...
test/com/sun/javadoc/testLambdaFeature/pkg1/NotAFuncInf.java
0 → 100644
浏览文件 @
4246329f
/*
* Copyright (c) 2013, 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.
*/
package
pkg1
;
public
interface
NotAFuncInf
<
V
>
{
V
call
()
throws
Exception
;
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录