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 134450 Details for
Bug 274917
Incorrect "empty block" warning underlining on annotations
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed fix
patch_274917.txt (text/plain), 4.15 KB, created by
Olivier Thomann
on 2009-05-05 11:35:12 EDT
(
hide
)
Description:
Proposed fix
Filename:
MIME Type:
Creator:
Olivier Thomann
Created:
2009-05-05 11:35:12 EDT
Size:
4.15 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core.tests.compiler >Index: src/org/eclipse/jdt/core/tests/compiler/regression/AnnotationTest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AnnotationTest.java,v >retrieving revision 1.197 >diff -u -r1.197 AnnotationTest.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/AnnotationTest.java 28 Apr 2009 17:17:35 -0000 1.197 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/AnnotationTest.java 5 May 2009 15:36:00 -0000 >@@ -44,7 +44,7 @@ > // All specified tests which do not belong to the class are skipped... > static { > // TESTS_NAMES = new String[] { "test127" }; >-// TESTS_NUMBERS = new int[] { 249 }; >+// TESTS_NUMBERS = new int[] { 269 }; > // TESTS_RANGE = new int[] { 249, -1 }; > } > >@@ -8826,4 +8826,28 @@ > "The value for annotation attribute X.Anno2.value must be an enum constant expression\n" + > "----------\n"); > } >+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=274917 >+public void test269() { >+ Map customOptions = new Hashtable(); >+ String[] warnings = CompilerOptions.warningOptionNames(); >+ for (int i = 0, ceil = warnings.length; i < ceil; i++) { >+ customOptions.put(warnings[i], CompilerOptions.WARNING); >+ } >+ this.runConformTest( >+ true, >+ new String[] { >+ "X.java", >+ "@interface X {}", >+ }, >+ null, >+ customOptions, >+ "----------\n" + >+ "1. WARNING in X.java (at line 1)\n" + >+ " @interface X {}\n" + >+ " ^^\n" + >+ "Empty block should be documented\n" + >+ "----------\n", >+ null, null, >+ JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings); >+} > } >#P org.eclipse.jdt.core >Index: compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java,v >retrieving revision 1.401 >diff -u -r1.401 Parser.java >--- compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java 31 Mar 2009 14:17:29 -0000 1.401 >+++ compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java 5 May 2009 15:36:03 -0000 >@@ -1357,6 +1357,10 @@ > typeDecl.declarationSourceEnd = flushCommentsDefinedPriorTo(this.endStatementPosition); > } > protected void consumeAnnotationTypeDeclarationHeader() { >+ TypeDeclaration annotationTypeDeclaration = (TypeDeclaration) this.astStack[this.astPtr]; >+ if (this.currentToken == TokenNameLBRACE) { >+ annotationTypeDeclaration.bodyStart = this.scanner.currentPosition; >+ } > if (this.currentElement != null) { > this.restartRecovery = true; // used to avoid branching back into the regular automaton > } >@@ -1420,11 +1424,12 @@ > 0, > length); > } >- annotationTypeDeclaration.bodyStart = annotationTypeDeclaration.sourceEnd + 1; > > // javadoc > annotationTypeDeclaration.javadoc = this.javadoc; > this.javadoc = null; >+ annotationTypeDeclaration.bodyStart = annotationTypeDeclaration.sourceEnd + 1; >+ > pushOnAstStack(annotationTypeDeclaration); > if(!this.statementRecoveryActivated && > this.options.sourceLevel < ClassFileConstants.JDK1_5 && >@@ -1449,9 +1454,7 @@ > System.arraycopy(this.genericsStack, this.genericsPtr + 1, annotationTypeDeclaration.typeParameters = new TypeParameter[length], 0, length); > > problemReporter().invalidUsageOfTypeParametersForAnnotationDeclaration(annotationTypeDeclaration); >- >- annotationTypeDeclaration.bodyStart = annotationTypeDeclaration.typeParameters[length-1].declarationSourceEnd + 1; >- >+ > // annotationTypeDeclaration.typeParameters = null; > > this.listTypeParameterLength = 0; >@@ -1473,6 +1476,7 @@ > annotationTypeDeclaration.sourceStart = (int) (pos >>> 32); > annotationTypeDeclaration.name = this.identifierStack[this.identifierPtr--]; > this.identifierLengthPtr--; >+ annotationTypeDeclaration.bodyStart = annotationTypeDeclaration.typeParameters[length-1].declarationSourceEnd + 1; > > //compute the declaration source too > // 'interface' push two int positions: the beginning of the class token and its end.
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 274917
:
134450
|
134552