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 131226 Details for
Bug 271561
JavaModelException when accessing an array of nested annotations
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
incomplete attempt at fix
271561.txt (text/plain), 2.72 KB, created by
Brian Vosburgh
on 2009-04-08 03:17:56 EDT
(
hide
)
Description:
incomplete attempt at fix
Filename:
MIME Type:
Creator:
Brian Vosburgh
Created:
2009-04-08 03:17:56 EDT
Size:
2.72 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: model/org/eclipse/jdt/internal/core/ClassFileInfo.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ClassFileInfo.java,v >retrieving revision 1.44 >diff -u -r1.44 ClassFileInfo.java >--- model/org/eclipse/jdt/internal/core/ClassFileInfo.java 7 Mar 2009 01:08:08 -0000 1.44 >+++ model/org/eclipse/jdt/internal/core/ClassFileInfo.java 8 Apr 2009 07:04:29 -0000 >@@ -57,12 +57,24 @@ > private void generateAnnotationInfo(JavaElement parent, HashMap newElements, IBinaryAnnotation annotationInfo) { > char[] typeName = org.eclipse.jdt.core.Signature.toCharArray(CharOperation.replaceOnCopy(annotationInfo.getTypeName(), '/', '.')); > Annotation annotation = new Annotation(parent, new String(typeName)); >+ // annotations can be in an array under the same parent annotation >+ while (newElements.containsKey(annotation)) >+ annotation.occurrenceCount++; > newElements.put(annotation, annotationInfo); > IBinaryElementValuePair[] pairs = annotationInfo.getElementValuePairs(); > for (int i = 0, length = pairs.length; i < length; i++) { > Object value = pairs[i].getValue(); > if (value instanceof IBinaryAnnotation) { > generateAnnotationInfo(annotation, newElements, (IBinaryAnnotation) value); >+ } else if (value instanceof Object[]) { >+ // if the value is an array, it can have no more than 1 dimension - no need to recurse >+ Object[] valueArray = (Object[]) value; >+ for (int j = 0, valueArrayLength = valueArray.length; j < valueArrayLength; j++) { >+ Object nestedValue = valueArray[j]; >+ if (nestedValue instanceof IBinaryAnnotation) { >+ generateAnnotationInfo(annotation, newElements, (IBinaryAnnotation) nestedValue); >+ } >+ } > } > } > } >Index: model/org/eclipse/jdt/internal/core/util/Util.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/Util.java,v >retrieving revision 1.129 >diff -u -r1.129 Util.java >--- model/org/eclipse/jdt/internal/core/util/Util.java 7 Mar 2009 00:58:54 -0000 1.129 >+++ model/org/eclipse/jdt/internal/core/util/Util.java 8 Apr 2009 07:04:29 -0000 >@@ -3098,6 +3098,14 @@ > // values are heterogeneous, value kind is thus unknown > memberValuePair.valueKind = IMemberValuePair.K_UNKNOWN; > } >+ if (value instanceof Annotation) { >+ Annotation annotation = (Annotation) value; >+ for (int j = 0; j < i; j++) { >+ if (annotation.equals(values[j])) { >+ annotation.occurrenceCount++; >+ } >+ } >+ } > values[i] = value; > } > if (memberValuePair.valueKind == -1)
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 271561
:
131221
|
131226
|
131310
|
131318
|
131335