Fixed decompilation of annotation values nested in arrays (IDEA-141133)

https://github.com/JetBrains/intellij-community/pull/272
This commit is contained in:
Sebastian Zarnekow
2015-06-08 17:24:05 +03:00
committed by Roman Shevchenko
parent f1829b0725
commit 22018fa859
7 changed files with 164 additions and 2 deletions
@@ -0,0 +1,72 @@
// IntelliJ API Decompiler stub source generated from a class file
// Implementation of methods is not available
package pkg;
public @interface MoreAnnotations {
@pkg.MoreAnnotations(intValue = 1, byteValue = 1, floatValue = 1.0f, doubleValue = 1.0, booleanValue = true, shortValue = 1, longValue = 1L, charValue = '\n', enumValue = pkg.MoreAnnotations.TestEnum.FirstValue, annotationValue = @pkg.MoreAnnotations.NestedAnnotation("a"), stringValue = "", classValue = java.lang.String.class)
java.lang.String annotatedWithValues = "";
@pkg.MoreAnnotations(intArray = {}, byteArray = {}, floatArray = {}, doubleArray = {}, booleanArray = {}, shortArray = {}, longArray = {}, charArray = {}, enumArray = {}, annotationArray = {}, stringArray = {}, classArray = {})
java.lang.String annotatedWithEmptyArrays = "";
@pkg.MoreAnnotations(intArray = {1, 0, 2147483647, -2147483648}, byteArray = {1, 0, 127, -128}, floatArray = {1.0f, 0.0f, 3.4028235E38f, 1.4E-45f, 0.0f / 0.0, 1.0f / 0.0, -1.0f / 0.0}, doubleArray = {1.0, 0.0, 1.7976931348623157E308, 4.9E-324, 0.0d / 0.0, 1.0 / 0.0, -1.0 / 0.0}, booleanArray = {true, false}, shortArray = {1, 0, 32767, -32768}, longArray = {1L, 0L, 9223372036854775807L, -9223372036854775808L}, charArray = {'a', '\n', '\u0001', '\u0000', '\uFFFF', '\u0000'}, enumArray = {pkg.MoreAnnotations.TestEnum.FirstValue, pkg.MoreAnnotations.TestEnum.SecondValue}, annotationArray = {@pkg.MoreAnnotations.NestedAnnotation("a"), @pkg.MoreAnnotations.NestedAnnotation("b")}, stringArray = {"first", "second", ""}, classArray = {java.lang.CharSequence.class, java.lang.String.class, java.lang.StringBuilder.class})
java.lang.String annotatedWithArrays = "";
int intValue() default 1;
byte byteValue() default 1;
float floatValue() default 1.0f / 0.0;
double doubleValue() default 0.0d / 0.0;
boolean booleanValue() default true;
short shortValue() default 1;
long longValue() default 1L;
char charValue() default '0';
pkg.MoreAnnotations.TestEnum enumValue() default pkg.MoreAnnotations.TestEnum.FirstValue;
pkg.MoreAnnotations.NestedAnnotation annotationValue() default @pkg.MoreAnnotations.NestedAnnotation;
java.lang.String stringValue() default "default";
java.lang.Class<? extends java.lang.CharSequence> classValue() default java.lang.CharSequence.class;
int[] intArray() default {1, 0, 2147483647, -2147483648};
byte[] byteArray() default {1, 0, 127, -128};
float[] floatArray() default {1.0f, 0.0f, 3.4028235E38f, 1.4E-45f, 0.0f / 0.0, 1.0f / 0.0, -1.0f / 0.0};
double[] doubleArray() default {1.0, 0.0, 1.7976931348623157E308, 4.9E-324, 0.0d / 0.0, 1.0 / 0.0, -1.0 / 0.0};
boolean[] booleanArray() default {true, false};
short[] shortArray() default {1, 0, 32767, -32768};
long[] longArray() default {1L, 0L, 9223372036854775807L, -9223372036854775808L};
char[] charArray() default {'\u0001', '\u0000', '\uFFFF', '\u0000'};
pkg.MoreAnnotations.TestEnum[] enumArray() default {pkg.MoreAnnotations.TestEnum.FirstValue};
pkg.MoreAnnotations.NestedAnnotation[] annotationArray() default {@pkg.MoreAnnotations.NestedAnnotation};
java.lang.String[] stringArray() default {"first", "second", ""};
java.lang.Class<? extends java.lang.CharSequence>[] classArray() default {java.lang.CharSequence.class, java.lang.String.class, java.lang.StringBuilder.class};
static enum TestEnum {
FirstValue, SecondValue;
private TestEnum() { /* compiled code */ }
}
static @interface NestedAnnotation {
java.lang.String value() default "MyString";
}
}
@@ -0,0 +1,89 @@
package pkg;
public @interface MoreAnnotations {
int intValue() default 1;
byte byteValue() default 1;
float floatValue() default Float.POSITIVE_INFINITY;
double doubleValue() default Double.NaN;
boolean booleanValue() default true;
short shortValue() default 1;
long longValue() default 1;
char charValue() default '0';
TestEnum enumValue() default TestEnum.FirstValue;
NestedAnnotation annotationValue() default @NestedAnnotation;
String stringValue() default "default";
Class<? extends CharSequence> classValue() default CharSequence.class;
int[] intArray() default { 1, 0, Integer.MAX_VALUE, Integer.MIN_VALUE };
byte[] byteArray() default { 1, 0, Byte.MAX_VALUE, Byte.MIN_VALUE };
float[] floatArray() default { 1, 0, Float.MAX_VALUE, Float.MIN_VALUE, Float.NaN, Float.POSITIVE_INFINITY, Float.NEGATIVE_INFINITY };
double[] doubleArray() default { 1, 0, Double.MAX_VALUE, Double.MIN_VALUE, Double.NaN, Double.POSITIVE_INFINITY, Double.NEGATIVE_INFINITY };
boolean[] booleanArray() default { true, false };
short[] shortArray() default { 1, 0, Short.MAX_VALUE, Short.MIN_VALUE };
long[] longArray() default { 1, 0, Long.MAX_VALUE, Long.MIN_VALUE };
char[] charArray() default { 1, 0, Character.MAX_VALUE, Character.MIN_VALUE };
TestEnum[] enumArray() default { TestEnum.FirstValue };
NestedAnnotation[] annotationArray() default { @NestedAnnotation };
String[] stringArray() default { "first", "second", ""};
Class<? extends CharSequence>[] classArray() default { CharSequence.class, String.class, StringBuilder.class };
@interface NestedAnnotation {
String value() default "MyString";
}
@MoreAnnotations(
intValue = 1,
byteValue = 1,
floatValue = 1,
doubleValue = 1,
booleanValue = true,
shortValue = 1,
longValue = 1,
charValue = '\n',
enumValue = TestEnum.FirstValue,
annotationValue = @NestedAnnotation("a"),
stringValue = "",
classValue = String.class
)
String annotatedWithValues = "";
@MoreAnnotations(
intArray = {},
byteArray = {},
floatArray = {},
doubleArray = {},
booleanArray = {},
shortArray = {},
longArray = {},
charArray = {},
enumArray = {},
annotationArray = {},
stringArray = {},
classArray = {}
)
String annotatedWithEmptyArrays = "";
@MoreAnnotations(
intArray = { 1, 0, Integer.MAX_VALUE, Integer.MIN_VALUE },
byteArray = { 1, 0, Byte.MAX_VALUE, Byte.MIN_VALUE },
floatArray = { 1, 0, Float.MAX_VALUE, Float.MIN_VALUE, Float.NaN, Float.POSITIVE_INFINITY, Float.NEGATIVE_INFINITY },
doubleArray = { 1, 0, Double.MAX_VALUE, Double.MIN_VALUE, Double.NaN, Double.POSITIVE_INFINITY, Double.NEGATIVE_INFINITY },
booleanArray = { true, false },
shortArray = { 1, 0, Short.MAX_VALUE, Short.MIN_VALUE },
longArray = { 1, 0, Long.MAX_VALUE, Long.MIN_VALUE },
charArray = { 'a', '\n', 1, 0, Character.MAX_VALUE, Character.MIN_VALUE },
enumArray = { TestEnum.FirstValue , TestEnum.SecondValue},
annotationArray = { @NestedAnnotation("a"), @NestedAnnotation("b") },
stringArray = { "first", "second", ""},
classArray = { CharSequence.class, String.class, StringBuilder.class }
)
String annotatedWithArrays = "";
public enum TestEnum {
FirstValue,
SecondValue
}
}
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
* Copyright 2000-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -44,6 +44,7 @@ public class ClsMirrorBuildingTest extends LightIdeaTestCase {
public void testNested() { doTest(); }
public void testDeprecated() { doTest(); }
public void testAnnotations() { doTest(); }
public void testMoreAnnotations() { doTest(); }
public void testParameterNames() { doTest(); }
public void testEmptyEnum() { doTest(); }
public void test$BuckClass() { doTest(); }