8342934: TYPE_USE annotations printed with error causing "," in toString output
Reviewed-by: iris, vromero
This commit is contained in:
parent
0853aee3b3
commit
ff165f9f0c
src/jdk.compiler/share/classes/com/sun/tools/javac/code
test/langtools/tools/javac/processing/model/type/AnnotatedTypeToString
@ -500,7 +500,7 @@ public abstract class Type extends AnnoConstruct implements TypeMirror, PoolCons
|
||||
if (prefix) {
|
||||
sb.append(" ");
|
||||
}
|
||||
sb.append(getAnnotationMirrors());
|
||||
sb.append(getAnnotationMirrors().toString(" "));
|
||||
sb.append(" ");
|
||||
}
|
||||
}
|
||||
|
@ -23,7 +23,7 @@
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 8284220
|
||||
* @bug 8284220 8342934
|
||||
* @summary Tests DeclaredType.toString with type annotations present, for example that '@A
|
||||
* Map.Entry' is printed as 'java.util.@A Map.Entry' (and not '@A java.util.Map.Entry' or
|
||||
* 'java.util.@A Entry').
|
||||
|
@ -32,6 +32,10 @@ import java.lang.annotation.Target;
|
||||
@Target(ElementType.TYPE_USE)
|
||||
@interface A {}
|
||||
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.TYPE_USE)
|
||||
@interface B {}
|
||||
|
||||
public class Test {
|
||||
static class StaticNested {
|
||||
static class InnerMostStaticNested {}
|
||||
@ -41,8 +45,8 @@ public class Test {
|
||||
class InnerMost {}
|
||||
}
|
||||
|
||||
@ExpectedToString("p.Test.@p.A StaticNested")
|
||||
@A StaticNested i;
|
||||
@ExpectedToString("p.Test.@p.A @p.B StaticNested")
|
||||
@A @B StaticNested i;
|
||||
|
||||
@ExpectedToString("p.Test.StaticNested.@p.A InnerMostStaticNested")
|
||||
StaticNested.@A InnerMostStaticNested j;
|
||||
|
Loading…
x
Reference in New Issue
Block a user