issue_id
int64
2.04k
425k
title
stringlengths
9
251
body
stringlengths
4
32.8k
status
stringclasses
6 values
after_fix_sha
stringlengths
7
7
project_name
stringclasses
6 values
repo_url
stringclasses
6 values
repo_name
stringclasses
6 values
language
stringclasses
1 value
issue_url
null
before_fix_sha
null
pull_url
null
commit_datetime
timestamp[us, tz=UTC]
report_datetime
timestamp[us, tz=UTC]
updated_file
stringlengths
23
187
chunk_content
stringlengths
1
22k
233,497
Bug 233497 StringIndexOutOfBoundsException thrown in BcelWeaver
null
resolved fixed
93b7bed
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-05-22T18:26:18Z
2008-05-22T18:13:20Z
weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java
String className = classFile.getClassName(); ResolvedType theType = world.resolve(className); if (theType!=null) { BcelObjectType classType = BcelWorld.getBcelObjectType(theType); if (classType!=null) classType.ensureDelegateConsistent(); } } if (input.isApplyAtAspectJMungersOnly()) { ContextToken atAspectJMungersOnly = CompilationAndWeavingContext.enteringPhase(CompilationAndWeavingContext.PROCESSING_ATASPECTJTYPE_MUNGERS_ONLY, ""); requestor.weavingAspects(); ContextToken aspectToken = CompilationAndWeavingContext.enteringPhase(CompilationAndWeavingContext.WEAVING_ASPECTS, ""); for (Iterator i = input.getClassFileIterator(); i.hasNext(); ) { UnwovenClassFile classFile = (UnwovenClassFile)i.next(); String className = classFile.getClassName(); ResolvedType theType = world.resolve(className); if (theType.isAnnotationStyleAspect()) { BcelObjectType classType = BcelWorld.getBcelObjectType(theType); if (classType==null) { throw new BCException("Can't find bcel delegate for "+className+" type="+theType.getClass()); } LazyClassGen clazz = classType.getLazyClassGen(); BcelPerClauseAspectAdder selfMunger = new BcelPerClauseAspectAdder(theType, theType.getPerClause().getKind()); selfMunger.forceMunge(clazz, true); classType.finishedWith(); UnwovenClassFile[] newClasses = getClassFilesFor(clazz); for (int news = 0; news < newClasses.length; news++) { requestor.acceptResult(newClasses[news]); } wovenClassNames.add(classFile.getClassName());
233,497
Bug 233497 StringIndexOutOfBoundsException thrown in BcelWeaver
null
resolved fixed
93b7bed
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-05-22T18:26:18Z
2008-05-22T18:13:20Z
weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java
} } requestor.weaveCompleted(); CompilationAndWeavingContext.leavingPhase(atAspectJMungersOnly); return wovenClassNames; } requestor.processingReweavableState(); ContextToken reweaveToken = CompilationAndWeavingContext.enteringPhase(CompilationAndWeavingContext.PROCESSING_REWEAVABLE_STATE,""); prepareToProcessReweavableState(); for (Iterator i = input.getClassFileIterator(); i.hasNext(); ) { UnwovenClassFile classFile = (UnwovenClassFile)i.next(); String className = classFile.getClassName(); BcelObjectType classType = getClassType(className); if (classType !=null) { ContextToken tok = CompilationAndWeavingContext.enteringPhase(CompilationAndWeavingContext.PROCESSING_REWEAVABLE_STATE, className); processReweavableStateIfPresent(className, classType); CompilationAndWeavingContext.leavingPhase(tok); } } CompilationAndWeavingContext.leavingPhase(reweaveToken); ContextToken typeMungingToken = CompilationAndWeavingContext.enteringPhase(CompilationAndWeavingContext.PROCESSING_TYPE_MUNGERS,""); requestor.addingTypeMungers();
233,497
Bug 233497 StringIndexOutOfBoundsException thrown in BcelWeaver
null
resolved fixed
93b7bed
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-05-22T18:26:18Z
2008-05-22T18:13:20Z
weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java
List typesToProcess = new ArrayList(); for (Iterator iter = input.getClassFileIterator(); iter.hasNext();) { UnwovenClassFile clf = (UnwovenClassFile) iter.next(); typesToProcess.add(clf.getClassName()); } while (typesToProcess.size()>0) { weaveParentsFor(typesToProcess,(String)typesToProcess.get(0)); } for (Iterator i = input.getClassFileIterator(); i.hasNext(); ) { UnwovenClassFile classFile = (UnwovenClassFile)i.next(); String className = classFile.getClassName(); addNormalTypeMungers(className); } CompilationAndWeavingContext.leavingPhase(typeMungingToken); requestor.weavingAspects(); ContextToken aspectToken = CompilationAndWeavingContext.enteringPhase(CompilationAndWeavingContext.WEAVING_ASPECTS, ""); for (Iterator i = input.getClassFileIterator(); i.hasNext(); ) { UnwovenClassFile classFile = (UnwovenClassFile)i.next(); String className = classFile.getClassName(); ResolvedType theType = world.resolve(className); if (theType.isAspect()) { BcelObjectType classType = BcelWorld.getBcelObjectType(theType);
233,497
Bug 233497 StringIndexOutOfBoundsException thrown in BcelWeaver
null
resolved fixed
93b7bed
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-05-22T18:26:18Z
2008-05-22T18:13:20Z
weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java
if (classType==null) { ReferenceTypeDelegate theDelegate = ((ReferenceType)theType).getDelegate(); if (theDelegate.getClass().getName().endsWith("EclipseSourceType")) continue; throw new BCException("Can't find bcel delegate for "+className+" type="+theType.getClass()); } weaveAndNotify(classFile, classType,requestor); wovenClassNames.add(className); } } CompilationAndWeavingContext.leavingPhase(aspectToken); requestor.weavingClasses(); ContextToken classToken = CompilationAndWeavingContext.enteringPhase(CompilationAndWeavingContext.WEAVING_CLASSES, ""); for (Iterator i = input.getClassFileIterator(); i.hasNext(); ) { UnwovenClassFile classFile = (UnwovenClassFile)i.next(); String className = classFile.getClassName(); ResolvedType theType = world.resolve(className); if (!theType.isAspect()) { BcelObjectType classType = BcelWorld.getBcelObjectType(theType); if (classType==null) { ReferenceTypeDelegate theDelegate = ((ReferenceType)theType).getDelegate();
233,497
Bug 233497 StringIndexOutOfBoundsException thrown in BcelWeaver
null
resolved fixed
93b7bed
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-05-22T18:26:18Z
2008-05-22T18:13:20Z
weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java
if (theDelegate.getClass().getName().endsWith("EclipseSourceType")) continue; throw new BCException("Can't find bcel delegate for "+className+" type="+theType.getClass()); } weaveAndNotify(classFile, classType, requestor); wovenClassNames.add(className); } } CompilationAndWeavingContext.leavingPhase(classToken); addedClasses = new ArrayList(); deletedTypenames = new ArrayList(); requestor.weaveCompleted(); CompilationAndWeavingContext.leavingPhase(weaveToken); if (trace.isTraceEnabled()) trace.exit("weave",wovenClassNames); return wovenClassNames; } public void allWeavingComplete() { warnOnUnmatchedAdvice(); } /** * In 1.5 mode and with XLint:adviceDidNotMatch enabled, put out messages for any * mungers that did not match anything. */ private void warnOnUnmatchedAdvice() { class AdviceLocation {
233,497
Bug 233497 StringIndexOutOfBoundsException thrown in BcelWeaver
null
resolved fixed
93b7bed
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-05-22T18:26:18Z
2008-05-22T18:13:20Z
weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java
private int lineNo; private UnresolvedType inAspect; public AdviceLocation(BcelAdvice advice) { this.lineNo = advice.getSourceLocation().getLine(); this.inAspect = advice.getDeclaringAspect(); } public boolean equals(Object obj) { if (!(obj instanceof AdviceLocation)) return false; AdviceLocation other = (AdviceLocation) obj; if (this.lineNo != other.lineNo) return false; if (!this.inAspect.equals(other.inAspect)) return false; return true; } public int hashCode() { return 37 + 17*lineNo + 17*inAspect.hashCode(); }; } if (world.isInJava5Mode() && world.getLint().adviceDidNotMatch.isEnabled()) { List l = world.getCrosscuttingMembersSet().getShadowMungers(); Set alreadyWarnedLocations = new HashSet(); for (Iterator iter = l.iterator(); iter.hasNext();) {
233,497
Bug 233497 StringIndexOutOfBoundsException thrown in BcelWeaver
null
resolved fixed
93b7bed
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-05-22T18:26:18Z
2008-05-22T18:13:20Z
weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java
ShadowMunger element = (ShadowMunger) iter.next(); if (element instanceof BcelAdvice) { BcelAdvice ba = (BcelAdvice)element; if (!ba.hasMatchedSomething()) { if (ba.getSignature()!=null) { AdviceLocation loc = new AdviceLocation(ba); if (alreadyWarnedLocations.contains(loc)) { continue; } else { alreadyWarnedLocations.add(loc); } if (!(ba.getSignature() instanceof BcelMethod) || !Utility.isSuppressing((AnnotationX[])ba.getSignature().getAnnotations(),"adviceDidNotMatch")) { world.getLint().adviceDidNotMatch.signal(ba.getDeclaringAspect().toString(), new SourceLocation(element.getSourceLocation().getSourceFile(),element.getSourceLocation().getLine())); } } } } } } } /**
233,497
Bug 233497 StringIndexOutOfBoundsException thrown in BcelWeaver
null
resolved fixed
93b7bed
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-05-22T18:26:18Z
2008-05-22T18:13:20Z
weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java
* 'typeToWeave' is one from the 'typesForWeaving' list. This routine ensures we process * supertypes (classes/interfaces) of 'typeToWeave' that are in the * 'typesForWeaving' list before 'typeToWeave' itself. 'typesToWeave' is then removed from * the 'typesForWeaving' list. * * Note: Future gotcha in here ... when supplying partial hierarchies, this algorithm may * break down. If you have a hierarchy A>B>C and only give A and C to the weaver, it * may choose to weave them in either order - but you'll probably have other problems if * you are supplying partial hierarchies like that ! */ private void weaveParentsFor(List typesForWeaving,String typeToWeave) { ResolvedType rtx = world.resolve(typeToWeave); ResolvedType superType = rtx.getSuperclass(); if (superType!=null && typesForWeaving.contains(superType.getName())) { weaveParentsFor(typesForWeaving,superType.getName()); } ResolvedType[] interfaceTypes = rtx.getDeclaredInterfaces(); for (int i = 0; i < interfaceTypes.length; i++) { ResolvedType rtxI = interfaceTypes[i]; if (typesForWeaving.contains(rtxI.getName())) { weaveParentsFor(typesForWeaving,rtxI.getName()); } } ContextToken tok = CompilationAndWeavingContext.enteringPhase(CompilationAndWeavingContext.PROCESSING_DECLARE_PARENTS,rtx.getName()); weaveParentTypeMungers(rtx); CompilationAndWeavingContext.leavingPhase(tok);
233,497
Bug 233497 StringIndexOutOfBoundsException thrown in BcelWeaver
null
resolved fixed
93b7bed
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-05-22T18:26:18Z
2008-05-22T18:13:20Z
weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java
typesForWeaving.remove(typeToWeave); } public void prepareToProcessReweavableState() { } public void processReweavableStateIfPresent(String className, BcelObjectType classType) { WeaverStateInfo wsi = classType.getWeaverState(); if (wsi!=null && wsi.isReweavable()) { world.showMessage(IMessage.INFO, WeaverMessages.format(WeaverMessages.PROCESSING_REWEAVABLE,className,classType.getSourceLocation().getSourceFile()), null,null); Set aspectsPreviouslyInWorld = wsi.getAspectsAffectingType(); if (aspectsPreviouslyInWorld!=null) { Set alreadyConfirmedReweavableState = new HashSet(); for (Iterator iter = aspectsPreviouslyInWorld.iterator(); iter.hasNext();) { String requiredTypeName = (String) iter.next(); if (!alreadyConfirmedReweavableState.contains(requiredTypeName)) { ResolvedType rtx = world.resolve(UnresolvedType.forName(requiredTypeName),true); boolean exists = !rtx.isMissing(); if (!exists) { world.showMessage(IMessage.ERROR, WeaverMessages.format(WeaverMessages.MISSING_REWEAVABLE_TYPE,requiredTypeName,className), classType.getSourceLocation(), null); } else {
233,497
Bug 233497 StringIndexOutOfBoundsException thrown in BcelWeaver
null
resolved fixed
93b7bed
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-05-22T18:26:18Z
2008-05-22T18:13:20Z
weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java
if(!xcutSet.containsAspect(rtx)){ world.showMessage( IMessage.ERROR, WeaverMessages.format( WeaverMessages.REWEAVABLE_ASPECT_NOT_REGISTERED, requiredTypeName, className ), null, null ); } else if (!world.getMessageHandler().isIgnoring(IMessage.INFO)) world.showMessage(IMessage.INFO, WeaverMessages.format(WeaverMessages.VERIFIED_REWEAVABLE_TYPE,requiredTypeName,rtx.getSourceLocation().getSourceFile()), null,null); alreadyConfirmedReweavableState.add(requiredTypeName); } } } } old: classType.setJavaClass(Utility.makeJavaClass(classType.getJavaClass().getFileName(), wsi.getUnwovenClassFileData(classType.getJavaClass().getBytes()))); } } private void weaveAndNotify(UnwovenClassFile classFile, BcelObjectType classType, IWeaveRequestor requestor) throws IOException { trace.enter("weaveAndNotify",this,new Object[] {classFile,classType,requestor});
233,497
Bug 233497 StringIndexOutOfBoundsException thrown in BcelWeaver
null
resolved fixed
93b7bed
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-05-22T18:26:18Z
2008-05-22T18:13:20Z
weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java
ContextToken tok = CompilationAndWeavingContext.enteringPhase(CompilationAndWeavingContext.WEAVING_TYPE, classType.getResolvedTypeX().getName()); LazyClassGen clazz = weaveWithoutDump(classFile,classType); classType.finishedWith(); if (clazz != null) { UnwovenClassFile[] newClasses = getClassFilesFor(clazz); if (newClasses[0].getClassName().equals(classFile.getClassName())) { newClasses[0].setClassNameAsChars(classFile.getClassNameAsChars()); } for (int i = 0; i < newClasses.length; i++) { requestor.acceptResult(newClasses[i]); } } else { requestor.acceptResult(classFile); } classType.weavingCompleted(); CompilationAndWeavingContext.leavingPhase(tok); trace.exit("weaveAndNotify"); } public BcelObjectType getClassType(String forClass) { return BcelWorld.getBcelObjectType(world.resolve(forClass)); } public void addParentTypeMungers(String typeName) {
233,497
Bug 233497 StringIndexOutOfBoundsException thrown in BcelWeaver
null
resolved fixed
93b7bed
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-05-22T18:26:18Z
2008-05-22T18:13:20Z
weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java
weaveParentTypeMungers(world.resolve(typeName)); } public void addNormalTypeMungers(String typeName) { weaveNormalTypeMungers(world.resolve(typeName)); } public UnwovenClassFile[] getClassFilesFor(LazyClassGen clazz) { List childClasses = clazz.getChildClasses(world); UnwovenClassFile[] ret = new UnwovenClassFile[1 + childClasses.size()]; ret[0] = new UnwovenClassFile(clazz.getFileName(),clazz.getJavaClassBytesIncludingReweavable(world)); int index = 1; for (Iterator iter = childClasses.iterator(); iter.hasNext();) { UnwovenClassFile.ChildClass element = (UnwovenClassFile.ChildClass) iter.next(); UnwovenClassFile childClass = new UnwovenClassFile(clazz.getFileName() + "$" + element.name, element.bytes); ret[index++] = childClass; } return ret; } /** * Weaves new parents and annotations onto a type ("declare parents" and "declare @type") * * Algorithm: * 1. First pass, do parents then do annotations. During this pass record: * - any parent mungers that don't match but have a non-wild annotation type pattern * - any annotation mungers that don't match * 2. Multiple subsequent passes which go over the munger lists constructed in the first * pass, repeatedly applying them until nothing changes. * FIXME asc confirm that algorithm is optimal ?? */
233,497
Bug 233497 StringIndexOutOfBoundsException thrown in BcelWeaver
null
resolved fixed
93b7bed
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-05-22T18:26:18Z
2008-05-22T18:13:20Z
weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java
public void weaveParentTypeMungers(ResolvedType onType) { if (onType.isRawType()) onType = onType.getGenericType(); onType.clearInterTypeMungers(); List decpToRepeat = new ArrayList(); boolean aParentChangeOccurred = false; boolean anAnnotationChangeOccurred = false; for (Iterator i = declareParentsList.iterator(); i.hasNext(); ) { DeclareParents decp = (DeclareParents)i.next(); boolean typeChanged = applyDeclareParents(decp,onType); if (typeChanged) { aParentChangeOccurred = true; } else { decpToRepeat.add(decp); } } for (Iterator i = xcutSet.getDeclareAnnotationOnTypes().iterator();i.hasNext();) { DeclareAnnotation decA = (DeclareAnnotation)i.next(); boolean typeChanged = applyDeclareAtType(decA,onType,true); if (typeChanged) { anAnnotationChangeOccurred = true; } } while ((aParentChangeOccurred || anAnnotationChangeOccurred) && !decpToRepeat.isEmpty()) { anAnnotationChangeOccurred = aParentChangeOccurred = false; List decpToRepeatNextTime = new ArrayList(); for (Iterator iter = decpToRepeat.iterator(); iter.hasNext();) {
233,497
Bug 233497 StringIndexOutOfBoundsException thrown in BcelWeaver
null
resolved fixed
93b7bed
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-05-22T18:26:18Z
2008-05-22T18:13:20Z
weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java
DeclareParents decp = (DeclareParents) iter.next(); boolean typeChanged = applyDeclareParents(decp,onType); if (typeChanged) { aParentChangeOccurred = true; } else { decpToRepeatNextTime.add(decp); } } for (Iterator iter = xcutSet.getDeclareAnnotationOnTypes().iterator(); iter.hasNext();) { DeclareAnnotation decA = (DeclareAnnotation) iter.next(); boolean typeChanged = applyDeclareAtType(decA,onType,false); if (typeChanged) { anAnnotationChangeOccurred = true; } } decpToRepeat = decpToRepeatNextTime; } } /** * Apply a declare @type - return true if we change the type */ private boolean applyDeclareAtType(DeclareAnnotation decA, ResolvedType onType,boolean reportProblems) { boolean didSomething = false; if (decA.matches(onType)) { if (onType.hasAnnotation(decA.getAnnotationX().getSignature())) { return false;
233,497
Bug 233497 StringIndexOutOfBoundsException thrown in BcelWeaver
null
resolved fixed
93b7bed
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-05-22T18:26:18Z
2008-05-22T18:13:20Z
weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java
} AnnotationX annoX = decA.getAnnotationX(); boolean problemReported = verifyTargetIsOK(decA, onType, annoX,reportProblems); if (!problemReported) { AsmRelationshipProvider.getDefault().addDeclareAnnotationRelationship(decA.getSourceLocation(),onType.getSourceLocation()); if (!getWorld().getMessageHandler().isIgnoring(IMessage.WEAVEINFO)){ getWorld().getMessageHandler().handleMessage( WeaveMessage.constructWeavingMessage(WeaveMessage.WEAVEMESSAGE_ANNOTATES, new String[]{ onType.toString(), Utility.beautifyLocation(onType.getSourceLocation()), decA.getAnnotationString(), "type", decA.getAspect().toString(), Utility.beautifyLocation(decA.getSourceLocation()) })); } didSomething = true; ResolvedTypeMunger newAnnotationTM = new AnnotationOnTypeMunger(annoX); newAnnotationTM.setSourceLocation(decA.getSourceLocation()); onType.addInterTypeMunger(new BcelTypeMunger(newAnnotationTM,decA.getAspect().resolve(world))); decA.copyAnnotationTo(onType); } } return didSomething; }
233,497
Bug 233497 StringIndexOutOfBoundsException thrown in BcelWeaver
null
resolved fixed
93b7bed
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-05-22T18:26:18Z
2008-05-22T18:13:20Z
weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java
/** * Checks for an @target() on the annotation and if found ensures it allows the annotation * to be attached to the target type that matched. */ private boolean verifyTargetIsOK(DeclareAnnotation decA, ResolvedType onType, AnnotationX annoX,boolean outputProblems) { boolean problemReported = false; if (annoX.specifiesTarget()) { if ( (onType.isAnnotation() && !annoX.allowedOnAnnotationType()) || (!annoX.allowedOnRegularType())) { if (outputProblems) { if (decA.isExactPattern()) { world.getMessageHandler().handleMessage(MessageUtil.error( WeaverMessages.format(WeaverMessages.INCORRECT_TARGET_FOR_DECLARE_ANNOTATION, onType.getName(),annoX.stringify(),annoX.getValidTargets()),decA.getSourceLocation())); } else { if (world.getLint().invalidTargetForAnnotation.isEnabled()) { world.getLint().invalidTargetForAnnotation.signal( new String[]{onType.getName(),annoX.stringify(),annoX.getValidTargets()},decA.getSourceLocation(),new ISourceLocation[]{onType.getSourceLocation()}); } } } problemReported = true; } } return problemReported; } /** * Apply a single declare parents - return true if we change the type */
233,497
Bug 233497 StringIndexOutOfBoundsException thrown in BcelWeaver
null
resolved fixed
93b7bed
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-05-22T18:26:18Z
2008-05-22T18:13:20Z
weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java
private boolean applyDeclareParents(DeclareParents p, ResolvedType onType) { boolean didSomething = false; List newParents = p.findMatchingNewParents(onType,true); if (!newParents.isEmpty()) { didSomething=true; BcelObjectType classType = BcelWorld.getBcelObjectType(onType); for (Iterator j = newParents.iterator(); j.hasNext(); ) { ResolvedType newParent = (ResolvedType)j.next(); classType.addParent(newParent); ResolvedTypeMunger newParentMunger = new NewParentTypeMunger(newParent); newParentMunger.setSourceLocation(p.getSourceLocation()); onType.addInterTypeMunger(new BcelTypeMunger(newParentMunger, xcutSet.findAspectDeclaringParents(p))); } } return didSomething; } public void weaveNormalTypeMungers(ResolvedType onType) { ContextToken tok = CompilationAndWeavingContext.enteringPhase(CompilationAndWeavingContext.PROCESSING_TYPE_MUNGERS, onType.getName()); if (onType.isRawType() || onType.isParameterizedType()) onType = onType.getGenericType(); for (Iterator i = typeMungerList.iterator(); i.hasNext(); ) { ConcreteTypeMunger m = (ConcreteTypeMunger)i.next(); if (!m.isLateMunger() && m.matches(onType)) { onType.addInterTypeMunger(m); }
233,497
Bug 233497 StringIndexOutOfBoundsException thrown in BcelWeaver
null
resolved fixed
93b7bed
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-05-22T18:26:18Z
2008-05-22T18:13:20Z
weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java
} CompilationAndWeavingContext.leavingPhase(tok); } public LazyClassGen weaveWithoutDump(UnwovenClassFile classFile, BcelObjectType classType) throws IOException { return weave(classFile, classType, false); } LazyClassGen weave(UnwovenClassFile classFile, BcelObjectType classType) throws IOException { LazyClassGen ret = weave(classFile, classType, true); if (progressListener != null) { progressMade += progressPerClassFile; progressListener.setProgress(progressMade); progressListener.setText("woven: " + classFile.getFilename()); } return ret; } private LazyClassGen weave(UnwovenClassFile classFile, BcelObjectType classType, boolean dump) throws IOException { if (classType.isSynthetic()) { if (dump) dumpUnchanged(classFile); return null; } List shadowMungers = fastMatch(shadowMungerList, classType.getResolvedTypeX()); List typeMungers = classType.getResolvedTypeX().getInterTypeMungers(); classType.getResolvedTypeX().checkInterTypeMungers();
233,497
Bug 233497 StringIndexOutOfBoundsException thrown in BcelWeaver
null
resolved fixed
93b7bed
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-05-22T18:26:18Z
2008-05-22T18:13:20Z
weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java
boolean mightNeedToWeave = shadowMungers.size() > 0 || typeMungers.size() > 0 || classType.isAspect() || world.getDeclareAnnotationOnMethods().size()>0 || world.getDeclareAnnotationOnFields().size()>0; boolean mightNeedBridgeMethods = world.isInJava5Mode() && !classType.isInterface() && classType.getResolvedTypeX().getInterTypeMungersIncludingSupers().size()>0; LazyClassGen clazz = null; if (mightNeedToWeave || mightNeedBridgeMethods) { clazz = classType.getLazyClassGen(); try { boolean isChanged = false; if (mightNeedToWeave) isChanged = BcelClassWeaver.weave(world, clazz, shadowMungers, typeMungers, lateTypeMungerList); if (mightNeedBridgeMethods) isChanged = BcelClassWeaver.calculateAnyRequiredBridgeMethods(world,clazz) || isChanged; if (isChanged) { if (dump) dump(classFile, clazz); return clazz; } } catch (RuntimeException re) { String classDebugInfo = null; try {
233,497
Bug 233497 StringIndexOutOfBoundsException thrown in BcelWeaver
null
resolved fixed
93b7bed
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-05-22T18:26:18Z
2008-05-22T18:13:20Z
weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java
classDebugInfo = clazz.toLongString(); } catch (Exception e) { classDebugInfo = clazz.getClassName(); } String messageText = "trouble in: \n" + classDebugInfo; getWorld().getMessageHandler().handleMessage( new Message(messageText,IMessage.ABORT,re,null) ); } catch (Error re) { String classDebugInfo = null; try { classDebugInfo = clazz.toLongString(); } catch (Exception e) { classDebugInfo = clazz.getClassName(); } String messageText = "trouble in: \n" + classDebugInfo; getWorld().getMessageHandler().handleMessage( new Message(messageText,IMessage.ABORT,re,null) ); } } if (dump) { dumpUnchanged(classFile); return clazz; } else {
233,497
Bug 233497 StringIndexOutOfBoundsException thrown in BcelWeaver
null
resolved fixed
93b7bed
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-05-22T18:26:18Z
2008-05-22T18:13:20Z
weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java
if (clazz != null && !clazz.getChildClasses(world).isEmpty()) { return clazz; } return null; } } private void dumpUnchanged(UnwovenClassFile classFile) throws IOException { if (zipOutputStream != null) { writeZipEntry(getEntryName(classFile.getJavaClass().getClassName()), classFile.getBytes()); } else { classFile.writeUnchangedBytes(); } } private String getEntryName(String className) { return className.replace('.', '/') + ".class"; } private void dump(UnwovenClassFile classFile, LazyClassGen clazz) throws IOException { if (zipOutputStream != null) { String mainClassName = classFile.getJavaClass().getClassName(); writeZipEntry(getEntryName(mainClassName), clazz.getJavaClass(world).getBytes()); if (!clazz.getChildClasses(world).isEmpty()) { for (Iterator i = clazz.getChildClasses(world).iterator(); i.hasNext();) { UnwovenClassFile.ChildClass c = (UnwovenClassFile.ChildClass) i.next(); writeZipEntry(getEntryName(mainClassName + "$" + c.name), c.bytes); }
233,497
Bug 233497 StringIndexOutOfBoundsException thrown in BcelWeaver
null
resolved fixed
93b7bed
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-05-22T18:26:18Z
2008-05-22T18:13:20Z
weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java
} } else { classFile.writeWovenBytes( clazz.getJavaClass(world).getBytes(), clazz.getChildClasses(world) ); } } private void writeZipEntry(String name, byte[] bytes) throws IOException { ZipEntry newEntry = new ZipEntry(name); zipOutputStream.putNextEntry(newEntry); zipOutputStream.write(bytes); zipOutputStream.closeEntry(); } private List fastMatch(List list, ResolvedType type) { if (list == null) return Collections.EMPTY_LIST; FastMatchInfo info = new FastMatchInfo(type, null); List result = new ArrayList(); Iterator iter = list.iterator(); while (iter.hasNext()) { ShadowMunger munger = (ShadowMunger)iter.next(); FuzzyBoolean fb = munger.getPointcut().fastMatch(info); if (fb.maybeTrue()) { result.add(munger); } }
233,497
Bug 233497 StringIndexOutOfBoundsException thrown in BcelWeaver
null
resolved fixed
93b7bed
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-05-22T18:26:18Z
2008-05-22T18:13:20Z
weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java
return result; } public void setProgressListener(IProgressListener listener, double previousProgress, double progressPerClassFile) { progressListener = listener; this.progressMade = previousProgress; this.progressPerClassFile = progressPerClassFile; } public void setReweavableMode(boolean xNotReweavable) { if (trace.isTraceEnabled()) trace.enter("setReweavableMode",this,xNotReweavable); inReweavableMode = !xNotReweavable; WeaverStateInfo.setReweavableModeDefaults(!xNotReweavable,false,true); BcelClassWeaver.setReweavableMode(!xNotReweavable); if (trace.isTraceEnabled()) trace.exit("setReweavableMode"); } public boolean isReweavable() { return inReweavableMode; } public World getWorld() { return world; } public void tidyUp() { if (trace.isTraceEnabled()) trace.enter("tidyUp",this); shadowMungerList = null; typeMungerList = null; lateTypeMungerList = null; declareParentsList = null; if (trace.isTraceEnabled()) trace.exit("tidyUp"); } }
227,295
Bug 227295 AJC error, somehow connected with generics
Build ID: 1.5.0.20070607 Steps To Reproduce: I cannot find a way to reproduce it, it's somehow "randomic", for example it happened to me now while creating a new class in an aspectj project, but when i then saved the .java it compiled properly. That's why I'm filing it in AJDT and not in AspectJ directly. Based on the exception, IIUC, there is a narrowing in a generic (UnresolvedType should be something like Converter<?>, while BoundedReferenceType should be somethinf like Converter<? extends Number>), and the weaver is not handling it properly, but simply casting from one to the other .. but this are just silly assumptions. More information: java.lang.ClassCastException at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding1(EclipseFactory.java:656) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding(EclipseFactory.java:579) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding1(EclipseFactory.java:640) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding(EclipseFactory.java:579) at org.asp ... Worker.java:55) Compile error: ClassCastException thrown: org.aspectj.weaver.UnresolvedType cannot be cast to org.aspectj.weaver.BoundedReferenceType
resolved fixed
3b2109a
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-06-06T20:38:14Z
2008-04-16T10:00:00Z
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java
/* ******************************************************************* * Copyright (c) 2002 Palo Alto Research Center, Incorporated (PARC). * All rights reserved. * This program and the accompanying materials are made available * under the terms of the Eclipse Public License v1.0 * which accompanies this distribution and is available at * http:www.eclipse.org/legal/epl-v10.html * * Contributors: * PARC initial implementation * Mik Kersten 2004-07-26 extended to allow overloading of * hierarchy builder * ******************************************************************/ package org.aspectj.ajdt.internal.compiler.lookup; import java.lang.reflect.Modifier; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; import org.aspectj.ajdt.internal.compiler.ast.AspectDeclaration; import org.aspectj.ajdt.internal.compiler.ast.AstUtil;
227,295
Bug 227295 AJC error, somehow connected with generics
Build ID: 1.5.0.20070607 Steps To Reproduce: I cannot find a way to reproduce it, it's somehow "randomic", for example it happened to me now while creating a new class in an aspectj project, but when i then saved the .java it compiled properly. That's why I'm filing it in AJDT and not in AspectJ directly. Based on the exception, IIUC, there is a narrowing in a generic (UnresolvedType should be something like Converter<?>, while BoundedReferenceType should be somethinf like Converter<? extends Number>), and the weaver is not handling it properly, but simply casting from one to the other .. but this are just silly assumptions. More information: java.lang.ClassCastException at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding1(EclipseFactory.java:656) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding(EclipseFactory.java:579) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding1(EclipseFactory.java:640) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding(EclipseFactory.java:579) at org.asp ... Worker.java:55) Compile error: ClassCastException thrown: org.aspectj.weaver.UnresolvedType cannot be cast to org.aspectj.weaver.BoundedReferenceType
resolved fixed
3b2109a
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-06-06T20:38:14Z
2008-04-16T10:00:00Z
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java
import org.aspectj.ajdt.internal.core.builder.AjBuildManager; import org.aspectj.bridge.ISourceLocation; import org.aspectj.bridge.IMessage.Kind; import org.aspectj.org.eclipse.jdt.core.Flags; import org.aspectj.org.eclipse.jdt.core.compiler.CharOperation; import org.aspectj.org.eclipse.jdt.internal.compiler.ast.ASTNode; import org.aspectj.org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration; import org.aspectj.org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration; import org.aspectj.org.eclipse.jdt.internal.compiler.ast.EmptyStatement; import org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeDeclaration; import org.aspectj.org.eclipse.jdt.internal.compiler.ast.Wildcard; import org.aspectj.org.eclipse.jdt.internal.compiler.impl.Constant; import org.aspectj.org.eclipse.jdt.internal.compiler.impl.ReferenceContext; import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ArrayBinding; 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.LocalTypeBinding; import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment; import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodBinding; import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ParameterizedTypeBinding; import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.RawTypeBinding; import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding; import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.Scope; import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding; import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.SyntheticFieldBinding; import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeBinding; import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeVariableBinding; import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.WildcardBinding; import org.aspectj.weaver.BoundedReferenceType; import org.aspectj.weaver.ConcreteTypeMunger;
227,295
Bug 227295 AJC error, somehow connected with generics
Build ID: 1.5.0.20070607 Steps To Reproduce: I cannot find a way to reproduce it, it's somehow "randomic", for example it happened to me now while creating a new class in an aspectj project, but when i then saved the .java it compiled properly. That's why I'm filing it in AJDT and not in AspectJ directly. Based on the exception, IIUC, there is a narrowing in a generic (UnresolvedType should be something like Converter<?>, while BoundedReferenceType should be somethinf like Converter<? extends Number>), and the weaver is not handling it properly, but simply casting from one to the other .. but this are just silly assumptions. More information: java.lang.ClassCastException at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding1(EclipseFactory.java:656) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding(EclipseFactory.java:579) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding1(EclipseFactory.java:640) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding(EclipseFactory.java:579) at org.asp ... Worker.java:55) Compile error: ClassCastException thrown: org.aspectj.weaver.UnresolvedType cannot be cast to org.aspectj.weaver.BoundedReferenceType
resolved fixed
3b2109a
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-06-06T20:38:14Z
2008-04-16T10:00:00Z
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java
import org.aspectj.weaver.IHasPosition; import org.aspectj.weaver.Member; import org.aspectj.weaver.MemberKind; import org.aspectj.weaver.NameMangler; import org.aspectj.weaver.NewFieldTypeMunger; import org.aspectj.weaver.NewMethodTypeMunger; import org.aspectj.weaver.ReferenceType; import org.aspectj.weaver.ResolvedMember; import org.aspectj.weaver.ResolvedMemberImpl; import org.aspectj.weaver.ResolvedType; import org.aspectj.weaver.Shadow; import org.aspectj.weaver.TypeFactory; import org.aspectj.weaver.TypeVariable; import org.aspectj.weaver.TypeVariableDeclaringElement; import org.aspectj.weaver.TypeVariableReference; import org.aspectj.weaver.UnresolvedType; import org.aspectj.weaver.UnresolvedTypeVariableReferenceType; import org.aspectj.weaver.WildcardedUnresolvedType; import org.aspectj.weaver.World; import org.aspectj.weaver.UnresolvedType.TypeKind; /** * @author Jim Hugunin */ public class EclipseFactory { public static boolean DEBUG = false; public static int debug_mungerCount = -1; private AjBuildManager buildManager; private LookupEnvironment lookupEnvironment;
227,295
Bug 227295 AJC error, somehow connected with generics
Build ID: 1.5.0.20070607 Steps To Reproduce: I cannot find a way to reproduce it, it's somehow "randomic", for example it happened to me now while creating a new class in an aspectj project, but when i then saved the .java it compiled properly. That's why I'm filing it in AJDT and not in AspectJ directly. Based on the exception, IIUC, there is a narrowing in a generic (UnresolvedType should be something like Converter<?>, while BoundedReferenceType should be somethinf like Converter<? extends Number>), and the weaver is not handling it properly, but simply casting from one to the other .. but this are just silly assumptions. More information: java.lang.ClassCastException at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding1(EclipseFactory.java:656) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding(EclipseFactory.java:579) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding1(EclipseFactory.java:640) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding(EclipseFactory.java:579) at org.asp ... Worker.java:55) Compile error: ClassCastException thrown: org.aspectj.weaver.UnresolvedType cannot be cast to org.aspectj.weaver.BoundedReferenceType
resolved fixed
3b2109a
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-06-06T20:38:14Z
2008-04-16T10:00:00Z
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java
private boolean xSerializableAspects; private World world; public Collection finishedTypeMungers = null; private Map typexToBinding = new HashMap(); private Map rawTypeXToBinding = new HashMap(); public static EclipseFactory fromLookupEnvironment(LookupEnvironment env) { AjLookupEnvironment aenv = (AjLookupEnvironment)env; return aenv.factory; } public static EclipseFactory fromScopeLookupEnvironment(Scope scope) { return fromLookupEnvironment(AstUtil.getCompilationUnitScope(scope).environment); } public EclipseFactory(LookupEnvironment lookupEnvironment,AjBuildManager buildManager) { this.lookupEnvironment = lookupEnvironment; this.buildManager = buildManager; this.world = buildManager.getWorld(); this.xSerializableAspects = buildManager.buildConfig.isXserializableAspects(); } public EclipseFactory(LookupEnvironment lookupEnvironment, World world, boolean xSer) { this.lookupEnvironment = lookupEnvironment; this.world = world;
227,295
Bug 227295 AJC error, somehow connected with generics
Build ID: 1.5.0.20070607 Steps To Reproduce: I cannot find a way to reproduce it, it's somehow "randomic", for example it happened to me now while creating a new class in an aspectj project, but when i then saved the .java it compiled properly. That's why I'm filing it in AJDT and not in AspectJ directly. Based on the exception, IIUC, there is a narrowing in a generic (UnresolvedType should be something like Converter<?>, while BoundedReferenceType should be somethinf like Converter<? extends Number>), and the weaver is not handling it properly, but simply casting from one to the other .. but this are just silly assumptions. More information: java.lang.ClassCastException at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding1(EclipseFactory.java:656) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding(EclipseFactory.java:579) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding1(EclipseFactory.java:640) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding(EclipseFactory.java:579) at org.asp ... Worker.java:55) Compile error: ClassCastException thrown: org.aspectj.weaver.UnresolvedType cannot be cast to org.aspectj.weaver.BoundedReferenceType
resolved fixed
3b2109a
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-06-06T20:38:14Z
2008-04-16T10:00:00Z
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java
this.xSerializableAspects = xSer; this.buildManager = null; } public World getWorld() { return world; } public void showMessage( Kind kind, String message, ISourceLocation loc1, ISourceLocation loc2) { getWorld().showMessage(kind, message, loc1, loc2); } public ResolvedType fromEclipse(ReferenceBinding binding) { if (binding == null) return ResolvedType.MISSING; ResolvedType ret = getWorld().resolve(fromBinding(binding)); return ret; } public ResolvedType fromTypeBindingToRTX(TypeBinding tb) { if (tb == null) return ResolvedType.MISSING; ResolvedType ret = getWorld().resolve(fromBinding(tb)); return ret; }
227,295
Bug 227295 AJC error, somehow connected with generics
Build ID: 1.5.0.20070607 Steps To Reproduce: I cannot find a way to reproduce it, it's somehow "randomic", for example it happened to me now while creating a new class in an aspectj project, but when i then saved the .java it compiled properly. That's why I'm filing it in AJDT and not in AspectJ directly. Based on the exception, IIUC, there is a narrowing in a generic (UnresolvedType should be something like Converter<?>, while BoundedReferenceType should be somethinf like Converter<? extends Number>), and the weaver is not handling it properly, but simply casting from one to the other .. but this are just silly assumptions. More information: java.lang.ClassCastException at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding1(EclipseFactory.java:656) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding(EclipseFactory.java:579) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding1(EclipseFactory.java:640) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding(EclipseFactory.java:579) at org.asp ... Worker.java:55) Compile error: ClassCastException thrown: org.aspectj.weaver.UnresolvedType cannot be cast to org.aspectj.weaver.BoundedReferenceType
resolved fixed
3b2109a
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-06-06T20:38:14Z
2008-04-16T10:00:00Z
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java
public ResolvedType[] fromEclipse(ReferenceBinding[] bindings) { if (bindings == null) { return ResolvedType.NONE; } int len = bindings.length; ResolvedType[] ret = new ResolvedType[len]; for (int i=0; i < len; i++) { ret[i] = fromEclipse(bindings[i]); } return ret; } public static String getName(TypeBinding binding) { if (binding instanceof TypeVariableBinding) { TypeVariableBinding tvb = (TypeVariableBinding)binding; if (tvb.firstBound!=null) { return getName(tvb.firstBound); } else { return getName(tvb.superclass); } } if (binding instanceof ReferenceBinding) { return new String( CharOperation.concatWith(((ReferenceBinding)binding).compoundName, '.')); } String packageName = new String(binding.qualifiedPackageName());
227,295
Bug 227295 AJC error, somehow connected with generics
Build ID: 1.5.0.20070607 Steps To Reproduce: I cannot find a way to reproduce it, it's somehow "randomic", for example it happened to me now while creating a new class in an aspectj project, but when i then saved the .java it compiled properly. That's why I'm filing it in AJDT and not in AspectJ directly. Based on the exception, IIUC, there is a narrowing in a generic (UnresolvedType should be something like Converter<?>, while BoundedReferenceType should be somethinf like Converter<? extends Number>), and the weaver is not handling it properly, but simply casting from one to the other .. but this are just silly assumptions. More information: java.lang.ClassCastException at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding1(EclipseFactory.java:656) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding(EclipseFactory.java:579) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding1(EclipseFactory.java:640) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding(EclipseFactory.java:579) at org.asp ... Worker.java:55) Compile error: ClassCastException thrown: org.aspectj.weaver.UnresolvedType cannot be cast to org.aspectj.weaver.BoundedReferenceType
resolved fixed
3b2109a
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-06-06T20:38:14Z
2008-04-16T10:00:00Z
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java
String className = new String(binding.qualifiedSourceName()).replace('.', '$'); if (packageName.length() > 0) { className = packageName + "." + className; } return new String(className); } /** * Some generics notes: * * Andy 6-May-05 * We were having trouble with parameterized types in a couple of places - due to TypeVariableBindings. When we * see a TypeVariableBinding now we default to either the firstBound if it is specified or java.lang.Object. Not * sure when/if this gets us unstuck? It does mean we forget that it is a type variable when going back * the other way from the UnresolvedType and that would seem a bad thing - but I've yet to see the reason we need to * remember the type variable. * Adrian 10-July-05 * When we forget it's a type variable we come unstuck when getting the declared members of a parameterized * type - since we don't know it's a type variable we can't replace it with the type parameter. */ public UnresolvedType fromBinding(TypeBinding binding) { if (binding instanceof HelperInterfaceBinding) { return ((HelperInterfaceBinding) binding).getTypeX(); } if (binding == null || binding.qualifiedSourceName() == null) { return ResolvedType.MISSING; } if (binding instanceof TypeVariableBinding) {
227,295
Bug 227295 AJC error, somehow connected with generics
Build ID: 1.5.0.20070607 Steps To Reproduce: I cannot find a way to reproduce it, it's somehow "randomic", for example it happened to me now while creating a new class in an aspectj project, but when i then saved the .java it compiled properly. That's why I'm filing it in AJDT and not in AspectJ directly. Based on the exception, IIUC, there is a narrowing in a generic (UnresolvedType should be something like Converter<?>, while BoundedReferenceType should be somethinf like Converter<? extends Number>), and the weaver is not handling it properly, but simply casting from one to the other .. but this are just silly assumptions. More information: java.lang.ClassCastException at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding1(EclipseFactory.java:656) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding(EclipseFactory.java:579) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding1(EclipseFactory.java:640) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding(EclipseFactory.java:579) at org.asp ... Worker.java:55) Compile error: ClassCastException thrown: org.aspectj.weaver.UnresolvedType cannot be cast to org.aspectj.weaver.BoundedReferenceType
resolved fixed
3b2109a
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-06-06T20:38:14Z
2008-04-16T10:00:00Z
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java
TypeVariableBinding tb = (TypeVariableBinding) binding; UnresolvedTypeVariableReferenceType utvrt = (UnresolvedTypeVariableReferenceType) fromTypeVariableBinding(tb); return utvrt; } if (binding instanceof ArrayBinding) { ArrayBinding aBinding = (ArrayBinding) binding; UnresolvedType componentType = fromBinding(aBinding.leafComponentType); return UnresolvedType.makeArray(componentType, aBinding.dimensions); } if (binding instanceof WildcardBinding) { WildcardBinding eWB = (WildcardBinding) binding; UnresolvedType theBound = null; if (eWB.bound instanceof TypeVariableBinding) { theBound = fromTypeVariableBinding((TypeVariableBinding)eWB.bound); } else { theBound = fromBinding(eWB.bound); } WildcardedUnresolvedType theType = (WildcardedUnresolvedType) TypeFactory.createTypeFromSignature(CharOperation.charToString(eWB.genericTypeSignature()));
227,295
Bug 227295 AJC error, somehow connected with generics
Build ID: 1.5.0.20070607 Steps To Reproduce: I cannot find a way to reproduce it, it's somehow "randomic", for example it happened to me now while creating a new class in an aspectj project, but when i then saved the .java it compiled properly. That's why I'm filing it in AJDT and not in AspectJ directly. Based on the exception, IIUC, there is a narrowing in a generic (UnresolvedType should be something like Converter<?>, while BoundedReferenceType should be somethinf like Converter<? extends Number>), and the weaver is not handling it properly, but simply casting from one to the other .. but this are just silly assumptions. More information: java.lang.ClassCastException at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding1(EclipseFactory.java:656) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding(EclipseFactory.java:579) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding1(EclipseFactory.java:640) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding(EclipseFactory.java:579) at org.asp ... Worker.java:55) Compile error: ClassCastException thrown: org.aspectj.weaver.UnresolvedType cannot be cast to org.aspectj.weaver.BoundedReferenceType
resolved fixed
3b2109a
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-06-06T20:38:14Z
2008-04-16T10:00:00Z
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java
return theType; } if (binding instanceof ParameterizedTypeBinding) { if (binding instanceof RawTypeBinding) { return UnresolvedType.forRawTypeName(getName(binding)); } ParameterizedTypeBinding ptb = (ParameterizedTypeBinding) binding; UnresolvedType[] arguments = null; if (ptb.arguments!=null) { arguments = new UnresolvedType[ptb.arguments.length]; for (int i = 0; i < arguments.length; i++) { arguments[i] = fromBinding(ptb.arguments[i]); } } String baseTypeSignature = null; ResolvedType baseType = getWorld().resolve(UnresolvedType.forName(getName(binding)),true); if (!baseType.isMissing()) { baseTypeSignature = baseType.getErasureSignature(); } else { baseTypeSignature = UnresolvedType.forName(getName(binding)).getSignature(); }
227,295
Bug 227295 AJC error, somehow connected with generics
Build ID: 1.5.0.20070607 Steps To Reproduce: I cannot find a way to reproduce it, it's somehow "randomic", for example it happened to me now while creating a new class in an aspectj project, but when i then saved the .java it compiled properly. That's why I'm filing it in AJDT and not in AspectJ directly. Based on the exception, IIUC, there is a narrowing in a generic (UnresolvedType should be something like Converter<?>, while BoundedReferenceType should be somethinf like Converter<? extends Number>), and the weaver is not handling it properly, but simply casting from one to the other .. but this are just silly assumptions. More information: java.lang.ClassCastException at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding1(EclipseFactory.java:656) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding(EclipseFactory.java:579) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding1(EclipseFactory.java:640) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding(EclipseFactory.java:579) at org.asp ... Worker.java:55) Compile error: ClassCastException thrown: org.aspectj.weaver.UnresolvedType cannot be cast to org.aspectj.weaver.BoundedReferenceType
resolved fixed
3b2109a
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-06-06T20:38:14Z
2008-04-16T10:00:00Z
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java
if (arguments==null) arguments=new UnresolvedType[0]; String parameterizedSig = ResolvedType.PARAMETERIZED_TYPE_IDENTIFIER+CharOperation.charToString(binding.genericTypeSignature()).substring(1); return TypeFactory.createUnresolvedParameterizedType(parameterizedSig,baseTypeSignature,arguments); } if (binding.isGenericType() && !binding.isParameterizedType() && !binding.isRawType()) { TypeVariableBinding[] tvbs = binding.typeVariables(); TypeVariable[] tVars = new TypeVariable[tvbs.length]; for (int i = 0; i < tvbs.length; i++) { TypeVariableBinding eclipseV = tvbs[i]; tVars[i] = ((TypeVariableReference)fromTypeVariableBinding(eclipseV)).getTypeVariable(); } if (!(binding instanceof SourceTypeBinding)) throw new RuntimeException("Cant get the generic sig for "+binding.debugName()); return UnresolvedType.forGenericType(getName(binding),tVars, CharOperation.charToString(((SourceTypeBinding)binding).genericSignature())); }
227,295
Bug 227295 AJC error, somehow connected with generics
Build ID: 1.5.0.20070607 Steps To Reproduce: I cannot find a way to reproduce it, it's somehow "randomic", for example it happened to me now while creating a new class in an aspectj project, but when i then saved the .java it compiled properly. That's why I'm filing it in AJDT and not in AspectJ directly. Based on the exception, IIUC, there is a narrowing in a generic (UnresolvedType should be something like Converter<?>, while BoundedReferenceType should be somethinf like Converter<? extends Number>), and the weaver is not handling it properly, but simply casting from one to the other .. but this are just silly assumptions. More information: java.lang.ClassCastException at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding1(EclipseFactory.java:656) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding(EclipseFactory.java:579) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding1(EclipseFactory.java:640) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding(EclipseFactory.java:579) at org.asp ... Worker.java:55) Compile error: ClassCastException thrown: org.aspectj.weaver.UnresolvedType cannot be cast to org.aspectj.weaver.BoundedReferenceType
resolved fixed
3b2109a
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-06-06T20:38:14Z
2008-04-16T10:00:00Z
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java
if (binding instanceof LocalTypeBinding) { LocalTypeBinding ltb = (LocalTypeBinding) binding; if (ltb.constantPoolName() != null && ltb.constantPoolName().length > 0) { return UnresolvedType.forSignature(new String(binding.signature())); } else { return UnresolvedType.forSignature(new String(ltb.enclosingType.signature())); } } return UnresolvedType.forName(getName(binding)); } /** * Some type variables refer to themselves recursively, this enables us to avoid * recursion problems. */ private static Map typeVariableBindingsInProgress = new HashMap(); /** * Convert from the eclipse form of type variable (TypeVariableBinding) to the AspectJ * form (TypeVariable). */ private UnresolvedType fromTypeVariableBinding(TypeVariableBinding aTypeVariableBinding) { if (typeVariableBindingsInProgress.containsKey(aTypeVariableBinding)) { return (UnresolvedType) typeVariableBindingsInProgress.get(aTypeVariableBinding); }
227,295
Bug 227295 AJC error, somehow connected with generics
Build ID: 1.5.0.20070607 Steps To Reproduce: I cannot find a way to reproduce it, it's somehow "randomic", for example it happened to me now while creating a new class in an aspectj project, but when i then saved the .java it compiled properly. That's why I'm filing it in AJDT and not in AspectJ directly. Based on the exception, IIUC, there is a narrowing in a generic (UnresolvedType should be something like Converter<?>, while BoundedReferenceType should be somethinf like Converter<? extends Number>), and the weaver is not handling it properly, but simply casting from one to the other .. but this are just silly assumptions. More information: java.lang.ClassCastException at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding1(EclipseFactory.java:656) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding(EclipseFactory.java:579) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding1(EclipseFactory.java:640) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding(EclipseFactory.java:579) at org.asp ... Worker.java:55) Compile error: ClassCastException thrown: org.aspectj.weaver.UnresolvedType cannot be cast to org.aspectj.weaver.BoundedReferenceType
resolved fixed
3b2109a
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-06-06T20:38:14Z
2008-04-16T10:00:00Z
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java
if (typeVariablesForAliasRecovery!=null) { String aliasname = (String)typeVariablesForAliasRecovery.get(aTypeVariableBinding); if (aliasname!=null) { UnresolvedTypeVariableReferenceType ret = new UnresolvedTypeVariableReferenceType(); ret.setTypeVariable(new TypeVariable(aliasname)); return ret; } } if (typeVariablesForThisMember.containsKey(new String(aTypeVariableBinding.sourceName))) { return (UnresolvedType)typeVariablesForThisMember.get(new String(aTypeVariableBinding.sourceName)); } String name = CharOperation.charToString(aTypeVariableBinding.sourceName()); UnresolvedTypeVariableReferenceType ret = new UnresolvedTypeVariableReferenceType(); typeVariableBindingsInProgress.put(aTypeVariableBinding,ret); TypeVariable tv = new TypeVariable(name); ret.setTypeVariable(tv); UnresolvedType superclassType = fromBinding(aTypeVariableBinding.superclass()); UnresolvedType[] superinterfaces = new UnresolvedType[aTypeVariableBinding.superInterfaces.length]; for (int i = 0; i < superinterfaces.length; i++) { superinterfaces[i] = fromBinding(aTypeVariableBinding.superInterfaces[i]); } tv.setUpperBound(superclassType);
227,295
Bug 227295 AJC error, somehow connected with generics
Build ID: 1.5.0.20070607 Steps To Reproduce: I cannot find a way to reproduce it, it's somehow "randomic", for example it happened to me now while creating a new class in an aspectj project, but when i then saved the .java it compiled properly. That's why I'm filing it in AJDT and not in AspectJ directly. Based on the exception, IIUC, there is a narrowing in a generic (UnresolvedType should be something like Converter<?>, while BoundedReferenceType should be somethinf like Converter<? extends Number>), and the weaver is not handling it properly, but simply casting from one to the other .. but this are just silly assumptions. More information: java.lang.ClassCastException at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding1(EclipseFactory.java:656) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding(EclipseFactory.java:579) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding1(EclipseFactory.java:640) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding(EclipseFactory.java:579) at org.asp ... Worker.java:55) Compile error: ClassCastException thrown: org.aspectj.weaver.UnresolvedType cannot be cast to org.aspectj.weaver.BoundedReferenceType
resolved fixed
3b2109a
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-06-06T20:38:14Z
2008-04-16T10:00:00Z
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java
tv.setAdditionalInterfaceBounds(superinterfaces); tv.setRank(aTypeVariableBinding.rank); if (aTypeVariableBinding.declaringElement instanceof MethodBinding) { tv.setDeclaringElementKind(TypeVariable.METHOD); } else { tv.setDeclaringElementKind(TypeVariable.TYPE); } if (aTypeVariableBinding.declaringElement instanceof MethodBinding) typeVariablesForThisMember.put(new String(aTypeVariableBinding.sourceName),ret); typeVariableBindingsInProgress.remove(aTypeVariableBinding); return ret; } public UnresolvedType[] fromBindings(TypeBinding[] bindings) { if (bindings == null) return UnresolvedType.NONE; int len = bindings.length; UnresolvedType[] ret = new UnresolvedType[len]; for (int i=0; i<len; i++) { ret[i] = fromBinding(bindings[i]); } return ret; } public static ASTNode astForLocation(IHasPosition location) { return new EmptyStatement(location.getStart(), location.getEnd()); } public Collection getDeclareParents() { return getWorld().getDeclareParents(); }
227,295
Bug 227295 AJC error, somehow connected with generics
Build ID: 1.5.0.20070607 Steps To Reproduce: I cannot find a way to reproduce it, it's somehow "randomic", for example it happened to me now while creating a new class in an aspectj project, but when i then saved the .java it compiled properly. That's why I'm filing it in AJDT and not in AspectJ directly. Based on the exception, IIUC, there is a narrowing in a generic (UnresolvedType should be something like Converter<?>, while BoundedReferenceType should be somethinf like Converter<? extends Number>), and the weaver is not handling it properly, but simply casting from one to the other .. but this are just silly assumptions. More information: java.lang.ClassCastException at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding1(EclipseFactory.java:656) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding(EclipseFactory.java:579) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding1(EclipseFactory.java:640) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding(EclipseFactory.java:579) at org.asp ... Worker.java:55) Compile error: ClassCastException thrown: org.aspectj.weaver.UnresolvedType cannot be cast to org.aspectj.weaver.BoundedReferenceType
resolved fixed
3b2109a
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-06-06T20:38:14Z
2008-04-16T10:00:00Z
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java
public Collection getDeclareAnnotationOnTypes() { return getWorld().getDeclareAnnotationOnTypes(); } public Collection getDeclareAnnotationOnFields() { return getWorld().getDeclareAnnotationOnFields(); } public Collection getDeclareAnnotationOnMethods() { return getWorld().getDeclareAnnotationOnMethods(); } public boolean areTypeMungersFinished() { return finishedTypeMungers != null; } public void finishTypeMungers() { Collection ret = new ArrayList(); Collection baseTypeMungers = getWorld().getCrosscuttingMembersSet().getTypeMungers(); debug_mungerCount=baseTypeMungers.size(); for (Iterator i = baseTypeMungers.iterator(); i.hasNext(); ) { ConcreteTypeMunger munger = (ConcreteTypeMunger) i.next();
227,295
Bug 227295 AJC error, somehow connected with generics
Build ID: 1.5.0.20070607 Steps To Reproduce: I cannot find a way to reproduce it, it's somehow "randomic", for example it happened to me now while creating a new class in an aspectj project, but when i then saved the .java it compiled properly. That's why I'm filing it in AJDT and not in AspectJ directly. Based on the exception, IIUC, there is a narrowing in a generic (UnresolvedType should be something like Converter<?>, while BoundedReferenceType should be somethinf like Converter<? extends Number>), and the weaver is not handling it properly, but simply casting from one to the other .. but this are just silly assumptions. More information: java.lang.ClassCastException at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding1(EclipseFactory.java:656) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding(EclipseFactory.java:579) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding1(EclipseFactory.java:640) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding(EclipseFactory.java:579) at org.asp ... Worker.java:55) Compile error: ClassCastException thrown: org.aspectj.weaver.UnresolvedType cannot be cast to org.aspectj.weaver.BoundedReferenceType
resolved fixed
3b2109a
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-06-06T20:38:14Z
2008-04-16T10:00:00Z
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java
EclipseTypeMunger etm = makeEclipseTypeMunger(munger); if (etm != null) ret.add(etm); } finishedTypeMungers = ret; } public EclipseTypeMunger makeEclipseTypeMunger(ConcreteTypeMunger concrete) { if (concrete.getMunger() != null && EclipseTypeMunger.supportsKind(concrete.getMunger().getKind())) { AbstractMethodDeclaration method = null; if (concrete instanceof EclipseTypeMunger) { method = ((EclipseTypeMunger)concrete).getSourceMethod(); } EclipseTypeMunger ret = new EclipseTypeMunger(this, concrete.getMunger(), concrete.getAspectType(), method); if (ret.getSourceLocation() == null) { ret.setSourceLocation(concrete.getSourceLocation()); } return ret; } else { return null; } } public Collection getTypeMungers() {
227,295
Bug 227295 AJC error, somehow connected with generics
Build ID: 1.5.0.20070607 Steps To Reproduce: I cannot find a way to reproduce it, it's somehow "randomic", for example it happened to me now while creating a new class in an aspectj project, but when i then saved the .java it compiled properly. That's why I'm filing it in AJDT and not in AspectJ directly. Based on the exception, IIUC, there is a narrowing in a generic (UnresolvedType should be something like Converter<?>, while BoundedReferenceType should be somethinf like Converter<? extends Number>), and the weaver is not handling it properly, but simply casting from one to the other .. but this are just silly assumptions. More information: java.lang.ClassCastException at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding1(EclipseFactory.java:656) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding(EclipseFactory.java:579) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding1(EclipseFactory.java:640) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding(EclipseFactory.java:579) at org.asp ... Worker.java:55) Compile error: ClassCastException thrown: org.aspectj.weaver.UnresolvedType cannot be cast to org.aspectj.weaver.BoundedReferenceType
resolved fixed
3b2109a
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-06-06T20:38:14Z
2008-04-16T10:00:00Z
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java
return finishedTypeMungers; } public ResolvedMember makeResolvedMember(MethodBinding binding) { return makeResolvedMember(binding, binding.declaringClass); } public ResolvedMember makeResolvedMember(MethodBinding binding, Shadow.Kind shadowKind) { MemberKind memberKind = binding.isConstructor() ? Member.CONSTRUCTOR : Member.METHOD; if (shadowKind == Shadow.AdviceExecution) memberKind = Member.ADVICE; return makeResolvedMember(binding,binding.declaringClass,memberKind); } /** * Conversion from a methodbinding (eclipse) to a resolvedmember (aspectj) is now done * in the scope of some type variables. Before converting the parts of a methodbinding * (params, return type) we store the type variables in this structure, then should any * component of the method binding refer to them, we grab them from the map. */ private Map typeVariablesForThisMember = new HashMap(); /** * This is a map from typevariablebindings (eclipsey things) to the names the user * originally specified in their ITD. For example if the target is 'interface I<N extends Number> {}' * and the ITD was 'public void I<X>.m(List<X> lxs) {}' then this map would contain a pointer * from the eclipse type 'N extends Number' to the letter 'X'. */ private Map typeVariablesForAliasRecovery; /** * Construct a resolvedmember from a methodbinding. The supplied map tells us about any * typevariablebindings that replaced typevariables whilst the compiler was resolving types -
227,295
Bug 227295 AJC error, somehow connected with generics
Build ID: 1.5.0.20070607 Steps To Reproduce: I cannot find a way to reproduce it, it's somehow "randomic", for example it happened to me now while creating a new class in an aspectj project, but when i then saved the .java it compiled properly. That's why I'm filing it in AJDT and not in AspectJ directly. Based on the exception, IIUC, there is a narrowing in a generic (UnresolvedType should be something like Converter<?>, while BoundedReferenceType should be somethinf like Converter<? extends Number>), and the weaver is not handling it properly, but simply casting from one to the other .. but this are just silly assumptions. More information: java.lang.ClassCastException at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding1(EclipseFactory.java:656) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding(EclipseFactory.java:579) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding1(EclipseFactory.java:640) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding(EclipseFactory.java:579) at org.asp ... Worker.java:55) Compile error: ClassCastException thrown: org.aspectj.weaver.UnresolvedType cannot be cast to org.aspectj.weaver.BoundedReferenceType
resolved fixed
3b2109a
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-06-06T20:38:14Z
2008-04-16T10:00:00Z
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java
* this only happens if it is a generic itd that shares type variables with its target type. */ public ResolvedMember makeResolvedMemberForITD(MethodBinding binding,TypeBinding declaringType, Map recoveryAliases) { ResolvedMember result = null; try { typeVariablesForAliasRecovery = recoveryAliases; result = makeResolvedMember(binding,declaringType); } finally { typeVariablesForAliasRecovery = null; } return result; } public ResolvedMember makeResolvedMember(MethodBinding binding, TypeBinding declaringType) { return makeResolvedMember(binding,declaringType, binding.isConstructor() ? Member.CONSTRUCTOR : Member.METHOD); } public ResolvedMember makeResolvedMember(MethodBinding binding, TypeBinding declaringType, MemberKind memberKind) { UnresolvedType[] ajTypeRefs = null; typeVariablesForThisMember.clear(); if (binding.typeVariables!=null) { ajTypeRefs = new UnresolvedType[binding.typeVariables.length]; for (int i = 0; i < binding.typeVariables.length; i++) { ajTypeRefs[i] = fromBinding(binding.typeVariables[i]); typeVariablesForThisMember.put(new String(binding.typeVariables[i].sourceName),ajTypeRefs[i]); } }
227,295
Bug 227295 AJC error, somehow connected with generics
Build ID: 1.5.0.20070607 Steps To Reproduce: I cannot find a way to reproduce it, it's somehow "randomic", for example it happened to me now while creating a new class in an aspectj project, but when i then saved the .java it compiled properly. That's why I'm filing it in AJDT and not in AspectJ directly. Based on the exception, IIUC, there is a narrowing in a generic (UnresolvedType should be something like Converter<?>, while BoundedReferenceType should be somethinf like Converter<? extends Number>), and the weaver is not handling it properly, but simply casting from one to the other .. but this are just silly assumptions. More information: java.lang.ClassCastException at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding1(EclipseFactory.java:656) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding(EclipseFactory.java:579) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding1(EclipseFactory.java:640) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding(EclipseFactory.java:579) at org.asp ... Worker.java:55) Compile error: ClassCastException thrown: org.aspectj.weaver.UnresolvedType cannot be cast to org.aspectj.weaver.BoundedReferenceType
resolved fixed
3b2109a
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-06-06T20:38:14Z
2008-04-16T10:00:00Z
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java
ResolvedType realDeclaringType = world.resolve(fromBinding(declaringType)); if (realDeclaringType.isRawType()) realDeclaringType = realDeclaringType.getGenericType(); ResolvedMemberImpl ret = new EclipseResolvedMember(binding, memberKind, realDeclaringType, binding.modifiers, fromBinding(binding.returnType), new String(binding.selector), fromBindings(binding.parameters), fromBindings(binding.thrownExceptions),this ); if (binding.isVarargs()) { ret.setVarargsMethod(); } if (ajTypeRefs!=null) { TypeVariable[] tVars = new TypeVariable[ajTypeRefs.length]; for (int i=0;i<ajTypeRefs.length;i++) { tVars[i]=((TypeVariableReference)ajTypeRefs[i]).getTypeVariable(); } ret.setTypeVariables(tVars); } typeVariablesForThisMember.clear(); ret.resolve(world); return ret; } public ResolvedMember makeResolvedMember(FieldBinding binding) { return makeResolvedMember(binding, binding.declaringClass); }
227,295
Bug 227295 AJC error, somehow connected with generics
Build ID: 1.5.0.20070607 Steps To Reproduce: I cannot find a way to reproduce it, it's somehow "randomic", for example it happened to me now while creating a new class in an aspectj project, but when i then saved the .java it compiled properly. That's why I'm filing it in AJDT and not in AspectJ directly. Based on the exception, IIUC, there is a narrowing in a generic (UnresolvedType should be something like Converter<?>, while BoundedReferenceType should be somethinf like Converter<? extends Number>), and the weaver is not handling it properly, but simply casting from one to the other .. but this are just silly assumptions. More information: java.lang.ClassCastException at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding1(EclipseFactory.java:656) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding(EclipseFactory.java:579) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding1(EclipseFactory.java:640) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding(EclipseFactory.java:579) at org.asp ... Worker.java:55) Compile error: ClassCastException thrown: org.aspectj.weaver.UnresolvedType cannot be cast to org.aspectj.weaver.BoundedReferenceType
resolved fixed
3b2109a
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-06-06T20:38:14Z
2008-04-16T10:00:00Z
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java
public ResolvedMember makeResolvedMember(FieldBinding binding, TypeBinding receiverType) { ResolvedType realDeclaringType = world.resolve(fromBinding(receiverType)); if (realDeclaringType.isRawType()) realDeclaringType = realDeclaringType.getGenericType(); ResolvedMemberImpl ret = new EclipseResolvedMember(binding, Member.FIELD, realDeclaringType, binding.modifiers, world.resolve(fromBinding(binding.type)), new String(binding.name), UnresolvedType.NONE); return ret; } public TypeBinding makeTypeBinding(UnresolvedType typeX) { TypeBinding ret = null; if (!typeX.isTypeVariableReference() && !isParameterizedWithTypeVariables(typeX)) { if (typeX.isRawType()) { ret = (TypeBinding)rawTypeXToBinding.get(typeX); } else { ret = (TypeBinding)typexToBinding.get(typeX); } } if (ret == null) { ret = makeTypeBinding1(typeX); if (!(typeX instanceof BoundedReferenceType) &&
227,295
Bug 227295 AJC error, somehow connected with generics
Build ID: 1.5.0.20070607 Steps To Reproduce: I cannot find a way to reproduce it, it's somehow "randomic", for example it happened to me now while creating a new class in an aspectj project, but when i then saved the .java it compiled properly. That's why I'm filing it in AJDT and not in AspectJ directly. Based on the exception, IIUC, there is a narrowing in a generic (UnresolvedType should be something like Converter<?>, while BoundedReferenceType should be somethinf like Converter<? extends Number>), and the weaver is not handling it properly, but simply casting from one to the other .. but this are just silly assumptions. More information: java.lang.ClassCastException at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding1(EclipseFactory.java:656) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding(EclipseFactory.java:579) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding1(EclipseFactory.java:640) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding(EclipseFactory.java:579) at org.asp ... Worker.java:55) Compile error: ClassCastException thrown: org.aspectj.weaver.UnresolvedType cannot be cast to org.aspectj.weaver.BoundedReferenceType
resolved fixed
3b2109a
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-06-06T20:38:14Z
2008-04-16T10:00:00Z
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java
!(typeX instanceof UnresolvedTypeVariableReferenceType) ) { if (typeX.isRawType()) { rawTypeXToBinding.put(typeX,ret); } else { typexToBinding.put(typeX, ret); } } } if (ret == null) { System.out.println("can't find: " + typeX); } return ret; } private boolean isParameterizedWithTypeVariables(UnresolvedType typeX) { if (!typeX.isParameterizedType()) return false; UnresolvedType[] typeArguments = typeX.getTypeParameters(); if (typeArguments!=null) { for (int i = 0; i < typeArguments.length; i++) { if (typeArguments[i].isTypeVariableReference()) return true; } } return false; } private ReferenceBinding baseTypeForParameterizedType; private int indexOfTypeParameterBeingConverted;
227,295
Bug 227295 AJC error, somehow connected with generics
Build ID: 1.5.0.20070607 Steps To Reproduce: I cannot find a way to reproduce it, it's somehow "randomic", for example it happened to me now while creating a new class in an aspectj project, but when i then saved the .java it compiled properly. That's why I'm filing it in AJDT and not in AspectJ directly. Based on the exception, IIUC, there is a narrowing in a generic (UnresolvedType should be something like Converter<?>, while BoundedReferenceType should be somethinf like Converter<? extends Number>), and the weaver is not handling it properly, but simply casting from one to the other .. but this are just silly assumptions. More information: java.lang.ClassCastException at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding1(EclipseFactory.java:656) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding(EclipseFactory.java:579) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding1(EclipseFactory.java:640) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding(EclipseFactory.java:579) at org.asp ... Worker.java:55) Compile error: ClassCastException thrown: org.aspectj.weaver.UnresolvedType cannot be cast to org.aspectj.weaver.BoundedReferenceType
resolved fixed
3b2109a
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-06-06T20:38:14Z
2008-04-16T10:00:00Z
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java
private TypeBinding makeTypeBinding1(UnresolvedType typeX) { if (typeX.isPrimitiveType()) { if (typeX == ResolvedType.BOOLEAN) return TypeBinding.BOOLEAN; if (typeX == ResolvedType.BYTE) return TypeBinding.BYTE; if (typeX == ResolvedType.CHAR) return TypeBinding.CHAR; if (typeX == ResolvedType.DOUBLE) return TypeBinding.DOUBLE; if (typeX == ResolvedType.FLOAT) return TypeBinding.FLOAT; if (typeX == ResolvedType.INT) return TypeBinding.INT; if (typeX == ResolvedType.LONG) return TypeBinding.LONG; if (typeX == ResolvedType.SHORT) return TypeBinding.SHORT; if (typeX == ResolvedType.VOID) return TypeBinding.VOID; throw new RuntimeException("weird primitive type " + typeX); } else if (typeX.isArray()) { int dim = 0; while (typeX.isArray()) { dim++; typeX = typeX.getComponentType(); } return lookupEnvironment.createArrayType(makeTypeBinding(typeX), dim); } else if (typeX.isParameterizedType()) { UnresolvedType[] typeParameters = typeX.getTypeParameters(); ReferenceBinding baseTypeBinding = lookupBinding(typeX.getBaseName()); TypeBinding[] argumentBindings = new TypeBinding[typeParameters.length]; baseTypeForParameterizedType = baseTypeBinding; for (int i = 0; i < argumentBindings.length; i++) { indexOfTypeParameterBeingConverted = i; argumentBindings[i] = makeTypeBinding(typeParameters[i]); }
227,295
Bug 227295 AJC error, somehow connected with generics
Build ID: 1.5.0.20070607 Steps To Reproduce: I cannot find a way to reproduce it, it's somehow "randomic", for example it happened to me now while creating a new class in an aspectj project, but when i then saved the .java it compiled properly. That's why I'm filing it in AJDT and not in AspectJ directly. Based on the exception, IIUC, there is a narrowing in a generic (UnresolvedType should be something like Converter<?>, while BoundedReferenceType should be somethinf like Converter<? extends Number>), and the weaver is not handling it properly, but simply casting from one to the other .. but this are just silly assumptions. More information: java.lang.ClassCastException at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding1(EclipseFactory.java:656) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding(EclipseFactory.java:579) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding1(EclipseFactory.java:640) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding(EclipseFactory.java:579) at org.asp ... Worker.java:55) Compile error: ClassCastException thrown: org.aspectj.weaver.UnresolvedType cannot be cast to org.aspectj.weaver.BoundedReferenceType
resolved fixed
3b2109a
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-06-06T20:38:14Z
2008-04-16T10:00:00Z
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java
indexOfTypeParameterBeingConverted = 0; baseTypeForParameterizedType = null; ParameterizedTypeBinding ptb = lookupEnvironment.createParameterizedType(baseTypeBinding,argumentBindings,baseTypeBinding.enclosingType()); return ptb; } else if (typeX.isTypeVariableReference()) { return makeTypeVariableBindingFromAJTypeVariable(((TypeVariableReference)typeX).getTypeVariable()); } else if (typeX.isRawType()) { ReferenceBinding baseTypeBinding = lookupBinding(typeX.getBaseName()); RawTypeBinding rtb = lookupEnvironment.createRawType(baseTypeBinding,baseTypeBinding.enclosingType()); return rtb; } else if (typeX.isGenericWildcard()) { BoundedReferenceType brt = (BoundedReferenceType)typeX; int boundkind = Wildcard.UNBOUND; TypeBinding bound = null; if (brt.isExtends()) { boundkind = Wildcard.EXTENDS; bound = makeTypeBinding(brt.getUpperBound()); } else if (brt.isSuper()) { boundkind = Wildcard.SUPER; bound = makeTypeBinding(brt.getLowerBound()); } TypeBinding[] otherBounds = null; if (brt.getAdditionalBounds()!=null && brt.getAdditionalBounds().length!=0) otherBounds = makeTypeBindings(brt.getAdditionalBounds()); WildcardBinding wb = lookupEnvironment.createWildcard(baseTypeForParameterizedType,indexOfTypeParameterBeingConverted,bound,otherBounds,boundkind); return wb; } else { return lookupBinding(typeX.getName());
227,295
Bug 227295 AJC error, somehow connected with generics
Build ID: 1.5.0.20070607 Steps To Reproduce: I cannot find a way to reproduce it, it's somehow "randomic", for example it happened to me now while creating a new class in an aspectj project, but when i then saved the .java it compiled properly. That's why I'm filing it in AJDT and not in AspectJ directly. Based on the exception, IIUC, there is a narrowing in a generic (UnresolvedType should be something like Converter<?>, while BoundedReferenceType should be somethinf like Converter<? extends Number>), and the weaver is not handling it properly, but simply casting from one to the other .. but this are just silly assumptions. More information: java.lang.ClassCastException at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding1(EclipseFactory.java:656) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding(EclipseFactory.java:579) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding1(EclipseFactory.java:640) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding(EclipseFactory.java:579) at org.asp ... Worker.java:55) Compile error: ClassCastException thrown: org.aspectj.weaver.UnresolvedType cannot be cast to org.aspectj.weaver.BoundedReferenceType
resolved fixed
3b2109a
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-06-06T20:38:14Z
2008-04-16T10:00:00Z
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java
} } private ReferenceBinding lookupBinding(String sname) { char[][] name = CharOperation.splitOn('.', sname.toCharArray()); ReferenceBinding rb = lookupEnvironment.getType(name); return rb; } public TypeBinding[] makeTypeBindings(UnresolvedType[] types) { int len = types.length; TypeBinding[] ret = new TypeBinding[len]; for (int i = 0; i < len; i++) { ret[i] = makeTypeBinding(types[i]); } return ret; } private ReferenceBinding[] makeReferenceBindings(UnresolvedType[] types) { int len = types.length; ReferenceBinding[] ret = new ReferenceBinding[len]; for (int i = 0; i < len; i++) { ret[i] = (ReferenceBinding)makeTypeBinding(types[i]); } return ret; }
227,295
Bug 227295 AJC error, somehow connected with generics
Build ID: 1.5.0.20070607 Steps To Reproduce: I cannot find a way to reproduce it, it's somehow "randomic", for example it happened to me now while creating a new class in an aspectj project, but when i then saved the .java it compiled properly. That's why I'm filing it in AJDT and not in AspectJ directly. Based on the exception, IIUC, there is a narrowing in a generic (UnresolvedType should be something like Converter<?>, while BoundedReferenceType should be somethinf like Converter<? extends Number>), and the weaver is not handling it properly, but simply casting from one to the other .. but this are just silly assumptions. More information: java.lang.ClassCastException at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding1(EclipseFactory.java:656) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding(EclipseFactory.java:579) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding1(EclipseFactory.java:640) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding(EclipseFactory.java:579) at org.asp ... Worker.java:55) Compile error: ClassCastException thrown: org.aspectj.weaver.UnresolvedType cannot be cast to org.aspectj.weaver.BoundedReferenceType
resolved fixed
3b2109a
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-06-06T20:38:14Z
2008-04-16T10:00:00Z
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java
public FieldBinding makeFieldBinding(NewFieldTypeMunger nftm) { return internalMakeFieldBinding(nftm.getSignature(),nftm.getTypeVariableAliases()); } /** * Convert a resolvedmember into an eclipse field binding */ public FieldBinding makeFieldBinding(ResolvedMember member,List aliases) { return internalMakeFieldBinding(member,aliases); } /** * Convert a resolvedmember into an eclipse field binding */ public FieldBinding makeFieldBinding(ResolvedMember member) { return internalMakeFieldBinding(member,null); } /** * Build a new Eclipse SyntheticFieldBinding for an AspectJ ResolvedMember. */ public SyntheticFieldBinding createSyntheticFieldBinding(SourceTypeBinding owningType,ResolvedMember member) { SyntheticFieldBinding sfb = new SyntheticFieldBinding(member.getName().toCharArray(), makeTypeBinding(member.getReturnType()), member.getModifiers() | Flags.AccSynthetic, owningType, Constant.NotAConstant, -1);
227,295
Bug 227295 AJC error, somehow connected with generics
Build ID: 1.5.0.20070607 Steps To Reproduce: I cannot find a way to reproduce it, it's somehow "randomic", for example it happened to me now while creating a new class in an aspectj project, but when i then saved the .java it compiled properly. That's why I'm filing it in AJDT and not in AspectJ directly. Based on the exception, IIUC, there is a narrowing in a generic (UnresolvedType should be something like Converter<?>, while BoundedReferenceType should be somethinf like Converter<? extends Number>), and the weaver is not handling it properly, but simply casting from one to the other .. but this are just silly assumptions. More information: java.lang.ClassCastException at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding1(EclipseFactory.java:656) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding(EclipseFactory.java:579) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding1(EclipseFactory.java:640) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding(EclipseFactory.java:579) at org.asp ... Worker.java:55) Compile error: ClassCastException thrown: org.aspectj.weaver.UnresolvedType cannot be cast to org.aspectj.weaver.BoundedReferenceType
resolved fixed
3b2109a
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-06-06T20:38:14Z
2008-04-16T10:00:00Z
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java
owningType.addSyntheticField(sfb); return sfb; } /** * Take a normal AJ member and convert it into an eclipse fieldBinding. * Taking into account any aliases that it may include due to being * a generic itd. Any aliases are put into the typeVariableToBinding * map so that they will be substituted as appropriate in the returned * fieldbinding. */ public FieldBinding internalMakeFieldBinding(ResolvedMember member,List aliases) { typeVariableToTypeBinding.clear(); TypeVariableBinding[] tvbs = null; ReferenceBinding declaringType = (ReferenceBinding)makeTypeBinding(member.getDeclaringType()); if (aliases!=null && aliases.size()>0) { int i =0; for (Iterator iter = aliases.iterator(); iter.hasNext();) { String element = (String) iter.next(); typeVariableToTypeBinding.put(element,declaringType.typeVariables()[i++]); } } currentType = declaringType; FieldBinding fb = null; if (member.getName().startsWith(NameMangler.PREFIX)) {
227,295
Bug 227295 AJC error, somehow connected with generics
Build ID: 1.5.0.20070607 Steps To Reproduce: I cannot find a way to reproduce it, it's somehow "randomic", for example it happened to me now while creating a new class in an aspectj project, but when i then saved the .java it compiled properly. That's why I'm filing it in AJDT and not in AspectJ directly. Based on the exception, IIUC, there is a narrowing in a generic (UnresolvedType should be something like Converter<?>, while BoundedReferenceType should be somethinf like Converter<? extends Number>), and the weaver is not handling it properly, but simply casting from one to the other .. but this are just silly assumptions. More information: java.lang.ClassCastException at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding1(EclipseFactory.java:656) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding(EclipseFactory.java:579) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding1(EclipseFactory.java:640) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding(EclipseFactory.java:579) at org.asp ... Worker.java:55) Compile error: ClassCastException thrown: org.aspectj.weaver.UnresolvedType cannot be cast to org.aspectj.weaver.BoundedReferenceType
resolved fixed
3b2109a
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-06-06T20:38:14Z
2008-04-16T10:00:00Z
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java
fb = new SyntheticFieldBinding(member.getName().toCharArray(), makeTypeBinding(member.getReturnType()), member.getModifiers() | Flags.AccSynthetic, currentType, Constant.NotAConstant,-1); } else { fb = new FieldBinding(member.getName().toCharArray(), makeTypeBinding(member.getReturnType()), member.getModifiers(), currentType, Constant.NotAConstant); } typeVariableToTypeBinding.clear(); currentType = null; if (member.getName().startsWith(NameMangler.PREFIX)) { fb.modifiers |= Flags.AccSynthetic; } return fb; } private ReferenceBinding currentType = null; public MethodBinding makeMethodBinding(NewMethodTypeMunger nmtm) { return internalMakeMethodBinding(nmtm.getSignature(),nmtm.getTypeVariableAliases()); } /** * Convert a resolvedmember into an eclipse method binding. */
227,295
Bug 227295 AJC error, somehow connected with generics
Build ID: 1.5.0.20070607 Steps To Reproduce: I cannot find a way to reproduce it, it's somehow "randomic", for example it happened to me now while creating a new class in an aspectj project, but when i then saved the .java it compiled properly. That's why I'm filing it in AJDT and not in AspectJ directly. Based on the exception, IIUC, there is a narrowing in a generic (UnresolvedType should be something like Converter<?>, while BoundedReferenceType should be somethinf like Converter<? extends Number>), and the weaver is not handling it properly, but simply casting from one to the other .. but this are just silly assumptions. More information: java.lang.ClassCastException at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding1(EclipseFactory.java:656) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding(EclipseFactory.java:579) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding1(EclipseFactory.java:640) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding(EclipseFactory.java:579) at org.asp ... Worker.java:55) Compile error: ClassCastException thrown: org.aspectj.weaver.UnresolvedType cannot be cast to org.aspectj.weaver.BoundedReferenceType
resolved fixed
3b2109a
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-06-06T20:38:14Z
2008-04-16T10:00:00Z
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java
public MethodBinding makeMethodBinding(ResolvedMember member,List aliases) { return internalMakeMethodBinding(member,aliases); } /** * Creates a method binding for a resolvedmember taking into account type variable aliases - * this variant can take an aliasTargetType and should be used when the alias target type * cannot be retrieved from the resolvedmember. */ public MethodBinding makeMethodBinding(ResolvedMember member,List aliases,UnresolvedType aliasTargetType) { return internalMakeMethodBinding(member,aliases,aliasTargetType); } /** * Convert a resolvedmember into an eclipse method binding. */ public MethodBinding makeMethodBinding(ResolvedMember member) { return internalMakeMethodBinding(member,null); } public MethodBinding internalMakeMethodBinding(ResolvedMember member,List aliases) { return internalMakeMethodBinding(member,aliases,member.getDeclaringType()); } /** * Take a normal AJ member and convert it into an eclipse methodBinding. * Taking into account any aliases that it may include due to being a * generic ITD. Any aliases are put into the typeVariableToBinding * map so that they will be substituted as appropriate in the returned * methodbinding
227,295
Bug 227295 AJC error, somehow connected with generics
Build ID: 1.5.0.20070607 Steps To Reproduce: I cannot find a way to reproduce it, it's somehow "randomic", for example it happened to me now while creating a new class in an aspectj project, but when i then saved the .java it compiled properly. That's why I'm filing it in AJDT and not in AspectJ directly. Based on the exception, IIUC, there is a narrowing in a generic (UnresolvedType should be something like Converter<?>, while BoundedReferenceType should be somethinf like Converter<? extends Number>), and the weaver is not handling it properly, but simply casting from one to the other .. but this are just silly assumptions. More information: java.lang.ClassCastException at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding1(EclipseFactory.java:656) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding(EclipseFactory.java:579) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding1(EclipseFactory.java:640) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding(EclipseFactory.java:579) at org.asp ... Worker.java:55) Compile error: ClassCastException thrown: org.aspectj.weaver.UnresolvedType cannot be cast to org.aspectj.weaver.BoundedReferenceType
resolved fixed
3b2109a
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-06-06T20:38:14Z
2008-04-16T10:00:00Z
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java
*/ public MethodBinding internalMakeMethodBinding(ResolvedMember member,List aliases,UnresolvedType aliasTargetType) { typeVariableToTypeBinding.clear(); TypeVariableBinding[] tvbs = null; if (member.getTypeVariables()!=null) { if (member.getTypeVariables().length==0) { tvbs = Binding.NO_TYPE_VARIABLES; } else { tvbs = makeTypeVariableBindingsFromAJTypeVariables(member.getTypeVariables()); } } ReferenceBinding declaringType = (ReferenceBinding)makeTypeBinding(member.getDeclaringType()); if (aliases!=null && aliases.size()!=0) { int i=0; ReferenceBinding aliasTarget = (ReferenceBinding)makeTypeBinding(aliasTargetType); if (aliasTarget.isRawType()) { aliasTarget = ((RawTypeBinding) aliasTarget).genericType(); } for (Iterator iter = aliases.iterator(); iter.hasNext();) { String element = (String) iter.next(); typeVariableToTypeBinding.put(element,aliasTarget.typeVariables()[i++]); } } currentType = declaringType; MethodBinding mb = new MethodBinding(member.getModifiers(), member.getName().toCharArray(),
227,295
Bug 227295 AJC error, somehow connected with generics
Build ID: 1.5.0.20070607 Steps To Reproduce: I cannot find a way to reproduce it, it's somehow "randomic", for example it happened to me now while creating a new class in an aspectj project, but when i then saved the .java it compiled properly. That's why I'm filing it in AJDT and not in AspectJ directly. Based on the exception, IIUC, there is a narrowing in a generic (UnresolvedType should be something like Converter<?>, while BoundedReferenceType should be somethinf like Converter<? extends Number>), and the weaver is not handling it properly, but simply casting from one to the other .. but this are just silly assumptions. More information: java.lang.ClassCastException at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding1(EclipseFactory.java:656) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding(EclipseFactory.java:579) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding1(EclipseFactory.java:640) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding(EclipseFactory.java:579) at org.asp ... Worker.java:55) Compile error: ClassCastException thrown: org.aspectj.weaver.UnresolvedType cannot be cast to org.aspectj.weaver.BoundedReferenceType
resolved fixed
3b2109a
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-06-06T20:38:14Z
2008-04-16T10:00:00Z
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java
makeTypeBinding(member.getReturnType()), makeTypeBindings(member.getParameterTypes()), makeReferenceBindings(member.getExceptions()), declaringType); if (tvbs!=null) mb.typeVariables = tvbs; typeVariableToTypeBinding.clear(); currentType = null; if (NameMangler.isSyntheticMethod(member.getName(), true)) { mb.modifiers |= Flags.AccSynthetic; } return mb; } /** * Convert a bunch of type variables in one go, from AspectJ form to Eclipse form. */ private TypeVariableBinding[] makeTypeVariableBindingsFromAJTypeVariables(TypeVariable[] typeVariables) { int len = typeVariables.length; TypeVariableBinding[] ret = new TypeVariableBinding[len]; for (int i = 0; i < len; i++) { ret[i] = makeTypeVariableBindingFromAJTypeVariable(typeVariables[i]); } return ret; }
227,295
Bug 227295 AJC error, somehow connected with generics
Build ID: 1.5.0.20070607 Steps To Reproduce: I cannot find a way to reproduce it, it's somehow "randomic", for example it happened to me now while creating a new class in an aspectj project, but when i then saved the .java it compiled properly. That's why I'm filing it in AJDT and not in AspectJ directly. Based on the exception, IIUC, there is a narrowing in a generic (UnresolvedType should be something like Converter<?>, while BoundedReferenceType should be somethinf like Converter<? extends Number>), and the weaver is not handling it properly, but simply casting from one to the other .. but this are just silly assumptions. More information: java.lang.ClassCastException at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding1(EclipseFactory.java:656) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding(EclipseFactory.java:579) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding1(EclipseFactory.java:640) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding(EclipseFactory.java:579) at org.asp ... Worker.java:55) Compile error: ClassCastException thrown: org.aspectj.weaver.UnresolvedType cannot be cast to org.aspectj.weaver.BoundedReferenceType
resolved fixed
3b2109a
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-06-06T20:38:14Z
2008-04-16T10:00:00Z
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java
private Map typeVariableToTypeBinding = new HashMap(); /** * Converts from an TypeVariableReference to a TypeVariableBinding. A TypeVariableReference * in AspectJ world holds a TypeVariable and it is this type variable that is converted * to the TypeVariableBinding. */ private TypeVariableBinding makeTypeVariableBinding(TypeVariableReference tvReference) { TypeVariable tv = tvReference.getTypeVariable(); TypeVariableBinding tvBinding = (TypeVariableBinding)typeVariableToTypeBinding.get(tv.getName()); if (currentType!=null) { TypeVariableBinding tvb = currentType.getTypeVariable(tv.getName().toCharArray()); if (tvb!=null) return tvb; } if (tvBinding==null) { Binding declaringElement = null; tvBinding = new TypeVariableBinding(tv.getName().toCharArray(),null,tv.getRank()); typeVariableToTypeBinding.put(tv.getName(),tvBinding); tvBinding.superclass=(ReferenceBinding)makeTypeBinding(tv.getUpperBound()); tvBinding.firstBound=(ReferenceBinding)makeTypeBinding(tv.getFirstBound()); if (tv.getAdditionalInterfaceBounds()==null) { tvBinding.superInterfaces=TypeVariableBinding.NO_SUPERINTERFACES; } else { TypeBinding tbs[] = makeTypeBindings(tv.getAdditionalInterfaceBounds()); ReferenceBinding[] rbs= new ReferenceBinding[tbs.length]; for (int i = 0; i < tbs.length; i++) { rbs[i] = (ReferenceBinding)tbs[i];
227,295
Bug 227295 AJC error, somehow connected with generics
Build ID: 1.5.0.20070607 Steps To Reproduce: I cannot find a way to reproduce it, it's somehow "randomic", for example it happened to me now while creating a new class in an aspectj project, but when i then saved the .java it compiled properly. That's why I'm filing it in AJDT and not in AspectJ directly. Based on the exception, IIUC, there is a narrowing in a generic (UnresolvedType should be something like Converter<?>, while BoundedReferenceType should be somethinf like Converter<? extends Number>), and the weaver is not handling it properly, but simply casting from one to the other .. but this are just silly assumptions. More information: java.lang.ClassCastException at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding1(EclipseFactory.java:656) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding(EclipseFactory.java:579) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding1(EclipseFactory.java:640) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding(EclipseFactory.java:579) at org.asp ... Worker.java:55) Compile error: ClassCastException thrown: org.aspectj.weaver.UnresolvedType cannot be cast to org.aspectj.weaver.BoundedReferenceType
resolved fixed
3b2109a
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-06-06T20:38:14Z
2008-04-16T10:00:00Z
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java
} tvBinding.superInterfaces=rbs; } } return tvBinding; } private TypeVariableBinding makeTypeVariableBindingFromAJTypeVariable(TypeVariable tv) { TypeVariableBinding tvBinding = (TypeVariableBinding)typeVariableToTypeBinding.get(tv.getName()); if (currentType!=null) { TypeVariableBinding tvb = currentType.getTypeVariable(tv.getName().toCharArray()); if (tvb!=null) return tvb; } if (tvBinding==null) { Binding declaringElement = null; tvBinding = new TypeVariableBinding(tv.getName().toCharArray(),declaringElement,tv.getRank()); typeVariableToTypeBinding.put(tv.getName(),tvBinding); tvBinding.superclass=(ReferenceBinding)makeTypeBinding(tv.getUpperBound()); tvBinding.firstBound=(ReferenceBinding)makeTypeBinding(tv.getFirstBound()); if (tv.getAdditionalInterfaceBounds()==null) { tvBinding.superInterfaces=TypeVariableBinding.NO_SUPERINTERFACES; } else { TypeBinding tbs[] = makeTypeBindings(tv.getAdditionalInterfaceBounds()); ReferenceBinding[] rbs= new ReferenceBinding[tbs.length]; for (int i = 0; i < tbs.length; i++) { rbs[i] = (ReferenceBinding)tbs[i]; } tvBinding.superInterfaces=rbs; }
227,295
Bug 227295 AJC error, somehow connected with generics
Build ID: 1.5.0.20070607 Steps To Reproduce: I cannot find a way to reproduce it, it's somehow "randomic", for example it happened to me now while creating a new class in an aspectj project, but when i then saved the .java it compiled properly. That's why I'm filing it in AJDT and not in AspectJ directly. Based on the exception, IIUC, there is a narrowing in a generic (UnresolvedType should be something like Converter<?>, while BoundedReferenceType should be somethinf like Converter<? extends Number>), and the weaver is not handling it properly, but simply casting from one to the other .. but this are just silly assumptions. More information: java.lang.ClassCastException at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding1(EclipseFactory.java:656) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding(EclipseFactory.java:579) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding1(EclipseFactory.java:640) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding(EclipseFactory.java:579) at org.asp ... Worker.java:55) Compile error: ClassCastException thrown: org.aspectj.weaver.UnresolvedType cannot be cast to org.aspectj.weaver.BoundedReferenceType
resolved fixed
3b2109a
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-06-06T20:38:14Z
2008-04-16T10:00:00Z
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java
} return tvBinding; } public MethodBinding makeMethodBindingForCall(Member member) { return new MethodBinding(member.getModifiers() & ~ Modifier.INTERFACE, member.getName().toCharArray(), makeTypeBinding(member.getReturnType()), makeTypeBindings(member.getParameterTypes()), new ReferenceBinding[0], (ReferenceBinding)makeTypeBinding(member.getDeclaringType())); } public void finishedCompilationUnit(CompilationUnitDeclaration unit) { if ((buildManager != null) && buildManager.doGenerateModel()) { AjBuildManager.getAsmHierarchyBuilder().buildStructureForCompilationUnit(unit, buildManager.getStructureModel(), buildManager.buildConfig); } } public void addTypeBinding(TypeBinding binding) { typexToBinding.put(fromBinding(binding), binding); } public void addTypeBindingAndStoreInWorld(TypeBinding binding) { UnresolvedType ut = fromBinding(binding); typexToBinding.put(ut, binding); world.lookupOrCreateName(ut); } public Shadow makeShadow(ASTNode location, ReferenceContext context) { return EclipseShadow.makeShadow(this, location, context); } public Shadow makeShadow(ReferenceContext context) { return EclipseShadow.makeShadow(this, (ASTNode) context, context);
227,295
Bug 227295 AJC error, somehow connected with generics
Build ID: 1.5.0.20070607 Steps To Reproduce: I cannot find a way to reproduce it, it's somehow "randomic", for example it happened to me now while creating a new class in an aspectj project, but when i then saved the .java it compiled properly. That's why I'm filing it in AJDT and not in AspectJ directly. Based on the exception, IIUC, there is a narrowing in a generic (UnresolvedType should be something like Converter<?>, while BoundedReferenceType should be somethinf like Converter<? extends Number>), and the weaver is not handling it properly, but simply casting from one to the other .. but this are just silly assumptions. More information: java.lang.ClassCastException at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding1(EclipseFactory.java:656) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding(EclipseFactory.java:579) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding1(EclipseFactory.java:640) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding(EclipseFactory.java:579) at org.asp ... Worker.java:55) Compile error: ClassCastException thrown: org.aspectj.weaver.UnresolvedType cannot be cast to org.aspectj.weaver.BoundedReferenceType
resolved fixed
3b2109a
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-06-06T20:38:14Z
2008-04-16T10:00:00Z
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java
} public void addSourceTypeBinding(SourceTypeBinding binding, CompilationUnitDeclaration unit) { TypeDeclaration decl = binding.scope.referenceContext; UnresolvedType simpleTx = null; if (binding.isGenericType()) { simpleTx = UnresolvedType.forRawTypeName(getName(binding)); } else if (binding.isLocalType()) { LocalTypeBinding ltb = (LocalTypeBinding) binding; if (ltb.constantPoolName() != null && ltb.constantPoolName().length > 0) { simpleTx = UnresolvedType.forSignature(new String(binding.signature())); } else { simpleTx = UnresolvedType.forName(getName(binding)); } }else { simpleTx = UnresolvedType.forName(getName(binding)); } ReferenceType name = getWorld().lookupOrCreateName(simpleTx); if (!binding.isRawType() && !binding.isGenericType() && name.getTypekind()==TypeKind.RAW) { name.demoteToSimpleType(); } EclipseSourceType t = new EclipseSourceType(name, this, binding, decl, unit);
227,295
Bug 227295 AJC error, somehow connected with generics
Build ID: 1.5.0.20070607 Steps To Reproduce: I cannot find a way to reproduce it, it's somehow "randomic", for example it happened to me now while creating a new class in an aspectj project, but when i then saved the .java it compiled properly. That's why I'm filing it in AJDT and not in AspectJ directly. Based on the exception, IIUC, there is a narrowing in a generic (UnresolvedType should be something like Converter<?>, while BoundedReferenceType should be somethinf like Converter<? extends Number>), and the weaver is not handling it properly, but simply casting from one to the other .. but this are just silly assumptions. More information: java.lang.ClassCastException at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding1(EclipseFactory.java:656) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding(EclipseFactory.java:579) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding1(EclipseFactory.java:640) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding(EclipseFactory.java:579) at org.asp ... Worker.java:55) Compile error: ClassCastException thrown: org.aspectj.weaver.UnresolvedType cannot be cast to org.aspectj.weaver.BoundedReferenceType
resolved fixed
3b2109a
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-06-06T20:38:14Z
2008-04-16T10:00:00Z
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java
if (binding.isGenericType()) { UnresolvedType complexTx = fromBinding(binding); ResolvedType cName = world.resolve(complexTx,true); ReferenceType complexName = null; if (!cName.isMissing()) { complexName = (ReferenceType) cName; complexName = (ReferenceType) complexName.getGenericType(); if (complexName == null) complexName = new ReferenceType(complexTx,world); } else { complexName = new ReferenceType(complexTx,world); } name.setGenericType(complexName); complexName.setDelegate(t); } name.setDelegate(t); if (decl instanceof AspectDeclaration) { ((AspectDeclaration)decl).typeX = name; ((AspectDeclaration)decl).concreteName = t; } ReferenceBinding[] memberTypes = binding.memberTypes; for (int i = 0, length = memberTypes.length; i < length; i++) { addSourceTypeBinding((SourceTypeBinding) memberTypes[i], unit); } }
227,295
Bug 227295 AJC error, somehow connected with generics
Build ID: 1.5.0.20070607 Steps To Reproduce: I cannot find a way to reproduce it, it's somehow "randomic", for example it happened to me now while creating a new class in an aspectj project, but when i then saved the .java it compiled properly. That's why I'm filing it in AJDT and not in AspectJ directly. Based on the exception, IIUC, there is a narrowing in a generic (UnresolvedType should be something like Converter<?>, while BoundedReferenceType should be somethinf like Converter<? extends Number>), and the weaver is not handling it properly, but simply casting from one to the other .. but this are just silly assumptions. More information: java.lang.ClassCastException at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding1(EclipseFactory.java:656) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding(EclipseFactory.java:579) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding1(EclipseFactory.java:640) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeTypeBinding(EclipseFactory.java:579) at org.asp ... Worker.java:55) Compile error: ClassCastException thrown: org.aspectj.weaver.UnresolvedType cannot be cast to org.aspectj.weaver.BoundedReferenceType
resolved fixed
3b2109a
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-06-06T20:38:14Z
2008-04-16T10:00:00Z
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java
public boolean isXSerializableAspects() { return xSerializableAspects; } public ResolvedMember fromBinding(MethodBinding binding) { return new ResolvedMemberImpl(Member.METHOD,fromBinding(binding.declaringClass),binding.modifiers, fromBinding(binding.returnType),CharOperation.charToString(binding.selector),fromBindings(binding.parameters)); } public TypeVariableDeclaringElement fromBinding(Binding declaringElement) { if (declaringElement instanceof TypeBinding) { return fromBinding(((TypeBinding)declaringElement)); } else { return fromBinding((MethodBinding)declaringElement); } } public void cleanup() { this.typexToBinding.clear(); this.rawTypeXToBinding.clear(); this.finishedTypeMungers = null; } public void minicleanup() { this.typexToBinding.clear(); this.rawTypeXToBinding.clear(); } }
155,347
Bug 155347 NPE during compilation of class file with pointcuts
I commented out a static nested aspect inside a class to let me do a rename refactoring in Eclipse. This results in the following exception, which even a full rebuild won't fix. The class does have pointcut definitions inside of it. Commenting those out avoids the problem (though it caused other syntax errors...) java.lang.ArrayIndexOutOfBoundsException at org.aspectj.weaver.patterns.IfPointcut.findResidueInternal(IfPointcut.java:186) at org.aspectj.weaver.patterns.Pointcut.findResidue(Pointcut.java:269) at org.aspectj.weaver.patterns.AndPointcut.findResidueInternal(AndPointcut.java:93) at org.aspectj.weaver.patterns.Pointcut.findResidue(Pointcut.java:269) at org.aspectj.weaver.patterns.AndPointcut.findResidueInternal(AndPointcut.java:93) at or ... ses when weaving when batch building BuildConfig[C:\devel\glassbox\.metadata\.plugins\org.eclipse.ajdt.core\glassboxAgent.generated.lst] #Files=210
resolved fixed
248962b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-06-10T20:48:36Z
2006-08-27T23:06:40Z
weaver/src/org/aspectj/weaver/patterns/IfPointcut.java
/* ******************************************************************* * Copyright (c) 2002 Palo Alto Research Center, Incorporated (PARC). * All rights reserved. * This program and the accompanying materials are made available * under the terms of the Eclipse Public License v1.0 * which accompanies this distribution and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * PARC initial implementation * Alexandre Vasseur if() implementation for @AJ style * ******************************************************************/ package org.aspectj.weaver.patterns; import java.io.DataOutputStream; import java.io.IOException; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import java.util.Map; import org.aspectj.bridge.IMessage; import org.aspectj.lang.JoinPoint; import org.aspectj.util.FuzzyBoolean; import org.aspectj.weaver.Advice; import org.aspectj.weaver.AjcMemberMaker; import org.aspectj.weaver.ISourceContext; import org.aspectj.weaver.IntMap; import org.aspectj.weaver.ResolvedMember; import org.aspectj.weaver.ResolvedMemberImpl;
155,347
Bug 155347 NPE during compilation of class file with pointcuts
I commented out a static nested aspect inside a class to let me do a rename refactoring in Eclipse. This results in the following exception, which even a full rebuild won't fix. The class does have pointcut definitions inside of it. Commenting those out avoids the problem (though it caused other syntax errors...) java.lang.ArrayIndexOutOfBoundsException at org.aspectj.weaver.patterns.IfPointcut.findResidueInternal(IfPointcut.java:186) at org.aspectj.weaver.patterns.Pointcut.findResidue(Pointcut.java:269) at org.aspectj.weaver.patterns.AndPointcut.findResidueInternal(AndPointcut.java:93) at org.aspectj.weaver.patterns.Pointcut.findResidue(Pointcut.java:269) at org.aspectj.weaver.patterns.AndPointcut.findResidueInternal(AndPointcut.java:93) at or ... ses when weaving when batch building BuildConfig[C:\devel\glassbox\.metadata\.plugins\org.eclipse.ajdt.core\glassboxAgent.generated.lst] #Files=210
resolved fixed
248962b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-06-10T20:48:36Z
2006-08-27T23:06:40Z
weaver/src/org/aspectj/weaver/patterns/IfPointcut.java
import org.aspectj.weaver.ResolvedPointcutDefinition; import org.aspectj.weaver.ResolvedType; import org.aspectj.weaver.Shadow; import org.aspectj.weaver.ShadowMunger; import org.aspectj.weaver.UnresolvedType; import org.aspectj.weaver.VersionedDataInputStream; import org.aspectj.weaver.WeaverMessages; import org.aspectj.weaver.World; import org.aspectj.weaver.ast.Expr; import org.aspectj.weaver.ast.Literal; import org.aspectj.weaver.ast.Test; import org.aspectj.weaver.ast.Var; public class IfPointcut extends Pointcut { public ResolvedMember testMethod; public int extraParameterFlags; /** * A token source dump that looks like a pointcut (but is NOT parseable at all - just here to help debugging etc) */ private String enclosingPointcutHint; public Pointcut residueSource; int baseArgsCount; public IfPointcut(ResolvedMember testMethod, int extraParameterFlags) { this.testMethod = testMethod; this.extraParameterFlags = extraParameterFlags; this.pointcutKind = IF; this.enclosingPointcutHint = null; } /**
155,347
Bug 155347 NPE during compilation of class file with pointcuts
I commented out a static nested aspect inside a class to let me do a rename refactoring in Eclipse. This results in the following exception, which even a full rebuild won't fix. The class does have pointcut definitions inside of it. Commenting those out avoids the problem (though it caused other syntax errors...) java.lang.ArrayIndexOutOfBoundsException at org.aspectj.weaver.patterns.IfPointcut.findResidueInternal(IfPointcut.java:186) at org.aspectj.weaver.patterns.Pointcut.findResidue(Pointcut.java:269) at org.aspectj.weaver.patterns.AndPointcut.findResidueInternal(AndPointcut.java:93) at org.aspectj.weaver.patterns.Pointcut.findResidue(Pointcut.java:269) at org.aspectj.weaver.patterns.AndPointcut.findResidueInternal(AndPointcut.java:93) at or ... ses when weaving when batch building BuildConfig[C:\devel\glassbox\.metadata\.plugins\org.eclipse.ajdt.core\glassboxAgent.generated.lst] #Files=210
resolved fixed
248962b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-06-10T20:48:36Z
2006-08-27T23:06:40Z
weaver/src/org/aspectj/weaver/patterns/IfPointcut.java
* No-arg constructor for @AJ style, where the if() body is actually the @Pointcut annotated method */ public IfPointcut(String enclosingPointcutHint) { this.pointcutKind = IF; this.enclosingPointcutHint = enclosingPointcutHint; this.testMethod = null; this.extraParameterFlags = -1; } public int couldMatchKinds() { return Shadow.ALL_SHADOW_KINDS_BITS; } public FuzzyBoolean fastMatch(FastMatchInfo type) { return FuzzyBoolean.MAYBE; } protected FuzzyBoolean matchInternal(Shadow shadow) { return FuzzyBoolean.MAYBE; } public boolean alwaysFalse() { return false; } public boolean alwaysTrue() { return false; } public Pointcut getResidueSource() { return residueSource;
155,347
Bug 155347 NPE during compilation of class file with pointcuts
I commented out a static nested aspect inside a class to let me do a rename refactoring in Eclipse. This results in the following exception, which even a full rebuild won't fix. The class does have pointcut definitions inside of it. Commenting those out avoids the problem (though it caused other syntax errors...) java.lang.ArrayIndexOutOfBoundsException at org.aspectj.weaver.patterns.IfPointcut.findResidueInternal(IfPointcut.java:186) at org.aspectj.weaver.patterns.Pointcut.findResidue(Pointcut.java:269) at org.aspectj.weaver.patterns.AndPointcut.findResidueInternal(AndPointcut.java:93) at org.aspectj.weaver.patterns.Pointcut.findResidue(Pointcut.java:269) at org.aspectj.weaver.patterns.AndPointcut.findResidueInternal(AndPointcut.java:93) at or ... ses when weaving when batch building BuildConfig[C:\devel\glassbox\.metadata\.plugins\org.eclipse.ajdt.core\glassboxAgent.generated.lst] #Files=210
resolved fixed
248962b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-06-10T20:48:36Z
2006-08-27T23:06:40Z
weaver/src/org/aspectj/weaver/patterns/IfPointcut.java
} public void write(DataOutputStream s) throws IOException { s.writeByte(Pointcut.IF); s.writeBoolean(testMethod != null); if (testMethod != null) testMethod.write(s); s.writeByte(extraParameterFlags); writeLocation(s); } public static Pointcut read(VersionedDataInputStream s, ISourceContext context) throws IOException { boolean hasTestMethod = s.readBoolean(); ResolvedMember resolvedTestMethod = null; if (hasTestMethod) { resolvedTestMethod = ResolvedMemberImpl.readResolvedMember(s, context); } IfPointcut ret = new IfPointcut(resolvedTestMethod, s.readByte()); ret.readLocation(context, s); return ret; } public void resolveBindings(IScope scope, Bindings bindings) { } public boolean equals(Object other) { if (!(other instanceof IfPointcut)) return false; IfPointcut o = (IfPointcut)other; if (o.testMethod==null) return (this.testMethod==null); return o.testMethod.equals(this.testMethod); } public int hashCode() {
155,347
Bug 155347 NPE during compilation of class file with pointcuts
I commented out a static nested aspect inside a class to let me do a rename refactoring in Eclipse. This results in the following exception, which even a full rebuild won't fix. The class does have pointcut definitions inside of it. Commenting those out avoids the problem (though it caused other syntax errors...) java.lang.ArrayIndexOutOfBoundsException at org.aspectj.weaver.patterns.IfPointcut.findResidueInternal(IfPointcut.java:186) at org.aspectj.weaver.patterns.Pointcut.findResidue(Pointcut.java:269) at org.aspectj.weaver.patterns.AndPointcut.findResidueInternal(AndPointcut.java:93) at org.aspectj.weaver.patterns.Pointcut.findResidue(Pointcut.java:269) at org.aspectj.weaver.patterns.AndPointcut.findResidueInternal(AndPointcut.java:93) at or ... ses when weaving when batch building BuildConfig[C:\devel\glassbox\.metadata\.plugins\org.eclipse.ajdt.core\glassboxAgent.generated.lst] #Files=210
resolved fixed
248962b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-06-10T20:48:36Z
2006-08-27T23:06:40Z
weaver/src/org/aspectj/weaver/patterns/IfPointcut.java
int result = 17; result = 37*result + testMethod.hashCode(); return result; } public String toString() { if (extraParameterFlags < 0) { return "if()"; } else { return "if(" + testMethod + ")"; } } private boolean findingResidue = false; private int ifLastMatchedShadowId; private Test ifLastMatchedShadowResidue; /** * At each shadow that matched, the residue can be different. */ protected Test findResidueInternal(Shadow shadow, ExposedState state) { if (findingResidue) return Literal.TRUE; findingResidue = true; try { if (shadow.shadowId == ifLastMatchedShadowId) return ifLastMatchedShadowResidue;
155,347
Bug 155347 NPE during compilation of class file with pointcuts
I commented out a static nested aspect inside a class to let me do a rename refactoring in Eclipse. This results in the following exception, which even a full rebuild won't fix. The class does have pointcut definitions inside of it. Commenting those out avoids the problem (though it caused other syntax errors...) java.lang.ArrayIndexOutOfBoundsException at org.aspectj.weaver.patterns.IfPointcut.findResidueInternal(IfPointcut.java:186) at org.aspectj.weaver.patterns.Pointcut.findResidue(Pointcut.java:269) at org.aspectj.weaver.patterns.AndPointcut.findResidueInternal(AndPointcut.java:93) at org.aspectj.weaver.patterns.Pointcut.findResidue(Pointcut.java:269) at org.aspectj.weaver.patterns.AndPointcut.findResidueInternal(AndPointcut.java:93) at or ... ses when weaving when batch building BuildConfig[C:\devel\glassbox\.metadata\.plugins\org.eclipse.ajdt.core\glassboxAgent.generated.lst] #Files=210
resolved fixed
248962b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-06-10T20:48:36Z
2006-08-27T23:06:40Z
weaver/src/org/aspectj/weaver/patterns/IfPointcut.java
Test ret = Literal.TRUE; List args = new ArrayList(); if (extraParameterFlags >= 0) { if (baseArgsCount > 0) { ExposedState myState = new ExposedState(baseArgsCount); residueSource.findResidue(shadow, myState); for (int i=0; i < baseArgsCount; i++) { Var v = myState.get(i); if (v == null) continue; args.add(v); ret = Test.makeAnd(ret, Test.makeInstanceof(v, testMethod.getParameterTypes()[i].resolve(shadow.getIWorld()))); } } if ((extraParameterFlags & Advice.ThisJoinPoint) != 0) { args.add(shadow.getThisJoinPointVar()); }
155,347
Bug 155347 NPE during compilation of class file with pointcuts
I commented out a static nested aspect inside a class to let me do a rename refactoring in Eclipse. This results in the following exception, which even a full rebuild won't fix. The class does have pointcut definitions inside of it. Commenting those out avoids the problem (though it caused other syntax errors...) java.lang.ArrayIndexOutOfBoundsException at org.aspectj.weaver.patterns.IfPointcut.findResidueInternal(IfPointcut.java:186) at org.aspectj.weaver.patterns.Pointcut.findResidue(Pointcut.java:269) at org.aspectj.weaver.patterns.AndPointcut.findResidueInternal(AndPointcut.java:93) at org.aspectj.weaver.patterns.Pointcut.findResidue(Pointcut.java:269) at org.aspectj.weaver.patterns.AndPointcut.findResidueInternal(AndPointcut.java:93) at or ... ses when weaving when batch building BuildConfig[C:\devel\glassbox\.metadata\.plugins\org.eclipse.ajdt.core\glassboxAgent.generated.lst] #Files=210
resolved fixed
248962b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-06-10T20:48:36Z
2006-08-27T23:06:40Z
weaver/src/org/aspectj/weaver/patterns/IfPointcut.java
if ((extraParameterFlags & Advice.ThisJoinPointStaticPart) != 0) { args.add(shadow.getThisJoinPointStaticPartVar()); } if ((extraParameterFlags & Advice.ThisEnclosingJoinPointStaticPart) != 0) { args.add(shadow.getThisEnclosingJoinPointStaticPartVar()); } } else { int currentStateIndex = 0; for (int i = 0; i < testMethod.getParameterTypes().length; i++) { String argSignature = testMethod.getParameterTypes()[i].getSignature(); if (AjcMemberMaker.TYPEX_JOINPOINT.getSignature().equals(argSignature)) { args.add(shadow.getThisJoinPointVar()); } else if (AjcMemberMaker.TYPEX_PROCEEDINGJOINPOINT.getSignature().equals(argSignature)) { args.add(shadow.getThisJoinPointVar()); } else if (AjcMemberMaker.TYPEX_STATICJOINPOINT.getSignature().equals(argSignature)) { args.add(shadow.getThisJoinPointStaticPartVar()); } else if (AjcMemberMaker.TYPEX_ENCLOSINGSTATICJOINPOINT.getSignature().equals(argSignature)) { args.add(shadow.getThisEnclosingJoinPointStaticPartVar()); } else { Var v = state.get(currentStateIndex++); args.add(v); ret = Test.makeAnd(ret, Test.makeInstanceof(v, testMethod.getParameterTypes()[i].resolve(shadow.getIWorld()))); } } }
155,347
Bug 155347 NPE during compilation of class file with pointcuts
I commented out a static nested aspect inside a class to let me do a rename refactoring in Eclipse. This results in the following exception, which even a full rebuild won't fix. The class does have pointcut definitions inside of it. Commenting those out avoids the problem (though it caused other syntax errors...) java.lang.ArrayIndexOutOfBoundsException at org.aspectj.weaver.patterns.IfPointcut.findResidueInternal(IfPointcut.java:186) at org.aspectj.weaver.patterns.Pointcut.findResidue(Pointcut.java:269) at org.aspectj.weaver.patterns.AndPointcut.findResidueInternal(AndPointcut.java:93) at org.aspectj.weaver.patterns.Pointcut.findResidue(Pointcut.java:269) at org.aspectj.weaver.patterns.AndPointcut.findResidueInternal(AndPointcut.java:93) at or ... ses when weaving when batch building BuildConfig[C:\devel\glassbox\.metadata\.plugins\org.eclipse.ajdt.core\glassboxAgent.generated.lst] #Files=210
resolved fixed
248962b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-06-10T20:48:36Z
2006-08-27T23:06:40Z
weaver/src/org/aspectj/weaver/patterns/IfPointcut.java
ret = Test.makeAnd(ret, Test.makeCall(testMethod, (Expr[])args.toArray(new Expr[args.size()]))); ifLastMatchedShadowId = shadow.shadowId; ifLastMatchedShadowResidue = ret; return ret; } finally { findingResidue = false; } } protected boolean shouldCopyLocationForConcretize() { return false; } private IfPointcut partiallyConcretized = null; public Pointcut concretize1(ResolvedType inAspect, ResolvedType declaringType, IntMap bindings) { if (isDeclare(bindings.getEnclosingAdvice())) { inAspect.getWorld().showMessage(IMessage.ERROR, WeaverMessages.format(WeaverMessages.IF_IN_DECLARE), bindings.getEnclosingAdvice().getSourceLocation(), null); return Pointcut.makeMatchesNothing(Pointcut.CONCRETE); }
155,347
Bug 155347 NPE during compilation of class file with pointcuts
I commented out a static nested aspect inside a class to let me do a rename refactoring in Eclipse. This results in the following exception, which even a full rebuild won't fix. The class does have pointcut definitions inside of it. Commenting those out avoids the problem (though it caused other syntax errors...) java.lang.ArrayIndexOutOfBoundsException at org.aspectj.weaver.patterns.IfPointcut.findResidueInternal(IfPointcut.java:186) at org.aspectj.weaver.patterns.Pointcut.findResidue(Pointcut.java:269) at org.aspectj.weaver.patterns.AndPointcut.findResidueInternal(AndPointcut.java:93) at org.aspectj.weaver.patterns.Pointcut.findResidue(Pointcut.java:269) at org.aspectj.weaver.patterns.AndPointcut.findResidueInternal(AndPointcut.java:93) at or ... ses when weaving when batch building BuildConfig[C:\devel\glassbox\.metadata\.plugins\org.eclipse.ajdt.core\glassboxAgent.generated.lst] #Files=210
resolved fixed
248962b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-06-10T20:48:36Z
2006-08-27T23:06:40Z
weaver/src/org/aspectj/weaver/patterns/IfPointcut.java
if (partiallyConcretized != null) { return partiallyConcretized; } final IfPointcut ret; if (extraParameterFlags < 0 && testMethod == null) { ResolvedPointcutDefinition def = bindings.peekEnclosingDefinition(); if (def != null) { ResolvedType aspect = inAspect.getWorld().resolve(def.getDeclaringType()); for (Iterator memberIter = aspect.getMethods(); memberIter.hasNext();) { ResolvedMember method = (ResolvedMember) memberIter.next(); if (def.getName().equals(method.getName()) && def.getParameterTypes().length == method.getParameterTypes().length) { boolean sameSig = true; for (int j = 0; j < method.getParameterTypes().length; j++) { UnresolvedType argJ = method.getParameterTypes()[j]; if (!argJ.equals(def.getParameterTypes()[j])) { sameSig = false; break; } } if (sameSig) { testMethod = method; break; } } } if (testMethod == null) { inAspect.getWorld().showMessage( IMessage.ERROR,
155,347
Bug 155347 NPE during compilation of class file with pointcuts
I commented out a static nested aspect inside a class to let me do a rename refactoring in Eclipse. This results in the following exception, which even a full rebuild won't fix. The class does have pointcut definitions inside of it. Commenting those out avoids the problem (though it caused other syntax errors...) java.lang.ArrayIndexOutOfBoundsException at org.aspectj.weaver.patterns.IfPointcut.findResidueInternal(IfPointcut.java:186) at org.aspectj.weaver.patterns.Pointcut.findResidue(Pointcut.java:269) at org.aspectj.weaver.patterns.AndPointcut.findResidueInternal(AndPointcut.java:93) at org.aspectj.weaver.patterns.Pointcut.findResidue(Pointcut.java:269) at org.aspectj.weaver.patterns.AndPointcut.findResidueInternal(AndPointcut.java:93) at or ... ses when weaving when batch building BuildConfig[C:\devel\glassbox\.metadata\.plugins\org.eclipse.ajdt.core\glassboxAgent.generated.lst] #Files=210
resolved fixed
248962b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-06-10T20:48:36Z
2006-08-27T23:06:40Z
weaver/src/org/aspectj/weaver/patterns/IfPointcut.java
"Cannot find if() body from '" + def.toString() + "' for '" + enclosingPointcutHint + "'", this.getSourceLocation(), null ); return Pointcut.makeMatchesNothing(Pointcut.CONCRETE); } } else { testMethod = inAspect.getWorld().resolve(bindings.getAdviceSignature()); } ret = new IfPointcut(enclosingPointcutHint); ret.testMethod = testMethod; } else { ret = new IfPointcut(testMethod, extraParameterFlags); } ret.copyLocationFrom(this); partiallyConcretized = ret; if (bindings.directlyInAdvice() && bindings.getEnclosingAdvice()==null) { inAspect.getWorld().showMessage(IMessage.ERROR, WeaverMessages.format(WeaverMessages.IF_IN_PERCLAUSE), this.getSourceLocation(),null); return Pointcut.makeMatchesNothing(Pointcut.CONCRETE); }
155,347
Bug 155347 NPE during compilation of class file with pointcuts
I commented out a static nested aspect inside a class to let me do a rename refactoring in Eclipse. This results in the following exception, which even a full rebuild won't fix. The class does have pointcut definitions inside of it. Commenting those out avoids the problem (though it caused other syntax errors...) java.lang.ArrayIndexOutOfBoundsException at org.aspectj.weaver.patterns.IfPointcut.findResidueInternal(IfPointcut.java:186) at org.aspectj.weaver.patterns.Pointcut.findResidue(Pointcut.java:269) at org.aspectj.weaver.patterns.AndPointcut.findResidueInternal(AndPointcut.java:93) at org.aspectj.weaver.patterns.Pointcut.findResidue(Pointcut.java:269) at org.aspectj.weaver.patterns.AndPointcut.findResidueInternal(AndPointcut.java:93) at or ... ses when weaving when batch building BuildConfig[C:\devel\glassbox\.metadata\.plugins\org.eclipse.ajdt.core\glassboxAgent.generated.lst] #Files=210
resolved fixed
248962b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-06-10T20:48:36Z
2006-08-27T23:06:40Z
weaver/src/org/aspectj/weaver/patterns/IfPointcut.java
if (bindings.directlyInAdvice()) { ShadowMunger advice = bindings.getEnclosingAdvice(); if (advice instanceof Advice) { ret.baseArgsCount = ((Advice)advice).getBaseParameterCount(); } else { ret.baseArgsCount = 0; } ret.residueSource = advice.getPointcut().concretize(inAspect, inAspect, ret.baseArgsCount, advice); } else { ResolvedPointcutDefinition def = bindings.peekEnclosingDefinition(); if (def == CflowPointcut.CFLOW_MARKER) { inAspect.getWorld().showMessage(IMessage.ERROR, WeaverMessages.format(WeaverMessages.IF_LEXICALLY_IN_CFLOW), getSourceLocation(), null); return Pointcut.makeMatchesNothing(Pointcut.CONCRETE); } ret.baseArgsCount = def.getParameterTypes().length; if (ret.extraParameterFlags < 0) { ret.baseArgsCount = 0; for (int i = 0; i < testMethod.getParameterTypes().length; i++) { String argSignature = testMethod.getParameterTypes()[i].getSignature(); if (AjcMemberMaker.TYPEX_JOINPOINT.getSignature().equals(argSignature) || AjcMemberMaker.TYPEX_PROCEEDINGJOINPOINT.getSignature().equals(argSignature) || AjcMemberMaker.TYPEX_STATICJOINPOINT.getSignature().equals(argSignature) || AjcMemberMaker.TYPEX_ENCLOSINGSTATICJOINPOINT.getSignature().equals(argSignature)) { ; } else { ret.baseArgsCount++;
155,347
Bug 155347 NPE during compilation of class file with pointcuts
I commented out a static nested aspect inside a class to let me do a rename refactoring in Eclipse. This results in the following exception, which even a full rebuild won't fix. The class does have pointcut definitions inside of it. Commenting those out avoids the problem (though it caused other syntax errors...) java.lang.ArrayIndexOutOfBoundsException at org.aspectj.weaver.patterns.IfPointcut.findResidueInternal(IfPointcut.java:186) at org.aspectj.weaver.patterns.Pointcut.findResidue(Pointcut.java:269) at org.aspectj.weaver.patterns.AndPointcut.findResidueInternal(AndPointcut.java:93) at org.aspectj.weaver.patterns.Pointcut.findResidue(Pointcut.java:269) at org.aspectj.weaver.patterns.AndPointcut.findResidueInternal(AndPointcut.java:93) at or ... ses when weaving when batch building BuildConfig[C:\devel\glassbox\.metadata\.plugins\org.eclipse.ajdt.core\glassboxAgent.generated.lst] #Files=210
resolved fixed
248962b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-06-10T20:48:36Z
2006-08-27T23:06:40Z
weaver/src/org/aspectj/weaver/patterns/IfPointcut.java
} } } IntMap newBindings = IntMap.idMap(ret.baseArgsCount); newBindings.copyContext(bindings); ret.residueSource = def.getPointcut().concretize(inAspect, declaringType, newBindings); } return ret; } public Pointcut parameterizeWith(Map typeVariableMap,World w) { return this; } public static IfPointcut makeIfFalsePointcut(State state) { IfPointcut ret = new IfFalsePointcut(); ret.state = state; return ret; } public Object accept(PatternNodeVisitor visitor, Object data) { return visitor.visit(this, data); } public static class IfFalsePointcut extends IfPointcut { public IfFalsePointcut() { super(null,0); this.pointcutKind = Pointcut.IF_FALSE; }
155,347
Bug 155347 NPE during compilation of class file with pointcuts
I commented out a static nested aspect inside a class to let me do a rename refactoring in Eclipse. This results in the following exception, which even a full rebuild won't fix. The class does have pointcut definitions inside of it. Commenting those out avoids the problem (though it caused other syntax errors...) java.lang.ArrayIndexOutOfBoundsException at org.aspectj.weaver.patterns.IfPointcut.findResidueInternal(IfPointcut.java:186) at org.aspectj.weaver.patterns.Pointcut.findResidue(Pointcut.java:269) at org.aspectj.weaver.patterns.AndPointcut.findResidueInternal(AndPointcut.java:93) at org.aspectj.weaver.patterns.Pointcut.findResidue(Pointcut.java:269) at org.aspectj.weaver.patterns.AndPointcut.findResidueInternal(AndPointcut.java:93) at or ... ses when weaving when batch building BuildConfig[C:\devel\glassbox\.metadata\.plugins\org.eclipse.ajdt.core\glassboxAgent.generated.lst] #Files=210
resolved fixed
248962b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-06-10T20:48:36Z
2006-08-27T23:06:40Z
weaver/src/org/aspectj/weaver/patterns/IfPointcut.java
public int couldMatchKinds() { return Shadow.NO_SHADOW_KINDS_BITS; } public boolean alwaysFalse() { return true; } protected Test findResidueInternal(Shadow shadow, ExposedState state) { return Literal.FALSE; } public FuzzyBoolean fastMatch(FastMatchInfo type) { return FuzzyBoolean.NO; } protected FuzzyBoolean matchInternal(Shadow shadow) { return FuzzyBoolean.NO; } public FuzzyBoolean match(JoinPoint.StaticPart jpsp) { return FuzzyBoolean.NO; } public void resolveBindings(IScope scope, Bindings bindings) { } public void postRead(ResolvedType enclosingType) { } public Pointcut concretize1( ResolvedType inAspect, ResolvedType declaringType,
155,347
Bug 155347 NPE during compilation of class file with pointcuts
I commented out a static nested aspect inside a class to let me do a rename refactoring in Eclipse. This results in the following exception, which even a full rebuild won't fix. The class does have pointcut definitions inside of it. Commenting those out avoids the problem (though it caused other syntax errors...) java.lang.ArrayIndexOutOfBoundsException at org.aspectj.weaver.patterns.IfPointcut.findResidueInternal(IfPointcut.java:186) at org.aspectj.weaver.patterns.Pointcut.findResidue(Pointcut.java:269) at org.aspectj.weaver.patterns.AndPointcut.findResidueInternal(AndPointcut.java:93) at org.aspectj.weaver.patterns.Pointcut.findResidue(Pointcut.java:269) at org.aspectj.weaver.patterns.AndPointcut.findResidueInternal(AndPointcut.java:93) at or ... ses when weaving when batch building BuildConfig[C:\devel\glassbox\.metadata\.plugins\org.eclipse.ajdt.core\glassboxAgent.generated.lst] #Files=210
resolved fixed
248962b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-06-10T20:48:36Z
2006-08-27T23:06:40Z
weaver/src/org/aspectj/weaver/patterns/IfPointcut.java
IntMap bindings) { if (isDeclare(bindings.getEnclosingAdvice())) { inAspect.getWorld().showMessage(IMessage.ERROR, WeaverMessages.format(WeaverMessages.IF_IN_DECLARE), bindings.getEnclosingAdvice().getSourceLocation(), null); return Pointcut.makeMatchesNothing(Pointcut.CONCRETE); } return makeIfFalsePointcut(state); } public void write(DataOutputStream s) throws IOException { s.writeByte(Pointcut.IF_FALSE); } public int hashCode() { int result = 17; return result; } public String toString() { return "if(false)"; } } public static IfPointcut makeIfTruePointcut(State state) { IfPointcut ret = new IfTruePointcut(); ret.state = state; return ret; } public static class IfTruePointcut extends IfPointcut {
155,347
Bug 155347 NPE during compilation of class file with pointcuts
I commented out a static nested aspect inside a class to let me do a rename refactoring in Eclipse. This results in the following exception, which even a full rebuild won't fix. The class does have pointcut definitions inside of it. Commenting those out avoids the problem (though it caused other syntax errors...) java.lang.ArrayIndexOutOfBoundsException at org.aspectj.weaver.patterns.IfPointcut.findResidueInternal(IfPointcut.java:186) at org.aspectj.weaver.patterns.Pointcut.findResidue(Pointcut.java:269) at org.aspectj.weaver.patterns.AndPointcut.findResidueInternal(AndPointcut.java:93) at org.aspectj.weaver.patterns.Pointcut.findResidue(Pointcut.java:269) at org.aspectj.weaver.patterns.AndPointcut.findResidueInternal(AndPointcut.java:93) at or ... ses when weaving when batch building BuildConfig[C:\devel\glassbox\.metadata\.plugins\org.eclipse.ajdt.core\glassboxAgent.generated.lst] #Files=210
resolved fixed
248962b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-06-10T20:48:36Z
2006-08-27T23:06:40Z
weaver/src/org/aspectj/weaver/patterns/IfPointcut.java
public IfTruePointcut() { super(null,0); this.pointcutKind = Pointcut.IF_TRUE; } public boolean alwaysTrue() { return true; } protected Test findResidueInternal(Shadow shadow, ExposedState state) { return Literal.TRUE; } public FuzzyBoolean fastMatch(FastMatchInfo type) { return FuzzyBoolean.YES; } protected FuzzyBoolean matchInternal(Shadow shadow) { return FuzzyBoolean.YES; } public FuzzyBoolean match(JoinPoint.StaticPart jpsp) { return FuzzyBoolean.YES; } public void resolveBindings(IScope scope, Bindings bindings) { } public void postRead(ResolvedType enclosingType) {
155,347
Bug 155347 NPE during compilation of class file with pointcuts
I commented out a static nested aspect inside a class to let me do a rename refactoring in Eclipse. This results in the following exception, which even a full rebuild won't fix. The class does have pointcut definitions inside of it. Commenting those out avoids the problem (though it caused other syntax errors...) java.lang.ArrayIndexOutOfBoundsException at org.aspectj.weaver.patterns.IfPointcut.findResidueInternal(IfPointcut.java:186) at org.aspectj.weaver.patterns.Pointcut.findResidue(Pointcut.java:269) at org.aspectj.weaver.patterns.AndPointcut.findResidueInternal(AndPointcut.java:93) at org.aspectj.weaver.patterns.Pointcut.findResidue(Pointcut.java:269) at org.aspectj.weaver.patterns.AndPointcut.findResidueInternal(AndPointcut.java:93) at or ... ses when weaving when batch building BuildConfig[C:\devel\glassbox\.metadata\.plugins\org.eclipse.ajdt.core\glassboxAgent.generated.lst] #Files=210
resolved fixed
248962b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-06-10T20:48:36Z
2006-08-27T23:06:40Z
weaver/src/org/aspectj/weaver/patterns/IfPointcut.java
} public Pointcut concretize1( ResolvedType inAspect, ResolvedType declaringType, IntMap bindings) { if (isDeclare(bindings.getEnclosingAdvice())) { inAspect.getWorld().showMessage(IMessage.ERROR, WeaverMessages.format(WeaverMessages.IF_IN_DECLARE), bindings.getEnclosingAdvice().getSourceLocation(), null); return Pointcut.makeMatchesNothing(Pointcut.CONCRETE); } return makeIfTruePointcut(state); } public void write(DataOutputStream s) throws IOException { s.writeByte(IF_TRUE); } public int hashCode() { int result = 37; return result; } public String toString() { return "if(true)"; } } }
203,367
Bug 203367 ITD of interface on generic type; can't match calls to methods on interface+
Build ID: I20070621-1340 Steps To Reproduce: package bug; // I used a "bug" package under the "src" source folder. public aspect CantMatchOnInterfaceIntroducedToGenericClass { public static interface Marker {} public static class NonGenericClass { public void doit(String msg) { System.out.println("doit(): msg = "+msg); } } public static class GenericClass<T> { public void doit(T t) { System.out.println("doit<T>(): t = "+t); } } declare parents: NonGenericClass implements Marker; declare parents: GenericClass implements Marker; pointcut nonGenericCall(): call (void NonGenericClass.doit(..)); pointcut genericCall(): call (void GenericClass.doit(..)); pointcut markerCall(): call (void Marker+.doit(..)); before(): nonGenericCall() { System.out.println("nonGenericCall: "+thisJoinPointStaticPart); } before(): genericCall() { System.out.println("genericCall: "+thisJoinPointStaticPart); } before(): markerCall() { System.out.println("markerCall: "+thisJoinPointStaticPart); } public static void main(String args[]) { new NonGenericClass().doit("message1"); new GenericClass<Integer>().doit(new Integer(2)); } } More information: The code pasted in the "steps" demonstrates the bug.
resolved fixed
11ebdd8
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-06-17T04:02:05Z
2007-09-13T21:46:40Z
tests/src/org/aspectj/systemtest/ajc161/Ajc161Tests.java
/******************************************************************************* * Copyright (c) 2008 Contributors * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Andy Clement - initial API and implementation *******************************************************************************/ package org.aspectj.systemtest.ajc161; import java.io.File; import java.util.Iterator; import java.util.Set; import junit.framework.Test; import org.aspectj.asm.AsmManager; import org.aspectj.asm.IRelationshipMap; import org.aspectj.testing.XMLBasedAjcTestCase; public class Ajc161Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
203,367
Bug 203367 ITD of interface on generic type; can't match calls to methods on interface+
Build ID: I20070621-1340 Steps To Reproduce: package bug; // I used a "bug" package under the "src" source folder. public aspect CantMatchOnInterfaceIntroducedToGenericClass { public static interface Marker {} public static class NonGenericClass { public void doit(String msg) { System.out.println("doit(): msg = "+msg); } } public static class GenericClass<T> { public void doit(T t) { System.out.println("doit<T>(): t = "+t); } } declare parents: NonGenericClass implements Marker; declare parents: GenericClass implements Marker; pointcut nonGenericCall(): call (void NonGenericClass.doit(..)); pointcut genericCall(): call (void GenericClass.doit(..)); pointcut markerCall(): call (void Marker+.doit(..)); before(): nonGenericCall() { System.out.println("nonGenericCall: "+thisJoinPointStaticPart); } before(): genericCall() { System.out.println("genericCall: "+thisJoinPointStaticPart); } before(): markerCall() { System.out.println("markerCall: "+thisJoinPointStaticPart); } public static void main(String args[]) { new NonGenericClass().doit("message1"); new GenericClass<Integer>().doit(new Integer(2)); } } More information: The code pasted in the "steps" demonstrates the bug.
resolved fixed
11ebdd8
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-06-17T04:02:05Z
2007-09-13T21:46:40Z
tests/src/org/aspectj/systemtest/ajc161/Ajc161Tests.java
public void testSuperItds_pr198196_1() { runTest("super itds - 2"); } public void testSuperItds_pr198196_2() { runTest("super itds - 3"); } public void testSuperItds_pr198196_3() { runTest("super itds - 4"); } public void testRunningBrokenCode_pr102733_2() { runTest("running broken code - 2"); } public void testRunningBrokenCode_pr102733() { runTest("running broken code"); } public void testErrorOnNonabstractGenericAtAspectJAspect_pr168982() { runTest("error on non-abstract generic ataspectj aspect");} public void testIgnoringTypeLevelSuppression_pr234933() { runTest("ignoring type level suppress");} public void testDuplicateMethodSignature_pr223226_2() { runTest("duplicate method signature - 2"); } public void testDuplicateMethodSignature_pr223226() { runTest("duplicate method signature"); } public void testProtectedMethodsAroundAdvice_pr197719_2() { runTest("protected methods and around advice - again - 2");} public void testProtectedMethodsAroundAdvice_pr197719() { runTest("protected methods and around advice - again");} public void testProtectedMethodsAroundAdvice_pr230075() { runTest("protected methods and around advice");} public void testFinalStringsAnnotationPointcut_pr174385() { runTest("static strings in annotation pointcuts");} public void testComplexBoundsGenericAspect_pr199130_1() { runTest("complex bounds on generic aspect - 1");} public void testComplexBoundsGenericAspect_pr199130_2() { runTest("complex bounds on generic aspect - 2");} public void testComplexBoundsGenericAspect_pr199130_3() { runTest("complex bounds on generic aspect - 3");} public void testPrivilegedGenericAspect_pr235505() { runTest("privileged generic aspect");} public void testPrivilegedGenericAspect_pr235505_2() { runTest("privileged generic aspect - 2");} public void testParsingAroundNoReturn_pr64222() { runTest("parsing around advice no return");} public void testParsingBeforeArrayRef_pr159268() { runTest("before array name");} public void testGenericAspectAroundAdvice_pr226201() { runTest("generic aspect around advice");} public void testCrazyGenericsInnerTypes_pr235829() { runTest("crazy generics and inner types");} public void testAnnotationExposureGenerics_pr235597() { runTest("annotation exposure and generics");} public void testIncorrectRelationship_pr235204() { runTest("incorrect call relationship");
203,367
Bug 203367 ITD of interface on generic type; can't match calls to methods on interface+
Build ID: I20070621-1340 Steps To Reproduce: package bug; // I used a "bug" package under the "src" source folder. public aspect CantMatchOnInterfaceIntroducedToGenericClass { public static interface Marker {} public static class NonGenericClass { public void doit(String msg) { System.out.println("doit(): msg = "+msg); } } public static class GenericClass<T> { public void doit(T t) { System.out.println("doit<T>(): t = "+t); } } declare parents: NonGenericClass implements Marker; declare parents: GenericClass implements Marker; pointcut nonGenericCall(): call (void NonGenericClass.doit(..)); pointcut genericCall(): call (void GenericClass.doit(..)); pointcut markerCall(): call (void Marker+.doit(..)); before(): nonGenericCall() { System.out.println("nonGenericCall: "+thisJoinPointStaticPart); } before(): genericCall() { System.out.println("genericCall: "+thisJoinPointStaticPart); } before(): markerCall() { System.out.println("markerCall: "+thisJoinPointStaticPart); } public static void main(String args[]) { new NonGenericClass().doit("message1"); new GenericClass<Integer>().doit(new Integer(2)); } } More information: The code pasted in the "steps" demonstrates the bug.
resolved fixed
11ebdd8
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-06-17T04:02:05Z
2007-09-13T21:46:40Z
tests/src/org/aspectj/systemtest/ajc161/Ajc161Tests.java
IRelationshipMap irm = AsmManager.getDefault().getRelationshipMap(); Set entries = irm.getEntries(); boolean gotSomethingValid = false; String expected = "<recursivepackage{RecursiveCatcher.java}RecursiveCatcher~recursiveCall~I?method-call(void recursivepackage.RecursiveCatcher.recursiveCall(int))"; for (Iterator iterator = entries.iterator(); iterator.hasNext();) { String str = (String) iterator.next(); if (str.indexOf(expected)!=-1) gotSomethingValid = true; } if (!gotSomethingValid) { fail("Did not find a relationship with the expected data in '"+expected+"'"); } } public void testITDPrecedence_pr233838_1() { runTest("itd precedence - 1"); } public void testITDPrecedence_pr233838_2() { runTest("itd precedence - 2"); } public void testGetFieldGenerics_pr227401() { runTest("getfield problem with generics");} public void testGenericAbstractAspects_pr231478() { runTest("generic abstract aspects"); } public void testFieldJoinpointsAndAnnotationValues_pr227993() { runTest("field jp anno value"); } public void testGenericsBoundsDecp_pr231187() { runTest("generics bounds decp"); } public void testGenericsBoundsDecp_pr231187_2() { runTest("generics bounds decp - 2"); } public void testLtwInheritedCflow_pr230134() { runTest("ltw inherited cflow"); } public void testAroundAdviceOnFieldSet_pr229910() { runTest("around advice on field set"); } public void testPipelineCompilationGenericReturnType_pr226567() { runTest("pipeline compilation and generic return type"); } public static Test suite() { return XMLBasedAjcTestCase.loadSuite(Ajc161Tests.class); } protected File getSpecFile() { return new File("../tests/src/org/aspectj/systemtest/ajc161/ajc161.xml"); } }
237,962
Bug 237962 [migration] Unexpected problem loading an aspect built with 1.5.4
We always support processing of old aspects. It doesn't matter what level of AspectJ was used to build an aspect, as long as you use that version or a later version of the weaver, we can unpack it and don't require it to be rebuilt from source. However, I've just encountered a .class apparently built with 1.5.4 that 1.6.1 cannot load. It crashes deserializing a PointcutDeclaration. In the data stream we have just read the numbers 1 and 3 indicating 'kinded pointcut' and then 'method-execution' and the next digit is a 0 when it should be 1-9. We crash with a: org.aspectj.weaver.BCException: weird kind 0 when batch building BuildConfig[null] #Files=43 at org.aspectj.weaver.MemberKind.read(MemberKind.java:35) at org.aspectj.weaver.patterns.SignaturePattern.read(SignaturePattern.java:682) The memberkind is a typesafeenum and so can never be other than 1-9. It is the first part of a signaturepattern so hard to see how it got written out 'wrong' right now. I've been told 1.5.4 can load this, so about to try that. Wow....1.5.4 did load it back in, how the hell. I suspect we aren't consuming enough in 1.6.1 which then leaves us some extra that we interpret as a rogue pointcut. Ok, in a comparison we consume one extra byte from the stream when reading it with 1.6.1 that we do not consume with 1.6.0 - at position 260. As I got closer to it, I knew what it would be - especially when I knew it was just one byte difference. The version check for whether the byte for 'annotation pattern relates to a parameter match' was wrong (urgh).
resolved fixed
be03167
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-06-20T17:15:52Z
2008-06-20T16:40:00Z
weaver/src/org/aspectj/weaver/patterns/AndAnnotationTypePattern.java
/* ******************************************************************* * Copyright (c) 2004 IBM Corporation. * All rights reserved. * This program and the accompanying materials are made available * under the terms of the Eclipse Public License v1.0 * which accompanies this distribution and is available at * http://www.eclipse.org/legal/epl-v10.html * * ******************************************************************/ package org.aspectj.weaver.patterns; import java.io.DataOutputStream; import java.io.IOException; import java.util.Map; import org.aspectj.util.FuzzyBoolean; import org.aspectj.weaver.AnnotatedElement; import org.aspectj.weaver.ISourceContext; import org.aspectj.weaver.VersionedDataInputStream; import org.aspectj.weaver.World; import org.aspectj.weaver.AjAttribute.WeaverVersionInfo; import org.aspectj.weaver.ResolvedType; /** * @author colyer * * TODO To change the template for this generated type comment go to * Window - Preferences - Java - Code Style - Code Templates */ public class AndAnnotationTypePattern extends AnnotationTypePattern {
237,962
Bug 237962 [migration] Unexpected problem loading an aspect built with 1.5.4
We always support processing of old aspects. It doesn't matter what level of AspectJ was used to build an aspect, as long as you use that version or a later version of the weaver, we can unpack it and don't require it to be rebuilt from source. However, I've just encountered a .class apparently built with 1.5.4 that 1.6.1 cannot load. It crashes deserializing a PointcutDeclaration. In the data stream we have just read the numbers 1 and 3 indicating 'kinded pointcut' and then 'method-execution' and the next digit is a 0 when it should be 1-9. We crash with a: org.aspectj.weaver.BCException: weird kind 0 when batch building BuildConfig[null] #Files=43 at org.aspectj.weaver.MemberKind.read(MemberKind.java:35) at org.aspectj.weaver.patterns.SignaturePattern.read(SignaturePattern.java:682) The memberkind is a typesafeenum and so can never be other than 1-9. It is the first part of a signaturepattern so hard to see how it got written out 'wrong' right now. I've been told 1.5.4 can load this, so about to try that. Wow....1.5.4 did load it back in, how the hell. I suspect we aren't consuming enough in 1.6.1 which then leaves us some extra that we interpret as a rogue pointcut. Ok, in a comparison we consume one extra byte from the stream when reading it with 1.6.1 that we do not consume with 1.6.0 - at position 260. As I got closer to it, I knew what it would be - especially when I knew it was just one byte difference. The version check for whether the byte for 'annotation pattern relates to a parameter match' was wrong (urgh).
resolved fixed
be03167
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-06-20T17:15:52Z
2008-06-20T16:40:00Z
weaver/src/org/aspectj/weaver/patterns/AndAnnotationTypePattern.java
private AnnotationTypePattern left; private AnnotationTypePattern right; public AndAnnotationTypePattern(AnnotationTypePattern left, AnnotationTypePattern right) {
237,962
Bug 237962 [migration] Unexpected problem loading an aspect built with 1.5.4
We always support processing of old aspects. It doesn't matter what level of AspectJ was used to build an aspect, as long as you use that version or a later version of the weaver, we can unpack it and don't require it to be rebuilt from source. However, I've just encountered a .class apparently built with 1.5.4 that 1.6.1 cannot load. It crashes deserializing a PointcutDeclaration. In the data stream we have just read the numbers 1 and 3 indicating 'kinded pointcut' and then 'method-execution' and the next digit is a 0 when it should be 1-9. We crash with a: org.aspectj.weaver.BCException: weird kind 0 when batch building BuildConfig[null] #Files=43 at org.aspectj.weaver.MemberKind.read(MemberKind.java:35) at org.aspectj.weaver.patterns.SignaturePattern.read(SignaturePattern.java:682) The memberkind is a typesafeenum and so can never be other than 1-9. It is the first part of a signaturepattern so hard to see how it got written out 'wrong' right now. I've been told 1.5.4 can load this, so about to try that. Wow....1.5.4 did load it back in, how the hell. I suspect we aren't consuming enough in 1.6.1 which then leaves us some extra that we interpret as a rogue pointcut. Ok, in a comparison we consume one extra byte from the stream when reading it with 1.6.1 that we do not consume with 1.6.0 - at position 260. As I got closer to it, I knew what it would be - especially when I knew it was just one byte difference. The version check for whether the byte for 'annotation pattern relates to a parameter match' was wrong (urgh).
resolved fixed
be03167
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-06-20T17:15:52Z
2008-06-20T16:40:00Z
weaver/src/org/aspectj/weaver/patterns/AndAnnotationTypePattern.java
this.left = left; this.right = right; setLocation(left.getSourceContext(), left.getStart(), right.getEnd()); } public FuzzyBoolean matches(AnnotatedElement annotated) { return left.matches(annotated).and(right.matches(annotated)); } public FuzzyBoolean matches(AnnotatedElement annotated, ResolvedType[] parameterAnnotations ) { return left.matches(annotated,parameterAnnotations).and(right.matches(annotated,parameterAnnotations)); } public void resolve(World world) { left.resolve(world); right.resolve(world); } /* (non-Javadoc) * @see org.aspectj.weaver.patterns.AnnotationTypePattern#resolveBindings(org.aspectj.weaver.patterns.IScope, org.aspectj.weaver.patterns.Bindings, boolean) */ public AnnotationTypePattern resolveBindings(IScope scope, Bindings bindings, boolean allowBinding) { left = left.resolveBindings(scope,bindings,allowBinding); right =right.resolveBindings(scope,bindings,allowBinding); return this; } public AnnotationTypePattern parameterizeWith(Map typeVariableMap,World w) { AnnotationTypePattern newLeft = left.parameterizeWith(typeVariableMap,w); AnnotationTypePattern newRight = right.parameterizeWith(typeVariableMap,w); AndAnnotationTypePattern ret = new AndAnnotationTypePattern(newLeft,newRight);
237,962
Bug 237962 [migration] Unexpected problem loading an aspect built with 1.5.4
We always support processing of old aspects. It doesn't matter what level of AspectJ was used to build an aspect, as long as you use that version or a later version of the weaver, we can unpack it and don't require it to be rebuilt from source. However, I've just encountered a .class apparently built with 1.5.4 that 1.6.1 cannot load. It crashes deserializing a PointcutDeclaration. In the data stream we have just read the numbers 1 and 3 indicating 'kinded pointcut' and then 'method-execution' and the next digit is a 0 when it should be 1-9. We crash with a: org.aspectj.weaver.BCException: weird kind 0 when batch building BuildConfig[null] #Files=43 at org.aspectj.weaver.MemberKind.read(MemberKind.java:35) at org.aspectj.weaver.patterns.SignaturePattern.read(SignaturePattern.java:682) The memberkind is a typesafeenum and so can never be other than 1-9. It is the first part of a signaturepattern so hard to see how it got written out 'wrong' right now. I've been told 1.5.4 can load this, so about to try that. Wow....1.5.4 did load it back in, how the hell. I suspect we aren't consuming enough in 1.6.1 which then leaves us some extra that we interpret as a rogue pointcut. Ok, in a comparison we consume one extra byte from the stream when reading it with 1.6.1 that we do not consume with 1.6.0 - at position 260. As I got closer to it, I knew what it would be - especially when I knew it was just one byte difference. The version check for whether the byte for 'annotation pattern relates to a parameter match' was wrong (urgh).
resolved fixed
be03167
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-06-20T17:15:52Z
2008-06-20T16:40:00Z
weaver/src/org/aspectj/weaver/patterns/AndAnnotationTypePattern.java
ret.copyLocationFrom(this); if (this.isForParameterAnnotationMatch()) ret.setForParameterAnnotationMatch(); return ret; } public static AnnotationTypePattern read(VersionedDataInputStream s, ISourceContext context) throws IOException { AnnotationTypePattern p = new AndAnnotationTypePattern( AnnotationTypePattern.read(s,context), AnnotationTypePattern.read(s,context)); p.readLocation(context,s); if (s.getMajorVersion()>=WeaverVersionInfo.WEAVER_VERSION_MINOR_AJ160) { if (s.readBoolean()) p.setForParameterAnnotationMatch(); } return p; } public void write(DataOutputStream s) throws IOException { s.writeByte(AnnotationTypePattern.AND); left.write(s); right.write(s); writeLocation(s); s.writeBoolean(isForParameterAnnotationMatch()); } public boolean equals(Object obj) { if (!(obj instanceof AndAnnotationTypePattern)) return false; AndAnnotationTypePattern other = (AndAnnotationTypePattern) obj; return (left.equals(other.left) && right.equals(other.right) && left.isForParameterAnnotationMatch()==right.isForParameterAnnotationMatch()); }
237,962
Bug 237962 [migration] Unexpected problem loading an aspect built with 1.5.4
We always support processing of old aspects. It doesn't matter what level of AspectJ was used to build an aspect, as long as you use that version or a later version of the weaver, we can unpack it and don't require it to be rebuilt from source. However, I've just encountered a .class apparently built with 1.5.4 that 1.6.1 cannot load. It crashes deserializing a PointcutDeclaration. In the data stream we have just read the numbers 1 and 3 indicating 'kinded pointcut' and then 'method-execution' and the next digit is a 0 when it should be 1-9. We crash with a: org.aspectj.weaver.BCException: weird kind 0 when batch building BuildConfig[null] #Files=43 at org.aspectj.weaver.MemberKind.read(MemberKind.java:35) at org.aspectj.weaver.patterns.SignaturePattern.read(SignaturePattern.java:682) The memberkind is a typesafeenum and so can never be other than 1-9. It is the first part of a signaturepattern so hard to see how it got written out 'wrong' right now. I've been told 1.5.4 can load this, so about to try that. Wow....1.5.4 did load it back in, how the hell. I suspect we aren't consuming enough in 1.6.1 which then leaves us some extra that we interpret as a rogue pointcut. Ok, in a comparison we consume one extra byte from the stream when reading it with 1.6.1 that we do not consume with 1.6.0 - at position 260. As I got closer to it, I knew what it would be - especially when I knew it was just one byte difference. The version check for whether the byte for 'annotation pattern relates to a parameter match' was wrong (urgh).
resolved fixed
be03167
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-06-20T17:15:52Z
2008-06-20T16:40:00Z
weaver/src/org/aspectj/weaver/patterns/AndAnnotationTypePattern.java
public int hashCode() { int result = 17; result = result*37 + left.hashCode(); result = result*37 + right.hashCode(); result = result*37 + (isForParameterAnnotationMatch()?0:1); return result; } public String toString() { return left.toString() + " " + right.toString(); } public AnnotationTypePattern getLeft() { return left; } public AnnotationTypePattern getRight() { return right; } public Object accept(PatternNodeVisitor visitor, Object data) { return visitor.visit(this, data); } public Object traverse(PatternNodeVisitor visitor, Object data) { Object ret = accept(visitor,data); left.traverse(visitor,ret); right.traverse(visitor,ret); return ret; } public void setForParameterAnnotationMatch() { left.setForParameterAnnotationMatch(); right.setForParameterAnnotationMatch(); } }
237,962
Bug 237962 [migration] Unexpected problem loading an aspect built with 1.5.4
We always support processing of old aspects. It doesn't matter what level of AspectJ was used to build an aspect, as long as you use that version or a later version of the weaver, we can unpack it and don't require it to be rebuilt from source. However, I've just encountered a .class apparently built with 1.5.4 that 1.6.1 cannot load. It crashes deserializing a PointcutDeclaration. In the data stream we have just read the numbers 1 and 3 indicating 'kinded pointcut' and then 'method-execution' and the next digit is a 0 when it should be 1-9. We crash with a: org.aspectj.weaver.BCException: weird kind 0 when batch building BuildConfig[null] #Files=43 at org.aspectj.weaver.MemberKind.read(MemberKind.java:35) at org.aspectj.weaver.patterns.SignaturePattern.read(SignaturePattern.java:682) The memberkind is a typesafeenum and so can never be other than 1-9. It is the first part of a signaturepattern so hard to see how it got written out 'wrong' right now. I've been told 1.5.4 can load this, so about to try that. Wow....1.5.4 did load it back in, how the hell. I suspect we aren't consuming enough in 1.6.1 which then leaves us some extra that we interpret as a rogue pointcut. Ok, in a comparison we consume one extra byte from the stream when reading it with 1.6.1 that we do not consume with 1.6.0 - at position 260. As I got closer to it, I knew what it would be - especially when I knew it was just one byte difference. The version check for whether the byte for 'annotation pattern relates to a parameter match' was wrong (urgh).
resolved fixed
be03167
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-06-20T17:15:52Z
2008-06-20T16:40:00Z
weaver/src/org/aspectj/weaver/patterns/NotAnnotationTypePattern.java
/* ******************************************************************* * Copyright (c) 2004 IBM Corporation. * All rights reserved. * This program and the accompanying materials are made available * under the terms of the Eclipse Public License v1.0 * which accompanies this distribution and is available at * http://www.eclipse.org/legal/epl-v10.html * * ******************************************************************/ package org.aspectj.weaver.patterns; import java.io.DataOutputStream; import java.io.IOException; import java.util.Map; import org.aspectj.util.FuzzyBoolean; import org.aspectj.weaver.AnnotatedElement; import org.aspectj.weaver.ISourceContext; import org.aspectj.weaver.ResolvedType; import org.aspectj.weaver.VersionedDataInputStream; import org.aspectj.weaver.World; import org.aspectj.weaver.AjAttribute.WeaverVersionInfo; public class NotAnnotationTypePattern extends AnnotationTypePattern {
237,962
Bug 237962 [migration] Unexpected problem loading an aspect built with 1.5.4
We always support processing of old aspects. It doesn't matter what level of AspectJ was used to build an aspect, as long as you use that version or a later version of the weaver, we can unpack it and don't require it to be rebuilt from source. However, I've just encountered a .class apparently built with 1.5.4 that 1.6.1 cannot load. It crashes deserializing a PointcutDeclaration. In the data stream we have just read the numbers 1 and 3 indicating 'kinded pointcut' and then 'method-execution' and the next digit is a 0 when it should be 1-9. We crash with a: org.aspectj.weaver.BCException: weird kind 0 when batch building BuildConfig[null] #Files=43 at org.aspectj.weaver.MemberKind.read(MemberKind.java:35) at org.aspectj.weaver.patterns.SignaturePattern.read(SignaturePattern.java:682) The memberkind is a typesafeenum and so can never be other than 1-9. It is the first part of a signaturepattern so hard to see how it got written out 'wrong' right now. I've been told 1.5.4 can load this, so about to try that. Wow....1.5.4 did load it back in, how the hell. I suspect we aren't consuming enough in 1.6.1 which then leaves us some extra that we interpret as a rogue pointcut. Ok, in a comparison we consume one extra byte from the stream when reading it with 1.6.1 that we do not consume with 1.6.0 - at position 260. As I got closer to it, I knew what it would be - especially when I knew it was just one byte difference. The version check for whether the byte for 'annotation pattern relates to a parameter match' was wrong (urgh).
resolved fixed
be03167
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-06-20T17:15:52Z
2008-06-20T16:40:00Z
weaver/src/org/aspectj/weaver/patterns/NotAnnotationTypePattern.java
AnnotationTypePattern negatedPattern; public NotAnnotationTypePattern(AnnotationTypePattern pattern) { this.negatedPattern = pattern; setLocation(pattern.getSourceContext(), pattern.getStart(), pattern.getEnd()); } /* (non-Javadoc) * @see org.aspectj.weaver.patterns.AnnotationTypePattern#matches(org.aspectj.weaver.AnnotatedElement) */ public FuzzyBoolean matches(AnnotatedElement annotated) { return negatedPattern.matches(annotated).not(); } public FuzzyBoolean matches(AnnotatedElement annotated,ResolvedType[] parameterAnnotations) { return negatedPattern.matches(annotated,parameterAnnotations).not(); } /* (non-Javadoc) * @see org.aspectj.weaver.patterns.AnnotationTypePattern#resolve(org.aspectj.weaver.World) */ public void resolve(World world) { negatedPattern.resolve(world); } /* (non-Javadoc) * @see org.aspectj.weaver.patterns.AnnotationTypePattern#resolveBindings(org.aspectj.weaver.patterns.IScope, org.aspectj.weaver.patterns.Bindings, boolean) */ public AnnotationTypePattern resolveBindings(IScope scope, Bindings bindings, boolean allowBinding) { negatedPattern = negatedPattern.resolveBindings(scope,bindings,allowBinding); return this;
237,962
Bug 237962 [migration] Unexpected problem loading an aspect built with 1.5.4
We always support processing of old aspects. It doesn't matter what level of AspectJ was used to build an aspect, as long as you use that version or a later version of the weaver, we can unpack it and don't require it to be rebuilt from source. However, I've just encountered a .class apparently built with 1.5.4 that 1.6.1 cannot load. It crashes deserializing a PointcutDeclaration. In the data stream we have just read the numbers 1 and 3 indicating 'kinded pointcut' and then 'method-execution' and the next digit is a 0 when it should be 1-9. We crash with a: org.aspectj.weaver.BCException: weird kind 0 when batch building BuildConfig[null] #Files=43 at org.aspectj.weaver.MemberKind.read(MemberKind.java:35) at org.aspectj.weaver.patterns.SignaturePattern.read(SignaturePattern.java:682) The memberkind is a typesafeenum and so can never be other than 1-9. It is the first part of a signaturepattern so hard to see how it got written out 'wrong' right now. I've been told 1.5.4 can load this, so about to try that. Wow....1.5.4 did load it back in, how the hell. I suspect we aren't consuming enough in 1.6.1 which then leaves us some extra that we interpret as a rogue pointcut. Ok, in a comparison we consume one extra byte from the stream when reading it with 1.6.1 that we do not consume with 1.6.0 - at position 260. As I got closer to it, I knew what it would be - especially when I knew it was just one byte difference. The version check for whether the byte for 'annotation pattern relates to a parameter match' was wrong (urgh).
resolved fixed
be03167
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-06-20T17:15:52Z
2008-06-20T16:40:00Z
weaver/src/org/aspectj/weaver/patterns/NotAnnotationTypePattern.java
} public AnnotationTypePattern parameterizeWith(Map typeVariableMap,World w) { AnnotationTypePattern newNegatedPattern = negatedPattern.parameterizeWith(typeVariableMap,w); NotAnnotationTypePattern ret = new NotAnnotationTypePattern(newNegatedPattern); ret.copyLocationFrom(this); if (this.isForParameterAnnotationMatch()) ret.setForParameterAnnotationMatch(); return ret; } /* (non-Javadoc) * @see org.aspectj.weaver.patterns.PatternNode#write(java.io.DataOutputStream) */ public void write(DataOutputStream s) throws IOException { s.writeByte(AnnotationTypePattern.NOT); negatedPattern.write(s); writeLocation(s); s.writeBoolean(isForParameterAnnotationMatch()); } public static AnnotationTypePattern read(VersionedDataInputStream s, ISourceContext context) throws IOException { AnnotationTypePattern ret = new NotAnnotationTypePattern(AnnotationTypePattern.read(s,context)); ret.readLocation(context,s); if (s.getMajorVersion()>=WeaverVersionInfo.WEAVER_VERSION_MINOR_AJ160) { if (s.readBoolean()) ret.setForParameterAnnotationMatch(); } return ret; } public boolean equals(Object obj) { if (!(obj instanceof NotAnnotationTypePattern)) return false;
237,962
Bug 237962 [migration] Unexpected problem loading an aspect built with 1.5.4
We always support processing of old aspects. It doesn't matter what level of AspectJ was used to build an aspect, as long as you use that version or a later version of the weaver, we can unpack it and don't require it to be rebuilt from source. However, I've just encountered a .class apparently built with 1.5.4 that 1.6.1 cannot load. It crashes deserializing a PointcutDeclaration. In the data stream we have just read the numbers 1 and 3 indicating 'kinded pointcut' and then 'method-execution' and the next digit is a 0 when it should be 1-9. We crash with a: org.aspectj.weaver.BCException: weird kind 0 when batch building BuildConfig[null] #Files=43 at org.aspectj.weaver.MemberKind.read(MemberKind.java:35) at org.aspectj.weaver.patterns.SignaturePattern.read(SignaturePattern.java:682) The memberkind is a typesafeenum and so can never be other than 1-9. It is the first part of a signaturepattern so hard to see how it got written out 'wrong' right now. I've been told 1.5.4 can load this, so about to try that. Wow....1.5.4 did load it back in, how the hell. I suspect we aren't consuming enough in 1.6.1 which then leaves us some extra that we interpret as a rogue pointcut. Ok, in a comparison we consume one extra byte from the stream when reading it with 1.6.1 that we do not consume with 1.6.0 - at position 260. As I got closer to it, I knew what it would be - especially when I knew it was just one byte difference. The version check for whether the byte for 'annotation pattern relates to a parameter match' was wrong (urgh).
resolved fixed
be03167
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-06-20T17:15:52Z
2008-06-20T16:40:00Z
weaver/src/org/aspectj/weaver/patterns/NotAnnotationTypePattern.java
NotAnnotationTypePattern other = (NotAnnotationTypePattern) obj; return other.negatedPattern.equals(negatedPattern) && other.isForParameterAnnotationMatch()==isForParameterAnnotationMatch(); } public int hashCode() { int result = 17 + 37*negatedPattern.hashCode(); result = 37*result +(isForParameterAnnotationMatch()?0:1); return result; } public String toString() { return "!" + negatedPattern.toString(); } public AnnotationTypePattern getNegatedPattern() { return negatedPattern; } public Object accept(PatternNodeVisitor visitor, Object data) { return visitor.visit(this, data); } public Object traverse(PatternNodeVisitor visitor, Object data) { Object ret = accept(visitor,data); negatedPattern.traverse(visitor,ret); return ret; } public void setForParameterAnnotationMatch() { negatedPattern.setForParameterAnnotationMatch(); } }
237,962
Bug 237962 [migration] Unexpected problem loading an aspect built with 1.5.4
We always support processing of old aspects. It doesn't matter what level of AspectJ was used to build an aspect, as long as you use that version or a later version of the weaver, we can unpack it and don't require it to be rebuilt from source. However, I've just encountered a .class apparently built with 1.5.4 that 1.6.1 cannot load. It crashes deserializing a PointcutDeclaration. In the data stream we have just read the numbers 1 and 3 indicating 'kinded pointcut' and then 'method-execution' and the next digit is a 0 when it should be 1-9. We crash with a: org.aspectj.weaver.BCException: weird kind 0 when batch building BuildConfig[null] #Files=43 at org.aspectj.weaver.MemberKind.read(MemberKind.java:35) at org.aspectj.weaver.patterns.SignaturePattern.read(SignaturePattern.java:682) The memberkind is a typesafeenum and so can never be other than 1-9. It is the first part of a signaturepattern so hard to see how it got written out 'wrong' right now. I've been told 1.5.4 can load this, so about to try that. Wow....1.5.4 did load it back in, how the hell. I suspect we aren't consuming enough in 1.6.1 which then leaves us some extra that we interpret as a rogue pointcut. Ok, in a comparison we consume one extra byte from the stream when reading it with 1.6.1 that we do not consume with 1.6.0 - at position 260. As I got closer to it, I knew what it would be - especially when I knew it was just one byte difference. The version check for whether the byte for 'annotation pattern relates to a parameter match' was wrong (urgh).
resolved fixed
be03167
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-06-20T17:15:52Z
2008-06-20T16:40:00Z
weaver/src/org/aspectj/weaver/patterns/OrAnnotationTypePattern.java
/* ******************************************************************* * Copyright (c) 2004 IBM Corporation. * All rights reserved. * This program and the accompanying materials are made available * under the terms of the Eclipse Public License v1.0 * which accompanies this distribution and is available at * http://www.eclipse.org/legal/epl-v10.html * * ******************************************************************/ package org.aspectj.weaver.patterns; import java.io.DataOutputStream; import java.io.IOException; import java.util.Map; import org.aspectj.util.FuzzyBoolean; import org.aspectj.weaver.AnnotatedElement; import org.aspectj.weaver.ISourceContext; import org.aspectj.weaver.ResolvedType; import org.aspectj.weaver.VersionedDataInputStream; import org.aspectj.weaver.World; import org.aspectj.weaver.AjAttribute.WeaverVersionInfo; public class OrAnnotationTypePattern extends AnnotationTypePattern { private AnnotationTypePattern left;
237,962
Bug 237962 [migration] Unexpected problem loading an aspect built with 1.5.4
We always support processing of old aspects. It doesn't matter what level of AspectJ was used to build an aspect, as long as you use that version or a later version of the weaver, we can unpack it and don't require it to be rebuilt from source. However, I've just encountered a .class apparently built with 1.5.4 that 1.6.1 cannot load. It crashes deserializing a PointcutDeclaration. In the data stream we have just read the numbers 1 and 3 indicating 'kinded pointcut' and then 'method-execution' and the next digit is a 0 when it should be 1-9. We crash with a: org.aspectj.weaver.BCException: weird kind 0 when batch building BuildConfig[null] #Files=43 at org.aspectj.weaver.MemberKind.read(MemberKind.java:35) at org.aspectj.weaver.patterns.SignaturePattern.read(SignaturePattern.java:682) The memberkind is a typesafeenum and so can never be other than 1-9. It is the first part of a signaturepattern so hard to see how it got written out 'wrong' right now. I've been told 1.5.4 can load this, so about to try that. Wow....1.5.4 did load it back in, how the hell. I suspect we aren't consuming enough in 1.6.1 which then leaves us some extra that we interpret as a rogue pointcut. Ok, in a comparison we consume one extra byte from the stream when reading it with 1.6.1 that we do not consume with 1.6.0 - at position 260. As I got closer to it, I knew what it would be - especially when I knew it was just one byte difference. The version check for whether the byte for 'annotation pattern relates to a parameter match' was wrong (urgh).
resolved fixed
be03167
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-06-20T17:15:52Z
2008-06-20T16:40:00Z
weaver/src/org/aspectj/weaver/patterns/OrAnnotationTypePattern.java
private AnnotationTypePattern right; public OrAnnotationTypePattern(AnnotationTypePattern left, AnnotationTypePattern right) { this.left = left; this.right = right; setLocation(left.getSourceContext(), left.getStart(), right.getEnd()); } public FuzzyBoolean matches(AnnotatedElement annotated) { return left.matches(annotated).or(right.matches(annotated)); } public FuzzyBoolean matches(AnnotatedElement annotated, ResolvedType[] parameterAnnotations ) { return left.matches(annotated,parameterAnnotations).or(right.matches(annotated,parameterAnnotations)); } public void resolve(World world) { left.resolve(world); right.resolve(world); } /* (non-Javadoc) * @see org.aspectj.weaver.patterns.AnnotationTypePattern#resolveBindings(org.aspectj.weaver.patterns.IScope, org.aspectj.weaver.patterns.Bindings, boolean) */ public AnnotationTypePattern resolveBindings(IScope scope, Bindings bindings, boolean allowBinding) { left = left.resolveBindings(scope,bindings,allowBinding); right =right.resolveBindings(scope,bindings,allowBinding); return this; } public AnnotationTypePattern parameterizeWith(Map typeVariableMap,World w) { AnnotationTypePattern newLeft = left.parameterizeWith(typeVariableMap,w); AnnotationTypePattern newRight = right.parameterizeWith(typeVariableMap,w);
237,962
Bug 237962 [migration] Unexpected problem loading an aspect built with 1.5.4
We always support processing of old aspects. It doesn't matter what level of AspectJ was used to build an aspect, as long as you use that version or a later version of the weaver, we can unpack it and don't require it to be rebuilt from source. However, I've just encountered a .class apparently built with 1.5.4 that 1.6.1 cannot load. It crashes deserializing a PointcutDeclaration. In the data stream we have just read the numbers 1 and 3 indicating 'kinded pointcut' and then 'method-execution' and the next digit is a 0 when it should be 1-9. We crash with a: org.aspectj.weaver.BCException: weird kind 0 when batch building BuildConfig[null] #Files=43 at org.aspectj.weaver.MemberKind.read(MemberKind.java:35) at org.aspectj.weaver.patterns.SignaturePattern.read(SignaturePattern.java:682) The memberkind is a typesafeenum and so can never be other than 1-9. It is the first part of a signaturepattern so hard to see how it got written out 'wrong' right now. I've been told 1.5.4 can load this, so about to try that. Wow....1.5.4 did load it back in, how the hell. I suspect we aren't consuming enough in 1.6.1 which then leaves us some extra that we interpret as a rogue pointcut. Ok, in a comparison we consume one extra byte from the stream when reading it with 1.6.1 that we do not consume with 1.6.0 - at position 260. As I got closer to it, I knew what it would be - especially when I knew it was just one byte difference. The version check for whether the byte for 'annotation pattern relates to a parameter match' was wrong (urgh).
resolved fixed
be03167
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-06-20T17:15:52Z
2008-06-20T16:40:00Z
weaver/src/org/aspectj/weaver/patterns/OrAnnotationTypePattern.java
OrAnnotationTypePattern ret = new OrAnnotationTypePattern(newLeft,newRight); ret.copyLocationFrom(this); if (isForParameterAnnotationMatch()) ret.setForParameterAnnotationMatch(); return ret; } public Object accept(PatternNodeVisitor visitor, Object data) { return visitor.visit(this,data); } public Object traverse(PatternNodeVisitor visitor, Object data) { Object ret = accept(visitor,data); left.traverse(visitor,ret); right.traverse(visitor,ret); return ret; } public static AnnotationTypePattern read(VersionedDataInputStream s, ISourceContext context) throws IOException { AnnotationTypePattern p = new OrAnnotationTypePattern( AnnotationTypePattern.read(s,context), AnnotationTypePattern.read(s,context)); p.readLocation(context,s); if (s.getMajorVersion()>=WeaverVersionInfo.WEAVER_VERSION_MINOR_AJ160) { if (s.readBoolean()) p.setForParameterAnnotationMatch(); } return p; } public void write(DataOutputStream s) throws IOException { s.writeByte(AnnotationTypePattern.OR); left.write(s);
237,962
Bug 237962 [migration] Unexpected problem loading an aspect built with 1.5.4
We always support processing of old aspects. It doesn't matter what level of AspectJ was used to build an aspect, as long as you use that version or a later version of the weaver, we can unpack it and don't require it to be rebuilt from source. However, I've just encountered a .class apparently built with 1.5.4 that 1.6.1 cannot load. It crashes deserializing a PointcutDeclaration. In the data stream we have just read the numbers 1 and 3 indicating 'kinded pointcut' and then 'method-execution' and the next digit is a 0 when it should be 1-9. We crash with a: org.aspectj.weaver.BCException: weird kind 0 when batch building BuildConfig[null] #Files=43 at org.aspectj.weaver.MemberKind.read(MemberKind.java:35) at org.aspectj.weaver.patterns.SignaturePattern.read(SignaturePattern.java:682) The memberkind is a typesafeenum and so can never be other than 1-9. It is the first part of a signaturepattern so hard to see how it got written out 'wrong' right now. I've been told 1.5.4 can load this, so about to try that. Wow....1.5.4 did load it back in, how the hell. I suspect we aren't consuming enough in 1.6.1 which then leaves us some extra that we interpret as a rogue pointcut. Ok, in a comparison we consume one extra byte from the stream when reading it with 1.6.1 that we do not consume with 1.6.0 - at position 260. As I got closer to it, I knew what it would be - especially when I knew it was just one byte difference. The version check for whether the byte for 'annotation pattern relates to a parameter match' was wrong (urgh).
resolved fixed
be03167
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-06-20T17:15:52Z
2008-06-20T16:40:00Z
weaver/src/org/aspectj/weaver/patterns/OrAnnotationTypePattern.java
right.write(s); writeLocation(s); s.writeBoolean(isForParameterAnnotationMatch()); } public boolean equals(Object obj) { if (!(obj instanceof OrAnnotationTypePattern)) return false; OrAnnotationTypePattern other = (OrAnnotationTypePattern) obj; return (left.equals(other.left) && right.equals(other.right)) && isForParameterAnnotationMatch()==other.isForParameterAnnotationMatch(); } public int hashCode() { int result = 17; result = result*37 + left.hashCode(); result = result*37 + right.hashCode(); result = result*37 + (isForParameterAnnotationMatch()?0:1); return result; } public String toString() { return "(" + left.toString() + " || " + right.toString() + ")"; } public AnnotationTypePattern getLeft() { return left; } public AnnotationTypePattern getRight() { return right; } public void setForParameterAnnotationMatch() { left.setForParameterAnnotationMatch(); right.setForParameterAnnotationMatch(); } }
237,962
Bug 237962 [migration] Unexpected problem loading an aspect built with 1.5.4
We always support processing of old aspects. It doesn't matter what level of AspectJ was used to build an aspect, as long as you use that version or a later version of the weaver, we can unpack it and don't require it to be rebuilt from source. However, I've just encountered a .class apparently built with 1.5.4 that 1.6.1 cannot load. It crashes deserializing a PointcutDeclaration. In the data stream we have just read the numbers 1 and 3 indicating 'kinded pointcut' and then 'method-execution' and the next digit is a 0 when it should be 1-9. We crash with a: org.aspectj.weaver.BCException: weird kind 0 when batch building BuildConfig[null] #Files=43 at org.aspectj.weaver.MemberKind.read(MemberKind.java:35) at org.aspectj.weaver.patterns.SignaturePattern.read(SignaturePattern.java:682) The memberkind is a typesafeenum and so can never be other than 1-9. It is the first part of a signaturepattern so hard to see how it got written out 'wrong' right now. I've been told 1.5.4 can load this, so about to try that. Wow....1.5.4 did load it back in, how the hell. I suspect we aren't consuming enough in 1.6.1 which then leaves us some extra that we interpret as a rogue pointcut. Ok, in a comparison we consume one extra byte from the stream when reading it with 1.6.1 that we do not consume with 1.6.0 - at position 260. As I got closer to it, I knew what it would be - especially when I knew it was just one byte difference. The version check for whether the byte for 'annotation pattern relates to a parameter match' was wrong (urgh).
resolved fixed
be03167
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-06-20T17:15:52Z
2008-06-20T16:40:00Z
weaver/src/org/aspectj/weaver/patterns/WildAnnotationTypePattern.java
/* ******************************************************************* * Copyright (c) 2004 IBM Corporation. * All rights reserved. * This program and the accompanying materials are made available * under the terms of the Eclipse Public License v1.0 * which accompanies this distribution and is available at * http://www.eclipse.org/legal/epl-v10.html * * ******************************************************************/ package org.aspectj.weaver.patterns; import java.io.DataOutputStream; import java.io.IOException; import java.util.HashMap; import java.util.Iterator; import java.util.Map; import java.util.Set; import org.aspectj.bridge.IMessage; import org.aspectj.bridge.MessageUtil; import org.aspectj.util.FuzzyBoolean; import org.aspectj.weaver.AnnotatedElement; import org.aspectj.weaver.BCException; import org.aspectj.weaver.ISourceContext; import org.aspectj.weaver.ResolvedMember; import org.aspectj.weaver.ResolvedType;
237,962
Bug 237962 [migration] Unexpected problem loading an aspect built with 1.5.4
We always support processing of old aspects. It doesn't matter what level of AspectJ was used to build an aspect, as long as you use that version or a later version of the weaver, we can unpack it and don't require it to be rebuilt from source. However, I've just encountered a .class apparently built with 1.5.4 that 1.6.1 cannot load. It crashes deserializing a PointcutDeclaration. In the data stream we have just read the numbers 1 and 3 indicating 'kinded pointcut' and then 'method-execution' and the next digit is a 0 when it should be 1-9. We crash with a: org.aspectj.weaver.BCException: weird kind 0 when batch building BuildConfig[null] #Files=43 at org.aspectj.weaver.MemberKind.read(MemberKind.java:35) at org.aspectj.weaver.patterns.SignaturePattern.read(SignaturePattern.java:682) The memberkind is a typesafeenum and so can never be other than 1-9. It is the first part of a signaturepattern so hard to see how it got written out 'wrong' right now. I've been told 1.5.4 can load this, so about to try that. Wow....1.5.4 did load it back in, how the hell. I suspect we aren't consuming enough in 1.6.1 which then leaves us some extra that we interpret as a rogue pointcut. Ok, in a comparison we consume one extra byte from the stream when reading it with 1.6.1 that we do not consume with 1.6.0 - at position 260. As I got closer to it, I knew what it would be - especially when I knew it was just one byte difference. The version check for whether the byte for 'annotation pattern relates to a parameter match' was wrong (urgh).
resolved fixed
be03167
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-06-20T17:15:52Z
2008-06-20T16:40:00Z
weaver/src/org/aspectj/weaver/patterns/WildAnnotationTypePattern.java
import org.aspectj.weaver.VersionedDataInputStream; import org.aspectj.weaver.WeaverMessages; import org.aspectj.weaver.World; import org.aspectj.weaver.AjAttribute.WeaverVersionInfo; /** * @author colyer * * TODO To change the template for this generated type comment go to * Window - Preferences - Java - Code Style - Code Templates */ public class WildAnnotationTypePattern extends AnnotationTypePattern { private TypePattern typePattern; private boolean resolved = false; Map annotationValues; /** * */ public WildAnnotationTypePattern(TypePattern typePattern) { super(); this.typePattern = typePattern; this.setLocation(typePattern.getSourceContext(), typePattern.start, typePattern.end); } public WildAnnotationTypePattern(TypePattern typePattern, Map annotationValues) { super(); this.typePattern = typePattern; this.annotationValues = annotationValues; this.setLocation(typePattern.getSourceContext(), typePattern.start, typePattern.end);
237,962
Bug 237962 [migration] Unexpected problem loading an aspect built with 1.5.4
We always support processing of old aspects. It doesn't matter what level of AspectJ was used to build an aspect, as long as you use that version or a later version of the weaver, we can unpack it and don't require it to be rebuilt from source. However, I've just encountered a .class apparently built with 1.5.4 that 1.6.1 cannot load. It crashes deserializing a PointcutDeclaration. In the data stream we have just read the numbers 1 and 3 indicating 'kinded pointcut' and then 'method-execution' and the next digit is a 0 when it should be 1-9. We crash with a: org.aspectj.weaver.BCException: weird kind 0 when batch building BuildConfig[null] #Files=43 at org.aspectj.weaver.MemberKind.read(MemberKind.java:35) at org.aspectj.weaver.patterns.SignaturePattern.read(SignaturePattern.java:682) The memberkind is a typesafeenum and so can never be other than 1-9. It is the first part of a signaturepattern so hard to see how it got written out 'wrong' right now. I've been told 1.5.4 can load this, so about to try that. Wow....1.5.4 did load it back in, how the hell. I suspect we aren't consuming enough in 1.6.1 which then leaves us some extra that we interpret as a rogue pointcut. Ok, in a comparison we consume one extra byte from the stream when reading it with 1.6.1 that we do not consume with 1.6.0 - at position 260. As I got closer to it, I knew what it would be - especially when I knew it was just one byte difference. The version check for whether the byte for 'annotation pattern relates to a parameter match' was wrong (urgh).
resolved fixed
be03167
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-06-20T17:15:52Z
2008-06-20T16:40:00Z
weaver/src/org/aspectj/weaver/patterns/WildAnnotationTypePattern.java
} public TypePattern getTypePattern() { return typePattern; } /* (non-Javadoc) * @see org.aspectj.weaver.patterns.AnnotationTypePattern#matches(org.aspectj.weaver.AnnotatedElement) */ public FuzzyBoolean matches(AnnotatedElement annotated) { return matches(annotated,null); } /** * Resolve any annotation values specified, checking they are all well formed (valid names, valid values) * @param annotationType the annotation type for which the values have been specified * @param scope the scope within which to resolve type references (eg. Color.GREEN) */ protected void resolveAnnotationValues(ResolvedType annotationType, IScope scope) { if (annotationValues == null) return; Set keys = annotationValues.keySet(); ResolvedMember[] ms = annotationType.getDeclaredMethods(); for (Iterator kIter = keys.iterator(); kIter.hasNext();) { String k = (String) kIter.next(); String v = (String) annotationValues.get(k); boolean validKey = false; for (int i = 0; i < ms.length; i++) { ResolvedMember resolvedMember = ms[i];
237,962
Bug 237962 [migration] Unexpected problem loading an aspect built with 1.5.4
We always support processing of old aspects. It doesn't matter what level of AspectJ was used to build an aspect, as long as you use that version or a later version of the weaver, we can unpack it and don't require it to be rebuilt from source. However, I've just encountered a .class apparently built with 1.5.4 that 1.6.1 cannot load. It crashes deserializing a PointcutDeclaration. In the data stream we have just read the numbers 1 and 3 indicating 'kinded pointcut' and then 'method-execution' and the next digit is a 0 when it should be 1-9. We crash with a: org.aspectj.weaver.BCException: weird kind 0 when batch building BuildConfig[null] #Files=43 at org.aspectj.weaver.MemberKind.read(MemberKind.java:35) at org.aspectj.weaver.patterns.SignaturePattern.read(SignaturePattern.java:682) The memberkind is a typesafeenum and so can never be other than 1-9. It is the first part of a signaturepattern so hard to see how it got written out 'wrong' right now. I've been told 1.5.4 can load this, so about to try that. Wow....1.5.4 did load it back in, how the hell. I suspect we aren't consuming enough in 1.6.1 which then leaves us some extra that we interpret as a rogue pointcut. Ok, in a comparison we consume one extra byte from the stream when reading it with 1.6.1 that we do not consume with 1.6.0 - at position 260. As I got closer to it, I knew what it would be - especially when I knew it was just one byte difference. The version check for whether the byte for 'annotation pattern relates to a parameter match' was wrong (urgh).
resolved fixed
be03167
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-06-20T17:15:52Z
2008-06-20T16:40:00Z
weaver/src/org/aspectj/weaver/patterns/WildAnnotationTypePattern.java
if (resolvedMember.getName().equals(k) && resolvedMember.isAbstract()) { validKey = true; ResolvedType t = resolvedMember.getReturnType().resolve(scope.getWorld()); if (t.isEnum()) { int pos = v.lastIndexOf("."); if (pos == -1) { IMessage m = MessageUtil.error( WeaverMessages.format(WeaverMessages.INVALID_ANNOTATION_VALUE,v,"enum"), getSourceLocation()); scope.getWorld().getMessageHandler().handleMessage(m); } else { String typename = v.substring(0,pos); ResolvedType rt = scope.lookupType(typename, this).resolve(scope.getWorld()); v = rt.getSignature()+v.substring(pos+1); annotationValues.put(k,v); } } else if (t.isPrimitiveType()) { if (t.getSignature()=="I") { try { int value = Integer.parseInt(v); annotationValues.put(k,Integer.toString(value)); } catch (NumberFormatException nfe) { IMessage m = MessageUtil.error( WeaverMessages.format(WeaverMessages.INVALID_ANNOTATION_VALUE,v,"int"), getSourceLocation()); scope.getWorld().getMessageHandler().handleMessage(m); } } else if (t.getSignature()=="F") { try {
237,962
Bug 237962 [migration] Unexpected problem loading an aspect built with 1.5.4
We always support processing of old aspects. It doesn't matter what level of AspectJ was used to build an aspect, as long as you use that version or a later version of the weaver, we can unpack it and don't require it to be rebuilt from source. However, I've just encountered a .class apparently built with 1.5.4 that 1.6.1 cannot load. It crashes deserializing a PointcutDeclaration. In the data stream we have just read the numbers 1 and 3 indicating 'kinded pointcut' and then 'method-execution' and the next digit is a 0 when it should be 1-9. We crash with a: org.aspectj.weaver.BCException: weird kind 0 when batch building BuildConfig[null] #Files=43 at org.aspectj.weaver.MemberKind.read(MemberKind.java:35) at org.aspectj.weaver.patterns.SignaturePattern.read(SignaturePattern.java:682) The memberkind is a typesafeenum and so can never be other than 1-9. It is the first part of a signaturepattern so hard to see how it got written out 'wrong' right now. I've been told 1.5.4 can load this, so about to try that. Wow....1.5.4 did load it back in, how the hell. I suspect we aren't consuming enough in 1.6.1 which then leaves us some extra that we interpret as a rogue pointcut. Ok, in a comparison we consume one extra byte from the stream when reading it with 1.6.1 that we do not consume with 1.6.0 - at position 260. As I got closer to it, I knew what it would be - especially when I knew it was just one byte difference. The version check for whether the byte for 'annotation pattern relates to a parameter match' was wrong (urgh).
resolved fixed
be03167
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-06-20T17:15:52Z
2008-06-20T16:40:00Z
weaver/src/org/aspectj/weaver/patterns/WildAnnotationTypePattern.java
float value = Float.parseFloat(v); annotationValues.put(k,Float.toString(value)); } catch (NumberFormatException nfe) { IMessage m = MessageUtil.error( WeaverMessages.format(WeaverMessages.INVALID_ANNOTATION_VALUE,v,"float"), getSourceLocation()); scope.getWorld().getMessageHandler().handleMessage(m); } } else if (t.getSignature()=="Z") { if (v.equalsIgnoreCase("true") || v.equalsIgnoreCase("false")) { } else { IMessage m = MessageUtil.error( WeaverMessages.format(WeaverMessages.INVALID_ANNOTATION_VALUE,v,"boolean"), getSourceLocation()); scope.getWorld().getMessageHandler().handleMessage(m); } } else if (t.getSignature()=="S") { try { short value = Short.parseShort(v); annotationValues.put(k,Short.toString(value)); } catch (NumberFormatException nfe) { IMessage m = MessageUtil.error( WeaverMessages.format(WeaverMessages.INVALID_ANNOTATION_VALUE,v,"short"), getSourceLocation()); scope.getWorld().getMessageHandler().handleMessage(m); } } else if (t.getSignature()=="J") { try { long value = Long.parseLong(v);
237,962
Bug 237962 [migration] Unexpected problem loading an aspect built with 1.5.4
We always support processing of old aspects. It doesn't matter what level of AspectJ was used to build an aspect, as long as you use that version or a later version of the weaver, we can unpack it and don't require it to be rebuilt from source. However, I've just encountered a .class apparently built with 1.5.4 that 1.6.1 cannot load. It crashes deserializing a PointcutDeclaration. In the data stream we have just read the numbers 1 and 3 indicating 'kinded pointcut' and then 'method-execution' and the next digit is a 0 when it should be 1-9. We crash with a: org.aspectj.weaver.BCException: weird kind 0 when batch building BuildConfig[null] #Files=43 at org.aspectj.weaver.MemberKind.read(MemberKind.java:35) at org.aspectj.weaver.patterns.SignaturePattern.read(SignaturePattern.java:682) The memberkind is a typesafeenum and so can never be other than 1-9. It is the first part of a signaturepattern so hard to see how it got written out 'wrong' right now. I've been told 1.5.4 can load this, so about to try that. Wow....1.5.4 did load it back in, how the hell. I suspect we aren't consuming enough in 1.6.1 which then leaves us some extra that we interpret as a rogue pointcut. Ok, in a comparison we consume one extra byte from the stream when reading it with 1.6.1 that we do not consume with 1.6.0 - at position 260. As I got closer to it, I knew what it would be - especially when I knew it was just one byte difference. The version check for whether the byte for 'annotation pattern relates to a parameter match' was wrong (urgh).
resolved fixed
be03167
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-06-20T17:15:52Z
2008-06-20T16:40:00Z
weaver/src/org/aspectj/weaver/patterns/WildAnnotationTypePattern.java
annotationValues.put(k,Long.toString(value)); } catch (NumberFormatException nfe) { IMessage m = MessageUtil.error( WeaverMessages.format(WeaverMessages.INVALID_ANNOTATION_VALUE,v,"long"), getSourceLocation()); scope.getWorld().getMessageHandler().handleMessage(m); } } else if (t.getSignature()=="D") { try { double value = Double.parseDouble(v); annotationValues.put(k,Double.toString(value)); } catch (NumberFormatException nfe) { IMessage m = MessageUtil.error( WeaverMessages.format(WeaverMessages.INVALID_ANNOTATION_VALUE,v,"double"), getSourceLocation()); scope.getWorld().getMessageHandler().handleMessage(m); } } else if (t.getSignature()=="B") { try { byte value = Byte.parseByte(v); annotationValues.put(k,Byte.toString(value)); } catch (NumberFormatException nfe) { IMessage m = MessageUtil.error( WeaverMessages.format(WeaverMessages.INVALID_ANNOTATION_VALUE,v,"byte"), getSourceLocation()); scope.getWorld().getMessageHandler().handleMessage(m); } } else if (t.getSignature()=="C") { if (v.length()!=3) { IMessage m = MessageUtil.error(
237,962
Bug 237962 [migration] Unexpected problem loading an aspect built with 1.5.4
We always support processing of old aspects. It doesn't matter what level of AspectJ was used to build an aspect, as long as you use that version or a later version of the weaver, we can unpack it and don't require it to be rebuilt from source. However, I've just encountered a .class apparently built with 1.5.4 that 1.6.1 cannot load. It crashes deserializing a PointcutDeclaration. In the data stream we have just read the numbers 1 and 3 indicating 'kinded pointcut' and then 'method-execution' and the next digit is a 0 when it should be 1-9. We crash with a: org.aspectj.weaver.BCException: weird kind 0 when batch building BuildConfig[null] #Files=43 at org.aspectj.weaver.MemberKind.read(MemberKind.java:35) at org.aspectj.weaver.patterns.SignaturePattern.read(SignaturePattern.java:682) The memberkind is a typesafeenum and so can never be other than 1-9. It is the first part of a signaturepattern so hard to see how it got written out 'wrong' right now. I've been told 1.5.4 can load this, so about to try that. Wow....1.5.4 did load it back in, how the hell. I suspect we aren't consuming enough in 1.6.1 which then leaves us some extra that we interpret as a rogue pointcut. Ok, in a comparison we consume one extra byte from the stream when reading it with 1.6.1 that we do not consume with 1.6.0 - at position 260. As I got closer to it, I knew what it would be - especially when I knew it was just one byte difference. The version check for whether the byte for 'annotation pattern relates to a parameter match' was wrong (urgh).
resolved fixed
be03167
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-06-20T17:15:52Z
2008-06-20T16:40:00Z
weaver/src/org/aspectj/weaver/patterns/WildAnnotationTypePattern.java
WeaverMessages.format(WeaverMessages.INVALID_ANNOTATION_VALUE,v,"char"), getSourceLocation()); scope.getWorld().getMessageHandler().handleMessage(m); } else { annotationValues.put(k,v.substring(1,2)); } } else { throw new RuntimeException("Not implemented for "+t); } } else if (t.equals(ResolvedType.JAVA_LANG_STRING)) { } else { throw new RuntimeException("Compiler limitation: annotation value support not implemented for type "+t); } } } if (!validKey) { IMessage m = MessageUtil.error( WeaverMessages.format(WeaverMessages.UNKNOWN_ANNOTATION_VALUE,annotationType,k), getSourceLocation()); scope.getWorld().getMessageHandler().handleMessage(m); } } } public FuzzyBoolean matches(AnnotatedElement annotated,ResolvedType[] parameterAnnotations) { if (!resolved) { throw new IllegalStateException("Can't match on an unresolved annotation type pattern"); } if (annotationValues!=null) {
237,962
Bug 237962 [migration] Unexpected problem loading an aspect built with 1.5.4
We always support processing of old aspects. It doesn't matter what level of AspectJ was used to build an aspect, as long as you use that version or a later version of the weaver, we can unpack it and don't require it to be rebuilt from source. However, I've just encountered a .class apparently built with 1.5.4 that 1.6.1 cannot load. It crashes deserializing a PointcutDeclaration. In the data stream we have just read the numbers 1 and 3 indicating 'kinded pointcut' and then 'method-execution' and the next digit is a 0 when it should be 1-9. We crash with a: org.aspectj.weaver.BCException: weird kind 0 when batch building BuildConfig[null] #Files=43 at org.aspectj.weaver.MemberKind.read(MemberKind.java:35) at org.aspectj.weaver.patterns.SignaturePattern.read(SignaturePattern.java:682) The memberkind is a typesafeenum and so can never be other than 1-9. It is the first part of a signaturepattern so hard to see how it got written out 'wrong' right now. I've been told 1.5.4 can load this, so about to try that. Wow....1.5.4 did load it back in, how the hell. I suspect we aren't consuming enough in 1.6.1 which then leaves us some extra that we interpret as a rogue pointcut. Ok, in a comparison we consume one extra byte from the stream when reading it with 1.6.1 that we do not consume with 1.6.0 - at position 260. As I got closer to it, I knew what it would be - especially when I knew it was just one byte difference. The version check for whether the byte for 'annotation pattern relates to a parameter match' was wrong (urgh).
resolved fixed
be03167
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-06-20T17:15:52Z
2008-06-20T16:40:00Z
weaver/src/org/aspectj/weaver/patterns/WildAnnotationTypePattern.java
throw new IllegalStateException("Cannot use annotationvalues with a wild annotation pattern"); } if (isForParameterAnnotationMatch()) { if (parameterAnnotations!=null && parameterAnnotations.length!=0) { for (int i = 0; i < parameterAnnotations.length; i++) { if (typePattern.matches(parameterAnnotations[i],TypePattern.STATIC).alwaysTrue()) { return FuzzyBoolean.YES; } } } } else { ResolvedType[] annTypes = annotated.getAnnotationTypes(); if (annTypes!=null && annTypes.length!=0) { for (int i = 0; i < annTypes.length; i++) { if (typePattern.matches(annTypes[i],TypePattern.STATIC).alwaysTrue()) { return FuzzyBoolean.YES; } } } } return FuzzyBoolean.NO; } /* (non-Javadoc) * @see org.aspectj.weaver.patterns.AnnotationTypePattern#resolve(org.aspectj.weaver.World) */ public void resolve(World world) { resolved = true;
237,962
Bug 237962 [migration] Unexpected problem loading an aspect built with 1.5.4
We always support processing of old aspects. It doesn't matter what level of AspectJ was used to build an aspect, as long as you use that version or a later version of the weaver, we can unpack it and don't require it to be rebuilt from source. However, I've just encountered a .class apparently built with 1.5.4 that 1.6.1 cannot load. It crashes deserializing a PointcutDeclaration. In the data stream we have just read the numbers 1 and 3 indicating 'kinded pointcut' and then 'method-execution' and the next digit is a 0 when it should be 1-9. We crash with a: org.aspectj.weaver.BCException: weird kind 0 when batch building BuildConfig[null] #Files=43 at org.aspectj.weaver.MemberKind.read(MemberKind.java:35) at org.aspectj.weaver.patterns.SignaturePattern.read(SignaturePattern.java:682) The memberkind is a typesafeenum and so can never be other than 1-9. It is the first part of a signaturepattern so hard to see how it got written out 'wrong' right now. I've been told 1.5.4 can load this, so about to try that. Wow....1.5.4 did load it back in, how the hell. I suspect we aren't consuming enough in 1.6.1 which then leaves us some extra that we interpret as a rogue pointcut. Ok, in a comparison we consume one extra byte from the stream when reading it with 1.6.1 that we do not consume with 1.6.0 - at position 260. As I got closer to it, I knew what it would be - especially when I knew it was just one byte difference. The version check for whether the byte for 'annotation pattern relates to a parameter match' was wrong (urgh).
resolved fixed
be03167
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-06-20T17:15:52Z
2008-06-20T16:40:00Z
weaver/src/org/aspectj/weaver/patterns/WildAnnotationTypePattern.java
} /** * This can modify in place, or return a new TypePattern if the type changes. */ public AnnotationTypePattern resolveBindings(IScope scope, Bindings bindings, boolean allowBinding) { if (!scope.getWorld().isInJava5Mode()) { scope.message(MessageUtil.error(WeaverMessages.format(WeaverMessages.ANNOTATIONS_NEED_JAVA5), getSourceLocation())); return this; } if (resolved) return this; this.typePattern = typePattern.resolveBindings(scope,bindings,false,false); resolved = true; if (typePattern instanceof ExactTypePattern) { ExactTypePattern et = (ExactTypePattern)typePattern; if (!et.getExactType().resolve(scope.getWorld()).isAnnotation()) { IMessage m = MessageUtil.error( WeaverMessages.format(WeaverMessages.REFERENCE_TO_NON_ANNOTATION_TYPE,et.getExactType().getName()), getSourceLocation()); scope.getWorld().getMessageHandler().handleMessage(m); resolved = false; } ResolvedType annotationType = et.getExactType().resolve(scope.getWorld()); resolveAnnotationValues(annotationType,scope); ExactAnnotationTypePattern eatp = new ExactAnnotationTypePattern(annotationType,annotationValues); eatp.copyLocationFrom(this); if (isForParameterAnnotationMatch()) eatp.setForParameterAnnotationMatch();
237,962
Bug 237962 [migration] Unexpected problem loading an aspect built with 1.5.4
We always support processing of old aspects. It doesn't matter what level of AspectJ was used to build an aspect, as long as you use that version or a later version of the weaver, we can unpack it and don't require it to be rebuilt from source. However, I've just encountered a .class apparently built with 1.5.4 that 1.6.1 cannot load. It crashes deserializing a PointcutDeclaration. In the data stream we have just read the numbers 1 and 3 indicating 'kinded pointcut' and then 'method-execution' and the next digit is a 0 when it should be 1-9. We crash with a: org.aspectj.weaver.BCException: weird kind 0 when batch building BuildConfig[null] #Files=43 at org.aspectj.weaver.MemberKind.read(MemberKind.java:35) at org.aspectj.weaver.patterns.SignaturePattern.read(SignaturePattern.java:682) The memberkind is a typesafeenum and so can never be other than 1-9. It is the first part of a signaturepattern so hard to see how it got written out 'wrong' right now. I've been told 1.5.4 can load this, so about to try that. Wow....1.5.4 did load it back in, how the hell. I suspect we aren't consuming enough in 1.6.1 which then leaves us some extra that we interpret as a rogue pointcut. Ok, in a comparison we consume one extra byte from the stream when reading it with 1.6.1 that we do not consume with 1.6.0 - at position 260. As I got closer to it, I knew what it would be - especially when I knew it was just one byte difference. The version check for whether the byte for 'annotation pattern relates to a parameter match' was wrong (urgh).
resolved fixed
be03167
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-06-20T17:15:52Z
2008-06-20T16:40:00Z
weaver/src/org/aspectj/weaver/patterns/WildAnnotationTypePattern.java
return eatp; } else { return this; } } public AnnotationTypePattern parameterizeWith(Map typeVariableMap,World w) { WildAnnotationTypePattern ret = new WildAnnotationTypePattern(typePattern.parameterizeWith(typeVariableMap,w)); ret.copyLocationFrom(this); ret.resolved = resolved; return ret; } private static final byte VERSION = 1; /* (non-Javadoc) * @see org.aspectj.weaver.patterns.PatternNode#write(java.io.DataOutputStream) */ public void write(DataOutputStream s) throws IOException { s.writeByte(AnnotationTypePattern.WILD); s.writeByte(VERSION); typePattern.write(s); writeLocation(s); s.writeBoolean(isForParameterAnnotationMatch()); if (annotationValues==null) { s.writeInt(0); } else { s.writeInt(annotationValues.size()); Set key = annotationValues.keySet(); for (Iterator keys = key.iterator(); keys.hasNext();) { String k = (String) keys.next();