Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 234668 Details for
Bug 414384
[1.8] type annotation on abbreviated inner class is not marked as inner type
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
test and fix
0001-Fix-Bug-414384.patch (text/plain), 6.46 KB, created by
Andrew Clement
on 2013-08-22 11:53:47 EDT
(
hide
)
Description:
test and fix
Filename:
MIME Type:
Creator:
Andrew Clement
Created:
2013-08-22 11:53:47 EDT
Size:
6.46 KB
patch
obsolete
>From 4fa5115e61d9b6acfc2d4e2f7f8f589ca3605d43 Mon Sep 17 00:00:00 2001 >From: Andy Clement <aclement@gopivotal.com> >Date: Thu, 22 Aug 2013 08:52:10 -0700 >Subject: [PATCH] Fix Bug 414384 > >--- > .../regression/JSR308SpecSnippetTests.java | 83 ++++++++++++++++++++++ > .../jdt/internal/compiler/ast/Annotation.java | 4 ++ > 2 files changed, 87 insertions(+) > >diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JSR308SpecSnippetTests.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JSR308SpecSnippetTests.java >index 1e31032..30c070e 100644 >--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JSR308SpecSnippetTests.java >+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JSR308SpecSnippetTests.java >@@ -17,6 +17,7 @@ > * Bug 415397 - [1.8][compiler] Type Annotations on wildcard type argument dropped > * Bug 415399 - [1.8][compiler] Type annotations on constructor results dropped by the code generator > * Bug 415470 - [1.8][compiler] Type annotations on class declaration go vanishing >+ * Bug 414384 - [1.8] type annotation on abbreviated inner class is not marked as inner type > *******************************************************************************/ > package org.eclipse.jdt.core.tests.compiler.regression; > >@@ -2071,4 +2072,86 @@ public class JSR308SpecSnippetTests extends AbstractRegressionTest { > "}"; > checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM); > } >+ >+ // Bug 414384 - [1.8] type annotation on abbreviated inner class is not marked as inner type >+ public void test035() throws Exception { >+ this.runConformTest( >+ new String[] { >+ "pkg/Clazz.java", >+ "package pkg;\n" + >+ "import java.lang.annotation.*;\n" + >+ "import static java.lang.annotation.ElementType.*;\n" + >+ "\n" + >+ "@Target({TYPE_USE}) @interface P { }\n" + >+ "@Target({TYPE_USE}) @interface O { }\n" + >+ "@Target({TYPE_USE}) @interface I { }\n" + >+ "\n" + >+ "public abstract class Clazz {\n" + >+ " public class Inner {}\n" + >+ " public abstract void n1(@I Inner i1);\n" + >+ " public abstract void n2(@O Clazz.@I Inner i2);\n" + >+ " public abstract void n3(pkg.@O Clazz.@I Inner i3);\n" + >+ "}\n", >+ }, >+ ""); >+ // javac b100 produces for the methods: >+ // public abstract void n1(pkg.Clazz$Inner); >+ // RuntimeInvisibleTypeAnnotations: >+ // 0: #14(): METHOD_FORMAL_PARAMETER, param_index=0, location=[INNER_TYPE] >+ // >+ // public abstract void n2(pkg.Clazz$Inner); >+ // RuntimeInvisibleTypeAnnotations: >+ // 0: #14(): METHOD_FORMAL_PARAMETER, param_index=0, location=[INNER_TYPE] >+ // 1: #16(): METHOD_FORMAL_PARAMETER, param_index=0 >+ // >+ // public abstract void n3(pkg.Clazz$Inner); >+ // RuntimeInvisibleTypeAnnotations: >+ // 0: #14(): METHOD_FORMAL_PARAMETER, param_index=0, location=[INNER_TYPE] >+ // 1: #16(): METHOD_FORMAL_PARAMETER, param_index=0 >+ String expectedOutput = >+ " // Method descriptor #15 (Lpkg/Clazz$Inner;)V\n" + >+ " public abstract void n1(pkg.Clazz.Inner arg0);\n" + >+ " RuntimeInvisibleTypeAnnotations: \n" + >+ " #17 @pkg.I(\n" + >+ " target type = 0x16 METHOD_FORMAL_PARAMETER\n" + >+ " method parameter index = 0\n" + >+ " location = [INNER_TYPE]\n" + >+ " )\n" + >+ " \n" + >+ >+ " // Method descriptor #15 (Lpkg/Clazz$Inner;)V\n" + >+ " public abstract void n2(pkg.Clazz.Inner arg0);\n" + >+ " RuntimeInvisibleTypeAnnotations: \n" + >+ " #19 @pkg.O(\n" + >+ " target type = 0x16 METHOD_FORMAL_PARAMETER\n" + >+ " method parameter index = 0\n" + >+ " )\n" + >+ " #17 @pkg.I(\n" + >+ " target type = 0x16 METHOD_FORMAL_PARAMETER\n" + >+ " method parameter index = 0\n" + >+ " location = [INNER_TYPE]\n" + >+ " )\n" + >+ " \n" + >+ >+ " // Method descriptor #15 (Lpkg/Clazz$Inner;)V\n" + >+ " public abstract void n3(pkg.Clazz.Inner arg0);\n" + >+ " RuntimeInvisibleTypeAnnotations: \n" + >+ " #19 @pkg.O(\n" + >+ " target type = 0x16 METHOD_FORMAL_PARAMETER\n" + >+ " method parameter index = 0\n" + >+ " )\n" + >+ " #17 @pkg.I(\n" + >+ " target type = 0x16 METHOD_FORMAL_PARAMETER\n" + >+ " method parameter index = 0\n" + >+ " location = [INNER_TYPE]\n" + >+ " )\n" + >+ "\n" + >+ " Inner classes:\n" + >+ " [inner class info: #24 pkg/Clazz$Inner, outer class info: #1 pkg/Clazz\n" + >+ " inner name: #26 Inner, accessflags: 1 public]\n" + >+ "}"; >+ checkDisassembledClassFile(OUTPUT_DIR + File.separator + "pkg" + File.separator + "Clazz.class", "pkg.Clazz", expectedOutput, ClassFileBytesDisassembler.SYSTEM); >+ } >+ >+ > } >\ No newline at end of file >diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Annotation.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Annotation.java >index 097d966..85f66b0 100644 >--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Annotation.java >+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Annotation.java >@@ -21,6 +21,7 @@ > * Bug 383624 - [1.8][compiler] Revive code generation support for type annotations (from Olivier's work) > * Bug 409517 - [1.8][compiler] Type annotation problems on more elaborate array references > * Bug 415397 - [1.8][compiler] Type Annotations on wildcard type argument dropped >+ * Bug 414384 - [1.8] type annotation on abbreviated inner class is not marked as inner type > *******************************************************************************/ > package org.eclipse.jdt.internal.compiler.ast; > >@@ -157,6 +158,9 @@ public abstract class Annotation extends Expression { > } > } > Annotation[][] annotations = typeReference.annotations; >+ if (annotations == null) { >+ annotations = new Annotation[][] { primaryAnnotation }; >+ } > int annotationsLevels = annotations == null ? 0 : annotations.length; > for (int i = 0; i < annotationsLevels; i++) { > Annotation [] current = annotations[i]; >-- >1.7.11.2 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 414384
: 234668