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 108764 Details for
Bug 241847
[plan] [annotation] param annotation matching pointcut does not always match
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
unfinished patch...
patch.txt (text/plain), 6.77 KB, created by
Andrew Clement
on 2008-07-30 12:41:06 EDT
(
hide
)
Description:
unfinished patch...
Filename:
MIME Type:
Creator:
Andrew Clement
Created:
2008-07-30 12:41:06 EDT
Size:
6.77 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.aspectj.ajdt.core >Index: src/org/aspectj/ajdt/internal/compiler/lookup/EclipseResolvedMember.java >=================================================================== >RCS file: /cvsroot/tools/org.aspectj/modules/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseResolvedMember.java,v >retrieving revision 1.8 >diff -u -r1.8 EclipseResolvedMember.java >--- src/org/aspectj/ajdt/internal/compiler/lookup/EclipseResolvedMember.java 7 Jul 2008 22:32:43 -0000 1.8 >+++ src/org/aspectj/ajdt/internal/compiler/lookup/EclipseResolvedMember.java 30 Jul 2008 16:38:14 -0000 >@@ -23,10 +23,13 @@ > import org.aspectj.org.eclipse.jdt.internal.compiler.ast.TrueLiteral; > import org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeDeclaration; > import org.aspectj.org.eclipse.jdt.internal.compiler.impl.IntConstant; >+import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.AnnotationBinding; >+import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.AnnotationHolder; > import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.Binding; > import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.FieldBinding; > import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodBinding; > import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding; >+import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeBinding; > import org.aspectj.weaver.AnnotationX; > import org.aspectj.weaver.BCException; > import org.aspectj.weaver.MemberKind; >@@ -85,6 +88,53 @@ > } > > >+ public AnnotationX[][] getParameterAnnotations() { >+ throw new BCException("EclipseResolvedMember.getParameterAnnotations() not-yet-implemented. Please raise a bug and turn off pipelining as a workaround"); >+ } >+ >+ public ResolvedType[][] getParameterAnnotationTypes() { >+ if (parameterAnnotationTypes!=null) return parameterAnnotationTypes; >+ ResolvedType[][] paramAnnos = null; >+ if (realBinding instanceof MethodBinding) { >+ MethodBinding mb = (MethodBinding)realBinding; >+ MethodBinding originalMethod = mb.original(); >+ if (originalMethod.declaringClass instanceof SourceTypeBinding) { >+ SourceTypeBinding sourceType = (SourceTypeBinding) originalMethod.declaringClass; >+ if (sourceType.scope != null) { >+ AbstractMethodDeclaration methodDeclaration = originalMethod.sourceMethod(); >+ sourceType.scope.referenceContext.resolve(); >+// if (methodDeclaration != null) { >+// methodDeclaration.resolve(sourceType.scope); >+// } >+ } >+ } >+ >+ >+ long abits = realBinding.getAnnotationTagBits(); // ensure resolved >+ TypeBinding[] params = mb.parameters; >+ if (params!=null) { >+ paramAnnos = new ResolvedType[params.length][]; >+ for (int i=0;i<params.length;i++) { >+ //AnnotationHolder ah = mb.declaringClass.retrieveAnnotationHolder(mb,true); >+ AnnotationBinding[] singleParameterAnnotations = mb.getParameterAnnotations(i); >+ paramAnnos[i] = new ResolvedType[singleParameterAnnotations==null?0:singleParameterAnnotations.length]; >+ if (singleParameterAnnotations!=null) { >+ for (int j=0;j<singleParameterAnnotations.length;j++) { >+ UnresolvedType ut = UnresolvedType.forSignature(new String(singleParameterAnnotations[j].getAnnotationType().signature())); >+ paramAnnos[i][j] = w.resolve(ut); >+ } >+ } >+ } >+ } >+ } >+ if (paramAnnos!=null) { >+ parameterAnnotationTypes = paramAnnos; >+ } else { >+ parameterAnnotationTypes = NO_PARAMETER_ANNOTATION_TYPES; >+ } >+ return parameterAnnotationTypes; >+ } >+ > public AnnotationX getAnnotationOfType(UnresolvedType ofType) { > long abits = realBinding.getAnnotationTagBits(); // ensure resolved > Annotation[] annos = getEclipseAnnotations(); >Index: src/org/aspectj/ajdt/internal/compiler/AjPipeliningCompilerAdapter.java >=================================================================== >RCS file: /cvsroot/tools/org.aspectj/modules/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/AjPipeliningCompilerAdapter.java,v >retrieving revision 1.12 >diff -u -r1.12 AjPipeliningCompilerAdapter.java >--- src/org/aspectj/ajdt/internal/compiler/AjPipeliningCompilerAdapter.java 17 Jul 2008 20:07:59 -0000 1.12 >+++ src/org/aspectj/ajdt/internal/compiler/AjPipeliningCompilerAdapter.java 30 Jul 2008 16:38:14 -0000 >@@ -232,6 +232,12 @@ > if (containsAnAspect(units[i])) aspects.add(units[i]); else nonaspects.add(units[i]); > } > >+ >+ List toDestroy = new ArrayList(); >+ toDestroy.addAll(nonaspects); >+ List orderedNonAspects = new ArrayList(); >+ sortThem(toDestroy,orderedNonAspects,new ArrayList()); >+ > if (units == null) return; // what does this mean? > > // ...and put them back together, aspects first >@@ -268,6 +274,53 @@ > } > } > >+ private List sortThem(List inputList, List collector,Map theMap) { >+ if (theMap.isEmpty()) { >+ for (Iterator iterator = inputList.iterator(); iterator.hasNext();) { >+ CompilationUnitDeclaration cud =(CompilationUnitDeclaration)iterator.next(); >+ TypeDeclaration[] typeDecls = cud.types; >+ if (typeDecls!=null) { >+ for (int i = 0; i < typeDecls.length; i++) { // loop through top level types in the file >+ TypeDeclaration declaration = typeDecls[i]; >+ theMap.put(declaration.binding.sourceName,cud); >+ if (declaration.memberTypes!=null) { >+ TypeDeclaration[] memberTypes = declaration.memberTypes; >+ for (int j = 0; j < memberTypes.length; j++) { // loop through inner types >+ theMap.put(memberTypes[j].binding.sourceName,cud); >+ } >+ } >+ } >+ } >+ } >+ } >+ for (Iterator iterator = inputList.iterator(); iterator.hasNext();) { >+ CompilationUnitDeclaration cud =(CompilationUnitDeclaration)iterator.next(); >+ TypeDeclaration[] typeDecls = cud.types; >+ if (typeDecls!=null) { >+ for (int i = 0; i < typeDecls.length; i++) { // loop through top level types in the file >+ TypeDeclaration declaration = typeDecls[i]; >+ char[] superName = declaration.superclass.resolvedType.sourceName(); >+ CompilationUnitDeclaration superCud = (CompilationUnitDeclaration)theMap.get(declaration); >+ if (superCud==null) { >+ collector.add(cud); >+ } >+// if (declaration.memberTypes!=null) { >+// TypeDeclaration[] memberTypes = declaration.memberTypes; >+// for (int j = 0; j < memberTypes.length; j++) { // loop through inner types >+// theMap.put(memberTypes[j].name,cud); >+// } >+// } >+ } >+ } >+ } >+ >+ >+ // go through the inputList, if the supertype of the next entry is in the list, add it to collector next otherwise just add the one being processed >+ >+ if (cud.) >+ } >+ >+ > public void beforeCompiling(ICompilationUnit[] sourceUnits) { > resultsPendingWeave = new ArrayList(); > reportedErrors = false;
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 241847
:
108239
| 108764