Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_langtools
提交
ba4f33a1
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看板
提交
ba4f33a1
编写于
10月 15, 2013
作者:
C
chegar
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
b4994199
a8325e04
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
464 addition
and
11 deletion
+464
-11
src/share/classes/com/sun/source/tree/NewArrayTree.java
src/share/classes/com/sun/source/tree/NewArrayTree.java
+1
-1
src/share/classes/com/sun/tools/doclets/formats/html/TagletWriterImpl.java
.../com/sun/tools/doclets/formats/html/TagletWriterImpl.java
+2
-1
src/share/classes/com/sun/tools/doclets/formats/html/markup/ContentBuilder.java
...sun/tools/doclets/formats/html/markup/ContentBuilder.java
+0
-2
src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlTree.java
...s/com/sun/tools/doclets/formats/html/markup/HtmlTree.java
+6
-1
src/share/classes/com/sun/tools/javac/comp/Resolve.java
src/share/classes/com/sun/tools/javac/comp/Resolve.java
+2
-6
test/com/sun/javadoc/testTagOutput/TestTagOutput.java
test/com/sun/javadoc/testTagOutput/TestTagOutput.java
+78
-0
test/com/sun/javadoc/testTagOutput/pkg1/DeprecatedTag.java
test/com/sun/javadoc/testTagOutput/pkg1/DeprecatedTag.java
+44
-0
test/tools/javac/lambda/T8025816/CrashMethodReferenceWithSiteTypeVarTest.java
...bda/T8025816/CrashMethodReferenceWithSiteTypeVarTest.java
+40
-0
test/tools/javac/tree/NoPrivateTypesExported.java
test/tools/javac/tree/NoPrivateTypesExported.java
+291
-0
未找到文件。
src/share/classes/com/sun/source/tree/NewArrayTree.java
浏览文件 @
ba4f33a1
...
...
@@ -25,7 +25,7 @@
package
com.sun.source.tree
;
import
com.sun.tools.javac
.util.List
;
import
java
.util.List
;
/**
* A tree node for an expression to create a new instance of an array.
...
...
src/share/classes/com/sun/tools/doclets/formats/html/TagletWriterImpl.java
浏览文件 @
ba4f33a1
...
...
@@ -118,7 +118,8 @@ public class TagletWriterImpl extends TagletWriter {
if
(
deprs
.
length
>
0
)
{
Content
body
=
commentTagsToOutput
(
null
,
doc
,
deprs
[
0
].
inlineTags
(),
false
);
result
.
addContent
(
HtmlTree
.
SPAN
(
HtmlStyle
.
italic
,
body
));
if
(!
body
.
isEmpty
())
result
.
addContent
(
HtmlTree
.
SPAN
(
HtmlStyle
.
italic
,
body
));
}
}
else
{
if
(
Util
.
isDeprecated
(
member
.
containingClass
()))
{
...
...
src/share/classes/com/sun/tools/doclets/formats/html/markup/ContentBuilder.java
浏览文件 @
ba4f33a1
...
...
@@ -41,8 +41,6 @@ public class ContentBuilder extends Content {
@Override
public
void
addContent
(
Content
content
)
{
nullCheck
(
content
);
if
((
content
instanceof
ContentBuilder
)
&&
content
.
isEmpty
())
return
;
ensureMutableContents
();
if
(
content
instanceof
ContentBuilder
)
{
contents
.
addAll
(((
ContentBuilder
)
content
).
contents
);
...
...
src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlTree.java
浏览文件 @
ba4f33a1
...
...
@@ -102,7 +102,12 @@ public class HtmlTree extends Content {
* @param tagContent tag content to be added
*/
public
void
addContent
(
Content
tagContent
)
{
if
(
tagContent
==
HtmlTree
.
EMPTY
||
tagContent
.
isValid
())
{
if
(
tagContent
instanceof
ContentBuilder
)
{
for
(
Content
content:
((
ContentBuilder
)
tagContent
).
contents
)
{
addContent
(
content
);
}
}
else
if
(
tagContent
==
HtmlTree
.
EMPTY
||
tagContent
.
isValid
())
{
if
(
content
.
isEmpty
())
content
=
new
ArrayList
<
Content
>();
content
.
add
(
tagContent
);
...
...
src/share/classes/com/sun/tools/javac/comp/Resolve.java
浏览文件 @
ba4f33a1
...
...
@@ -424,13 +424,14 @@ public class Resolve {
*/
private
boolean
isProtectedAccessible
(
Symbol
sym
,
ClassSymbol
c
,
Type
site
)
{
Type
newSite
=
site
.
hasTag
(
TYPEVAR
)
?
site
.
getUpperBound
()
:
site
;
while
(
c
!=
null
&&
!(
c
.
isSubClass
(
sym
.
owner
,
types
)
&&
(
c
.
flags
()
&
INTERFACE
)
==
0
&&
// In JLS 2e 6.6.2.1, the subclass restriction applies
// only to instance fields and methods -- types are excluded
// regardless of whether they are declared 'static' or not.
((
sym
.
flags
()
&
STATIC
)
!=
0
||
sym
.
kind
==
TYP
||
s
ite
.
tsym
.
isSubClass
(
c
,
types
))))
((
sym
.
flags
()
&
STATIC
)
!=
0
||
sym
.
kind
==
TYP
||
newS
ite
.
tsym
.
isSubClass
(
c
,
types
))))
c
=
c
.
owner
.
enclClass
();
return
c
!=
null
;
}
...
...
@@ -2710,11 +2711,6 @@ public class Resolve {
InferenceContext
inferenceContext
)
{
MethodResolutionPhase
maxPhase
=
boxingAllowed
?
VARARITY
:
BASIC
;
if
(
site
.
hasTag
(
TYPEVAR
))
{
return
resolveMemberReference
(
pos
,
env
,
referenceTree
,
site
.
getUpperBound
(),
name
,
argtypes
,
typeargtypes
,
boxingAllowed
,
methodCheck
,
inferenceContext
);
}
site
=
types
.
capture
(
site
);
ReferenceLookupHelper
boundLookupHelper
;
...
...
test/com/sun/javadoc/testTagOutput/TestTagOutput.java
0 → 100644
浏览文件 @
ba4f33a1
/*
* 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. 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 8026370
* @summary This test checks the generated tag output.
* @author Bhavesh Patel
* @library ../lib/
* @build JavadocTester TestTagOutput
* @run main TestTagOutput
*/
public
class
TestTagOutput
extends
JavadocTester
{
private
static
final
String
BUG_ID
=
"8026370"
;
private
static
final
String
[][]
TEST
=
{
{
BUG_ID
+
FS
+
"pkg1"
+
FS
+
"DeprecatedTag.html"
,
"<div class=\"block\"><span class=\"strong\">Deprecated.</span> </div>"
},
{
BUG_ID
+
FS
+
"pkg1"
+
FS
+
"DeprecatedTag.html"
,
"<div class=\"block\"><span class=\"strong\">Deprecated.</span> "
+
"<span class=\"italic\">Do not use this.</span></div>"
}};
private
static
final
String
[][]
NEGATED_TEST
=
{
{
BUG_ID
+
FS
+
"pkg1"
+
FS
+
"DeprecatedTag.html"
,
"<div class=\"block\"><span class=\"strong\">Deprecated."
+
"</span> <span class=\"italic\"></span></div>"
}};
private
static
final
String
[]
ARGS
=
new
String
[]
{
"-d"
,
BUG_ID
,
"-sourcepath"
,
SRC_DIR
,
"pkg1"
};
/**
* The entry point of the test.
* @param args the array of command line arguments.
*/
public
static
void
main
(
String
[]
args
)
{
TestTagOutput
tester
=
new
TestTagOutput
();
run
(
tester
,
ARGS
,
TEST
,
NEGATED_TEST
);
tester
.
printSummary
();
}
/**
* {@inheritDoc}
*/
public
String
getBugId
()
{
return
BUG_ID
;
}
/**
* {@inheritDoc}
*/
public
String
getBugName
()
{
return
getClass
().
getName
();
}
}
test/com/sun/javadoc/testTagOutput/pkg1/DeprecatedTag.java
0 → 100644
浏览文件 @
ba4f33a1
/*
* 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
class
DeprecatedTag
{
/**
* This method is deprecated.
*
* @deprecated
*/
public
void
deprecatedMethod
()
{
}
/**
* This method is also deprecated.
*
* @deprecated Do not use this.
*/
public
void
deprecatedMethodWithDesc
()
{
}
}
test/tools/javac/lambda/T8025816/CrashMethodReferenceWithSiteTypeVarTest.java
0 → 100644
浏览文件 @
ba4f33a1
/*
* 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.
*/
/*
* @test
* @bug 8025816
* @summary Compiler crash when default method call with method reference
* @compile CrashMethodReferenceWithSiteTypeVarTest.java
*/
import
java.util.Collection
;
import
java.util.Comparator
;
public
class
CrashMethodReferenceWithSiteTypeVarTest
{
public
<
T
>
void
m1
(
Collection
<
T
>
c
,
Comparator
<
T
>
comp
)
{}
public
<
T
extends
Comparable
>
void
m2
(
Collection
<
T
>
c
)
{
m1
(
c
,
T:
:
compareTo
);
}
}
test/tools/javac/tree/NoPrivateTypesExported.java
0 → 100644
浏览文件 @
ba4f33a1
/*
* 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.
*/
/*
* @test
* @bug 8026180
* @summary Ensuring javax.lang.model.**, javax.tools.**, javax.annotation.processing.**
* and com.sun.source.** don't export inappropriate types.
* @library /tools/javac/lib
* @build JavacTestingAbstractProcessor NoPrivateTypesExported
* @compile -processor NoPrivateTypesExported NoPrivateTypesExported.java
*/
import
java.lang.annotation.Documented
;
import
java.util.Arrays
;
import
java.util.HashSet
;
import
java.util.List
;
import
java.util.Set
;
import
javax.annotation.processing.RoundEnvironment
;
import
javax.lang.model.element.AnnotationMirror
;
import
javax.lang.model.element.AnnotationValue
;
import
javax.lang.model.element.Element
;
import
javax.lang.model.element.ElementKind
;
import
javax.lang.model.element.ExecutableElement
;
import
javax.lang.model.element.PackageElement
;
import
javax.lang.model.element.TypeElement
;
import
javax.lang.model.element.TypeParameterElement
;
import
javax.lang.model.element.VariableElement
;
import
javax.lang.model.type.ArrayType
;
import
javax.lang.model.type.DeclaredType
;
import
javax.lang.model.type.IntersectionType
;
import
javax.lang.model.type.TypeMirror
;
import
javax.lang.model.type.TypeVariable
;
import
javax.lang.model.type.WildcardType
;
import
javax.lang.model.util.ElementScanner8
;
import
javax.lang.model.util.SimpleAnnotationValueVisitor8
;
import
javax.tools.Diagnostic.Kind
;
public
class
NoPrivateTypesExported
extends
JavacTestingAbstractProcessor
{
private
static
final
String
[]
javaxLangModelPackages
=
new
String
[]
{
"javax.lang.model"
,
"javax.lang.model.element"
,
"javax.lang.model.type"
,
"javax.lang.model.util"
,
};
private
static
final
Set
<
String
>
javaxLangModelAcceptable
;
private
static
final
String
[]
javaxToolsProcessingPackages
=
new
String
[]
{
"javax.annotation.processing"
,
"javax.tools"
,
};
private
static
final
Set
<
String
>
javaxToolsProcessingAcceptable
;
private
static
final
String
[]
comSunSourcePackages
=
new
String
[]
{
"com.sun.source.doctree"
,
"com.sun.source.tree"
,
"com.sun.source.util"
};
private
static
final
Set
<
String
>
comSunSourceAcceptable
;
static
{
javaxLangModelAcceptable
=
new
HashSet
<>(
Arrays
.
asList
(
"java.io."
,
"java.lang."
,
"java.net."
,
"java.nio."
,
"java.util."
,
"javax.lang.model."
,
"javax.annotation.processing.SupportedSourceVersion"
,
"jdk.Exported"
));
Set
<
String
>
javaxToolsProcessingAcceptableTemp
=
new
HashSet
<>();
javaxToolsProcessingAcceptableTemp
.
addAll
(
javaxLangModelAcceptable
);
javaxToolsProcessingAcceptableTemp
.
addAll
(
Arrays
.
asList
(
"javax.annotation.processing."
,
"javax.tools."
));
javaxToolsProcessingAcceptable
=
javaxToolsProcessingAcceptableTemp
;
Set
<
String
>
comSunSourceAcceptableTemp
=
new
HashSet
<>();
comSunSourceAcceptableTemp
.
addAll
(
javaxToolsProcessingAcceptable
);
comSunSourceAcceptableTemp
.
addAll
(
Arrays
.
asList
(
"com.sun.source.doctree."
,
"com.sun.source.tree."
,
"com.sun.source.util."
));
comSunSourceAcceptable
=
comSunSourceAcceptableTemp
;
}
@Override
public
boolean
process
(
Set
<?
extends
TypeElement
>
annotations
,
RoundEnvironment
roundEnv
)
{
if
(
roundEnv
.
processingOver
())
{
verifyPackage
(
javaxLangModelPackages
,
javaxLangModelAcceptable
);
verifyPackage
(
javaxToolsProcessingPackages
,
javaxToolsProcessingAcceptable
);
verifyPackage
(
comSunSourcePackages
,
comSunSourceAcceptable
);
}
return
true
;
}
private
void
verifyPackage
(
String
[]
packagesToTest
,
Set
<
String
>
acceptable
)
{
for
(
String
packageToTest
:
packagesToTest
)
{
PackageElement
packageElement
=
processingEnv
.
getElementUtils
()
.
getPackageElement
(
packageToTest
);
verifyReferredTypesAcceptable
(
packageElement
,
acceptable
);
}
}
private
void
verifyReferredTypesAcceptable
(
Element
rootElement
,
final
Set
<
String
>
acceptable
)
{
new
ElementScanner8
<
Void
,
Void
>()
{
@Override
public
Void
visitType
(
TypeElement
e
,
Void
p
)
{
verifyTypeAcceptable
(
e
.
getSuperclass
(),
acceptable
);
verifyTypesAcceptable
(
e
.
getInterfaces
(),
acceptable
);
scan
(
e
.
getTypeParameters
(),
p
);
scan
(
e
.
getEnclosedElements
(),
p
);
verifyAnnotations
(
e
.
getAnnotationMirrors
(),
acceptable
);
return
null
;
}
@Override
public
Void
visitTypeParameter
(
TypeParameterElement
e
,
Void
p
)
{
verifyTypesAcceptable
(
e
.
getBounds
(),
acceptable
);
scan
(
e
.
getEnclosedElements
(),
p
);
verifyAnnotations
(
e
.
getAnnotationMirrors
(),
acceptable
);
return
null
;
}
@Override
public
Void
visitPackage
(
PackageElement
e
,
Void
p
)
{
scan
(
e
.
getEnclosedElements
(),
p
);
verifyAnnotations
(
e
.
getAnnotationMirrors
(),
acceptable
);
return
null
;
}
@Override
public
Void
visitVariable
(
VariableElement
e
,
Void
p
)
{
verifyTypeAcceptable
(
e
.
asType
(),
acceptable
);
scan
(
e
.
getEnclosedElements
(),
p
);
verifyAnnotations
(
e
.
getAnnotationMirrors
(),
acceptable
);
return
null
;
}
@Override
public
Void
visitExecutable
(
ExecutableElement
e
,
Void
p
)
{
scan
(
e
.
getTypeParameters
(),
p
);
verifyTypeAcceptable
(
e
.
getReturnType
(),
acceptable
);
scan
(
e
.
getParameters
(),
p
);
verifyTypesAcceptable
(
e
.
getThrownTypes
(),
acceptable
);
scan
(
e
.
getEnclosedElements
(),
p
);
verifyAnnotations
(
e
.
getAnnotationMirrors
(),
acceptable
);
return
null
;
}
}.
scan
(
rootElement
,
null
);
}
private
void
verifyAnnotations
(
Iterable
<?
extends
AnnotationMirror
>
annotations
,
Set
<
String
>
acceptable
)
{
for
(
AnnotationMirror
mirror
:
annotations
)
{
Element
annotationElement
=
mirror
.
getAnnotationType
().
asElement
();
if
(
annotationElement
.
getAnnotation
(
Documented
.
class
)
==
null
)
{
note
(
"Ignoring undocumented annotation: "
+
mirror
.
getAnnotationType
());
}
verifyTypeAcceptable
(
mirror
.
getAnnotationType
(),
acceptable
);
for
(
AnnotationValue
value
:
mirror
.
getElementValues
().
values
())
{
verifyAnnotationValue
(
value
,
acceptable
);
}
}
}
private
void
verifyAnnotationValue
(
AnnotationValue
value
,
final
Set
<
String
>
acceptable
)
{
value
.
accept
(
new
SimpleAnnotationValueVisitor8
<
Void
,
Void
>()
{
@Override
public
Void
visitType
(
TypeMirror
t
,
Void
p
)
{
verifyTypeAcceptable
(
t
,
acceptable
);
return
null
;
}
@Override
public
Void
visitEnumConstant
(
VariableElement
c
,
Void
p
)
{
verifyReferredTypesAcceptable
(
c
,
acceptable
);
return
null
;
}
@Override
public
Void
visitArray
(
List
<?
extends
AnnotationValue
>
vals
,
Void
p
)
{
for
(
AnnotationValue
val
:
vals
)
{
val
.
accept
(
this
,
p
);
}
return
null
;
}
@Override
protected
Void
defaultAction
(
Object
o
,
Void
p
)
{
error
(
"Unexpected AnnotationValue: "
+
o
.
toString
());
return
super
.
defaultAction
(
o
,
p
);
}
},
null
);
}
private
void
verifyTypesAcceptable
(
Iterable
<?
extends
TypeMirror
>
types
,
Set
<
String
>
acceptable
)
{
if
(
types
==
null
)
return
;
for
(
TypeMirror
type
:
types
)
{
verifyTypeAcceptable
(
type
,
acceptable
);
}
}
private
void
verifyTypeAcceptable
(
TypeMirror
type
,
Set
<
String
>
acceptable
)
{
if
(
type
==
null
)
return
;
verifyAnnotations
(
type
.
getAnnotationMirrors
(),
acceptable
);
switch
(
type
.
getKind
())
{
case
BOOLEAN:
case
BYTE:
case
CHAR:
case
DOUBLE:
case
FLOAT:
case
INT:
case
LONG:
case
SHORT:
case
VOID:
case
NONE:
case
NULL:
return
;
case
DECLARED:
DeclaredType
dt
=
(
DeclaredType
)
type
;
TypeElement
outermostTypeElement
=
outermostTypeElement
(
dt
.
asElement
());
String
outermostType
=
outermostTypeElement
.
getQualifiedName
().
toString
();
boolean
isAcceptable
=
false
;
for
(
String
acceptablePackage
:
acceptable
)
{
if
(
outermostType
.
startsWith
(
acceptablePackage
))
{
isAcceptable
=
true
;
break
;
}
}
if
(!
isAcceptable
)
{
error
(
"Type not acceptable for this API: "
+
dt
.
toString
());
}
for
(
TypeMirror
bound
:
dt
.
getTypeArguments
())
{
verifyTypeAcceptable
(
bound
,
acceptable
);
}
break
;
case
ARRAY:
verifyTypeAcceptable
(((
ArrayType
)
type
).
getComponentType
(),
acceptable
);
break
;
case
INTERSECTION:
for
(
TypeMirror
element
:
((
IntersectionType
)
type
).
getBounds
())
{
verifyTypeAcceptable
(
element
,
acceptable
);
}
break
;
case
TYPEVAR:
verifyTypeAcceptable
(((
TypeVariable
)
type
).
getLowerBound
(),
acceptable
);
verifyTypeAcceptable
(((
TypeVariable
)
type
).
getUpperBound
(),
acceptable
);
break
;
case
WILDCARD:
verifyTypeAcceptable
(((
WildcardType
)
type
).
getExtendsBound
(),
acceptable
);
verifyTypeAcceptable
(((
WildcardType
)
type
).
getSuperBound
(),
acceptable
);
break
;
default
:
error
(
"Type not acceptable for this API: "
+
type
.
toString
());
break
;
}
}
private
TypeElement
outermostTypeElement
(
Element
el
)
{
while
(
el
.
getEnclosingElement
().
getKind
()
!=
ElementKind
.
PACKAGE
)
{
el
=
el
.
getEnclosingElement
();
}
return
(
TypeElement
)
el
;
}
private
void
error
(
String
text
)
{
processingEnv
.
getMessager
().
printMessage
(
Kind
.
ERROR
,
text
);
}
private
void
note
(
String
text
)
{
processingEnv
.
getMessager
().
printMessage
(
Kind
.
NOTE
,
text
);
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录