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
171,667
Bug 171667 When ordering a Clean with Build Automatico I receive the error below.
When executing an Clean Project in Eclipse with Automatic Building I receive the error below. line from the top stack, e.g. "SomeFile.jara:243" java.lang.NullPointerException at org.aspectj.ajdt.internal.compiler.problem.AjProblemReporter.methodMustOverride(AjProblemReporter.java:380) at org.aspectj.org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.resolveStatements(MethodDeclaration.java:153) at org.aspectj.org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolve(AbstractMethodDeclaration.java:400) at org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeDe ... pter.java:107) at org.aspectj.ajde.internal.AspectJBuildManager$CompilerThread.run(AspectJBuildManager.java:191) NullPointerException thrown: null
resolved fixed
4177bed
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2007-02-16T10:02:27Z
2007-01-25T15:46:40Z
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/problem/AjProblemReporter.java
if (name.indexOf("interField") != -1) { if ((metaTagBits & TagBits.AnnotationForField) != 0) return; } else if (name.indexOf("interConstructor") != -1) { if ((metaTagBits & TagBits.AnnotationForConstructor) != 0) return; } else if (name.indexOf("interMethod") != -1) { if ((metaTagBits & TagBits.AnnotationForMethod) != 0) return; } else if (name.indexOf("declare_"+DeclareAnnotation.AT_TYPE+"_")!=-1) { if ((metaTagBits & TagBits.AnnotationForAnnotationType)!=0 || (metaTagBits & TagBits.AnnotationForType)!=0) return; } else if (name.indexOf("declare_"+DeclareAnnotation.AT_FIELD+"_")!=-1) { if ((metaTagBits & TagBits.AnnotationForField)!=0) return; } else if (name.indexOf("declare_"+DeclareAnnotation.AT_CONSTRUCTOR+"_")!=-1) { if ((metaTagBits & TagBits.AnnotationForConstructor)!=0) return; } else if (name.indexOf("declare_eow") != -1) { if ((metaTagBits & TagBits.AnnotationForField) != 0) return; } } } super.disallowedTargetForAnnotation(annotation); } public void overridesPackageDefaultMethod(MethodBinding localMethod, MethodBinding inheritedMethod) { if (new String(localMethod.selector).startsWith("ajc$")) return; super.overridesPackageDefaultMethod(localMethod,inheritedMethod); } public void handle( int problemId,
171,667
Bug 171667 When ordering a Clean with Build Automatico I receive the error below.
When executing an Clean Project in Eclipse with Automatic Building I receive the error below. line from the top stack, e.g. "SomeFile.jara:243" java.lang.NullPointerException at org.aspectj.ajdt.internal.compiler.problem.AjProblemReporter.methodMustOverride(AjProblemReporter.java:380) at org.aspectj.org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.resolveStatements(MethodDeclaration.java:153) at org.aspectj.org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolve(AbstractMethodDeclaration.java:400) at org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeDe ... pter.java:107) at org.aspectj.ajde.internal.AspectJBuildManager$CompilerThread.run(AspectJBuildManager.java:191) NullPointerException thrown: null
resolved fixed
4177bed
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2007-02-16T10:02:27Z
2007-01-25T15:46:40Z
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/problem/AjProblemReporter.java
String[] problemArguments, String[] messageArguments, int severity, int problemStartPosition, int problemEndPosition, ReferenceContext referenceContext, CompilationResult unitResult) { if (severity != Ignore && DUMP_STACK) { Thread.dumpStack(); } super.handle( problemId, problemArguments, messageArguments, severity, problemStartPosition, problemEndPosition, referenceContext, unitResult); } public void javadocMissingParamTag(char[] name, int sourceStart, int sourceEnd, int modifiers) { boolean reportIt = true; String sName = new String(name); if (sName.startsWith("ajc$")) reportIt = false; if (sName.equals("thisJoinPoint")) reportIt = false; if (sName.equals("thisJoinPointStaticPart")) reportIt = false; if (sName.equals("thisEnclosingJoinPointStaticPart")) reportIt = false;
171,667
Bug 171667 When ordering a Clean with Build Automatico I receive the error below.
When executing an Clean Project in Eclipse with Automatic Building I receive the error below. line from the top stack, e.g. "SomeFile.jara:243" java.lang.NullPointerException at org.aspectj.ajdt.internal.compiler.problem.AjProblemReporter.methodMustOverride(AjProblemReporter.java:380) at org.aspectj.org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.resolveStatements(MethodDeclaration.java:153) at org.aspectj.org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolve(AbstractMethodDeclaration.java:400) at org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeDe ... pter.java:107) at org.aspectj.ajde.internal.AspectJBuildManager$CompilerThread.run(AspectJBuildManager.java:191) NullPointerException thrown: null
resolved fixed
4177bed
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2007-02-16T10:02:27Z
2007-01-25T15:46:40Z
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/problem/AjProblemReporter.java
if (sName.equals("ajc_aroundClosure")) reportIt = false; if (reportIt) super.javadocMissingParamTag(name,sourceStart,sourceEnd,modifiers); } public void abstractMethodInAbstractClass(SourceTypeBinding type, AbstractMethodDeclaration methodDecl) { String abstractMethodName = new String(methodDecl.selector); if (abstractMethodName.startsWith("ajc$pointcut")) { return; } String[] arguments = new String[] {new String(type.sourceName()), abstractMethodName}; super.handle( IProblem.AbstractMethodInAbstractClass, arguments, arguments, methodDecl.sourceStart, methodDecl.sourceEnd,this.referenceContext, this.referenceContext == null ? null : this.referenceContext.compilationResult()); } /** * Called when there is an ITD marked @override that doesn't override a supertypes method. * The method and the binding are passed - some information is useful from each. The 'method' * knows about source offsets for the message, the 'binding' has the signature of what the * ITD is trying to be in the target class. */ public void itdMethodMustOverride(AbstractMethodDeclaration method,MethodBinding binding) { this.handle(
171,667
Bug 171667 When ordering a Clean with Build Automatico I receive the error below.
When executing an Clean Project in Eclipse with Automatic Building I receive the error below. line from the top stack, e.g. "SomeFile.jara:243" java.lang.NullPointerException at org.aspectj.ajdt.internal.compiler.problem.AjProblemReporter.methodMustOverride(AjProblemReporter.java:380) at org.aspectj.org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.resolveStatements(MethodDeclaration.java:153) at org.aspectj.org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolve(AbstractMethodDeclaration.java:400) at org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeDe ... pter.java:107) at org.aspectj.ajde.internal.AspectJBuildManager$CompilerThread.run(AspectJBuildManager.java:191) NullPointerException thrown: null
resolved fixed
4177bed
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2007-02-16T10:02:27Z
2007-01-25T15:46:40Z
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/problem/AjProblemReporter.java
IProblem.MethodMustOverride, new String[] {new String(binding.selector), typesAsString(binding.isVarargs(), binding.parameters, false), new String(binding.declaringClass.readableName()), }, new String[] {new String(binding.selector), typesAsString(binding.isVarargs(), binding.parameters, true), new String(binding.declaringClass.shortReadableName()),}, method.sourceStart, method.sourceEnd, this.referenceContext, this.referenceContext == null ? null : this.referenceContext.compilationResult()); } /** * Overrides the implementation in ProblemReporter and is ITD aware. * To report a *real* problem with an ITD marked @override, the other methodMustOverride() method is used. */ public void methodMustOverride(AbstractMethodDeclaration method) { MethodBinding binding = method.binding; if (new String(method.selector).startsWith("ajc$")) return; ResolvedMember possiblyErroneousRm = factory.makeResolvedMember(method.binding); ResolvedType onTypeX = factory.fromEclipse(method.binding.declaringClass); ResolvedType supertypeToLookAt = onTypeX.getSuperclass(); while (supertypeToLookAt!=null) { List itMungers = supertypeToLookAt.getInterTypeMungers(); for (Iterator i = itMungers.iterator(); i.hasNext(); ) { ConcreteTypeMunger m = (ConcreteTypeMunger)i.next(); ResolvedMember sig = m.getSignature();
171,667
Bug 171667 When ordering a Clean with Build Automatico I receive the error below.
When executing an Clean Project in Eclipse with Automatic Building I receive the error below. line from the top stack, e.g. "SomeFile.jara:243" java.lang.NullPointerException at org.aspectj.ajdt.internal.compiler.problem.AjProblemReporter.methodMustOverride(AjProblemReporter.java:380) at org.aspectj.org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.resolveStatements(MethodDeclaration.java:153) at org.aspectj.org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolve(AbstractMethodDeclaration.java:400) at org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeDe ... pter.java:107) at org.aspectj.ajde.internal.AspectJBuildManager$CompilerThread.run(AspectJBuildManager.java:191) NullPointerException thrown: null
resolved fixed
4177bed
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2007-02-16T10:02:27Z
2007-01-25T15:46:40Z
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/problem/AjProblemReporter.java
ResolvedMember rm = AjcMemberMaker.interMethod(sig,m.getAspectType(), sig.getDeclaringType().resolve(factory.getWorld()).isInterface()); if (ResolvedType.matches(rm,possiblyErroneousRm)) { return; } } supertypeToLookAt = supertypeToLookAt.getSuperclass(); } super.methodMustOverride(method); } private String typesAsString(boolean isVarargs, TypeBinding[] types, boolean makeShort) { StringBuffer buffer = new StringBuffer(10); for (int i = 0, length = types.length; i < length; i++) { if (i != 0) buffer.append(", "); TypeBinding type = types[i]; boolean isVarargType = isVarargs && i == length-1; if (isVarargType) type = ((ArrayBinding)type).elementsType(); buffer.append(new String(makeShort ? type.shortReadableName() : type.readableName())); if (isVarargType) buffer.append("..."); } return buffer.toString(); } public void visibilityConflict(MethodBinding currentMethod, MethodBinding inheritedMethod) {
171,667
Bug 171667 When ordering a Clean with Build Automatico I receive the error below.
When executing an Clean Project in Eclipse with Automatic Building I receive the error below. line from the top stack, e.g. "SomeFile.jara:243" java.lang.NullPointerException at org.aspectj.ajdt.internal.compiler.problem.AjProblemReporter.methodMustOverride(AjProblemReporter.java:380) at org.aspectj.org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.resolveStatements(MethodDeclaration.java:153) at org.aspectj.org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolve(AbstractMethodDeclaration.java:400) at org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeDe ... pter.java:107) at org.aspectj.ajde.internal.AspectJBuildManager$CompilerThread.run(AspectJBuildManager.java:191) NullPointerException thrown: null
resolved fixed
4177bed
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2007-02-16T10:02:27Z
2007-01-25T15:46:40Z
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/problem/AjProblemReporter.java
if (isIntertypeDeclaration(currentMethod) && isIntertypeDeclaration(inheritedMethod) && Modifier.isPrivate(currentMethod.modifiers) && Modifier.isPrivate(inheritedMethod.modifiers)) { return; } super.visibilityConflict(currentMethod,inheritedMethod); } public void unusedPrivateType(TypeDeclaration typeDecl) { if (typeDecl instanceof AspectDeclaration) return; if (typeDecl.enclosingType!=null && (typeDecl.enclosingType instanceof AspectDeclaration)) { AspectDeclaration ad = (AspectDeclaration)typeDecl.enclosingType; if (ad.concreteName!=null) { List declares = ad.concreteName.declares; for (Iterator iter = declares.iterator(); iter.hasNext();) { Object dec = (Object) iter.next(); if (dec instanceof DeclareParents) { DeclareParents decp = (DeclareParents)dec; TypePattern[] newparents = decp.getParents().getTypePatterns(); for (int i = 0; i < newparents.length; i++) { TypePattern pattern = newparents[i]; UnresolvedType ut = pattern.getExactType(); if (ut==null) continue; if (CharOperation.compareWith(typeDecl.binding.signature(),ut.getSignature().toCharArray())==0) return; } } }
171,667
Bug 171667 When ordering a Clean with Build Automatico I receive the error below.
When executing an Clean Project in Eclipse with Automatic Building I receive the error below. line from the top stack, e.g. "SomeFile.jara:243" java.lang.NullPointerException at org.aspectj.ajdt.internal.compiler.problem.AjProblemReporter.methodMustOverride(AjProblemReporter.java:380) at org.aspectj.org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.resolveStatements(MethodDeclaration.java:153) at org.aspectj.org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolve(AbstractMethodDeclaration.java:400) at org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeDe ... pter.java:107) at org.aspectj.ajde.internal.AspectJBuildManager$CompilerThread.run(AspectJBuildManager.java:191) NullPointerException thrown: null
resolved fixed
4177bed
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2007-02-16T10:02:27Z
2007-01-25T15:46:40Z
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/problem/AjProblemReporter.java
} } super.unusedPrivateType(typeDecl); } public void unusedPrivateMethod(AbstractMethodDeclaration methodDecl) { if (!(methodDecl instanceof PointcutDeclaration)) super.unusedPrivateMethod(methodDecl); } public void caseExpressionMustBeConstant(Expression expression) { if (expression instanceof QualifiedNameReference) { QualifiedNameReference qnr = (QualifiedNameReference)expression; if (qnr.otherBindings!=null && qnr.otherBindings.length>0 && qnr.otherBindings[0] instanceof PrivilegedFieldBinding) { super.signalError(expression.sourceStart,expression.sourceEnd,"Fields accessible due to an aspect being privileged can not be used in switch statements"); referenceContext.tagAsHavingErrors(); return; } } super.caseExpressionMustBeConstant(expression); } public void unusedArgument(LocalDeclaration localDecl) { String argType = new String(localDecl.type.resolvedType.signature()); if (argType.startsWith("Lorg/aspectj/runtime/internal")) return; if (localDecl!=null && localDecl instanceof Argument) { Argument arg = (Argument)localDecl;
171,667
Bug 171667 When ordering a Clean with Build Automatico I receive the error below.
When executing an Clean Project in Eclipse with Automatic Building I receive the error below. line from the top stack, e.g. "SomeFile.jara:243" java.lang.NullPointerException at org.aspectj.ajdt.internal.compiler.problem.AjProblemReporter.methodMustOverride(AjProblemReporter.java:380) at org.aspectj.org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.resolveStatements(MethodDeclaration.java:153) at org.aspectj.org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolve(AbstractMethodDeclaration.java:400) at org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeDe ... pter.java:107) at org.aspectj.ajde.internal.AspectJBuildManager$CompilerThread.run(AspectJBuildManager.java:191) NullPointerException thrown: null
resolved fixed
4177bed
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2007-02-16T10:02:27Z
2007-01-25T15:46:40Z
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/problem/AjProblemReporter.java
if (arg.binding!=null && arg.binding.declaringScope!=null) { ReferenceContext context = arg.binding.declaringScope.referenceContext(); if (context!=null && context instanceof PointcutDeclaration) return; } } super.unusedArgument(localDecl); } /** * A side-effect of the way that we handle itds on default methods on top-most implementors * of interfaces is that a class acquiring a final default ITD will erroneously report * that it can't override its own member. This method detects that situation. */ public void finalMethodCannotBeOverridden(MethodBinding currentMethod, MethodBinding inheritedMethod) { if (currentMethod == inheritedMethod) return; super.finalMethodCannotBeOverridden(currentMethod, inheritedMethod); } /** * The method verifier is a bit 'keen' and doesn't cope well with ITDMs which are * of course to be considered a 'default' implementation if the target type doesn't * supply one. This test may not be complete - it is possible that it should read if * *either* is an ITD...but I dont have a testcase that shows that is required. yet. * (pr115788) */ public void duplicateInheritedMethods(SourceTypeBinding type, MethodBinding inheritedMethod1, MethodBinding inheritedMethod2) { if (!(inheritedMethod1 instanceof InterTypeMethodBinding && inheritedMethod2 instanceof InterTypeMethodBinding)) super.duplicateInheritedMethods(type,inheritedMethod1,inheritedMethod2); }
171,667
Bug 171667 When ordering a Clean with Build Automatico I receive the error below.
When executing an Clean Project in Eclipse with Automatic Building I receive the error below. line from the top stack, e.g. "SomeFile.jara:243" java.lang.NullPointerException at org.aspectj.ajdt.internal.compiler.problem.AjProblemReporter.methodMustOverride(AjProblemReporter.java:380) at org.aspectj.org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.resolveStatements(MethodDeclaration.java:153) at org.aspectj.org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolve(AbstractMethodDeclaration.java:400) at org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeDe ... pter.java:107) at org.aspectj.ajde.internal.AspectJBuildManager$CompilerThread.run(AspectJBuildManager.java:191) NullPointerException thrown: null
resolved fixed
4177bed
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2007-02-16T10:02:27Z
2007-01-25T15:46:40Z
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/problem/AjProblemReporter.java
/** * All problems end up routed through here at some point... */ public IProblem createProblem(char[] fileName, int problemId, String[] problemArguments, String[] messageArguments, int severity, int problemStartPosition, int problemEndPosition, int lineNumber) { IProblem problem = super.createProblem(fileName, problemId, problemArguments, messageArguments, severity, problemStartPosition, problemEndPosition, lineNumber); if (factory.getWorld().isInPinpointMode()) { MessageIssued ex = new MessageIssued(); ex.fillInStackTrace(); StringWriter sw = new StringWriter(); ex.printStackTrace(new PrintWriter(sw)); StringBuffer sb = new StringBuffer(); sb.append(CompilationAndWeavingContext.getCurrentContext()); sb.append(sw.toString()); problem = new PinpointedProblem(problem,sb.toString()); } return problem; } private static class MessageIssued extends RuntimeException { public String getMessage() { return "message issued..."; } } private static class PinpointedProblem implements IProblem { private IProblem delegate; private String message;
171,667
Bug 171667 When ordering a Clean with Build Automatico I receive the error below.
When executing an Clean Project in Eclipse with Automatic Building I receive the error below. line from the top stack, e.g. "SomeFile.jara:243" java.lang.NullPointerException at org.aspectj.ajdt.internal.compiler.problem.AjProblemReporter.methodMustOverride(AjProblemReporter.java:380) at org.aspectj.org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.resolveStatements(MethodDeclaration.java:153) at org.aspectj.org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolve(AbstractMethodDeclaration.java:400) at org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeDe ... pter.java:107) at org.aspectj.ajde.internal.AspectJBuildManager$CompilerThread.run(AspectJBuildManager.java:191) NullPointerException thrown: null
resolved fixed
4177bed
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2007-02-16T10:02:27Z
2007-01-25T15:46:40Z
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/problem/AjProblemReporter.java
public PinpointedProblem(IProblem aProblem, String pinpoint) { this.delegate = aProblem; if (delegate.getMessage().indexOf("message issued...") == -1) { this.message = delegate.getMessage() + "\n" + pinpoint; } else { this.message = delegate.getMessage(); } } public String[] getArguments() {return delegate.getArguments();} public int getID() {return delegate.getID();} public String getMessage() { return message; } public char[] getOriginatingFileName() {return delegate.getOriginatingFileName();} public int getSourceEnd() { return delegate.getSourceEnd();} public int getSourceLineNumber() { return delegate.getSourceLineNumber();} public int getSourceStart() { return delegate.getSourceStart();} public boolean isError() { return delegate.isError();} public boolean isWarning() { return delegate.isWarning();} public void setSourceEnd(int sourceEnd) { delegate.setSourceEnd(sourceEnd); } public void setSourceLineNumber(int lineNumber) { delegate.setSourceLineNumber(lineNumber);} public void setSourceStart(int sourceStart) { delegate.setSourceStart(sourceStart);} public void setSeeAlsoProblems(IProblem[] problems) { delegate.setSeeAlsoProblems(problems);} public IProblem[] seeAlso() { return delegate.seeAlso();} public void setSupplementaryMessageInfo(String msg) { delegate.setSupplementaryMessageInfo(msg);} public String getSupplementaryMessageInfo() { return delegate.getSupplementaryMessageInfo();} } }
175,039
Bug 175039 ArrayIndexOutOfBoundException Bug with Nested Type in TypeParameters
I debugged this stack trace from load-time weaving (ajcore files are also available). I found that the signature argument to TypeFactory.createTypeFromSignature(String) is Pjava/lang/Enum<Ljavax/jws/soap/SOAPBinding$ParameterStyle;>; but the method is erroneously using an empty array of parameters, because it thinks the $ relates to the generic type, not the parameter. It should be fairly easy to reproduce with a test case and to fix with a patch - I'll look at it some more tonight or this week. java.lang.ArrayIndexOutOfBoundsException at org.aspectj.weaver.ResolvedType.getMemberParameterizationMap(ResolvedType.java:698) at org.aspectj.weaver.ReferenceType.getDeclaredInterfaces(ReferenceType.java:406) at org.aspectj.weaver.ResolvedType.getDirectSupertypes(ResolvedType.java:65) at org.aspectj.weaver.patterns.TypePattern.matchesSubtypes(TypePattern.java:182) at org.aspectj.weaver.patterns.TypePattern.matchesSubtypes(TypePattern.java:169) at org.aspectj.weaver.patterns.TypePattern.matchesStatically(TypePattern.java:119) at org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.accept(ClassLoaderWeavingAdaptor.java:621) at org.aspectj.weaver.tools.WeavingAdaptor.weaveClass(WeavingAdaptor.java:253) at org.aspectj.weaver.loadtime.Aj.preProcess(Aj.java:78) at org.aspectj.weaver.loadtime.ClassPreProcessorAgentAdapter.transform(ClassPreProcessorAgentAdapter.java:52) at sun.instrument.TransformerManager.transform(TransformerManager.java:122) at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:155) at java.lang.ClassLoader.defineClass(Ljava.lang.String;[BIILjava.security.ProtectionDomain;)Ljava.lang.Class;(Unknown Source) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124) at java.net.URLClassLoader.defineClass(URLClassLoader.java:260) at java.net.URLClassLoader.access$100(URLClassLoader.java:56) at java.net.URLClassLoader$1.run(URLClassLoader.java:195) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(Ljava.lang.String;Z)Ljava.lang.Class;(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268) at java.lang.ClassLoader.loadClass(Ljava.lang.String;)Ljava.lang.Class;(Unknown Source) at java.lang.ClassLoader.loadClassFromNative(Ljava.lang.String;)Ljava.lang.Class;(Unknown Source) at java.lang.Class.forName(Ljava.lang.String;ZLjava.lang.ClassLoader;)Ljava.lang.Class;(Unknown Source) at jrockit.reflect.MemberAccess.getClassFromFieldDesc(Ljava.lang.String;ILjava.lang.ClassLoader;)Ljava.lang.Class;(Unknown Source) at jrockit.reflect.MemberAccess.getReturnClassFromMethodDesc(Ljava.lang.String;Ljava.lang.ClassLoader;)Ljava.lang.Class;(Unknown Source)
resolved fixed
579ec14
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2007-03-06T09:59:56Z
2007-02-21T20:33:20Z
weaver/src/org/aspectj/weaver/TypeFactory.java
/* ******************************************************************* * Copyright (c) 2005 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://eclipse.org/legal/epl-v10.html * * Contributors: * Adrian Colyer Initial implementation * ******************************************************************/ package org.aspectj.weaver; import java.util.ArrayList; import java.util.List; import org.aspectj.weaver.UnresolvedType.TypeKind; /** * @author colyer * */ public class TypeFactory { /** * Create a parameterized version of a generic type. * @param aGenericType * @param someTypeParameters note, in the case of an inner type of a parameterized type, * this parameter may legitimately be null * @param inAWorld
175,039
Bug 175039 ArrayIndexOutOfBoundException Bug with Nested Type in TypeParameters
I debugged this stack trace from load-time weaving (ajcore files are also available). I found that the signature argument to TypeFactory.createTypeFromSignature(String) is Pjava/lang/Enum<Ljavax/jws/soap/SOAPBinding$ParameterStyle;>; but the method is erroneously using an empty array of parameters, because it thinks the $ relates to the generic type, not the parameter. It should be fairly easy to reproduce with a test case and to fix with a patch - I'll look at it some more tonight or this week. java.lang.ArrayIndexOutOfBoundsException at org.aspectj.weaver.ResolvedType.getMemberParameterizationMap(ResolvedType.java:698) at org.aspectj.weaver.ReferenceType.getDeclaredInterfaces(ReferenceType.java:406) at org.aspectj.weaver.ResolvedType.getDirectSupertypes(ResolvedType.java:65) at org.aspectj.weaver.patterns.TypePattern.matchesSubtypes(TypePattern.java:182) at org.aspectj.weaver.patterns.TypePattern.matchesSubtypes(TypePattern.java:169) at org.aspectj.weaver.patterns.TypePattern.matchesStatically(TypePattern.java:119) at org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.accept(ClassLoaderWeavingAdaptor.java:621) at org.aspectj.weaver.tools.WeavingAdaptor.weaveClass(WeavingAdaptor.java:253) at org.aspectj.weaver.loadtime.Aj.preProcess(Aj.java:78) at org.aspectj.weaver.loadtime.ClassPreProcessorAgentAdapter.transform(ClassPreProcessorAgentAdapter.java:52) at sun.instrument.TransformerManager.transform(TransformerManager.java:122) at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:155) at java.lang.ClassLoader.defineClass(Ljava.lang.String;[BIILjava.security.ProtectionDomain;)Ljava.lang.Class;(Unknown Source) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124) at java.net.URLClassLoader.defineClass(URLClassLoader.java:260) at java.net.URLClassLoader.access$100(URLClassLoader.java:56) at java.net.URLClassLoader$1.run(URLClassLoader.java:195) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(Ljava.lang.String;Z)Ljava.lang.Class;(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268) at java.lang.ClassLoader.loadClass(Ljava.lang.String;)Ljava.lang.Class;(Unknown Source) at java.lang.ClassLoader.loadClassFromNative(Ljava.lang.String;)Ljava.lang.Class;(Unknown Source) at java.lang.Class.forName(Ljava.lang.String;ZLjava.lang.ClassLoader;)Ljava.lang.Class;(Unknown Source) at jrockit.reflect.MemberAccess.getClassFromFieldDesc(Ljava.lang.String;ILjava.lang.ClassLoader;)Ljava.lang.Class;(Unknown Source) at jrockit.reflect.MemberAccess.getReturnClassFromMethodDesc(Ljava.lang.String;Ljava.lang.ClassLoader;)Ljava.lang.Class;(Unknown Source)
resolved fixed
579ec14
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2007-03-06T09:59:56Z
2007-02-21T20:33:20Z
weaver/src/org/aspectj/weaver/TypeFactory.java
* @return */ public static ReferenceType createParameterizedType( ResolvedType aBaseType, UnresolvedType[] someTypeParameters, World inAWorld ) { ResolvedType baseType = aBaseType; if (!aBaseType.isGenericType()) { if (someTypeParameters != null && someTypeParameters.length>0) { if (!aBaseType.isRawType()) throw new IllegalStateException("Expecting raw type, not: "+aBaseType); baseType = baseType.getGenericType(); if (baseType == null) throw new IllegalStateException("Raw type does not have generic type set"); } } ResolvedType[] resolvedParameters = inAWorld.resolve(someTypeParameters); ReferenceType pType = new ReferenceType(baseType,resolvedParameters,inAWorld); return (ReferenceType) pType.resolve(inAWorld); } /** * Create an *unresolved* parameterized version of a generic type. */ public static UnresolvedType createUnresolvedParameterizedType(String sig,String erasuresig,UnresolvedType[] arguments) { return new UnresolvedType(sig,erasuresig,arguments); } public static ReferenceType createRawType( ResolvedType aBaseType, World inAWorld
175,039
Bug 175039 ArrayIndexOutOfBoundException Bug with Nested Type in TypeParameters
I debugged this stack trace from load-time weaving (ajcore files are also available). I found that the signature argument to TypeFactory.createTypeFromSignature(String) is Pjava/lang/Enum<Ljavax/jws/soap/SOAPBinding$ParameterStyle;>; but the method is erroneously using an empty array of parameters, because it thinks the $ relates to the generic type, not the parameter. It should be fairly easy to reproduce with a test case and to fix with a patch - I'll look at it some more tonight or this week. java.lang.ArrayIndexOutOfBoundsException at org.aspectj.weaver.ResolvedType.getMemberParameterizationMap(ResolvedType.java:698) at org.aspectj.weaver.ReferenceType.getDeclaredInterfaces(ReferenceType.java:406) at org.aspectj.weaver.ResolvedType.getDirectSupertypes(ResolvedType.java:65) at org.aspectj.weaver.patterns.TypePattern.matchesSubtypes(TypePattern.java:182) at org.aspectj.weaver.patterns.TypePattern.matchesSubtypes(TypePattern.java:169) at org.aspectj.weaver.patterns.TypePattern.matchesStatically(TypePattern.java:119) at org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.accept(ClassLoaderWeavingAdaptor.java:621) at org.aspectj.weaver.tools.WeavingAdaptor.weaveClass(WeavingAdaptor.java:253) at org.aspectj.weaver.loadtime.Aj.preProcess(Aj.java:78) at org.aspectj.weaver.loadtime.ClassPreProcessorAgentAdapter.transform(ClassPreProcessorAgentAdapter.java:52) at sun.instrument.TransformerManager.transform(TransformerManager.java:122) at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:155) at java.lang.ClassLoader.defineClass(Ljava.lang.String;[BIILjava.security.ProtectionDomain;)Ljava.lang.Class;(Unknown Source) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124) at java.net.URLClassLoader.defineClass(URLClassLoader.java:260) at java.net.URLClassLoader.access$100(URLClassLoader.java:56) at java.net.URLClassLoader$1.run(URLClassLoader.java:195) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(Ljava.lang.String;Z)Ljava.lang.Class;(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268) at java.lang.ClassLoader.loadClass(Ljava.lang.String;)Ljava.lang.Class;(Unknown Source) at java.lang.ClassLoader.loadClassFromNative(Ljava.lang.String;)Ljava.lang.Class;(Unknown Source) at java.lang.Class.forName(Ljava.lang.String;ZLjava.lang.ClassLoader;)Ljava.lang.Class;(Unknown Source) at jrockit.reflect.MemberAccess.getClassFromFieldDesc(Ljava.lang.String;ILjava.lang.ClassLoader;)Ljava.lang.Class;(Unknown Source) at jrockit.reflect.MemberAccess.getReturnClassFromMethodDesc(Ljava.lang.String;Ljava.lang.ClassLoader;)Ljava.lang.Class;(Unknown Source)
resolved fixed
579ec14
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2007-03-06T09:59:56Z
2007-02-21T20:33:20Z
weaver/src/org/aspectj/weaver/TypeFactory.java
) { if (aBaseType.isRawType()) return (ReferenceType) aBaseType; if (!aBaseType.isGenericType()) { if (!aBaseType.isRawType()) throw new IllegalStateException("Expecting generic type"); } ReferenceType rType = new ReferenceType(aBaseType,inAWorld); return (ReferenceType) rType.resolve(inAWorld); } /** * Creates a sensible unresolvedtype from some signature, for example: * signature = LIGuard<TT;>; * bound = toString=IGuard<T> sig=PIGuard<TT;>; sigErasure=LIGuard; kind=parameterized */ private static UnresolvedType convertSigToType(String aSignature) { UnresolvedType bound = null; int startOfParams = aSignature.indexOf('<'); if (startOfParams==-1) { bound = UnresolvedType.forSignature(aSignature); } else { int endOfParams = aSignature.lastIndexOf('>'); String signatureErasure = "L" + aSignature.substring(1,startOfParams) + ";"; UnresolvedType[] typeParams = createTypeParams(aSignature.substring(startOfParams +1, endOfParams)); bound = new UnresolvedType("P"+aSignature.substring(1),signatureErasure,typeParams); } return bound; } /**
175,039
Bug 175039 ArrayIndexOutOfBoundException Bug with Nested Type in TypeParameters
I debugged this stack trace from load-time weaving (ajcore files are also available). I found that the signature argument to TypeFactory.createTypeFromSignature(String) is Pjava/lang/Enum<Ljavax/jws/soap/SOAPBinding$ParameterStyle;>; but the method is erroneously using an empty array of parameters, because it thinks the $ relates to the generic type, not the parameter. It should be fairly easy to reproduce with a test case and to fix with a patch - I'll look at it some more tonight or this week. java.lang.ArrayIndexOutOfBoundsException at org.aspectj.weaver.ResolvedType.getMemberParameterizationMap(ResolvedType.java:698) at org.aspectj.weaver.ReferenceType.getDeclaredInterfaces(ReferenceType.java:406) at org.aspectj.weaver.ResolvedType.getDirectSupertypes(ResolvedType.java:65) at org.aspectj.weaver.patterns.TypePattern.matchesSubtypes(TypePattern.java:182) at org.aspectj.weaver.patterns.TypePattern.matchesSubtypes(TypePattern.java:169) at org.aspectj.weaver.patterns.TypePattern.matchesStatically(TypePattern.java:119) at org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.accept(ClassLoaderWeavingAdaptor.java:621) at org.aspectj.weaver.tools.WeavingAdaptor.weaveClass(WeavingAdaptor.java:253) at org.aspectj.weaver.loadtime.Aj.preProcess(Aj.java:78) at org.aspectj.weaver.loadtime.ClassPreProcessorAgentAdapter.transform(ClassPreProcessorAgentAdapter.java:52) at sun.instrument.TransformerManager.transform(TransformerManager.java:122) at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:155) at java.lang.ClassLoader.defineClass(Ljava.lang.String;[BIILjava.security.ProtectionDomain;)Ljava.lang.Class;(Unknown Source) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124) at java.net.URLClassLoader.defineClass(URLClassLoader.java:260) at java.net.URLClassLoader.access$100(URLClassLoader.java:56) at java.net.URLClassLoader$1.run(URLClassLoader.java:195) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(Ljava.lang.String;Z)Ljava.lang.Class;(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268) at java.lang.ClassLoader.loadClass(Ljava.lang.String;)Ljava.lang.Class;(Unknown Source) at java.lang.ClassLoader.loadClassFromNative(Ljava.lang.String;)Ljava.lang.Class;(Unknown Source) at java.lang.Class.forName(Ljava.lang.String;ZLjava.lang.ClassLoader;)Ljava.lang.Class;(Unknown Source) at jrockit.reflect.MemberAccess.getClassFromFieldDesc(Ljava.lang.String;ILjava.lang.ClassLoader;)Ljava.lang.Class;(Unknown Source) at jrockit.reflect.MemberAccess.getReturnClassFromMethodDesc(Ljava.lang.String;Ljava.lang.ClassLoader;)Ljava.lang.Class;(Unknown Source)
resolved fixed
579ec14
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2007-03-06T09:59:56Z
2007-02-21T20:33:20Z
weaver/src/org/aspectj/weaver/TypeFactory.java
* Used by UnresolvedType.read, creates a type from a full signature. * @param signature * @return */ public static UnresolvedType createTypeFromSignature(String signature) { if (signature.equals(ResolvedType.MISSING_NAME)) return ResolvedType.MISSING; char firstChar = signature.charAt(0); if (firstChar=='P') { int startOfParams = signature.indexOf('<'); if (startOfParams==-1) { String signatureErasure = "L" + signature.substring(1); UnresolvedType[] typeParams = new UnresolvedType[0]; return new UnresolvedType(signature,signatureErasure,typeParams); } else { int endOfParams = locateMatchingEndBracket(signature,startOfParams); StringBuffer erasureSig = new StringBuffer(signature); while (startOfParams!=-1) { erasureSig.delete(startOfParams,endOfParams+1); startOfParams = locateFirstBracket(erasureSig); if (startOfParams!=-1) endOfParams = locateMatchingEndBracket(erasureSig,startOfParams); } String signatureErasure = "L" + erasureSig.toString().substring(1);
175,039
Bug 175039 ArrayIndexOutOfBoundException Bug with Nested Type in TypeParameters
I debugged this stack trace from load-time weaving (ajcore files are also available). I found that the signature argument to TypeFactory.createTypeFromSignature(String) is Pjava/lang/Enum<Ljavax/jws/soap/SOAPBinding$ParameterStyle;>; but the method is erroneously using an empty array of parameters, because it thinks the $ relates to the generic type, not the parameter. It should be fairly easy to reproduce with a test case and to fix with a patch - I'll look at it some more tonight or this week. java.lang.ArrayIndexOutOfBoundsException at org.aspectj.weaver.ResolvedType.getMemberParameterizationMap(ResolvedType.java:698) at org.aspectj.weaver.ReferenceType.getDeclaredInterfaces(ReferenceType.java:406) at org.aspectj.weaver.ResolvedType.getDirectSupertypes(ResolvedType.java:65) at org.aspectj.weaver.patterns.TypePattern.matchesSubtypes(TypePattern.java:182) at org.aspectj.weaver.patterns.TypePattern.matchesSubtypes(TypePattern.java:169) at org.aspectj.weaver.patterns.TypePattern.matchesStatically(TypePattern.java:119) at org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.accept(ClassLoaderWeavingAdaptor.java:621) at org.aspectj.weaver.tools.WeavingAdaptor.weaveClass(WeavingAdaptor.java:253) at org.aspectj.weaver.loadtime.Aj.preProcess(Aj.java:78) at org.aspectj.weaver.loadtime.ClassPreProcessorAgentAdapter.transform(ClassPreProcessorAgentAdapter.java:52) at sun.instrument.TransformerManager.transform(TransformerManager.java:122) at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:155) at java.lang.ClassLoader.defineClass(Ljava.lang.String;[BIILjava.security.ProtectionDomain;)Ljava.lang.Class;(Unknown Source) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124) at java.net.URLClassLoader.defineClass(URLClassLoader.java:260) at java.net.URLClassLoader.access$100(URLClassLoader.java:56) at java.net.URLClassLoader$1.run(URLClassLoader.java:195) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(Ljava.lang.String;Z)Ljava.lang.Class;(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268) at java.lang.ClassLoader.loadClass(Ljava.lang.String;)Ljava.lang.Class;(Unknown Source) at java.lang.ClassLoader.loadClassFromNative(Ljava.lang.String;)Ljava.lang.Class;(Unknown Source) at java.lang.Class.forName(Ljava.lang.String;ZLjava.lang.ClassLoader;)Ljava.lang.Class;(Unknown Source) at jrockit.reflect.MemberAccess.getClassFromFieldDesc(Ljava.lang.String;ILjava.lang.ClassLoader;)Ljava.lang.Class;(Unknown Source) at jrockit.reflect.MemberAccess.getReturnClassFromMethodDesc(Ljava.lang.String;Ljava.lang.ClassLoader;)Ljava.lang.Class;(Unknown Source)
resolved fixed
579ec14
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2007-03-06T09:59:56Z
2007-02-21T20:33:20Z
weaver/src/org/aspectj/weaver/TypeFactory.java
String lastType = null; int nestedTypePosition = signature.indexOf("$"); if (nestedTypePosition!=-1) lastType = signature.substring(nestedTypePosition+1); else lastType = new String(signature); startOfParams = lastType.indexOf("<"); endOfParams = locateMatchingEndBracket(lastType,startOfParams); UnresolvedType[] typeParams = UnresolvedType.NONE; if (startOfParams!=-1) { typeParams = createTypeParams(lastType.substring(startOfParams +1, endOfParams)); } return new UnresolvedType(signature,signatureErasure,typeParams); } } else if (signature.equals("?")){ UnresolvedType ret = UnresolvedType.SOMETHING; ret.typeKind = TypeKind.WILDCARD; return ret; } else if(firstChar=='+') { UnresolvedType ret = new UnresolvedType(signature); ret.typeKind = TypeKind.WILDCARD; ret.setUpperBound(convertSigToType(signature.substring(1))); return ret; } else if (firstChar=='-') { UnresolvedType ret = new UnresolvedType(signature);
175,039
Bug 175039 ArrayIndexOutOfBoundException Bug with Nested Type in TypeParameters
I debugged this stack trace from load-time weaving (ajcore files are also available). I found that the signature argument to TypeFactory.createTypeFromSignature(String) is Pjava/lang/Enum<Ljavax/jws/soap/SOAPBinding$ParameterStyle;>; but the method is erroneously using an empty array of parameters, because it thinks the $ relates to the generic type, not the parameter. It should be fairly easy to reproduce with a test case and to fix with a patch - I'll look at it some more tonight or this week. java.lang.ArrayIndexOutOfBoundsException at org.aspectj.weaver.ResolvedType.getMemberParameterizationMap(ResolvedType.java:698) at org.aspectj.weaver.ReferenceType.getDeclaredInterfaces(ReferenceType.java:406) at org.aspectj.weaver.ResolvedType.getDirectSupertypes(ResolvedType.java:65) at org.aspectj.weaver.patterns.TypePattern.matchesSubtypes(TypePattern.java:182) at org.aspectj.weaver.patterns.TypePattern.matchesSubtypes(TypePattern.java:169) at org.aspectj.weaver.patterns.TypePattern.matchesStatically(TypePattern.java:119) at org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.accept(ClassLoaderWeavingAdaptor.java:621) at org.aspectj.weaver.tools.WeavingAdaptor.weaveClass(WeavingAdaptor.java:253) at org.aspectj.weaver.loadtime.Aj.preProcess(Aj.java:78) at org.aspectj.weaver.loadtime.ClassPreProcessorAgentAdapter.transform(ClassPreProcessorAgentAdapter.java:52) at sun.instrument.TransformerManager.transform(TransformerManager.java:122) at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:155) at java.lang.ClassLoader.defineClass(Ljava.lang.String;[BIILjava.security.ProtectionDomain;)Ljava.lang.Class;(Unknown Source) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124) at java.net.URLClassLoader.defineClass(URLClassLoader.java:260) at java.net.URLClassLoader.access$100(URLClassLoader.java:56) at java.net.URLClassLoader$1.run(URLClassLoader.java:195) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(Ljava.lang.String;Z)Ljava.lang.Class;(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268) at java.lang.ClassLoader.loadClass(Ljava.lang.String;)Ljava.lang.Class;(Unknown Source) at java.lang.ClassLoader.loadClassFromNative(Ljava.lang.String;)Ljava.lang.Class;(Unknown Source) at java.lang.Class.forName(Ljava.lang.String;ZLjava.lang.ClassLoader;)Ljava.lang.Class;(Unknown Source) at jrockit.reflect.MemberAccess.getClassFromFieldDesc(Ljava.lang.String;ILjava.lang.ClassLoader;)Ljava.lang.Class;(Unknown Source) at jrockit.reflect.MemberAccess.getReturnClassFromMethodDesc(Ljava.lang.String;Ljava.lang.ClassLoader;)Ljava.lang.Class;(Unknown Source)
resolved fixed
579ec14
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2007-03-06T09:59:56Z
2007-02-21T20:33:20Z
weaver/src/org/aspectj/weaver/TypeFactory.java
ret.typeKind = TypeKind.WILDCARD; ret.setLowerBound(convertSigToType(signature.substring(1))); return ret; } else if (firstChar=='T') { String typeVariableName = signature.substring(1); if (typeVariableName.endsWith(";")) { typeVariableName = typeVariableName.substring(0, typeVariableName.length() -1); } return new UnresolvedTypeVariableReferenceType(new TypeVariable(typeVariableName)); } else if (firstChar=='[') { int dims = 0; while (signature.charAt(dims)=='[') dims++; UnresolvedType componentType = createTypeFromSignature(signature.substring(dims)); return new UnresolvedType(signature, signature.substring(0,dims)+componentType.getErasureSignature()); } else if (signature.length()==1) { switch (firstChar) { case 'V': return ResolvedType.VOID; case 'Z': return ResolvedType.BOOLEAN; case 'B': return ResolvedType.BYTE; case 'C': return ResolvedType.CHAR; case 'D': return ResolvedType.DOUBLE; case 'F': return ResolvedType.FLOAT; case 'I': return ResolvedType.INT; case 'J': return ResolvedType.LONG; case 'S': return ResolvedType.SHORT; } } return new UnresolvedType(signature); }
175,039
Bug 175039 ArrayIndexOutOfBoundException Bug with Nested Type in TypeParameters
I debugged this stack trace from load-time weaving (ajcore files are also available). I found that the signature argument to TypeFactory.createTypeFromSignature(String) is Pjava/lang/Enum<Ljavax/jws/soap/SOAPBinding$ParameterStyle;>; but the method is erroneously using an empty array of parameters, because it thinks the $ relates to the generic type, not the parameter. It should be fairly easy to reproduce with a test case and to fix with a patch - I'll look at it some more tonight or this week. java.lang.ArrayIndexOutOfBoundsException at org.aspectj.weaver.ResolvedType.getMemberParameterizationMap(ResolvedType.java:698) at org.aspectj.weaver.ReferenceType.getDeclaredInterfaces(ReferenceType.java:406) at org.aspectj.weaver.ResolvedType.getDirectSupertypes(ResolvedType.java:65) at org.aspectj.weaver.patterns.TypePattern.matchesSubtypes(TypePattern.java:182) at org.aspectj.weaver.patterns.TypePattern.matchesSubtypes(TypePattern.java:169) at org.aspectj.weaver.patterns.TypePattern.matchesStatically(TypePattern.java:119) at org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.accept(ClassLoaderWeavingAdaptor.java:621) at org.aspectj.weaver.tools.WeavingAdaptor.weaveClass(WeavingAdaptor.java:253) at org.aspectj.weaver.loadtime.Aj.preProcess(Aj.java:78) at org.aspectj.weaver.loadtime.ClassPreProcessorAgentAdapter.transform(ClassPreProcessorAgentAdapter.java:52) at sun.instrument.TransformerManager.transform(TransformerManager.java:122) at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:155) at java.lang.ClassLoader.defineClass(Ljava.lang.String;[BIILjava.security.ProtectionDomain;)Ljava.lang.Class;(Unknown Source) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124) at java.net.URLClassLoader.defineClass(URLClassLoader.java:260) at java.net.URLClassLoader.access$100(URLClassLoader.java:56) at java.net.URLClassLoader$1.run(URLClassLoader.java:195) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(Ljava.lang.String;Z)Ljava.lang.Class;(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268) at java.lang.ClassLoader.loadClass(Ljava.lang.String;)Ljava.lang.Class;(Unknown Source) at java.lang.ClassLoader.loadClassFromNative(Ljava.lang.String;)Ljava.lang.Class;(Unknown Source) at java.lang.Class.forName(Ljava.lang.String;ZLjava.lang.ClassLoader;)Ljava.lang.Class;(Unknown Source) at jrockit.reflect.MemberAccess.getClassFromFieldDesc(Ljava.lang.String;ILjava.lang.ClassLoader;)Ljava.lang.Class;(Unknown Source) at jrockit.reflect.MemberAccess.getReturnClassFromMethodDesc(Ljava.lang.String;Ljava.lang.ClassLoader;)Ljava.lang.Class;(Unknown Source)
resolved fixed
579ec14
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2007-03-06T09:59:56Z
2007-02-21T20:33:20Z
weaver/src/org/aspectj/weaver/TypeFactory.java
private static int locateMatchingEndBracket(String signature, int startOfParams) { if (startOfParams==-1) return -1; int count =1; int idx = startOfParams; while (count>0 && idx<signature.length()) { idx++; if (signature.charAt(idx)=='<') count++; if (signature.charAt(idx)=='>') count--; } return idx; } private static int locateMatchingEndBracket(StringBuffer signature, int startOfParams) { if (startOfParams==-1) return -1; int count =1; int idx = startOfParams; while (count>0 && idx<signature.length()) { idx++; if (signature.charAt(idx)=='<') count++; if (signature.charAt(idx)=='>') count--; } return idx; } private static int locateFirstBracket(StringBuffer signature) { int idx = 0; while (idx<signature.length()) { if (signature.charAt(idx)=='<') return idx; idx++; }
175,039
Bug 175039 ArrayIndexOutOfBoundException Bug with Nested Type in TypeParameters
I debugged this stack trace from load-time weaving (ajcore files are also available). I found that the signature argument to TypeFactory.createTypeFromSignature(String) is Pjava/lang/Enum<Ljavax/jws/soap/SOAPBinding$ParameterStyle;>; but the method is erroneously using an empty array of parameters, because it thinks the $ relates to the generic type, not the parameter. It should be fairly easy to reproduce with a test case and to fix with a patch - I'll look at it some more tonight or this week. java.lang.ArrayIndexOutOfBoundsException at org.aspectj.weaver.ResolvedType.getMemberParameterizationMap(ResolvedType.java:698) at org.aspectj.weaver.ReferenceType.getDeclaredInterfaces(ReferenceType.java:406) at org.aspectj.weaver.ResolvedType.getDirectSupertypes(ResolvedType.java:65) at org.aspectj.weaver.patterns.TypePattern.matchesSubtypes(TypePattern.java:182) at org.aspectj.weaver.patterns.TypePattern.matchesSubtypes(TypePattern.java:169) at org.aspectj.weaver.patterns.TypePattern.matchesStatically(TypePattern.java:119) at org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.accept(ClassLoaderWeavingAdaptor.java:621) at org.aspectj.weaver.tools.WeavingAdaptor.weaveClass(WeavingAdaptor.java:253) at org.aspectj.weaver.loadtime.Aj.preProcess(Aj.java:78) at org.aspectj.weaver.loadtime.ClassPreProcessorAgentAdapter.transform(ClassPreProcessorAgentAdapter.java:52) at sun.instrument.TransformerManager.transform(TransformerManager.java:122) at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:155) at java.lang.ClassLoader.defineClass(Ljava.lang.String;[BIILjava.security.ProtectionDomain;)Ljava.lang.Class;(Unknown Source) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124) at java.net.URLClassLoader.defineClass(URLClassLoader.java:260) at java.net.URLClassLoader.access$100(URLClassLoader.java:56) at java.net.URLClassLoader$1.run(URLClassLoader.java:195) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(Ljava.lang.String;Z)Ljava.lang.Class;(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268) at java.lang.ClassLoader.loadClass(Ljava.lang.String;)Ljava.lang.Class;(Unknown Source) at java.lang.ClassLoader.loadClassFromNative(Ljava.lang.String;)Ljava.lang.Class;(Unknown Source) at java.lang.Class.forName(Ljava.lang.String;ZLjava.lang.ClassLoader;)Ljava.lang.Class;(Unknown Source) at jrockit.reflect.MemberAccess.getClassFromFieldDesc(Ljava.lang.String;ILjava.lang.ClassLoader;)Ljava.lang.Class;(Unknown Source) at jrockit.reflect.MemberAccess.getReturnClassFromMethodDesc(Ljava.lang.String;Ljava.lang.ClassLoader;)Ljava.lang.Class;(Unknown Source)
resolved fixed
579ec14
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2007-03-06T09:59:56Z
2007-02-21T20:33:20Z
weaver/src/org/aspectj/weaver/TypeFactory.java
return -1; } private static UnresolvedType[] createTypeParams(String typeParameterSpecification) { String remainingToProcess = typeParameterSpecification; List types = new ArrayList(); while(!remainingToProcess.equals("")) { int endOfSig = 0; int anglies = 0; boolean sigFound = false; for (endOfSig = 0; (endOfSig < remainingToProcess.length()) && !sigFound; endOfSig++) { char thisChar = remainingToProcess.charAt(endOfSig); switch(thisChar) { case '<' : anglies++; break; case '>' : anglies--; break; case ';' : if (anglies == 0) { sigFound = true; break; } } } types.add(createTypeFromSignature(remainingToProcess.substring(0,endOfSig))); remainingToProcess = remainingToProcess.substring(endOfSig); } UnresolvedType[] typeParams = new UnresolvedType[types.size()]; types.toArray(typeParams); return typeParams; } }
175,039
Bug 175039 ArrayIndexOutOfBoundException Bug with Nested Type in TypeParameters
I debugged this stack trace from load-time weaving (ajcore files are also available). I found that the signature argument to TypeFactory.createTypeFromSignature(String) is Pjava/lang/Enum<Ljavax/jws/soap/SOAPBinding$ParameterStyle;>; but the method is erroneously using an empty array of parameters, because it thinks the $ relates to the generic type, not the parameter. It should be fairly easy to reproduce with a test case and to fix with a patch - I'll look at it some more tonight or this week. java.lang.ArrayIndexOutOfBoundsException at org.aspectj.weaver.ResolvedType.getMemberParameterizationMap(ResolvedType.java:698) at org.aspectj.weaver.ReferenceType.getDeclaredInterfaces(ReferenceType.java:406) at org.aspectj.weaver.ResolvedType.getDirectSupertypes(ResolvedType.java:65) at org.aspectj.weaver.patterns.TypePattern.matchesSubtypes(TypePattern.java:182) at org.aspectj.weaver.patterns.TypePattern.matchesSubtypes(TypePattern.java:169) at org.aspectj.weaver.patterns.TypePattern.matchesStatically(TypePattern.java:119) at org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.accept(ClassLoaderWeavingAdaptor.java:621) at org.aspectj.weaver.tools.WeavingAdaptor.weaveClass(WeavingAdaptor.java:253) at org.aspectj.weaver.loadtime.Aj.preProcess(Aj.java:78) at org.aspectj.weaver.loadtime.ClassPreProcessorAgentAdapter.transform(ClassPreProcessorAgentAdapter.java:52) at sun.instrument.TransformerManager.transform(TransformerManager.java:122) at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:155) at java.lang.ClassLoader.defineClass(Ljava.lang.String;[BIILjava.security.ProtectionDomain;)Ljava.lang.Class;(Unknown Source) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124) at java.net.URLClassLoader.defineClass(URLClassLoader.java:260) at java.net.URLClassLoader.access$100(URLClassLoader.java:56) at java.net.URLClassLoader$1.run(URLClassLoader.java:195) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(Ljava.lang.String;Z)Ljava.lang.Class;(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268) at java.lang.ClassLoader.loadClass(Ljava.lang.String;)Ljava.lang.Class;(Unknown Source) at java.lang.ClassLoader.loadClassFromNative(Ljava.lang.String;)Ljava.lang.Class;(Unknown Source) at java.lang.Class.forName(Ljava.lang.String;ZLjava.lang.ClassLoader;)Ljava.lang.Class;(Unknown Source) at jrockit.reflect.MemberAccess.getClassFromFieldDesc(Ljava.lang.String;ILjava.lang.ClassLoader;)Ljava.lang.Class;(Unknown Source) at jrockit.reflect.MemberAccess.getReturnClassFromMethodDesc(Ljava.lang.String;Ljava.lang.ClassLoader;)Ljava.lang.Class;(Unknown Source)
resolved fixed
579ec14
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2007-03-06T09:59:56Z
2007-02-21T20:33:20Z
weaver/testsrc/org/aspectj/weaver/TypeXTestCase.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 * ******************************************************************/ package org.aspectj.weaver; import junit.framework.TestCase; import org.aspectj.testing.util.TestUtil; import org.aspectj.util.LangUtil; import org.aspectj.weaver.bcel.BcelWorld; /** * This is a test case for all the portions of UnresolvedType that don't require a world. */ public class TypeXTestCase extends TestCase {
175,039
Bug 175039 ArrayIndexOutOfBoundException Bug with Nested Type in TypeParameters
I debugged this stack trace from load-time weaving (ajcore files are also available). I found that the signature argument to TypeFactory.createTypeFromSignature(String) is Pjava/lang/Enum<Ljavax/jws/soap/SOAPBinding$ParameterStyle;>; but the method is erroneously using an empty array of parameters, because it thinks the $ relates to the generic type, not the parameter. It should be fairly easy to reproduce with a test case and to fix with a patch - I'll look at it some more tonight or this week. java.lang.ArrayIndexOutOfBoundsException at org.aspectj.weaver.ResolvedType.getMemberParameterizationMap(ResolvedType.java:698) at org.aspectj.weaver.ReferenceType.getDeclaredInterfaces(ReferenceType.java:406) at org.aspectj.weaver.ResolvedType.getDirectSupertypes(ResolvedType.java:65) at org.aspectj.weaver.patterns.TypePattern.matchesSubtypes(TypePattern.java:182) at org.aspectj.weaver.patterns.TypePattern.matchesSubtypes(TypePattern.java:169) at org.aspectj.weaver.patterns.TypePattern.matchesStatically(TypePattern.java:119) at org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.accept(ClassLoaderWeavingAdaptor.java:621) at org.aspectj.weaver.tools.WeavingAdaptor.weaveClass(WeavingAdaptor.java:253) at org.aspectj.weaver.loadtime.Aj.preProcess(Aj.java:78) at org.aspectj.weaver.loadtime.ClassPreProcessorAgentAdapter.transform(ClassPreProcessorAgentAdapter.java:52) at sun.instrument.TransformerManager.transform(TransformerManager.java:122) at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:155) at java.lang.ClassLoader.defineClass(Ljava.lang.String;[BIILjava.security.ProtectionDomain;)Ljava.lang.Class;(Unknown Source) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124) at java.net.URLClassLoader.defineClass(URLClassLoader.java:260) at java.net.URLClassLoader.access$100(URLClassLoader.java:56) at java.net.URLClassLoader$1.run(URLClassLoader.java:195) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(Ljava.lang.String;Z)Ljava.lang.Class;(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268) at java.lang.ClassLoader.loadClass(Ljava.lang.String;)Ljava.lang.Class;(Unknown Source) at java.lang.ClassLoader.loadClassFromNative(Ljava.lang.String;)Ljava.lang.Class;(Unknown Source) at java.lang.Class.forName(Ljava.lang.String;ZLjava.lang.ClassLoader;)Ljava.lang.Class;(Unknown Source) at jrockit.reflect.MemberAccess.getClassFromFieldDesc(Ljava.lang.String;ILjava.lang.ClassLoader;)Ljava.lang.Class;(Unknown Source) at jrockit.reflect.MemberAccess.getReturnClassFromMethodDesc(Ljava.lang.String;Ljava.lang.ClassLoader;)Ljava.lang.Class;(Unknown Source)
resolved fixed
579ec14
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2007-03-06T09:59:56Z
2007-02-21T20:33:20Z
weaver/testsrc/org/aspectj/weaver/TypeXTestCase.java
public TypeXTestCase(String name) { super(name); } public void testUnresolvedTypes() { String[] testNames = new String[] {"int", "long", "int[]", "boolean[][]", "java.lang.String", "java.lang.String[]", "void" }; String[] testSigs = new String[] {"I", "J", "[I", "[[Z", "Ljava/lang/String;", "[Ljava/lang/String;", "V" };
175,039
Bug 175039 ArrayIndexOutOfBoundException Bug with Nested Type in TypeParameters
I debugged this stack trace from load-time weaving (ajcore files are also available). I found that the signature argument to TypeFactory.createTypeFromSignature(String) is Pjava/lang/Enum<Ljavax/jws/soap/SOAPBinding$ParameterStyle;>; but the method is erroneously using an empty array of parameters, because it thinks the $ relates to the generic type, not the parameter. It should be fairly easy to reproduce with a test case and to fix with a patch - I'll look at it some more tonight or this week. java.lang.ArrayIndexOutOfBoundsException at org.aspectj.weaver.ResolvedType.getMemberParameterizationMap(ResolvedType.java:698) at org.aspectj.weaver.ReferenceType.getDeclaredInterfaces(ReferenceType.java:406) at org.aspectj.weaver.ResolvedType.getDirectSupertypes(ResolvedType.java:65) at org.aspectj.weaver.patterns.TypePattern.matchesSubtypes(TypePattern.java:182) at org.aspectj.weaver.patterns.TypePattern.matchesSubtypes(TypePattern.java:169) at org.aspectj.weaver.patterns.TypePattern.matchesStatically(TypePattern.java:119) at org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.accept(ClassLoaderWeavingAdaptor.java:621) at org.aspectj.weaver.tools.WeavingAdaptor.weaveClass(WeavingAdaptor.java:253) at org.aspectj.weaver.loadtime.Aj.preProcess(Aj.java:78) at org.aspectj.weaver.loadtime.ClassPreProcessorAgentAdapter.transform(ClassPreProcessorAgentAdapter.java:52) at sun.instrument.TransformerManager.transform(TransformerManager.java:122) at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:155) at java.lang.ClassLoader.defineClass(Ljava.lang.String;[BIILjava.security.ProtectionDomain;)Ljava.lang.Class;(Unknown Source) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124) at java.net.URLClassLoader.defineClass(URLClassLoader.java:260) at java.net.URLClassLoader.access$100(URLClassLoader.java:56) at java.net.URLClassLoader$1.run(URLClassLoader.java:195) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(Ljava.lang.String;Z)Ljava.lang.Class;(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268) at java.lang.ClassLoader.loadClass(Ljava.lang.String;)Ljava.lang.Class;(Unknown Source) at java.lang.ClassLoader.loadClassFromNative(Ljava.lang.String;)Ljava.lang.Class;(Unknown Source) at java.lang.Class.forName(Ljava.lang.String;ZLjava.lang.ClassLoader;)Ljava.lang.Class;(Unknown Source) at jrockit.reflect.MemberAccess.getClassFromFieldDesc(Ljava.lang.String;ILjava.lang.ClassLoader;)Ljava.lang.Class;(Unknown Source) at jrockit.reflect.MemberAccess.getReturnClassFromMethodDesc(Ljava.lang.String;Ljava.lang.ClassLoader;)Ljava.lang.Class;(Unknown Source)
resolved fixed
579ec14
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2007-03-06T09:59:56Z
2007-02-21T20:33:20Z
weaver/testsrc/org/aspectj/weaver/TypeXTestCase.java
String[] componentNames = new String[] {null, null, "int", "boolean[]", null, "java.lang.String", null }; int[] sizes = new int[] {1, 2, 1, 1, 1, 1, 0}; boolean[] isPrimitive = new boolean[] { true, true, false, false, false, false, true }; nameSignatureTest(testNames, testSigs); arrayTest(UnresolvedType.forNames(testNames), componentNames); arrayTest(UnresolvedType.forSignatures(testSigs), componentNames); sizeTest(UnresolvedType.forNames(testNames), sizes); sizeTest(UnresolvedType.forSignatures(testSigs), sizes); isPrimitiveTest(UnresolvedType.forSignatures(testSigs), isPrimitive); } public void testNameAndSigWithInners() { UnresolvedType t = UnresolvedType.forName("java.util.Map$Entry"); assertEquals(t.getName(), "java.util.Map$Entry"); assertEquals(t.getSignature(), "Ljava/util/Map$Entry;"); assertEquals(t.getOutermostType(), UnresolvedType.forName("java.util.Map")); assertEquals(UnresolvedType.forName("java.util.Map").getOutermostType(), UnresolvedType.forName("java.util.Map")); } public void testNameAndSigWithParameters() { UnresolvedType t = UnresolvedType.forName("java.util.List<java.lang.String>"); assertEquals(t.getName(),"java.util.List<java.lang.String>"); assertEquals(t.getSignature(),"Pjava/util/List<Ljava/lang/String;>;"); t = UnresolvedType.forSignature("Pjava/util/List<Ljava/lang/String;>;");
175,039
Bug 175039 ArrayIndexOutOfBoundException Bug with Nested Type in TypeParameters
I debugged this stack trace from load-time weaving (ajcore files are also available). I found that the signature argument to TypeFactory.createTypeFromSignature(String) is Pjava/lang/Enum<Ljavax/jws/soap/SOAPBinding$ParameterStyle;>; but the method is erroneously using an empty array of parameters, because it thinks the $ relates to the generic type, not the parameter. It should be fairly easy to reproduce with a test case and to fix with a patch - I'll look at it some more tonight or this week. java.lang.ArrayIndexOutOfBoundsException at org.aspectj.weaver.ResolvedType.getMemberParameterizationMap(ResolvedType.java:698) at org.aspectj.weaver.ReferenceType.getDeclaredInterfaces(ReferenceType.java:406) at org.aspectj.weaver.ResolvedType.getDirectSupertypes(ResolvedType.java:65) at org.aspectj.weaver.patterns.TypePattern.matchesSubtypes(TypePattern.java:182) at org.aspectj.weaver.patterns.TypePattern.matchesSubtypes(TypePattern.java:169) at org.aspectj.weaver.patterns.TypePattern.matchesStatically(TypePattern.java:119) at org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.accept(ClassLoaderWeavingAdaptor.java:621) at org.aspectj.weaver.tools.WeavingAdaptor.weaveClass(WeavingAdaptor.java:253) at org.aspectj.weaver.loadtime.Aj.preProcess(Aj.java:78) at org.aspectj.weaver.loadtime.ClassPreProcessorAgentAdapter.transform(ClassPreProcessorAgentAdapter.java:52) at sun.instrument.TransformerManager.transform(TransformerManager.java:122) at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:155) at java.lang.ClassLoader.defineClass(Ljava.lang.String;[BIILjava.security.ProtectionDomain;)Ljava.lang.Class;(Unknown Source) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124) at java.net.URLClassLoader.defineClass(URLClassLoader.java:260) at java.net.URLClassLoader.access$100(URLClassLoader.java:56) at java.net.URLClassLoader$1.run(URLClassLoader.java:195) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(Ljava.lang.String;Z)Ljava.lang.Class;(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268) at java.lang.ClassLoader.loadClass(Ljava.lang.String;)Ljava.lang.Class;(Unknown Source) at java.lang.ClassLoader.loadClassFromNative(Ljava.lang.String;)Ljava.lang.Class;(Unknown Source) at java.lang.Class.forName(Ljava.lang.String;ZLjava.lang.ClassLoader;)Ljava.lang.Class;(Unknown Source) at jrockit.reflect.MemberAccess.getClassFromFieldDesc(Ljava.lang.String;ILjava.lang.ClassLoader;)Ljava.lang.Class;(Unknown Source) at jrockit.reflect.MemberAccess.getReturnClassFromMethodDesc(Ljava.lang.String;Ljava.lang.ClassLoader;)Ljava.lang.Class;(Unknown Source)
resolved fixed
579ec14
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2007-03-06T09:59:56Z
2007-02-21T20:33:20Z
weaver/testsrc/org/aspectj/weaver/TypeXTestCase.java
assertEquals(t.getName(),"java.util.List<java.lang.String>"); assertEquals(t.getSignature(),"Pjava/util/List<Ljava/lang/String;>;"); t = UnresolvedType.forName("java.util.Map<java.util.String,java.util.List<java.lang.Integer>>"); assertEquals(t.getName(),"java.util.Map<java.util.String,java.util.List<java.lang.Integer>>"); assertEquals(t.getSignature(),"Pjava/util/Map<Ljava/util/String;Pjava/util/List<Ljava/lang/Integer;>;>;"); t = UnresolvedType.forSignature("Pjava/util/Map<Ljava/util/String;Pjava/util/List<Ljava/lang/Integer;>;>;"); assertEquals(t.getName(),"java.util.Map<java.util.String,java.util.List<java.lang.Integer>>"); assertEquals(t.getSignature(),"Pjava/util/Map<Ljava/util/String;Pjava/util/List<Ljava/lang/Integer;>;>;"); } /** * Verify UnresolvedType signature processing creates the right kind of UnresolvedType's from a signature. * * For example, calling UnresolvedType.dump() for * "Ljava/util/Map<Ljava/util/List<Ljava/lang/String;>;Ljava/lang/String;>;" * results in: * UnresolvedType: signature=Ljava/util/Map<Ljava/util/List<Ljava/lang/String;>;Ljava/lang/String;>; parameterized=true #params=2 * UnresolvedType: signature=Ljava/util/List<Ljava/lang/String;>; parameterized=true #params=1 * UnresolvedType: signature=Ljava/lang/String; parameterized=false #params=0 * UnresolvedType: signature=Ljava/lang/String; parameterized=false #params=0 */ public void testTypexGenericSignatureProcessing() { UnresolvedType tx = null; tx = UnresolvedType.forSignature("Pjava/util/Set<Ljava/lang/String;>;"); checkTX(tx,true,1); tx = UnresolvedType.forSignature("Pjava/util/Set<Pjava/util/List<Ljava/lang/String;>;>;"); checkTX(tx,true,1);
175,039
Bug 175039 ArrayIndexOutOfBoundException Bug with Nested Type in TypeParameters
I debugged this stack trace from load-time weaving (ajcore files are also available). I found that the signature argument to TypeFactory.createTypeFromSignature(String) is Pjava/lang/Enum<Ljavax/jws/soap/SOAPBinding$ParameterStyle;>; but the method is erroneously using an empty array of parameters, because it thinks the $ relates to the generic type, not the parameter. It should be fairly easy to reproduce with a test case and to fix with a patch - I'll look at it some more tonight or this week. java.lang.ArrayIndexOutOfBoundsException at org.aspectj.weaver.ResolvedType.getMemberParameterizationMap(ResolvedType.java:698) at org.aspectj.weaver.ReferenceType.getDeclaredInterfaces(ReferenceType.java:406) at org.aspectj.weaver.ResolvedType.getDirectSupertypes(ResolvedType.java:65) at org.aspectj.weaver.patterns.TypePattern.matchesSubtypes(TypePattern.java:182) at org.aspectj.weaver.patterns.TypePattern.matchesSubtypes(TypePattern.java:169) at org.aspectj.weaver.patterns.TypePattern.matchesStatically(TypePattern.java:119) at org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.accept(ClassLoaderWeavingAdaptor.java:621) at org.aspectj.weaver.tools.WeavingAdaptor.weaveClass(WeavingAdaptor.java:253) at org.aspectj.weaver.loadtime.Aj.preProcess(Aj.java:78) at org.aspectj.weaver.loadtime.ClassPreProcessorAgentAdapter.transform(ClassPreProcessorAgentAdapter.java:52) at sun.instrument.TransformerManager.transform(TransformerManager.java:122) at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:155) at java.lang.ClassLoader.defineClass(Ljava.lang.String;[BIILjava.security.ProtectionDomain;)Ljava.lang.Class;(Unknown Source) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124) at java.net.URLClassLoader.defineClass(URLClassLoader.java:260) at java.net.URLClassLoader.access$100(URLClassLoader.java:56) at java.net.URLClassLoader$1.run(URLClassLoader.java:195) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(Ljava.lang.String;Z)Ljava.lang.Class;(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268) at java.lang.ClassLoader.loadClass(Ljava.lang.String;)Ljava.lang.Class;(Unknown Source) at java.lang.ClassLoader.loadClassFromNative(Ljava.lang.String;)Ljava.lang.Class;(Unknown Source) at java.lang.Class.forName(Ljava.lang.String;ZLjava.lang.ClassLoader;)Ljava.lang.Class;(Unknown Source) at jrockit.reflect.MemberAccess.getClassFromFieldDesc(Ljava.lang.String;ILjava.lang.ClassLoader;)Ljava.lang.Class;(Unknown Source) at jrockit.reflect.MemberAccess.getReturnClassFromMethodDesc(Ljava.lang.String;Ljava.lang.ClassLoader;)Ljava.lang.Class;(Unknown Source)
resolved fixed
579ec14
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2007-03-06T09:59:56Z
2007-02-21T20:33:20Z
weaver/testsrc/org/aspectj/weaver/TypeXTestCase.java
tx = UnresolvedType.forSignature("Pjava/util/Map<Pjava/util/List<Ljava/lang/String;>;Ljava/lang/String;>;"); checkTX(tx,true,2); checkTX(tx.getTypeParameters()[0],true,1); checkTX(tx.getTypeParameters()[1],false,0); } public void testTypeXForParameterizedTypes() { if (LangUtil.is15VMOrGreater()) { World world = new BcelWorld(); UnresolvedType stringType = UnresolvedType.forName("java/lang/String"); ResolvedType listOfStringType = TypeFactory.createParameterizedType( UnresolvedType.forName("java/util/List").resolve(world), new UnresolvedType[] {stringType}, world); assertEquals("1 type param",1,listOfStringType.typeParameters.length); assertEquals(stringType,listOfStringType.typeParameters[0]); assertTrue(listOfStringType.isParameterizedType()); assertFalse(listOfStringType.isGenericType()); } } private void checkTX(UnresolvedType tx,boolean shouldBeParameterized,int numberOfTypeParameters) { assertTrue("Expected parameterization flag to be "+shouldBeParameterized,tx.isParameterizedType()==shouldBeParameterized); if (numberOfTypeParameters==0) { UnresolvedType[] params = tx.getTypeParameters(); assertTrue("Expected 0 type parameters but found "+params.length,params==null || params.length==0); } else { assertTrue("Expected #type parameters to be "+numberOfTypeParameters,tx.getTypeParameters().length==numberOfTypeParameters); }
175,039
Bug 175039 ArrayIndexOutOfBoundException Bug with Nested Type in TypeParameters
I debugged this stack trace from load-time weaving (ajcore files are also available). I found that the signature argument to TypeFactory.createTypeFromSignature(String) is Pjava/lang/Enum<Ljavax/jws/soap/SOAPBinding$ParameterStyle;>; but the method is erroneously using an empty array of parameters, because it thinks the $ relates to the generic type, not the parameter. It should be fairly easy to reproduce with a test case and to fix with a patch - I'll look at it some more tonight or this week. java.lang.ArrayIndexOutOfBoundsException at org.aspectj.weaver.ResolvedType.getMemberParameterizationMap(ResolvedType.java:698) at org.aspectj.weaver.ReferenceType.getDeclaredInterfaces(ReferenceType.java:406) at org.aspectj.weaver.ResolvedType.getDirectSupertypes(ResolvedType.java:65) at org.aspectj.weaver.patterns.TypePattern.matchesSubtypes(TypePattern.java:182) at org.aspectj.weaver.patterns.TypePattern.matchesSubtypes(TypePattern.java:169) at org.aspectj.weaver.patterns.TypePattern.matchesStatically(TypePattern.java:119) at org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.accept(ClassLoaderWeavingAdaptor.java:621) at org.aspectj.weaver.tools.WeavingAdaptor.weaveClass(WeavingAdaptor.java:253) at org.aspectj.weaver.loadtime.Aj.preProcess(Aj.java:78) at org.aspectj.weaver.loadtime.ClassPreProcessorAgentAdapter.transform(ClassPreProcessorAgentAdapter.java:52) at sun.instrument.TransformerManager.transform(TransformerManager.java:122) at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:155) at java.lang.ClassLoader.defineClass(Ljava.lang.String;[BIILjava.security.ProtectionDomain;)Ljava.lang.Class;(Unknown Source) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124) at java.net.URLClassLoader.defineClass(URLClassLoader.java:260) at java.net.URLClassLoader.access$100(URLClassLoader.java:56) at java.net.URLClassLoader$1.run(URLClassLoader.java:195) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(Ljava.lang.String;Z)Ljava.lang.Class;(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268) at java.lang.ClassLoader.loadClass(Ljava.lang.String;)Ljava.lang.Class;(Unknown Source) at java.lang.ClassLoader.loadClassFromNative(Ljava.lang.String;)Ljava.lang.Class;(Unknown Source) at java.lang.Class.forName(Ljava.lang.String;ZLjava.lang.ClassLoader;)Ljava.lang.Class;(Unknown Source) at jrockit.reflect.MemberAccess.getClassFromFieldDesc(Ljava.lang.String;ILjava.lang.ClassLoader;)Ljava.lang.Class;(Unknown Source) at jrockit.reflect.MemberAccess.getReturnClassFromMethodDesc(Ljava.lang.String;Ljava.lang.ClassLoader;)Ljava.lang.Class;(Unknown Source)
resolved fixed
579ec14
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2007-03-06T09:59:56Z
2007-02-21T20:33:20Z
weaver/testsrc/org/aspectj/weaver/TypeXTestCase.java
} private void isPrimitiveTest(UnresolvedType[] types, boolean[] isPrimitives) { for (int i = 0, len = types.length; i < len; i++) { UnresolvedType type = types[i]; boolean b = isPrimitives[i]; assertEquals(type + " is primitive: ", b, type.isPrimitiveType()); } } private void sizeTest(UnresolvedType[] types, int[] sizes) { for (int i = 0, len = types.length; i < len; i++) { UnresolvedType type = types[i]; int size = sizes[i]; assertEquals("size of " + type + ": ", size, type.getSize()); } } private void arrayTest(UnresolvedType[] types, String[] components) { for (int i = 0, len = types.length; i < len; i++) { UnresolvedType type = types[i]; String component = components[i]; assertEquals(type + " is array: ", component != null, type.isArray()); if (component != null) assertEquals(type + " componentType: ", component, type.getComponentType().getName()); } } private void nameSignatureTest(String[] ns, String[] ss) { for (int i = 0, len = ns.length; i < len; i++) { String n = ns[i]; String s = ss[i];
175,039
Bug 175039 ArrayIndexOutOfBoundException Bug with Nested Type in TypeParameters
I debugged this stack trace from load-time weaving (ajcore files are also available). I found that the signature argument to TypeFactory.createTypeFromSignature(String) is Pjava/lang/Enum<Ljavax/jws/soap/SOAPBinding$ParameterStyle;>; but the method is erroneously using an empty array of parameters, because it thinks the $ relates to the generic type, not the parameter. It should be fairly easy to reproduce with a test case and to fix with a patch - I'll look at it some more tonight or this week. java.lang.ArrayIndexOutOfBoundsException at org.aspectj.weaver.ResolvedType.getMemberParameterizationMap(ResolvedType.java:698) at org.aspectj.weaver.ReferenceType.getDeclaredInterfaces(ReferenceType.java:406) at org.aspectj.weaver.ResolvedType.getDirectSupertypes(ResolvedType.java:65) at org.aspectj.weaver.patterns.TypePattern.matchesSubtypes(TypePattern.java:182) at org.aspectj.weaver.patterns.TypePattern.matchesSubtypes(TypePattern.java:169) at org.aspectj.weaver.patterns.TypePattern.matchesStatically(TypePattern.java:119) at org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.accept(ClassLoaderWeavingAdaptor.java:621) at org.aspectj.weaver.tools.WeavingAdaptor.weaveClass(WeavingAdaptor.java:253) at org.aspectj.weaver.loadtime.Aj.preProcess(Aj.java:78) at org.aspectj.weaver.loadtime.ClassPreProcessorAgentAdapter.transform(ClassPreProcessorAgentAdapter.java:52) at sun.instrument.TransformerManager.transform(TransformerManager.java:122) at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:155) at java.lang.ClassLoader.defineClass(Ljava.lang.String;[BIILjava.security.ProtectionDomain;)Ljava.lang.Class;(Unknown Source) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124) at java.net.URLClassLoader.defineClass(URLClassLoader.java:260) at java.net.URLClassLoader.access$100(URLClassLoader.java:56) at java.net.URLClassLoader$1.run(URLClassLoader.java:195) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(Ljava.lang.String;Z)Ljava.lang.Class;(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268) at java.lang.ClassLoader.loadClass(Ljava.lang.String;)Ljava.lang.Class;(Unknown Source) at java.lang.ClassLoader.loadClassFromNative(Ljava.lang.String;)Ljava.lang.Class;(Unknown Source) at java.lang.Class.forName(Ljava.lang.String;ZLjava.lang.ClassLoader;)Ljava.lang.Class;(Unknown Source) at jrockit.reflect.MemberAccess.getClassFromFieldDesc(Ljava.lang.String;ILjava.lang.ClassLoader;)Ljava.lang.Class;(Unknown Source) at jrockit.reflect.MemberAccess.getReturnClassFromMethodDesc(Ljava.lang.String;Ljava.lang.ClassLoader;)Ljava.lang.Class;(Unknown Source)
resolved fixed
579ec14
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2007-03-06T09:59:56Z
2007-02-21T20:33:20Z
weaver/testsrc/org/aspectj/weaver/TypeXTestCase.java
UnresolvedType tn = UnresolvedType.forName(n); UnresolvedType ts = UnresolvedType.forSignature(s); assertEquals("forName(n).getName()", n, tn.getName()); assertEquals("forSignature(s).getSignature()", s, ts.getSignature()); assertEquals("forName(n).getSignature()", s, tn.getSignature()); assertEquals("forSignature(n).getName()", n, ts.getName()); TestUtil.assertCommutativeEquals(tn, tn, true); TestUtil.assertCommutativeEquals(ts, ts, true); TestUtil.assertCommutativeEquals(tn, ts, true); for (int j = 0; j < len; j++) { if (i == j) continue; UnresolvedType tn1 = UnresolvedType.forName(ns[j]); UnresolvedType ts1 = UnresolvedType.forSignature(ss[j]); TestUtil.assertCommutativeEquals(tn, tn1, false); TestUtil.assertCommutativeEquals(ts, tn1, false); TestUtil.assertCommutativeEquals(tn, ts1, false); TestUtil.assertCommutativeEquals(ts, ts1, false); } } } }
206,732
Bug 206732 [itds] Problem with ITDs appearing to be applied twice (and clashing) for binary types
As reported by Josh on the mailing list: I have the following 2 files: Advised.aj: package bugs; public class Advised {} aspect ITD { public void Advised.f() {} } Ref.aj: package notbugs; import bugs.Advised; public class Ref { public void g() { new Advised().f(); } } I am attempting to build Advised.aj into a jar, and refer to it from Ref.aj, using the following ant build.xml: <?xml version="1.0"?> <project name="Bugs" basedir="C:\workplace\imds\Bugs" xmlns:aj="antlib:org.aspectj"> <taskdef uri="antlib:org.aspectj" resource="org/aspectj/antlib.xml" classpath="./aspectjtools.jar"/> <target name="clean"> <delete dir="bugs" includes="**/*.class"/> <delete dir="notbugs" includes="**/*.class"/> </target> <target name="task1"> <aj:iajc srcdir="." destdir="." source="1.5" target="1.5"> <classpath location=".\aspectjrt.jar"/> <include name="bugs/Advised.aj"/> </aj:iajc> </target> <target name="task2"> <aj:iajc source="1.5" target="1.5" srcdir="."> <classpath location=".\aspectjrt.jar"/> <aspectpath location="."/> <include name="notbugs/Ref.aj"/> </aj:iajc> </target> </project> From within Eclipse, there are no build errors because this is all one project. On the command line, however, once I execute ant task2, I get the following marvelous error message which suggests that ajc is trying to ITD f into a class it already ITDd f into before: [aj:iajc] error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() [aj:iajc] MessageHolder: (8 info) (1 error) [aj:iajc] [error 0]: error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() Let me also say that in my real use-case, the jar produced by task1 will contain aspects that should apply to clients thereof, and as such, that jar should indeed be in the aspectpath (not the classpath) for task2 (unless I am seriously misunderstanding something). How to stop this duplicate attempt to ITD? Josh --- Josh is correct that using aspectpath will pull in the aspects for application to other types, the problem is that when pulling in type Advised, we reapply known ITDs and it clashes with the one added in the original build of the type. Two possible fixes that I am looking at: - don't reapply the ITDs (they are added to ensure type system is consistent) to binary types pulled in from the aspectpath - recognize the ITD is clashing with a member previously applied through the same ITD I am not sure we can determine it came from the aspectpath at the point the clash is detected. I have option (2) already implemented, but I'll try a little more with option 1 before giving up ;)
resolved fixed
797ec4d
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2007-10-18T11:03:05Z
2007-10-18T09:33:20Z
weaver/src/org/aspectj/weaver/ResolvedType.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 @AspectJ ITDs * ******************************************************************/ package org.aspectj.weaver; import java.lang.reflect.Modifier; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.HashMap;
206,732
Bug 206732 [itds] Problem with ITDs appearing to be applied twice (and clashing) for binary types
As reported by Josh on the mailing list: I have the following 2 files: Advised.aj: package bugs; public class Advised {} aspect ITD { public void Advised.f() {} } Ref.aj: package notbugs; import bugs.Advised; public class Ref { public void g() { new Advised().f(); } } I am attempting to build Advised.aj into a jar, and refer to it from Ref.aj, using the following ant build.xml: <?xml version="1.0"?> <project name="Bugs" basedir="C:\workplace\imds\Bugs" xmlns:aj="antlib:org.aspectj"> <taskdef uri="antlib:org.aspectj" resource="org/aspectj/antlib.xml" classpath="./aspectjtools.jar"/> <target name="clean"> <delete dir="bugs" includes="**/*.class"/> <delete dir="notbugs" includes="**/*.class"/> </target> <target name="task1"> <aj:iajc srcdir="." destdir="." source="1.5" target="1.5"> <classpath location=".\aspectjrt.jar"/> <include name="bugs/Advised.aj"/> </aj:iajc> </target> <target name="task2"> <aj:iajc source="1.5" target="1.5" srcdir="."> <classpath location=".\aspectjrt.jar"/> <aspectpath location="."/> <include name="notbugs/Ref.aj"/> </aj:iajc> </target> </project> From within Eclipse, there are no build errors because this is all one project. On the command line, however, once I execute ant task2, I get the following marvelous error message which suggests that ajc is trying to ITD f into a class it already ITDd f into before: [aj:iajc] error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() [aj:iajc] MessageHolder: (8 info) (1 error) [aj:iajc] [error 0]: error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() Let me also say that in my real use-case, the jar produced by task1 will contain aspects that should apply to clients thereof, and as such, that jar should indeed be in the aspectpath (not the classpath) for task2 (unless I am seriously misunderstanding something). How to stop this duplicate attempt to ITD? Josh --- Josh is correct that using aspectpath will pull in the aspects for application to other types, the problem is that when pulling in type Advised, we reapply known ITDs and it clashes with the one added in the original build of the type. Two possible fixes that I am looking at: - don't reapply the ITDs (they are added to ensure type system is consistent) to binary types pulled in from the aspectpath - recognize the ITD is clashing with a member previously applied through the same ITD I am not sure we can determine it came from the aspectpath at the point the clash is detected. I have option (2) already implemented, but I'll try a little more with option 1 before giving up ;)
resolved fixed
797ec4d
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2007-10-18T11:03:05Z
2007-10-18T09:33:20Z
weaver/src/org/aspectj/weaver/ResolvedType.java
import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Set; import org.aspectj.bridge.IMessage; import org.aspectj.bridge.ISourceLocation; import org.aspectj.bridge.Message; import org.aspectj.bridge.MessageUtil; import org.aspectj.util.FuzzyBoolean; import org.aspectj.weaver.patterns.Declare; import org.aspectj.weaver.patterns.PerClause; public abstract class ResolvedType extends UnresolvedType implements AnnotatedElement { public static final ResolvedType[] EMPTY_RESOLVED_TYPE_ARRAY = new ResolvedType[0]; public static final String PARAMETERIZED_TYPE_IDENTIFIER = "P"; private ResolvedType[] resolvedTypeParams; private String binaryPath; protected World world; protected ResolvedType(String signature, World world) { super(signature); this.world = world; } protected ResolvedType(String signature, String signatureErasure, World world) { super(signature,signatureErasure); this.world = world; }
206,732
Bug 206732 [itds] Problem with ITDs appearing to be applied twice (and clashing) for binary types
As reported by Josh on the mailing list: I have the following 2 files: Advised.aj: package bugs; public class Advised {} aspect ITD { public void Advised.f() {} } Ref.aj: package notbugs; import bugs.Advised; public class Ref { public void g() { new Advised().f(); } } I am attempting to build Advised.aj into a jar, and refer to it from Ref.aj, using the following ant build.xml: <?xml version="1.0"?> <project name="Bugs" basedir="C:\workplace\imds\Bugs" xmlns:aj="antlib:org.aspectj"> <taskdef uri="antlib:org.aspectj" resource="org/aspectj/antlib.xml" classpath="./aspectjtools.jar"/> <target name="clean"> <delete dir="bugs" includes="**/*.class"/> <delete dir="notbugs" includes="**/*.class"/> </target> <target name="task1"> <aj:iajc srcdir="." destdir="." source="1.5" target="1.5"> <classpath location=".\aspectjrt.jar"/> <include name="bugs/Advised.aj"/> </aj:iajc> </target> <target name="task2"> <aj:iajc source="1.5" target="1.5" srcdir="."> <classpath location=".\aspectjrt.jar"/> <aspectpath location="."/> <include name="notbugs/Ref.aj"/> </aj:iajc> </target> </project> From within Eclipse, there are no build errors because this is all one project. On the command line, however, once I execute ant task2, I get the following marvelous error message which suggests that ajc is trying to ITD f into a class it already ITDd f into before: [aj:iajc] error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() [aj:iajc] MessageHolder: (8 info) (1 error) [aj:iajc] [error 0]: error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() Let me also say that in my real use-case, the jar produced by task1 will contain aspects that should apply to clients thereof, and as such, that jar should indeed be in the aspectpath (not the classpath) for task2 (unless I am seriously misunderstanding something). How to stop this duplicate attempt to ITD? Josh --- Josh is correct that using aspectpath will pull in the aspects for application to other types, the problem is that when pulling in type Advised, we reapply known ITDs and it clashes with the one added in the original build of the type. Two possible fixes that I am looking at: - don't reapply the ITDs (they are added to ensure type system is consistent) to binary types pulled in from the aspectpath - recognize the ITD is clashing with a member previously applied through the same ITD I am not sure we can determine it came from the aspectpath at the point the clash is detected. I have option (2) already implemented, but I'll try a little more with option 1 before giving up ;)
resolved fixed
797ec4d
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2007-10-18T11:03:05Z
2007-10-18T09:33:20Z
weaver/src/org/aspectj/weaver/ResolvedType.java
/** * Returns an iterator through ResolvedType objects representing all the direct * supertypes of this type. That is, through the superclass, if any, and * all declared interfaces. */ public final Iterator getDirectSupertypes() { Iterator ifacesIterator = Iterators.array(getDeclaredInterfaces()); ResolvedType superclass = getSuperclass(); if (superclass == null) { return ifacesIterator; } else { return Iterators.snoc(ifacesIterator, superclass); } } public abstract ResolvedMember[] getDeclaredFields(); public abstract ResolvedMember[] getDeclaredMethods(); public abstract ResolvedType[] getDeclaredInterfaces(); public abstract ResolvedMember[] getDeclaredPointcuts(); /** * Returns a ResolvedType object representing the superclass of this type, or null. * If this represents a java.lang.Object, a primitive type, or void, this * method returns null. */ public abstract ResolvedType getSuperclass(); /** * Returns the modifiers for this type. * <p/> * See {@link Class#getModifiers()} for a description
206,732
Bug 206732 [itds] Problem with ITDs appearing to be applied twice (and clashing) for binary types
As reported by Josh on the mailing list: I have the following 2 files: Advised.aj: package bugs; public class Advised {} aspect ITD { public void Advised.f() {} } Ref.aj: package notbugs; import bugs.Advised; public class Ref { public void g() { new Advised().f(); } } I am attempting to build Advised.aj into a jar, and refer to it from Ref.aj, using the following ant build.xml: <?xml version="1.0"?> <project name="Bugs" basedir="C:\workplace\imds\Bugs" xmlns:aj="antlib:org.aspectj"> <taskdef uri="antlib:org.aspectj" resource="org/aspectj/antlib.xml" classpath="./aspectjtools.jar"/> <target name="clean"> <delete dir="bugs" includes="**/*.class"/> <delete dir="notbugs" includes="**/*.class"/> </target> <target name="task1"> <aj:iajc srcdir="." destdir="." source="1.5" target="1.5"> <classpath location=".\aspectjrt.jar"/> <include name="bugs/Advised.aj"/> </aj:iajc> </target> <target name="task2"> <aj:iajc source="1.5" target="1.5" srcdir="."> <classpath location=".\aspectjrt.jar"/> <aspectpath location="."/> <include name="notbugs/Ref.aj"/> </aj:iajc> </target> </project> From within Eclipse, there are no build errors because this is all one project. On the command line, however, once I execute ant task2, I get the following marvelous error message which suggests that ajc is trying to ITD f into a class it already ITDd f into before: [aj:iajc] error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() [aj:iajc] MessageHolder: (8 info) (1 error) [aj:iajc] [error 0]: error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() Let me also say that in my real use-case, the jar produced by task1 will contain aspects that should apply to clients thereof, and as such, that jar should indeed be in the aspectpath (not the classpath) for task2 (unless I am seriously misunderstanding something). How to stop this duplicate attempt to ITD? Josh --- Josh is correct that using aspectpath will pull in the aspects for application to other types, the problem is that when pulling in type Advised, we reapply known ITDs and it clashes with the one added in the original build of the type. Two possible fixes that I am looking at: - don't reapply the ITDs (they are added to ensure type system is consistent) to binary types pulled in from the aspectpath - recognize the ITD is clashing with a member previously applied through the same ITD I am not sure we can determine it came from the aspectpath at the point the clash is detected. I have option (2) already implemented, but I'll try a little more with option 1 before giving up ;)
resolved fixed
797ec4d
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2007-10-18T11:03:05Z
2007-10-18T09:33:20Z
weaver/src/org/aspectj/weaver/ResolvedType.java
* of the weirdness of this methods on primitives and arrays. * * @param world the {@link World} in which the lookup is made. * @return an int representing the modifiers for this type * @see java.lang.reflect.Modifier */ public abstract int getModifiers(); public boolean isMissing() { return false; } public static boolean isMissing (UnresolvedType unresolved) { if (unresolved instanceof ResolvedType) { ResolvedType resolved = (ResolvedType)unresolved; return resolved.isMissing(); } else return (unresolved == MISSING); } public ResolvedType[] getAnnotationTypes() { return EMPTY_RESOLVED_TYPE_ARRAY; } public final UnresolvedType getSuperclass(World world) { return getSuperclass(); }
206,732
Bug 206732 [itds] Problem with ITDs appearing to be applied twice (and clashing) for binary types
As reported by Josh on the mailing list: I have the following 2 files: Advised.aj: package bugs; public class Advised {} aspect ITD { public void Advised.f() {} } Ref.aj: package notbugs; import bugs.Advised; public class Ref { public void g() { new Advised().f(); } } I am attempting to build Advised.aj into a jar, and refer to it from Ref.aj, using the following ant build.xml: <?xml version="1.0"?> <project name="Bugs" basedir="C:\workplace\imds\Bugs" xmlns:aj="antlib:org.aspectj"> <taskdef uri="antlib:org.aspectj" resource="org/aspectj/antlib.xml" classpath="./aspectjtools.jar"/> <target name="clean"> <delete dir="bugs" includes="**/*.class"/> <delete dir="notbugs" includes="**/*.class"/> </target> <target name="task1"> <aj:iajc srcdir="." destdir="." source="1.5" target="1.5"> <classpath location=".\aspectjrt.jar"/> <include name="bugs/Advised.aj"/> </aj:iajc> </target> <target name="task2"> <aj:iajc source="1.5" target="1.5" srcdir="."> <classpath location=".\aspectjrt.jar"/> <aspectpath location="."/> <include name="notbugs/Ref.aj"/> </aj:iajc> </target> </project> From within Eclipse, there are no build errors because this is all one project. On the command line, however, once I execute ant task2, I get the following marvelous error message which suggests that ajc is trying to ITD f into a class it already ITDd f into before: [aj:iajc] error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() [aj:iajc] MessageHolder: (8 info) (1 error) [aj:iajc] [error 0]: error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() Let me also say that in my real use-case, the jar produced by task1 will contain aspects that should apply to clients thereof, and as such, that jar should indeed be in the aspectpath (not the classpath) for task2 (unless I am seriously misunderstanding something). How to stop this duplicate attempt to ITD? Josh --- Josh is correct that using aspectpath will pull in the aspects for application to other types, the problem is that when pulling in type Advised, we reapply known ITDs and it clashes with the one added in the original build of the type. Two possible fixes that I am looking at: - don't reapply the ITDs (they are added to ensure type system is consistent) to binary types pulled in from the aspectpath - recognize the ITD is clashing with a member previously applied through the same ITD I am not sure we can determine it came from the aspectpath at the point the clash is detected. I have option (2) already implemented, but I'll try a little more with option 1 before giving up ;)
resolved fixed
797ec4d
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2007-10-18T11:03:05Z
2007-10-18T09:33:20Z
weaver/src/org/aspectj/weaver/ResolvedType.java
static Set validBoxing = new HashSet(); static { validBoxing.add("Ljava/lang/Byte;B"); validBoxing.add("Ljava/lang/Character;C"); validBoxing.add("Ljava/lang/Double;D"); validBoxing.add("Ljava/lang/Float;F"); validBoxing.add("Ljava/lang/Integer;I"); validBoxing.add("Ljava/lang/Long;J"); validBoxing.add("Ljava/lang/Short;S"); validBoxing.add("Ljava/lang/Boolean;Z"); validBoxing.add("BLjava/lang/Byte;"); validBoxing.add("CLjava/lang/Character;"); validBoxing.add("DLjava/lang/Double;"); validBoxing.add("FLjava/lang/Float;"); validBoxing.add("ILjava/lang/Integer;"); validBoxing.add("JLjava/lang/Long;"); validBoxing.add("SLjava/lang/Short;"); validBoxing.add("ZLjava/lang/Boolean;"); } public ResolvedType getResolvedComponentType() { return null; } public World getWorld() { return world;
206,732
Bug 206732 [itds] Problem with ITDs appearing to be applied twice (and clashing) for binary types
As reported by Josh on the mailing list: I have the following 2 files: Advised.aj: package bugs; public class Advised {} aspect ITD { public void Advised.f() {} } Ref.aj: package notbugs; import bugs.Advised; public class Ref { public void g() { new Advised().f(); } } I am attempting to build Advised.aj into a jar, and refer to it from Ref.aj, using the following ant build.xml: <?xml version="1.0"?> <project name="Bugs" basedir="C:\workplace\imds\Bugs" xmlns:aj="antlib:org.aspectj"> <taskdef uri="antlib:org.aspectj" resource="org/aspectj/antlib.xml" classpath="./aspectjtools.jar"/> <target name="clean"> <delete dir="bugs" includes="**/*.class"/> <delete dir="notbugs" includes="**/*.class"/> </target> <target name="task1"> <aj:iajc srcdir="." destdir="." source="1.5" target="1.5"> <classpath location=".\aspectjrt.jar"/> <include name="bugs/Advised.aj"/> </aj:iajc> </target> <target name="task2"> <aj:iajc source="1.5" target="1.5" srcdir="."> <classpath location=".\aspectjrt.jar"/> <aspectpath location="."/> <include name="notbugs/Ref.aj"/> </aj:iajc> </target> </project> From within Eclipse, there are no build errors because this is all one project. On the command line, however, once I execute ant task2, I get the following marvelous error message which suggests that ajc is trying to ITD f into a class it already ITDd f into before: [aj:iajc] error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() [aj:iajc] MessageHolder: (8 info) (1 error) [aj:iajc] [error 0]: error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() Let me also say that in my real use-case, the jar produced by task1 will contain aspects that should apply to clients thereof, and as such, that jar should indeed be in the aspectpath (not the classpath) for task2 (unless I am seriously misunderstanding something). How to stop this duplicate attempt to ITD? Josh --- Josh is correct that using aspectpath will pull in the aspects for application to other types, the problem is that when pulling in type Advised, we reapply known ITDs and it clashes with the one added in the original build of the type. Two possible fixes that I am looking at: - don't reapply the ITDs (they are added to ensure type system is consistent) to binary types pulled in from the aspectpath - recognize the ITD is clashing with a member previously applied through the same ITD I am not sure we can determine it came from the aspectpath at the point the clash is detected. I have option (2) already implemented, but I'll try a little more with option 1 before giving up ;)
resolved fixed
797ec4d
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2007-10-18T11:03:05Z
2007-10-18T09:33:20Z
weaver/src/org/aspectj/weaver/ResolvedType.java
} public final boolean equals(Object other) { if (other instanceof ResolvedType) { return this == other; } else { return super.equals(other); } } /** * returns an iterator through all of the fields of this type, in order * for checking from JVM spec 2ed 5.4.3.2. This means that the order is * <p/> * <ul><li> fields from current class </li> * <li> recur into direct superinterfaces </li> * <li> recur into superclass </li> * </ul> * <p/> * We keep a hashSet of interfaces that we've visited so we don't spiral * out into 2^n land. */ public Iterator getFields() { final Iterators.Filter dupFilter = Iterators.dupFilter(); Iterators.Getter typeGetter = new Iterators.Getter() { public Iterator get(Object o) { return dupFilter.filter(
206,732
Bug 206732 [itds] Problem with ITDs appearing to be applied twice (and clashing) for binary types
As reported by Josh on the mailing list: I have the following 2 files: Advised.aj: package bugs; public class Advised {} aspect ITD { public void Advised.f() {} } Ref.aj: package notbugs; import bugs.Advised; public class Ref { public void g() { new Advised().f(); } } I am attempting to build Advised.aj into a jar, and refer to it from Ref.aj, using the following ant build.xml: <?xml version="1.0"?> <project name="Bugs" basedir="C:\workplace\imds\Bugs" xmlns:aj="antlib:org.aspectj"> <taskdef uri="antlib:org.aspectj" resource="org/aspectj/antlib.xml" classpath="./aspectjtools.jar"/> <target name="clean"> <delete dir="bugs" includes="**/*.class"/> <delete dir="notbugs" includes="**/*.class"/> </target> <target name="task1"> <aj:iajc srcdir="." destdir="." source="1.5" target="1.5"> <classpath location=".\aspectjrt.jar"/> <include name="bugs/Advised.aj"/> </aj:iajc> </target> <target name="task2"> <aj:iajc source="1.5" target="1.5" srcdir="."> <classpath location=".\aspectjrt.jar"/> <aspectpath location="."/> <include name="notbugs/Ref.aj"/> </aj:iajc> </target> </project> From within Eclipse, there are no build errors because this is all one project. On the command line, however, once I execute ant task2, I get the following marvelous error message which suggests that ajc is trying to ITD f into a class it already ITDd f into before: [aj:iajc] error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() [aj:iajc] MessageHolder: (8 info) (1 error) [aj:iajc] [error 0]: error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() Let me also say that in my real use-case, the jar produced by task1 will contain aspects that should apply to clients thereof, and as such, that jar should indeed be in the aspectpath (not the classpath) for task2 (unless I am seriously misunderstanding something). How to stop this duplicate attempt to ITD? Josh --- Josh is correct that using aspectpath will pull in the aspects for application to other types, the problem is that when pulling in type Advised, we reapply known ITDs and it clashes with the one added in the original build of the type. Two possible fixes that I am looking at: - don't reapply the ITDs (they are added to ensure type system is consistent) to binary types pulled in from the aspectpath - recognize the ITD is clashing with a member previously applied through the same ITD I am not sure we can determine it came from the aspectpath at the point the clash is detected. I have option (2) already implemented, but I'll try a little more with option 1 before giving up ;)
resolved fixed
797ec4d
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2007-10-18T11:03:05Z
2007-10-18T09:33:20Z
weaver/src/org/aspectj/weaver/ResolvedType.java
((ResolvedType)o).getDirectSupertypes()); } }; Iterators.Getter fieldGetter = new Iterators.Getter() { public Iterator get(Object o) { return Iterators.array(((ResolvedType)o).getDeclaredFields()); } }; return Iterators.mapOver( Iterators.recur(this, typeGetter), fieldGetter); } /** * returns an iterator through all of the methods of this type, in order * for checking from JVM spec 2ed 5.4.3.3. This means that the order is * <p/> * <ul><li> methods from current class </li> * <li> recur into superclass, all the way up, not touching interfaces </li> * <li> recur into all superinterfaces, in some unspecified order </li> * </ul> * <p/> * We keep a hashSet of interfaces that we've visited so we don't spiral * out into 2^n land. * NOTE: Take a look at the javadoc on getMethodsWithoutIterator() to see if * you are sensitive to a quirk in getMethods() */ public Iterator getMethods() { final Iterators.Filter dupFilter = Iterators.dupFilter(); Iterators.Getter ifaceGetter = new Iterators.Getter() {
206,732
Bug 206732 [itds] Problem with ITDs appearing to be applied twice (and clashing) for binary types
As reported by Josh on the mailing list: I have the following 2 files: Advised.aj: package bugs; public class Advised {} aspect ITD { public void Advised.f() {} } Ref.aj: package notbugs; import bugs.Advised; public class Ref { public void g() { new Advised().f(); } } I am attempting to build Advised.aj into a jar, and refer to it from Ref.aj, using the following ant build.xml: <?xml version="1.0"?> <project name="Bugs" basedir="C:\workplace\imds\Bugs" xmlns:aj="antlib:org.aspectj"> <taskdef uri="antlib:org.aspectj" resource="org/aspectj/antlib.xml" classpath="./aspectjtools.jar"/> <target name="clean"> <delete dir="bugs" includes="**/*.class"/> <delete dir="notbugs" includes="**/*.class"/> </target> <target name="task1"> <aj:iajc srcdir="." destdir="." source="1.5" target="1.5"> <classpath location=".\aspectjrt.jar"/> <include name="bugs/Advised.aj"/> </aj:iajc> </target> <target name="task2"> <aj:iajc source="1.5" target="1.5" srcdir="."> <classpath location=".\aspectjrt.jar"/> <aspectpath location="."/> <include name="notbugs/Ref.aj"/> </aj:iajc> </target> </project> From within Eclipse, there are no build errors because this is all one project. On the command line, however, once I execute ant task2, I get the following marvelous error message which suggests that ajc is trying to ITD f into a class it already ITDd f into before: [aj:iajc] error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() [aj:iajc] MessageHolder: (8 info) (1 error) [aj:iajc] [error 0]: error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() Let me also say that in my real use-case, the jar produced by task1 will contain aspects that should apply to clients thereof, and as such, that jar should indeed be in the aspectpath (not the classpath) for task2 (unless I am seriously misunderstanding something). How to stop this duplicate attempt to ITD? Josh --- Josh is correct that using aspectpath will pull in the aspects for application to other types, the problem is that when pulling in type Advised, we reapply known ITDs and it clashes with the one added in the original build of the type. Two possible fixes that I am looking at: - don't reapply the ITDs (they are added to ensure type system is consistent) to binary types pulled in from the aspectpath - recognize the ITD is clashing with a member previously applied through the same ITD I am not sure we can determine it came from the aspectpath at the point the clash is detected. I have option (2) already implemented, but I'll try a little more with option 1 before giving up ;)
resolved fixed
797ec4d
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2007-10-18T11:03:05Z
2007-10-18T09:33:20Z
weaver/src/org/aspectj/weaver/ResolvedType.java
public Iterator get(Object o) { return dupFilter.filter( Iterators.array(((ResolvedType)o).getDeclaredInterfaces()) ); } }; Iterators.Getter methodGetter = new Iterators.Getter() { public Iterator get(Object o) { return Iterators.array(((ResolvedType)o).getDeclaredMethods()); } }; return Iterators.mapOver( Iterators.append( new Iterator() { ResolvedType curr = ResolvedType.this; public boolean hasNext() { return curr != null; } public Object next() { ResolvedType ret = curr; curr = curr.getSuperclass(); return ret; } public void remove() { throw new UnsupportedOperationException(); } }, Iterators.recur(this, ifaceGetter)),
206,732
Bug 206732 [itds] Problem with ITDs appearing to be applied twice (and clashing) for binary types
As reported by Josh on the mailing list: I have the following 2 files: Advised.aj: package bugs; public class Advised {} aspect ITD { public void Advised.f() {} } Ref.aj: package notbugs; import bugs.Advised; public class Ref { public void g() { new Advised().f(); } } I am attempting to build Advised.aj into a jar, and refer to it from Ref.aj, using the following ant build.xml: <?xml version="1.0"?> <project name="Bugs" basedir="C:\workplace\imds\Bugs" xmlns:aj="antlib:org.aspectj"> <taskdef uri="antlib:org.aspectj" resource="org/aspectj/antlib.xml" classpath="./aspectjtools.jar"/> <target name="clean"> <delete dir="bugs" includes="**/*.class"/> <delete dir="notbugs" includes="**/*.class"/> </target> <target name="task1"> <aj:iajc srcdir="." destdir="." source="1.5" target="1.5"> <classpath location=".\aspectjrt.jar"/> <include name="bugs/Advised.aj"/> </aj:iajc> </target> <target name="task2"> <aj:iajc source="1.5" target="1.5" srcdir="."> <classpath location=".\aspectjrt.jar"/> <aspectpath location="."/> <include name="notbugs/Ref.aj"/> </aj:iajc> </target> </project> From within Eclipse, there are no build errors because this is all one project. On the command line, however, once I execute ant task2, I get the following marvelous error message which suggests that ajc is trying to ITD f into a class it already ITDd f into before: [aj:iajc] error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() [aj:iajc] MessageHolder: (8 info) (1 error) [aj:iajc] [error 0]: error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() Let me also say that in my real use-case, the jar produced by task1 will contain aspects that should apply to clients thereof, and as such, that jar should indeed be in the aspectpath (not the classpath) for task2 (unless I am seriously misunderstanding something). How to stop this duplicate attempt to ITD? Josh --- Josh is correct that using aspectpath will pull in the aspects for application to other types, the problem is that when pulling in type Advised, we reapply known ITDs and it clashes with the one added in the original build of the type. Two possible fixes that I am looking at: - don't reapply the ITDs (they are added to ensure type system is consistent) to binary types pulled in from the aspectpath - recognize the ITD is clashing with a member previously applied through the same ITD I am not sure we can determine it came from the aspectpath at the point the clash is detected. I have option (2) already implemented, but I'll try a little more with option 1 before giving up ;)
resolved fixed
797ec4d
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2007-10-18T11:03:05Z
2007-10-18T09:33:20Z
weaver/src/org/aspectj/weaver/ResolvedType.java
methodGetter); } /** * Return a list of methods, first those declared on this class, then those declared on the superclass (recurse) and then those declared * on the superinterfaces. The getMethods() call above doesn't quite work the same as it will (through the iterator) return methods * declared on *this* class twice, once at the start and once at the end - I couldn't debug that problem, so created this alternative. */ public List getMethodsWithoutIterator(boolean includeITDs, boolean allowMissing) { List methods = new ArrayList(); Set knowninterfaces = new HashSet(); addAndRecurse(knowninterfaces,methods,this,includeITDs,allowMissing); return methods; } private void addAndRecurse(Set knowninterfaces,List collector, ResolvedType rtx, boolean includeITDs, boolean allowMissing) { collector.addAll(Arrays.asList(rtx.getDeclaredMethods())); if (includeITDs && rtx.interTypeMungers != null) { for (Iterator i = interTypeMungers.iterator(); i.hasNext();) { ConcreteTypeMunger tm = (ConcreteTypeMunger) i.next(); ResolvedMember rm = tm.getSignature(); if (rm != null) { collector.add(tm.getSignature()); } } } if (!rtx.equals(ResolvedType.OBJECT)) { ResolvedType superType = rtx.getSuperclass(); if (superType != null && !superType.isMissing()) {
206,732
Bug 206732 [itds] Problem with ITDs appearing to be applied twice (and clashing) for binary types
As reported by Josh on the mailing list: I have the following 2 files: Advised.aj: package bugs; public class Advised {} aspect ITD { public void Advised.f() {} } Ref.aj: package notbugs; import bugs.Advised; public class Ref { public void g() { new Advised().f(); } } I am attempting to build Advised.aj into a jar, and refer to it from Ref.aj, using the following ant build.xml: <?xml version="1.0"?> <project name="Bugs" basedir="C:\workplace\imds\Bugs" xmlns:aj="antlib:org.aspectj"> <taskdef uri="antlib:org.aspectj" resource="org/aspectj/antlib.xml" classpath="./aspectjtools.jar"/> <target name="clean"> <delete dir="bugs" includes="**/*.class"/> <delete dir="notbugs" includes="**/*.class"/> </target> <target name="task1"> <aj:iajc srcdir="." destdir="." source="1.5" target="1.5"> <classpath location=".\aspectjrt.jar"/> <include name="bugs/Advised.aj"/> </aj:iajc> </target> <target name="task2"> <aj:iajc source="1.5" target="1.5" srcdir="."> <classpath location=".\aspectjrt.jar"/> <aspectpath location="."/> <include name="notbugs/Ref.aj"/> </aj:iajc> </target> </project> From within Eclipse, there are no build errors because this is all one project. On the command line, however, once I execute ant task2, I get the following marvelous error message which suggests that ajc is trying to ITD f into a class it already ITDd f into before: [aj:iajc] error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() [aj:iajc] MessageHolder: (8 info) (1 error) [aj:iajc] [error 0]: error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() Let me also say that in my real use-case, the jar produced by task1 will contain aspects that should apply to clients thereof, and as such, that jar should indeed be in the aspectpath (not the classpath) for task2 (unless I am seriously misunderstanding something). How to stop this duplicate attempt to ITD? Josh --- Josh is correct that using aspectpath will pull in the aspects for application to other types, the problem is that when pulling in type Advised, we reapply known ITDs and it clashes with the one added in the original build of the type. Two possible fixes that I am looking at: - don't reapply the ITDs (they are added to ensure type system is consistent) to binary types pulled in from the aspectpath - recognize the ITD is clashing with a member previously applied through the same ITD I am not sure we can determine it came from the aspectpath at the point the clash is detected. I have option (2) already implemented, but I'll try a little more with option 1 before giving up ;)
resolved fixed
797ec4d
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2007-10-18T11:03:05Z
2007-10-18T09:33:20Z
weaver/src/org/aspectj/weaver/ResolvedType.java
addAndRecurse(knowninterfaces,collector,superType,includeITDs,allowMissing); } } ResolvedType[] interfaces = rtx.getDeclaredInterfaces(); for (int i = 0; i < interfaces.length; i++) { ResolvedType iface = interfaces[i]; boolean shouldSkip = false; for (int j = 0; j < rtx.interTypeMungers.size(); j++) { ConcreteTypeMunger munger = (ConcreteTypeMunger) rtx.interTypeMungers.get(j); if (munger.getMunger()!=null && munger.getMunger().getKind() == ResolvedTypeMunger.Parent && ((NewParentTypeMunger)munger.getMunger()).getNewParent().equals(iface) ) { shouldSkip = true; break; } } if (!shouldSkip && !knowninterfaces.contains(iface)) { knowninterfaces.add(iface); if (allowMissing && iface.isMissing()) { if (iface instanceof MissingResolvedTypeWithKnownSignature) { ((MissingResolvedTypeWithKnownSignature)iface).raiseWarningOnMissingInterfaceWhilstFindingMethods(); } } else { addAndRecurse(knowninterfaces,collector,iface,includeITDs,allowMissing); } } } }
206,732
Bug 206732 [itds] Problem with ITDs appearing to be applied twice (and clashing) for binary types
As reported by Josh on the mailing list: I have the following 2 files: Advised.aj: package bugs; public class Advised {} aspect ITD { public void Advised.f() {} } Ref.aj: package notbugs; import bugs.Advised; public class Ref { public void g() { new Advised().f(); } } I am attempting to build Advised.aj into a jar, and refer to it from Ref.aj, using the following ant build.xml: <?xml version="1.0"?> <project name="Bugs" basedir="C:\workplace\imds\Bugs" xmlns:aj="antlib:org.aspectj"> <taskdef uri="antlib:org.aspectj" resource="org/aspectj/antlib.xml" classpath="./aspectjtools.jar"/> <target name="clean"> <delete dir="bugs" includes="**/*.class"/> <delete dir="notbugs" includes="**/*.class"/> </target> <target name="task1"> <aj:iajc srcdir="." destdir="." source="1.5" target="1.5"> <classpath location=".\aspectjrt.jar"/> <include name="bugs/Advised.aj"/> </aj:iajc> </target> <target name="task2"> <aj:iajc source="1.5" target="1.5" srcdir="."> <classpath location=".\aspectjrt.jar"/> <aspectpath location="."/> <include name="notbugs/Ref.aj"/> </aj:iajc> </target> </project> From within Eclipse, there are no build errors because this is all one project. On the command line, however, once I execute ant task2, I get the following marvelous error message which suggests that ajc is trying to ITD f into a class it already ITDd f into before: [aj:iajc] error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() [aj:iajc] MessageHolder: (8 info) (1 error) [aj:iajc] [error 0]: error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() Let me also say that in my real use-case, the jar produced by task1 will contain aspects that should apply to clients thereof, and as such, that jar should indeed be in the aspectpath (not the classpath) for task2 (unless I am seriously misunderstanding something). How to stop this duplicate attempt to ITD? Josh --- Josh is correct that using aspectpath will pull in the aspects for application to other types, the problem is that when pulling in type Advised, we reapply known ITDs and it clashes with the one added in the original build of the type. Two possible fixes that I am looking at: - don't reapply the ITDs (they are added to ensure type system is consistent) to binary types pulled in from the aspectpath - recognize the ITD is clashing with a member previously applied through the same ITD I am not sure we can determine it came from the aspectpath at the point the clash is detected. I have option (2) already implemented, but I'll try a little more with option 1 before giving up ;)
resolved fixed
797ec4d
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2007-10-18T11:03:05Z
2007-10-18T09:33:20Z
weaver/src/org/aspectj/weaver/ResolvedType.java
public ResolvedType[] getResolvedTypeParameters() { if (resolvedTypeParams == null) { resolvedTypeParams = world.resolve(typeParameters); } return resolvedTypeParams; } /** * described in JVM spec 2ed 5.4.3.2 */ public ResolvedMember lookupField(Member m) { return lookupMember(m, getFields()); } /** * described in JVM spec 2ed 5.4.3.3. * Doesnt check ITDs. */ public ResolvedMember lookupMethod(Member m) { return lookupMember(m, getMethods()); } public ResolvedMember lookupMethodInITDs(Member m) { if (interTypeMungers != null) { for (Iterator i = interTypeMungers.iterator(); i.hasNext();) { ConcreteTypeMunger tm = (ConcreteTypeMunger) i.next(); if (matches(tm.getSignature(), m)) { return tm.getSignature(); } } }
206,732
Bug 206732 [itds] Problem with ITDs appearing to be applied twice (and clashing) for binary types
As reported by Josh on the mailing list: I have the following 2 files: Advised.aj: package bugs; public class Advised {} aspect ITD { public void Advised.f() {} } Ref.aj: package notbugs; import bugs.Advised; public class Ref { public void g() { new Advised().f(); } } I am attempting to build Advised.aj into a jar, and refer to it from Ref.aj, using the following ant build.xml: <?xml version="1.0"?> <project name="Bugs" basedir="C:\workplace\imds\Bugs" xmlns:aj="antlib:org.aspectj"> <taskdef uri="antlib:org.aspectj" resource="org/aspectj/antlib.xml" classpath="./aspectjtools.jar"/> <target name="clean"> <delete dir="bugs" includes="**/*.class"/> <delete dir="notbugs" includes="**/*.class"/> </target> <target name="task1"> <aj:iajc srcdir="." destdir="." source="1.5" target="1.5"> <classpath location=".\aspectjrt.jar"/> <include name="bugs/Advised.aj"/> </aj:iajc> </target> <target name="task2"> <aj:iajc source="1.5" target="1.5" srcdir="."> <classpath location=".\aspectjrt.jar"/> <aspectpath location="."/> <include name="notbugs/Ref.aj"/> </aj:iajc> </target> </project> From within Eclipse, there are no build errors because this is all one project. On the command line, however, once I execute ant task2, I get the following marvelous error message which suggests that ajc is trying to ITD f into a class it already ITDd f into before: [aj:iajc] error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() [aj:iajc] MessageHolder: (8 info) (1 error) [aj:iajc] [error 0]: error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() Let me also say that in my real use-case, the jar produced by task1 will contain aspects that should apply to clients thereof, and as such, that jar should indeed be in the aspectpath (not the classpath) for task2 (unless I am seriously misunderstanding something). How to stop this duplicate attempt to ITD? Josh --- Josh is correct that using aspectpath will pull in the aspects for application to other types, the problem is that when pulling in type Advised, we reapply known ITDs and it clashes with the one added in the original build of the type. Two possible fixes that I am looking at: - don't reapply the ITDs (they are added to ensure type system is consistent) to binary types pulled in from the aspectpath - recognize the ITD is clashing with a member previously applied through the same ITD I am not sure we can determine it came from the aspectpath at the point the clash is detected. I have option (2) already implemented, but I'll try a little more with option 1 before giving up ;)
resolved fixed
797ec4d
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2007-10-18T11:03:05Z
2007-10-18T09:33:20Z
weaver/src/org/aspectj/weaver/ResolvedType.java
return null; } /** * return null if not found */ private ResolvedMember lookupMember(Member m, Iterator i) { while (i.hasNext()) { ResolvedMember f = (ResolvedMember) i.next(); if (matches(f, m)) return f; if (f.hasBackingGenericMember() && m.getName().equals(f.getName())) { if (matches(f.getBackingGenericMember(),m)) return f; } } return null; } /** * return null if not found */ private ResolvedMember lookupMember(Member m, ResolvedMember[] a) { for (int i = 0; i < a.length; i++) { ResolvedMember f = a[i]; if (matches(f, m)) return f; } return null; }
206,732
Bug 206732 [itds] Problem with ITDs appearing to be applied twice (and clashing) for binary types
As reported by Josh on the mailing list: I have the following 2 files: Advised.aj: package bugs; public class Advised {} aspect ITD { public void Advised.f() {} } Ref.aj: package notbugs; import bugs.Advised; public class Ref { public void g() { new Advised().f(); } } I am attempting to build Advised.aj into a jar, and refer to it from Ref.aj, using the following ant build.xml: <?xml version="1.0"?> <project name="Bugs" basedir="C:\workplace\imds\Bugs" xmlns:aj="antlib:org.aspectj"> <taskdef uri="antlib:org.aspectj" resource="org/aspectj/antlib.xml" classpath="./aspectjtools.jar"/> <target name="clean"> <delete dir="bugs" includes="**/*.class"/> <delete dir="notbugs" includes="**/*.class"/> </target> <target name="task1"> <aj:iajc srcdir="." destdir="." source="1.5" target="1.5"> <classpath location=".\aspectjrt.jar"/> <include name="bugs/Advised.aj"/> </aj:iajc> </target> <target name="task2"> <aj:iajc source="1.5" target="1.5" srcdir="."> <classpath location=".\aspectjrt.jar"/> <aspectpath location="."/> <include name="notbugs/Ref.aj"/> </aj:iajc> </target> </project> From within Eclipse, there are no build errors because this is all one project. On the command line, however, once I execute ant task2, I get the following marvelous error message which suggests that ajc is trying to ITD f into a class it already ITDd f into before: [aj:iajc] error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() [aj:iajc] MessageHolder: (8 info) (1 error) [aj:iajc] [error 0]: error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() Let me also say that in my real use-case, the jar produced by task1 will contain aspects that should apply to clients thereof, and as such, that jar should indeed be in the aspectpath (not the classpath) for task2 (unless I am seriously misunderstanding something). How to stop this duplicate attempt to ITD? Josh --- Josh is correct that using aspectpath will pull in the aspects for application to other types, the problem is that when pulling in type Advised, we reapply known ITDs and it clashes with the one added in the original build of the type. Two possible fixes that I am looking at: - don't reapply the ITDs (they are added to ensure type system is consistent) to binary types pulled in from the aspectpath - recognize the ITD is clashing with a member previously applied through the same ITD I am not sure we can determine it came from the aspectpath at the point the clash is detected. I have option (2) already implemented, but I'll try a little more with option 1 before giving up ;)
resolved fixed
797ec4d
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2007-10-18T11:03:05Z
2007-10-18T09:33:20Z
weaver/src/org/aspectj/weaver/ResolvedType.java
/** * Looks for the first member in the hierarchy matching aMember. This method * differs from lookupMember(Member) in that it takes into account parameters * which are type variables - which clearly an unresolved Member cannot do since * it does not know anything about type variables. */ public ResolvedMember lookupResolvedMember(ResolvedMember aMember,boolean allowMissing) { Iterator toSearch = null; ResolvedMember found = null; if ((aMember.getKind() == Member.METHOD) || (aMember.getKind() == Member.CONSTRUCTOR)) { toSearch = getMethodsWithoutIterator(true,allowMissing).iterator(); } else { if (aMember.getKind() != Member.FIELD) throw new IllegalStateException("I didn't know you would look for members of kind " + aMember.getKind()); toSearch = getFields(); } while(toSearch.hasNext()) { ResolvedMemberImpl candidate = (ResolvedMemberImpl) toSearch.next(); if (candidate.matches(aMember)) { found = candidate; break; } } return found; } public static boolean matches(Member m1, Member m2) { if (m1 == null) return m2 == null; if (m2 == null) return false;
206,732
Bug 206732 [itds] Problem with ITDs appearing to be applied twice (and clashing) for binary types
As reported by Josh on the mailing list: I have the following 2 files: Advised.aj: package bugs; public class Advised {} aspect ITD { public void Advised.f() {} } Ref.aj: package notbugs; import bugs.Advised; public class Ref { public void g() { new Advised().f(); } } I am attempting to build Advised.aj into a jar, and refer to it from Ref.aj, using the following ant build.xml: <?xml version="1.0"?> <project name="Bugs" basedir="C:\workplace\imds\Bugs" xmlns:aj="antlib:org.aspectj"> <taskdef uri="antlib:org.aspectj" resource="org/aspectj/antlib.xml" classpath="./aspectjtools.jar"/> <target name="clean"> <delete dir="bugs" includes="**/*.class"/> <delete dir="notbugs" includes="**/*.class"/> </target> <target name="task1"> <aj:iajc srcdir="." destdir="." source="1.5" target="1.5"> <classpath location=".\aspectjrt.jar"/> <include name="bugs/Advised.aj"/> </aj:iajc> </target> <target name="task2"> <aj:iajc source="1.5" target="1.5" srcdir="."> <classpath location=".\aspectjrt.jar"/> <aspectpath location="."/> <include name="notbugs/Ref.aj"/> </aj:iajc> </target> </project> From within Eclipse, there are no build errors because this is all one project. On the command line, however, once I execute ant task2, I get the following marvelous error message which suggests that ajc is trying to ITD f into a class it already ITDd f into before: [aj:iajc] error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() [aj:iajc] MessageHolder: (8 info) (1 error) [aj:iajc] [error 0]: error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() Let me also say that in my real use-case, the jar produced by task1 will contain aspects that should apply to clients thereof, and as such, that jar should indeed be in the aspectpath (not the classpath) for task2 (unless I am seriously misunderstanding something). How to stop this duplicate attempt to ITD? Josh --- Josh is correct that using aspectpath will pull in the aspects for application to other types, the problem is that when pulling in type Advised, we reapply known ITDs and it clashes with the one added in the original build of the type. Two possible fixes that I am looking at: - don't reapply the ITDs (they are added to ensure type system is consistent) to binary types pulled in from the aspectpath - recognize the ITD is clashing with a member previously applied through the same ITD I am not sure we can determine it came from the aspectpath at the point the clash is detected. I have option (2) already implemented, but I'll try a little more with option 1 before giving up ;)
resolved fixed
797ec4d
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2007-10-18T11:03:05Z
2007-10-18T09:33:20Z
weaver/src/org/aspectj/weaver/ResolvedType.java
boolean equalNames = m1.getName().equals(m2.getName()); if (!equalNames) return false; boolean equalSignatures = m1.getSignature().equals(m2.getSignature()); if (equalSignatures) return true; boolean equalCovariantSignatures = m1.getParameterSignature().equals(m2.getParameterSignature()); if (equalCovariantSignatures) return true; return false; } public static boolean conflictingSignature(Member m1, Member m2) { if (m1 == null || m2 == null) return false; if (!m1.getName().equals(m2.getName())) { return false; } if (m1.getKind() != m2.getKind()) { return false; } if (m1.getKind() == Member.FIELD) { return m1.getDeclaringType().equals(m2.getDeclaringType()); } else if (m1.getKind() == Member.POINTCUT) { return true;
206,732
Bug 206732 [itds] Problem with ITDs appearing to be applied twice (and clashing) for binary types
As reported by Josh on the mailing list: I have the following 2 files: Advised.aj: package bugs; public class Advised {} aspect ITD { public void Advised.f() {} } Ref.aj: package notbugs; import bugs.Advised; public class Ref { public void g() { new Advised().f(); } } I am attempting to build Advised.aj into a jar, and refer to it from Ref.aj, using the following ant build.xml: <?xml version="1.0"?> <project name="Bugs" basedir="C:\workplace\imds\Bugs" xmlns:aj="antlib:org.aspectj"> <taskdef uri="antlib:org.aspectj" resource="org/aspectj/antlib.xml" classpath="./aspectjtools.jar"/> <target name="clean"> <delete dir="bugs" includes="**/*.class"/> <delete dir="notbugs" includes="**/*.class"/> </target> <target name="task1"> <aj:iajc srcdir="." destdir="." source="1.5" target="1.5"> <classpath location=".\aspectjrt.jar"/> <include name="bugs/Advised.aj"/> </aj:iajc> </target> <target name="task2"> <aj:iajc source="1.5" target="1.5" srcdir="."> <classpath location=".\aspectjrt.jar"/> <aspectpath location="."/> <include name="notbugs/Ref.aj"/> </aj:iajc> </target> </project> From within Eclipse, there are no build errors because this is all one project. On the command line, however, once I execute ant task2, I get the following marvelous error message which suggests that ajc is trying to ITD f into a class it already ITDd f into before: [aj:iajc] error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() [aj:iajc] MessageHolder: (8 info) (1 error) [aj:iajc] [error 0]: error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() Let me also say that in my real use-case, the jar produced by task1 will contain aspects that should apply to clients thereof, and as such, that jar should indeed be in the aspectpath (not the classpath) for task2 (unless I am seriously misunderstanding something). How to stop this duplicate attempt to ITD? Josh --- Josh is correct that using aspectpath will pull in the aspects for application to other types, the problem is that when pulling in type Advised, we reapply known ITDs and it clashes with the one added in the original build of the type. Two possible fixes that I am looking at: - don't reapply the ITDs (they are added to ensure type system is consistent) to binary types pulled in from the aspectpath - recognize the ITD is clashing with a member previously applied through the same ITD I am not sure we can determine it came from the aspectpath at the point the clash is detected. I have option (2) already implemented, but I'll try a little more with option 1 before giving up ;)
resolved fixed
797ec4d
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2007-10-18T11:03:05Z
2007-10-18T09:33:20Z
weaver/src/org/aspectj/weaver/ResolvedType.java
} UnresolvedType[] p1 = m1.getGenericParameterTypes(); UnresolvedType[] p2 = m2.getGenericParameterTypes(); if (p1==null) p1 = m1.getParameterTypes(); if (p2==null) p2 = m2.getParameterTypes(); int n = p1.length; if (n != p2.length) return false; for (int i=0; i < n; i++) { if (!p1[i].equals(p2[i])) return false; } return true; } /** * returns an iterator through all of the pointcuts of this type, in order * for checking from JVM spec 2ed 5.4.3.2 (as for fields). This means that the order is * <p/> * <ul><li> pointcuts from current class </li> * <li> recur into direct superinterfaces </li> * <li> recur into superclass </li> * </ul> * <p/> * We keep a hashSet of interfaces that we've visited so we don't spiral * out into 2^n land. */ public Iterator getPointcuts() {
206,732
Bug 206732 [itds] Problem with ITDs appearing to be applied twice (and clashing) for binary types
As reported by Josh on the mailing list: I have the following 2 files: Advised.aj: package bugs; public class Advised {} aspect ITD { public void Advised.f() {} } Ref.aj: package notbugs; import bugs.Advised; public class Ref { public void g() { new Advised().f(); } } I am attempting to build Advised.aj into a jar, and refer to it from Ref.aj, using the following ant build.xml: <?xml version="1.0"?> <project name="Bugs" basedir="C:\workplace\imds\Bugs" xmlns:aj="antlib:org.aspectj"> <taskdef uri="antlib:org.aspectj" resource="org/aspectj/antlib.xml" classpath="./aspectjtools.jar"/> <target name="clean"> <delete dir="bugs" includes="**/*.class"/> <delete dir="notbugs" includes="**/*.class"/> </target> <target name="task1"> <aj:iajc srcdir="." destdir="." source="1.5" target="1.5"> <classpath location=".\aspectjrt.jar"/> <include name="bugs/Advised.aj"/> </aj:iajc> </target> <target name="task2"> <aj:iajc source="1.5" target="1.5" srcdir="."> <classpath location=".\aspectjrt.jar"/> <aspectpath location="."/> <include name="notbugs/Ref.aj"/> </aj:iajc> </target> </project> From within Eclipse, there are no build errors because this is all one project. On the command line, however, once I execute ant task2, I get the following marvelous error message which suggests that ajc is trying to ITD f into a class it already ITDd f into before: [aj:iajc] error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() [aj:iajc] MessageHolder: (8 info) (1 error) [aj:iajc] [error 0]: error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() Let me also say that in my real use-case, the jar produced by task1 will contain aspects that should apply to clients thereof, and as such, that jar should indeed be in the aspectpath (not the classpath) for task2 (unless I am seriously misunderstanding something). How to stop this duplicate attempt to ITD? Josh --- Josh is correct that using aspectpath will pull in the aspects for application to other types, the problem is that when pulling in type Advised, we reapply known ITDs and it clashes with the one added in the original build of the type. Two possible fixes that I am looking at: - don't reapply the ITDs (they are added to ensure type system is consistent) to binary types pulled in from the aspectpath - recognize the ITD is clashing with a member previously applied through the same ITD I am not sure we can determine it came from the aspectpath at the point the clash is detected. I have option (2) already implemented, but I'll try a little more with option 1 before giving up ;)
resolved fixed
797ec4d
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2007-10-18T11:03:05Z
2007-10-18T09:33:20Z
weaver/src/org/aspectj/weaver/ResolvedType.java
final Iterators.Filter dupFilter = Iterators.dupFilter(); Iterators.Getter typeGetter = new Iterators.Getter() { public Iterator get(Object o) { return dupFilter.filter( ((ResolvedType)o).getDirectSupertypes()); } }; Iterators.Getter pointcutGetter = new Iterators.Getter() { public Iterator get(Object o) { return Iterators.array(((ResolvedType)o).getDeclaredPointcuts()); } }; return Iterators.mapOver( Iterators.recur(this, typeGetter), pointcutGetter); } public ResolvedPointcutDefinition findPointcut(String name) { for (Iterator i = getPointcuts(); i.hasNext(); ) { ResolvedPointcutDefinition f = (ResolvedPointcutDefinition) i.next(); if (name.equals(f.getName())) { return f; } }
206,732
Bug 206732 [itds] Problem with ITDs appearing to be applied twice (and clashing) for binary types
As reported by Josh on the mailing list: I have the following 2 files: Advised.aj: package bugs; public class Advised {} aspect ITD { public void Advised.f() {} } Ref.aj: package notbugs; import bugs.Advised; public class Ref { public void g() { new Advised().f(); } } I am attempting to build Advised.aj into a jar, and refer to it from Ref.aj, using the following ant build.xml: <?xml version="1.0"?> <project name="Bugs" basedir="C:\workplace\imds\Bugs" xmlns:aj="antlib:org.aspectj"> <taskdef uri="antlib:org.aspectj" resource="org/aspectj/antlib.xml" classpath="./aspectjtools.jar"/> <target name="clean"> <delete dir="bugs" includes="**/*.class"/> <delete dir="notbugs" includes="**/*.class"/> </target> <target name="task1"> <aj:iajc srcdir="." destdir="." source="1.5" target="1.5"> <classpath location=".\aspectjrt.jar"/> <include name="bugs/Advised.aj"/> </aj:iajc> </target> <target name="task2"> <aj:iajc source="1.5" target="1.5" srcdir="."> <classpath location=".\aspectjrt.jar"/> <aspectpath location="."/> <include name="notbugs/Ref.aj"/> </aj:iajc> </target> </project> From within Eclipse, there are no build errors because this is all one project. On the command line, however, once I execute ant task2, I get the following marvelous error message which suggests that ajc is trying to ITD f into a class it already ITDd f into before: [aj:iajc] error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() [aj:iajc] MessageHolder: (8 info) (1 error) [aj:iajc] [error 0]: error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() Let me also say that in my real use-case, the jar produced by task1 will contain aspects that should apply to clients thereof, and as such, that jar should indeed be in the aspectpath (not the classpath) for task2 (unless I am seriously misunderstanding something). How to stop this duplicate attempt to ITD? Josh --- Josh is correct that using aspectpath will pull in the aspects for application to other types, the problem is that when pulling in type Advised, we reapply known ITDs and it clashes with the one added in the original build of the type. Two possible fixes that I am looking at: - don't reapply the ITDs (they are added to ensure type system is consistent) to binary types pulled in from the aspectpath - recognize the ITD is clashing with a member previously applied through the same ITD I am not sure we can determine it came from the aspectpath at the point the clash is detected. I have option (2) already implemented, but I'll try a little more with option 1 before giving up ;)
resolved fixed
797ec4d
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2007-10-18T11:03:05Z
2007-10-18T09:33:20Z
weaver/src/org/aspectj/weaver/ResolvedType.java
if (!getOutermostType().equals(this)) { ResolvedType outerType = getOutermostType().resolve(world); ResolvedPointcutDefinition rpd = outerType.findPointcut(name); return rpd; } return null; } public CrosscuttingMembers crosscuttingMembers; public CrosscuttingMembers collectCrosscuttingMembers(boolean shouldConcretizeIfNeeded) { crosscuttingMembers = new CrosscuttingMembers(this,shouldConcretizeIfNeeded); crosscuttingMembers.setPerClause(getPerClause()); crosscuttingMembers.addShadowMungers(collectShadowMungers()); crosscuttingMembers.addTypeMungers(getTypeMungers()); crosscuttingMembers.addDeclares(collectDeclares(!this.doesNotExposeShadowMungers())); crosscuttingMembers.addPrivilegedAccesses(getPrivilegedAccesses()); return crosscuttingMembers; } public final Collection collectDeclares(boolean includeAdviceLike) { if (! this.isAspect() ) return Collections.EMPTY_LIST;
206,732
Bug 206732 [itds] Problem with ITDs appearing to be applied twice (and clashing) for binary types
As reported by Josh on the mailing list: I have the following 2 files: Advised.aj: package bugs; public class Advised {} aspect ITD { public void Advised.f() {} } Ref.aj: package notbugs; import bugs.Advised; public class Ref { public void g() { new Advised().f(); } } I am attempting to build Advised.aj into a jar, and refer to it from Ref.aj, using the following ant build.xml: <?xml version="1.0"?> <project name="Bugs" basedir="C:\workplace\imds\Bugs" xmlns:aj="antlib:org.aspectj"> <taskdef uri="antlib:org.aspectj" resource="org/aspectj/antlib.xml" classpath="./aspectjtools.jar"/> <target name="clean"> <delete dir="bugs" includes="**/*.class"/> <delete dir="notbugs" includes="**/*.class"/> </target> <target name="task1"> <aj:iajc srcdir="." destdir="." source="1.5" target="1.5"> <classpath location=".\aspectjrt.jar"/> <include name="bugs/Advised.aj"/> </aj:iajc> </target> <target name="task2"> <aj:iajc source="1.5" target="1.5" srcdir="."> <classpath location=".\aspectjrt.jar"/> <aspectpath location="."/> <include name="notbugs/Ref.aj"/> </aj:iajc> </target> </project> From within Eclipse, there are no build errors because this is all one project. On the command line, however, once I execute ant task2, I get the following marvelous error message which suggests that ajc is trying to ITD f into a class it already ITDd f into before: [aj:iajc] error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() [aj:iajc] MessageHolder: (8 info) (1 error) [aj:iajc] [error 0]: error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() Let me also say that in my real use-case, the jar produced by task1 will contain aspects that should apply to clients thereof, and as such, that jar should indeed be in the aspectpath (not the classpath) for task2 (unless I am seriously misunderstanding something). How to stop this duplicate attempt to ITD? Josh --- Josh is correct that using aspectpath will pull in the aspects for application to other types, the problem is that when pulling in type Advised, we reapply known ITDs and it clashes with the one added in the original build of the type. Two possible fixes that I am looking at: - don't reapply the ITDs (they are added to ensure type system is consistent) to binary types pulled in from the aspectpath - recognize the ITD is clashing with a member previously applied through the same ITD I am not sure we can determine it came from the aspectpath at the point the clash is detected. I have option (2) already implemented, but I'll try a little more with option 1 before giving up ;)
resolved fixed
797ec4d
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2007-10-18T11:03:05Z
2007-10-18T09:33:20Z
weaver/src/org/aspectj/weaver/ResolvedType.java
ArrayList ret = new ArrayList(); } if (!this.isAbstract()) { final Iterators.Filter dupFilter = Iterators.dupFilter(); Iterators.Getter typeGetter = new Iterators.Getter() { public Iterator get(Object o) { return dupFilter.filter( ((ResolvedType)o).getDirectSupertypes()); } }; Iterator typeIterator = Iterators.recur(this, typeGetter); while (typeIterator.hasNext()) { ResolvedType ty = (ResolvedType) typeIterator.next(); for (Iterator i = ty.getDeclares().iterator(); i.hasNext();) { Declare dec = (Declare) i.next(); if (dec.isAdviceLike()) { if (includeAdviceLike) ret.add(dec); } else { ret.add(dec); } } } }
206,732
Bug 206732 [itds] Problem with ITDs appearing to be applied twice (and clashing) for binary types
As reported by Josh on the mailing list: I have the following 2 files: Advised.aj: package bugs; public class Advised {} aspect ITD { public void Advised.f() {} } Ref.aj: package notbugs; import bugs.Advised; public class Ref { public void g() { new Advised().f(); } } I am attempting to build Advised.aj into a jar, and refer to it from Ref.aj, using the following ant build.xml: <?xml version="1.0"?> <project name="Bugs" basedir="C:\workplace\imds\Bugs" xmlns:aj="antlib:org.aspectj"> <taskdef uri="antlib:org.aspectj" resource="org/aspectj/antlib.xml" classpath="./aspectjtools.jar"/> <target name="clean"> <delete dir="bugs" includes="**/*.class"/> <delete dir="notbugs" includes="**/*.class"/> </target> <target name="task1"> <aj:iajc srcdir="." destdir="." source="1.5" target="1.5"> <classpath location=".\aspectjrt.jar"/> <include name="bugs/Advised.aj"/> </aj:iajc> </target> <target name="task2"> <aj:iajc source="1.5" target="1.5" srcdir="."> <classpath location=".\aspectjrt.jar"/> <aspectpath location="."/> <include name="notbugs/Ref.aj"/> </aj:iajc> </target> </project> From within Eclipse, there are no build errors because this is all one project. On the command line, however, once I execute ant task2, I get the following marvelous error message which suggests that ajc is trying to ITD f into a class it already ITDd f into before: [aj:iajc] error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() [aj:iajc] MessageHolder: (8 info) (1 error) [aj:iajc] [error 0]: error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() Let me also say that in my real use-case, the jar produced by task1 will contain aspects that should apply to clients thereof, and as such, that jar should indeed be in the aspectpath (not the classpath) for task2 (unless I am seriously misunderstanding something). How to stop this duplicate attempt to ITD? Josh --- Josh is correct that using aspectpath will pull in the aspects for application to other types, the problem is that when pulling in type Advised, we reapply known ITDs and it clashes with the one added in the original build of the type. Two possible fixes that I am looking at: - don't reapply the ITDs (they are added to ensure type system is consistent) to binary types pulled in from the aspectpath - recognize the ITD is clashing with a member previously applied through the same ITD I am not sure we can determine it came from the aspectpath at the point the clash is detected. I have option (2) already implemented, but I'll try a little more with option 1 before giving up ;)
resolved fixed
797ec4d
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2007-10-18T11:03:05Z
2007-10-18T09:33:20Z
weaver/src/org/aspectj/weaver/ResolvedType.java
return ret; } private final Collection collectShadowMungers() { if (! this.isAspect() || this.isAbstract() || this.doesNotExposeShadowMungers()) return Collections.EMPTY_LIST; ArrayList acc = new ArrayList(); final Iterators.Filter dupFilter = Iterators.dupFilter(); Iterators.Getter typeGetter = new Iterators.Getter() { public Iterator get(Object o) { return dupFilter.filter( ((ResolvedType)o).getDirectSupertypes()); } }; Iterator typeIterator = Iterators.recur(this, typeGetter); while (typeIterator.hasNext()) { ResolvedType ty = (ResolvedType) typeIterator.next(); acc.addAll(ty.getDeclaredShadowMungers()); } return acc; } protected boolean doesNotExposeShadowMungers() { return false; }
206,732
Bug 206732 [itds] Problem with ITDs appearing to be applied twice (and clashing) for binary types
As reported by Josh on the mailing list: I have the following 2 files: Advised.aj: package bugs; public class Advised {} aspect ITD { public void Advised.f() {} } Ref.aj: package notbugs; import bugs.Advised; public class Ref { public void g() { new Advised().f(); } } I am attempting to build Advised.aj into a jar, and refer to it from Ref.aj, using the following ant build.xml: <?xml version="1.0"?> <project name="Bugs" basedir="C:\workplace\imds\Bugs" xmlns:aj="antlib:org.aspectj"> <taskdef uri="antlib:org.aspectj" resource="org/aspectj/antlib.xml" classpath="./aspectjtools.jar"/> <target name="clean"> <delete dir="bugs" includes="**/*.class"/> <delete dir="notbugs" includes="**/*.class"/> </target> <target name="task1"> <aj:iajc srcdir="." destdir="." source="1.5" target="1.5"> <classpath location=".\aspectjrt.jar"/> <include name="bugs/Advised.aj"/> </aj:iajc> </target> <target name="task2"> <aj:iajc source="1.5" target="1.5" srcdir="."> <classpath location=".\aspectjrt.jar"/> <aspectpath location="."/> <include name="notbugs/Ref.aj"/> </aj:iajc> </target> </project> From within Eclipse, there are no build errors because this is all one project. On the command line, however, once I execute ant task2, I get the following marvelous error message which suggests that ajc is trying to ITD f into a class it already ITDd f into before: [aj:iajc] error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() [aj:iajc] MessageHolder: (8 info) (1 error) [aj:iajc] [error 0]: error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() Let me also say that in my real use-case, the jar produced by task1 will contain aspects that should apply to clients thereof, and as such, that jar should indeed be in the aspectpath (not the classpath) for task2 (unless I am seriously misunderstanding something). How to stop this duplicate attempt to ITD? Josh --- Josh is correct that using aspectpath will pull in the aspects for application to other types, the problem is that when pulling in type Advised, we reapply known ITDs and it clashes with the one added in the original build of the type. Two possible fixes that I am looking at: - don't reapply the ITDs (they are added to ensure type system is consistent) to binary types pulled in from the aspectpath - recognize the ITD is clashing with a member previously applied through the same ITD I am not sure we can determine it came from the aspectpath at the point the clash is detected. I have option (2) already implemented, but I'll try a little more with option 1 before giving up ;)
resolved fixed
797ec4d
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2007-10-18T11:03:05Z
2007-10-18T09:33:20Z
weaver/src/org/aspectj/weaver/ResolvedType.java
public PerClause getPerClause() { return null; } protected Collection getDeclares() { return Collections.EMPTY_LIST; } protected Collection getTypeMungers() { return Collections.EMPTY_LIST; } protected Collection getPrivilegedAccesses() { return Collections.EMPTY_LIST; } public final boolean isInterface() { return Modifier.isInterface(getModifiers()); } public final boolean isAbstract() { return Modifier.isAbstract(getModifiers()); } public boolean isClass() { return false; } public boolean isAspect() {
206,732
Bug 206732 [itds] Problem with ITDs appearing to be applied twice (and clashing) for binary types
As reported by Josh on the mailing list: I have the following 2 files: Advised.aj: package bugs; public class Advised {} aspect ITD { public void Advised.f() {} } Ref.aj: package notbugs; import bugs.Advised; public class Ref { public void g() { new Advised().f(); } } I am attempting to build Advised.aj into a jar, and refer to it from Ref.aj, using the following ant build.xml: <?xml version="1.0"?> <project name="Bugs" basedir="C:\workplace\imds\Bugs" xmlns:aj="antlib:org.aspectj"> <taskdef uri="antlib:org.aspectj" resource="org/aspectj/antlib.xml" classpath="./aspectjtools.jar"/> <target name="clean"> <delete dir="bugs" includes="**/*.class"/> <delete dir="notbugs" includes="**/*.class"/> </target> <target name="task1"> <aj:iajc srcdir="." destdir="." source="1.5" target="1.5"> <classpath location=".\aspectjrt.jar"/> <include name="bugs/Advised.aj"/> </aj:iajc> </target> <target name="task2"> <aj:iajc source="1.5" target="1.5" srcdir="."> <classpath location=".\aspectjrt.jar"/> <aspectpath location="."/> <include name="notbugs/Ref.aj"/> </aj:iajc> </target> </project> From within Eclipse, there are no build errors because this is all one project. On the command line, however, once I execute ant task2, I get the following marvelous error message which suggests that ajc is trying to ITD f into a class it already ITDd f into before: [aj:iajc] error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() [aj:iajc] MessageHolder: (8 info) (1 error) [aj:iajc] [error 0]: error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() Let me also say that in my real use-case, the jar produced by task1 will contain aspects that should apply to clients thereof, and as such, that jar should indeed be in the aspectpath (not the classpath) for task2 (unless I am seriously misunderstanding something). How to stop this duplicate attempt to ITD? Josh --- Josh is correct that using aspectpath will pull in the aspects for application to other types, the problem is that when pulling in type Advised, we reapply known ITDs and it clashes with the one added in the original build of the type. Two possible fixes that I am looking at: - don't reapply the ITDs (they are added to ensure type system is consistent) to binary types pulled in from the aspectpath - recognize the ITD is clashing with a member previously applied through the same ITD I am not sure we can determine it came from the aspectpath at the point the clash is detected. I have option (2) already implemented, but I'll try a little more with option 1 before giving up ;)
resolved fixed
797ec4d
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2007-10-18T11:03:05Z
2007-10-18T09:33:20Z
weaver/src/org/aspectj/weaver/ResolvedType.java
return false; } public boolean isAnnotationStyleAspect() { return false; } /** * Note: Only overridden by Name subtype. */ public boolean isEnum() { return false; } /** * Note: Only overridden by Name subtype. */ public boolean isAnnotation() { return false; } public boolean isAnonymous() { return false; } public boolean isNested() { return false; } /** * Note: Only overridden by Name subtype */
206,732
Bug 206732 [itds] Problem with ITDs appearing to be applied twice (and clashing) for binary types
As reported by Josh on the mailing list: I have the following 2 files: Advised.aj: package bugs; public class Advised {} aspect ITD { public void Advised.f() {} } Ref.aj: package notbugs; import bugs.Advised; public class Ref { public void g() { new Advised().f(); } } I am attempting to build Advised.aj into a jar, and refer to it from Ref.aj, using the following ant build.xml: <?xml version="1.0"?> <project name="Bugs" basedir="C:\workplace\imds\Bugs" xmlns:aj="antlib:org.aspectj"> <taskdef uri="antlib:org.aspectj" resource="org/aspectj/antlib.xml" classpath="./aspectjtools.jar"/> <target name="clean"> <delete dir="bugs" includes="**/*.class"/> <delete dir="notbugs" includes="**/*.class"/> </target> <target name="task1"> <aj:iajc srcdir="." destdir="." source="1.5" target="1.5"> <classpath location=".\aspectjrt.jar"/> <include name="bugs/Advised.aj"/> </aj:iajc> </target> <target name="task2"> <aj:iajc source="1.5" target="1.5" srcdir="."> <classpath location=".\aspectjrt.jar"/> <aspectpath location="."/> <include name="notbugs/Ref.aj"/> </aj:iajc> </target> </project> From within Eclipse, there are no build errors because this is all one project. On the command line, however, once I execute ant task2, I get the following marvelous error message which suggests that ajc is trying to ITD f into a class it already ITDd f into before: [aj:iajc] error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() [aj:iajc] MessageHolder: (8 info) (1 error) [aj:iajc] [error 0]: error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() Let me also say that in my real use-case, the jar produced by task1 will contain aspects that should apply to clients thereof, and as such, that jar should indeed be in the aspectpath (not the classpath) for task2 (unless I am seriously misunderstanding something). How to stop this duplicate attempt to ITD? Josh --- Josh is correct that using aspectpath will pull in the aspects for application to other types, the problem is that when pulling in type Advised, we reapply known ITDs and it clashes with the one added in the original build of the type. Two possible fixes that I am looking at: - don't reapply the ITDs (they are added to ensure type system is consistent) to binary types pulled in from the aspectpath - recognize the ITD is clashing with a member previously applied through the same ITD I am not sure we can determine it came from the aspectpath at the point the clash is detected. I have option (2) already implemented, but I'll try a little more with option 1 before giving up ;)
resolved fixed
797ec4d
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2007-10-18T11:03:05Z
2007-10-18T09:33:20Z
weaver/src/org/aspectj/weaver/ResolvedType.java
public void addAnnotation(AnnotationX annotationX) { throw new RuntimeException("ResolvedType.addAnnotation() should never be called"); } /** * Note: Only overridden by Name subtype */ public AnnotationX[] getAnnotations() { throw new RuntimeException("ResolvedType.getAnnotations() should never be called"); } /** * Note: Only overridden by ReferenceType subtype */ public boolean canAnnotationTargetType() { return false; } /** * Note: Only overridden by ReferenceType subtype */ public AnnotationTargetKind[] getAnnotationTargetKinds() { return null; } /** * Note: Only overridden by Name subtype. */ public boolean isAnnotationWithRuntimeRetention() { return false;
206,732
Bug 206732 [itds] Problem with ITDs appearing to be applied twice (and clashing) for binary types
As reported by Josh on the mailing list: I have the following 2 files: Advised.aj: package bugs; public class Advised {} aspect ITD { public void Advised.f() {} } Ref.aj: package notbugs; import bugs.Advised; public class Ref { public void g() { new Advised().f(); } } I am attempting to build Advised.aj into a jar, and refer to it from Ref.aj, using the following ant build.xml: <?xml version="1.0"?> <project name="Bugs" basedir="C:\workplace\imds\Bugs" xmlns:aj="antlib:org.aspectj"> <taskdef uri="antlib:org.aspectj" resource="org/aspectj/antlib.xml" classpath="./aspectjtools.jar"/> <target name="clean"> <delete dir="bugs" includes="**/*.class"/> <delete dir="notbugs" includes="**/*.class"/> </target> <target name="task1"> <aj:iajc srcdir="." destdir="." source="1.5" target="1.5"> <classpath location=".\aspectjrt.jar"/> <include name="bugs/Advised.aj"/> </aj:iajc> </target> <target name="task2"> <aj:iajc source="1.5" target="1.5" srcdir="."> <classpath location=".\aspectjrt.jar"/> <aspectpath location="."/> <include name="notbugs/Ref.aj"/> </aj:iajc> </target> </project> From within Eclipse, there are no build errors because this is all one project. On the command line, however, once I execute ant task2, I get the following marvelous error message which suggests that ajc is trying to ITD f into a class it already ITDd f into before: [aj:iajc] error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() [aj:iajc] MessageHolder: (8 info) (1 error) [aj:iajc] [error 0]: error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() Let me also say that in my real use-case, the jar produced by task1 will contain aspects that should apply to clients thereof, and as such, that jar should indeed be in the aspectpath (not the classpath) for task2 (unless I am seriously misunderstanding something). How to stop this duplicate attempt to ITD? Josh --- Josh is correct that using aspectpath will pull in the aspects for application to other types, the problem is that when pulling in type Advised, we reapply known ITDs and it clashes with the one added in the original build of the type. Two possible fixes that I am looking at: - don't reapply the ITDs (they are added to ensure type system is consistent) to binary types pulled in from the aspectpath - recognize the ITD is clashing with a member previously applied through the same ITD I am not sure we can determine it came from the aspectpath at the point the clash is detected. I have option (2) already implemented, but I'll try a little more with option 1 before giving up ;)
resolved fixed
797ec4d
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2007-10-18T11:03:05Z
2007-10-18T09:33:20Z
weaver/src/org/aspectj/weaver/ResolvedType.java
} public boolean isSynthetic() { return signature.indexOf("$ajc") != -1; } public final boolean isFinal() { return Modifier.isFinal(getModifiers()); } protected Map getMemberParameterizationMap() { if (!isParameterizedType()) return Collections.EMPTY_MAP; TypeVariable[] tvs = getGenericType().getTypeVariables(); Map parameterizationMap = new HashMap(); for (int i = 0; i < tvs.length; i++) { parameterizationMap.put(tvs[i].getName(), typeParameters[i]); } return parameterizationMap; } public Collection getDeclaredAdvice() { List l = new ArrayList(); ResolvedMember[] methods = getDeclaredMethods(); if (isParameterizedType()) methods = getGenericType().getDeclaredMethods(); Map typeVariableMap = getAjMemberParameterizationMap(); for (int i=0, len = methods.length; i < len; i++) { ShadowMunger munger = methods[i].getAssociatedShadowMunger(); if (munger != null) { if (ajMembersNeedParameterization()) { munger = munger.parameterizeWith(this,typeVariableMap);
206,732
Bug 206732 [itds] Problem with ITDs appearing to be applied twice (and clashing) for binary types
As reported by Josh on the mailing list: I have the following 2 files: Advised.aj: package bugs; public class Advised {} aspect ITD { public void Advised.f() {} } Ref.aj: package notbugs; import bugs.Advised; public class Ref { public void g() { new Advised().f(); } } I am attempting to build Advised.aj into a jar, and refer to it from Ref.aj, using the following ant build.xml: <?xml version="1.0"?> <project name="Bugs" basedir="C:\workplace\imds\Bugs" xmlns:aj="antlib:org.aspectj"> <taskdef uri="antlib:org.aspectj" resource="org/aspectj/antlib.xml" classpath="./aspectjtools.jar"/> <target name="clean"> <delete dir="bugs" includes="**/*.class"/> <delete dir="notbugs" includes="**/*.class"/> </target> <target name="task1"> <aj:iajc srcdir="." destdir="." source="1.5" target="1.5"> <classpath location=".\aspectjrt.jar"/> <include name="bugs/Advised.aj"/> </aj:iajc> </target> <target name="task2"> <aj:iajc source="1.5" target="1.5" srcdir="."> <classpath location=".\aspectjrt.jar"/> <aspectpath location="."/> <include name="notbugs/Ref.aj"/> </aj:iajc> </target> </project> From within Eclipse, there are no build errors because this is all one project. On the command line, however, once I execute ant task2, I get the following marvelous error message which suggests that ajc is trying to ITD f into a class it already ITDd f into before: [aj:iajc] error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() [aj:iajc] MessageHolder: (8 info) (1 error) [aj:iajc] [error 0]: error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() Let me also say that in my real use-case, the jar produced by task1 will contain aspects that should apply to clients thereof, and as such, that jar should indeed be in the aspectpath (not the classpath) for task2 (unless I am seriously misunderstanding something). How to stop this duplicate attempt to ITD? Josh --- Josh is correct that using aspectpath will pull in the aspects for application to other types, the problem is that when pulling in type Advised, we reapply known ITDs and it clashes with the one added in the original build of the type. Two possible fixes that I am looking at: - don't reapply the ITDs (they are added to ensure type system is consistent) to binary types pulled in from the aspectpath - recognize the ITD is clashing with a member previously applied through the same ITD I am not sure we can determine it came from the aspectpath at the point the clash is detected. I have option (2) already implemented, but I'll try a little more with option 1 before giving up ;)
resolved fixed
797ec4d
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2007-10-18T11:03:05Z
2007-10-18T09:33:20Z
weaver/src/org/aspectj/weaver/ResolvedType.java
if (munger instanceof Advice) { Advice advice = (Advice) munger; UnresolvedType[] ptypes = methods[i].getGenericParameterTypes() ; UnresolvedType[] newPTypes = new UnresolvedType[ptypes.length]; for (int j = 0; j < ptypes.length; j++) { if (ptypes[j] instanceof TypeVariableReferenceType) { TypeVariableReferenceType tvrt = (TypeVariableReferenceType) ptypes[j]; if (typeVariableMap.containsKey(tvrt.getTypeVariable().getName())) { newPTypes[j] = (UnresolvedType) typeVariableMap.get(tvrt.getTypeVariable().getName()); } else { newPTypes[j] = ptypes[j]; } } else { newPTypes[j] = ptypes[j]; } } advice.setBindingParameterTypes(newPTypes); } } munger.setDeclaringType(this); l.add(munger); } } return l; } public Collection getDeclaredShadowMungers() { Collection c = getDeclaredAdvice(); return c;
206,732
Bug 206732 [itds] Problem with ITDs appearing to be applied twice (and clashing) for binary types
As reported by Josh on the mailing list: I have the following 2 files: Advised.aj: package bugs; public class Advised {} aspect ITD { public void Advised.f() {} } Ref.aj: package notbugs; import bugs.Advised; public class Ref { public void g() { new Advised().f(); } } I am attempting to build Advised.aj into a jar, and refer to it from Ref.aj, using the following ant build.xml: <?xml version="1.0"?> <project name="Bugs" basedir="C:\workplace\imds\Bugs" xmlns:aj="antlib:org.aspectj"> <taskdef uri="antlib:org.aspectj" resource="org/aspectj/antlib.xml" classpath="./aspectjtools.jar"/> <target name="clean"> <delete dir="bugs" includes="**/*.class"/> <delete dir="notbugs" includes="**/*.class"/> </target> <target name="task1"> <aj:iajc srcdir="." destdir="." source="1.5" target="1.5"> <classpath location=".\aspectjrt.jar"/> <include name="bugs/Advised.aj"/> </aj:iajc> </target> <target name="task2"> <aj:iajc source="1.5" target="1.5" srcdir="."> <classpath location=".\aspectjrt.jar"/> <aspectpath location="."/> <include name="notbugs/Ref.aj"/> </aj:iajc> </target> </project> From within Eclipse, there are no build errors because this is all one project. On the command line, however, once I execute ant task2, I get the following marvelous error message which suggests that ajc is trying to ITD f into a class it already ITDd f into before: [aj:iajc] error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() [aj:iajc] MessageHolder: (8 info) (1 error) [aj:iajc] [error 0]: error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() Let me also say that in my real use-case, the jar produced by task1 will contain aspects that should apply to clients thereof, and as such, that jar should indeed be in the aspectpath (not the classpath) for task2 (unless I am seriously misunderstanding something). How to stop this duplicate attempt to ITD? Josh --- Josh is correct that using aspectpath will pull in the aspects for application to other types, the problem is that when pulling in type Advised, we reapply known ITDs and it clashes with the one added in the original build of the type. Two possible fixes that I am looking at: - don't reapply the ITDs (they are added to ensure type system is consistent) to binary types pulled in from the aspectpath - recognize the ITD is clashing with a member previously applied through the same ITD I am not sure we can determine it came from the aspectpath at the point the clash is detected. I have option (2) already implemented, but I'll try a little more with option 1 before giving up ;)
resolved fixed
797ec4d
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2007-10-18T11:03:05Z
2007-10-18T09:33:20Z
weaver/src/org/aspectj/weaver/ResolvedType.java
} public ResolvedMember[] getDeclaredJavaFields() { return filterInJavaVisible(getDeclaredFields()); } public ResolvedMember[] getDeclaredJavaMethods() { return filterInJavaVisible(getDeclaredMethods()); } public ShadowMunger[] getDeclaredShadowMungersArray() { List l = (List) getDeclaredShadowMungers(); return (ShadowMunger[]) l.toArray(new ShadowMunger[l.size()]); } private ResolvedMember[] filterInJavaVisible(ResolvedMember[] ms) { List l = new ArrayList(); for (int i=0, len = ms.length; i < len; i++) { if (! ms[i].isAjSynthetic() && ms[i].getAssociatedShadowMunger() == null) { l.add(ms[i]); } } return (ResolvedMember[]) l.toArray(new ResolvedMember[l.size()]); } public abstract ISourceContext getSourceContext(); public static final ResolvedType[] NONE = new ResolvedType[0]; public static final Primitive BYTE = new Primitive("B", 1, 0); public static final Primitive CHAR = new Primitive("C", 1, 1); public static final Primitive DOUBLE = new Primitive("D", 2, 2);
206,732
Bug 206732 [itds] Problem with ITDs appearing to be applied twice (and clashing) for binary types
As reported by Josh on the mailing list: I have the following 2 files: Advised.aj: package bugs; public class Advised {} aspect ITD { public void Advised.f() {} } Ref.aj: package notbugs; import bugs.Advised; public class Ref { public void g() { new Advised().f(); } } I am attempting to build Advised.aj into a jar, and refer to it from Ref.aj, using the following ant build.xml: <?xml version="1.0"?> <project name="Bugs" basedir="C:\workplace\imds\Bugs" xmlns:aj="antlib:org.aspectj"> <taskdef uri="antlib:org.aspectj" resource="org/aspectj/antlib.xml" classpath="./aspectjtools.jar"/> <target name="clean"> <delete dir="bugs" includes="**/*.class"/> <delete dir="notbugs" includes="**/*.class"/> </target> <target name="task1"> <aj:iajc srcdir="." destdir="." source="1.5" target="1.5"> <classpath location=".\aspectjrt.jar"/> <include name="bugs/Advised.aj"/> </aj:iajc> </target> <target name="task2"> <aj:iajc source="1.5" target="1.5" srcdir="."> <classpath location=".\aspectjrt.jar"/> <aspectpath location="."/> <include name="notbugs/Ref.aj"/> </aj:iajc> </target> </project> From within Eclipse, there are no build errors because this is all one project. On the command line, however, once I execute ant task2, I get the following marvelous error message which suggests that ajc is trying to ITD f into a class it already ITDd f into before: [aj:iajc] error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() [aj:iajc] MessageHolder: (8 info) (1 error) [aj:iajc] [error 0]: error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() Let me also say that in my real use-case, the jar produced by task1 will contain aspects that should apply to clients thereof, and as such, that jar should indeed be in the aspectpath (not the classpath) for task2 (unless I am seriously misunderstanding something). How to stop this duplicate attempt to ITD? Josh --- Josh is correct that using aspectpath will pull in the aspects for application to other types, the problem is that when pulling in type Advised, we reapply known ITDs and it clashes with the one added in the original build of the type. Two possible fixes that I am looking at: - don't reapply the ITDs (they are added to ensure type system is consistent) to binary types pulled in from the aspectpath - recognize the ITD is clashing with a member previously applied through the same ITD I am not sure we can determine it came from the aspectpath at the point the clash is detected. I have option (2) already implemented, but I'll try a little more with option 1 before giving up ;)
resolved fixed
797ec4d
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2007-10-18T11:03:05Z
2007-10-18T09:33:20Z
weaver/src/org/aspectj/weaver/ResolvedType.java
public static final Primitive FLOAT = new Primitive("F", 1, 3); public static final Primitive INT = new Primitive("I", 1, 4); public static final Primitive LONG = new Primitive("J", 2, 5); public static final Primitive SHORT = new Primitive("S", 1, 6); public static final Primitive VOID = new Primitive("V", 0, 8); public static final Primitive BOOLEAN = new Primitive("Z", 1, 7); public static final Missing MISSING = new Missing(); public static void resetPrimitives() { BYTE.world=null; CHAR.world=null; DOUBLE.world=null; FLOAT.world=null; INT.world=null; LONG.world=null; SHORT.world=null; VOID.world=null; BOOLEAN.world=null; } public static ResolvedType makeArray(ResolvedType type, int dim) { if (dim == 0) return type; ResolvedType array = new Array("[" + type.getSignature(),"["+type.getErasureSignature(),type.getWorld(),type); return makeArray(array,dim-1); } static class Array extends ResolvedType {
206,732
Bug 206732 [itds] Problem with ITDs appearing to be applied twice (and clashing) for binary types
As reported by Josh on the mailing list: I have the following 2 files: Advised.aj: package bugs; public class Advised {} aspect ITD { public void Advised.f() {} } Ref.aj: package notbugs; import bugs.Advised; public class Ref { public void g() { new Advised().f(); } } I am attempting to build Advised.aj into a jar, and refer to it from Ref.aj, using the following ant build.xml: <?xml version="1.0"?> <project name="Bugs" basedir="C:\workplace\imds\Bugs" xmlns:aj="antlib:org.aspectj"> <taskdef uri="antlib:org.aspectj" resource="org/aspectj/antlib.xml" classpath="./aspectjtools.jar"/> <target name="clean"> <delete dir="bugs" includes="**/*.class"/> <delete dir="notbugs" includes="**/*.class"/> </target> <target name="task1"> <aj:iajc srcdir="." destdir="." source="1.5" target="1.5"> <classpath location=".\aspectjrt.jar"/> <include name="bugs/Advised.aj"/> </aj:iajc> </target> <target name="task2"> <aj:iajc source="1.5" target="1.5" srcdir="."> <classpath location=".\aspectjrt.jar"/> <aspectpath location="."/> <include name="notbugs/Ref.aj"/> </aj:iajc> </target> </project> From within Eclipse, there are no build errors because this is all one project. On the command line, however, once I execute ant task2, I get the following marvelous error message which suggests that ajc is trying to ITD f into a class it already ITDd f into before: [aj:iajc] error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() [aj:iajc] MessageHolder: (8 info) (1 error) [aj:iajc] [error 0]: error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() Let me also say that in my real use-case, the jar produced by task1 will contain aspects that should apply to clients thereof, and as such, that jar should indeed be in the aspectpath (not the classpath) for task2 (unless I am seriously misunderstanding something). How to stop this duplicate attempt to ITD? Josh --- Josh is correct that using aspectpath will pull in the aspects for application to other types, the problem is that when pulling in type Advised, we reapply known ITDs and it clashes with the one added in the original build of the type. Two possible fixes that I am looking at: - don't reapply the ITDs (they are added to ensure type system is consistent) to binary types pulled in from the aspectpath - recognize the ITD is clashing with a member previously applied through the same ITD I am not sure we can determine it came from the aspectpath at the point the clash is detected. I have option (2) already implemented, but I'll try a little more with option 1 before giving up ;)
resolved fixed
797ec4d
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2007-10-18T11:03:05Z
2007-10-18T09:33:20Z
weaver/src/org/aspectj/weaver/ResolvedType.java
ResolvedType componentType; Array(String sig, String erasureSig,World world, ResolvedType componentType) { super(sig,erasureSig, world); this.componentType = componentType; } public final ResolvedMember[] getDeclaredFields() { return ResolvedMember.NONE; } public final ResolvedMember[] getDeclaredMethods() { return ResolvedMember.NONE; }
206,732
Bug 206732 [itds] Problem with ITDs appearing to be applied twice (and clashing) for binary types
As reported by Josh on the mailing list: I have the following 2 files: Advised.aj: package bugs; public class Advised {} aspect ITD { public void Advised.f() {} } Ref.aj: package notbugs; import bugs.Advised; public class Ref { public void g() { new Advised().f(); } } I am attempting to build Advised.aj into a jar, and refer to it from Ref.aj, using the following ant build.xml: <?xml version="1.0"?> <project name="Bugs" basedir="C:\workplace\imds\Bugs" xmlns:aj="antlib:org.aspectj"> <taskdef uri="antlib:org.aspectj" resource="org/aspectj/antlib.xml" classpath="./aspectjtools.jar"/> <target name="clean"> <delete dir="bugs" includes="**/*.class"/> <delete dir="notbugs" includes="**/*.class"/> </target> <target name="task1"> <aj:iajc srcdir="." destdir="." source="1.5" target="1.5"> <classpath location=".\aspectjrt.jar"/> <include name="bugs/Advised.aj"/> </aj:iajc> </target> <target name="task2"> <aj:iajc source="1.5" target="1.5" srcdir="."> <classpath location=".\aspectjrt.jar"/> <aspectpath location="."/> <include name="notbugs/Ref.aj"/> </aj:iajc> </target> </project> From within Eclipse, there are no build errors because this is all one project. On the command line, however, once I execute ant task2, I get the following marvelous error message which suggests that ajc is trying to ITD f into a class it already ITDd f into before: [aj:iajc] error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() [aj:iajc] MessageHolder: (8 info) (1 error) [aj:iajc] [error 0]: error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() Let me also say that in my real use-case, the jar produced by task1 will contain aspects that should apply to clients thereof, and as such, that jar should indeed be in the aspectpath (not the classpath) for task2 (unless I am seriously misunderstanding something). How to stop this duplicate attempt to ITD? Josh --- Josh is correct that using aspectpath will pull in the aspects for application to other types, the problem is that when pulling in type Advised, we reapply known ITDs and it clashes with the one added in the original build of the type. Two possible fixes that I am looking at: - don't reapply the ITDs (they are added to ensure type system is consistent) to binary types pulled in from the aspectpath - recognize the ITD is clashing with a member previously applied through the same ITD I am not sure we can determine it came from the aspectpath at the point the clash is detected. I have option (2) already implemented, but I'll try a little more with option 1 before giving up ;)
resolved fixed
797ec4d
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2007-10-18T11:03:05Z
2007-10-18T09:33:20Z
weaver/src/org/aspectj/weaver/ResolvedType.java
public final ResolvedType[] getDeclaredInterfaces() { return new ResolvedType[] { world.getCoreType(CLONEABLE), world.getCoreType(SERIALIZABLE) }; } public final ResolvedMember[] getDeclaredPointcuts() { return ResolvedMember.NONE; } public boolean hasAnnotation(UnresolvedType ofType) { return false; } public final ResolvedType getSuperclass() { return world.getCoreType(OBJECT); } public final boolean isAssignableFrom(ResolvedType o) { if (! o.isArray()) return false; if (o.getComponentType().isPrimitiveType()) { return o.equals(this); } else { return getComponentType().resolve(world).isAssignableFrom(o.getComponentType().resolve(world)); } } public boolean isAssignableFrom(ResolvedType o, boolean allowMissing) { return isAssignableFrom(o); }
206,732
Bug 206732 [itds] Problem with ITDs appearing to be applied twice (and clashing) for binary types
As reported by Josh on the mailing list: I have the following 2 files: Advised.aj: package bugs; public class Advised {} aspect ITD { public void Advised.f() {} } Ref.aj: package notbugs; import bugs.Advised; public class Ref { public void g() { new Advised().f(); } } I am attempting to build Advised.aj into a jar, and refer to it from Ref.aj, using the following ant build.xml: <?xml version="1.0"?> <project name="Bugs" basedir="C:\workplace\imds\Bugs" xmlns:aj="antlib:org.aspectj"> <taskdef uri="antlib:org.aspectj" resource="org/aspectj/antlib.xml" classpath="./aspectjtools.jar"/> <target name="clean"> <delete dir="bugs" includes="**/*.class"/> <delete dir="notbugs" includes="**/*.class"/> </target> <target name="task1"> <aj:iajc srcdir="." destdir="." source="1.5" target="1.5"> <classpath location=".\aspectjrt.jar"/> <include name="bugs/Advised.aj"/> </aj:iajc> </target> <target name="task2"> <aj:iajc source="1.5" target="1.5" srcdir="."> <classpath location=".\aspectjrt.jar"/> <aspectpath location="."/> <include name="notbugs/Ref.aj"/> </aj:iajc> </target> </project> From within Eclipse, there are no build errors because this is all one project. On the command line, however, once I execute ant task2, I get the following marvelous error message which suggests that ajc is trying to ITD f into a class it already ITDd f into before: [aj:iajc] error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() [aj:iajc] MessageHolder: (8 info) (1 error) [aj:iajc] [error 0]: error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() Let me also say that in my real use-case, the jar produced by task1 will contain aspects that should apply to clients thereof, and as such, that jar should indeed be in the aspectpath (not the classpath) for task2 (unless I am seriously misunderstanding something). How to stop this duplicate attempt to ITD? Josh --- Josh is correct that using aspectpath will pull in the aspects for application to other types, the problem is that when pulling in type Advised, we reapply known ITDs and it clashes with the one added in the original build of the type. Two possible fixes that I am looking at: - don't reapply the ITDs (they are added to ensure type system is consistent) to binary types pulled in from the aspectpath - recognize the ITD is clashing with a member previously applied through the same ITD I am not sure we can determine it came from the aspectpath at the point the clash is detected. I have option (2) already implemented, but I'll try a little more with option 1 before giving up ;)
resolved fixed
797ec4d
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2007-10-18T11:03:05Z
2007-10-18T09:33:20Z
weaver/src/org/aspectj/weaver/ResolvedType.java
public final boolean isCoerceableFrom(ResolvedType o) { if (o.equals(UnresolvedType.OBJECT) || o.equals(UnresolvedType.SERIALIZABLE) || o.equals(UnresolvedType.CLONEABLE)) { return true; } if (! o.isArray()) return false; if (o.getComponentType().isPrimitiveType()) { return o.equals(this); } else { return getComponentType().resolve(world).isCoerceableFrom(o.getComponentType().resolve(world)); } } public final int getModifiers() { int mask = Modifier.PUBLIC | Modifier.PRIVATE | Modifier.PROTECTED; return (componentType.getModifiers() & mask) | Modifier.FINAL; } public UnresolvedType getComponentType() { return componentType; } public ResolvedType getResolvedComponentType() { return componentType; } public ISourceContext getSourceContext() { return getResolvedComponentType().getSourceContext(); } } static class Primitive extends ResolvedType {
206,732
Bug 206732 [itds] Problem with ITDs appearing to be applied twice (and clashing) for binary types
As reported by Josh on the mailing list: I have the following 2 files: Advised.aj: package bugs; public class Advised {} aspect ITD { public void Advised.f() {} } Ref.aj: package notbugs; import bugs.Advised; public class Ref { public void g() { new Advised().f(); } } I am attempting to build Advised.aj into a jar, and refer to it from Ref.aj, using the following ant build.xml: <?xml version="1.0"?> <project name="Bugs" basedir="C:\workplace\imds\Bugs" xmlns:aj="antlib:org.aspectj"> <taskdef uri="antlib:org.aspectj" resource="org/aspectj/antlib.xml" classpath="./aspectjtools.jar"/> <target name="clean"> <delete dir="bugs" includes="**/*.class"/> <delete dir="notbugs" includes="**/*.class"/> </target> <target name="task1"> <aj:iajc srcdir="." destdir="." source="1.5" target="1.5"> <classpath location=".\aspectjrt.jar"/> <include name="bugs/Advised.aj"/> </aj:iajc> </target> <target name="task2"> <aj:iajc source="1.5" target="1.5" srcdir="."> <classpath location=".\aspectjrt.jar"/> <aspectpath location="."/> <include name="notbugs/Ref.aj"/> </aj:iajc> </target> </project> From within Eclipse, there are no build errors because this is all one project. On the command line, however, once I execute ant task2, I get the following marvelous error message which suggests that ajc is trying to ITD f into a class it already ITDd f into before: [aj:iajc] error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() [aj:iajc] MessageHolder: (8 info) (1 error) [aj:iajc] [error 0]: error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() Let me also say that in my real use-case, the jar produced by task1 will contain aspects that should apply to clients thereof, and as such, that jar should indeed be in the aspectpath (not the classpath) for task2 (unless I am seriously misunderstanding something). How to stop this duplicate attempt to ITD? Josh --- Josh is correct that using aspectpath will pull in the aspects for application to other types, the problem is that when pulling in type Advised, we reapply known ITDs and it clashes with the one added in the original build of the type. Two possible fixes that I am looking at: - don't reapply the ITDs (they are added to ensure type system is consistent) to binary types pulled in from the aspectpath - recognize the ITD is clashing with a member previously applied through the same ITD I am not sure we can determine it came from the aspectpath at the point the clash is detected. I have option (2) already implemented, but I'll try a little more with option 1 before giving up ;)
resolved fixed
797ec4d
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2007-10-18T11:03:05Z
2007-10-18T09:33:20Z
weaver/src/org/aspectj/weaver/ResolvedType.java
private int size; private int index; Primitive(String signature, int size, int index) { super(signature, null); this.size = size; this.index = index; this.typeKind=TypeKind.PRIMITIVE; } public final int getSize() { return size; } public final int getModifiers() { return Modifier.PUBLIC | Modifier.FINAL; } public final boolean isPrimitiveType() { return true;
206,732
Bug 206732 [itds] Problem with ITDs appearing to be applied twice (and clashing) for binary types
As reported by Josh on the mailing list: I have the following 2 files: Advised.aj: package bugs; public class Advised {} aspect ITD { public void Advised.f() {} } Ref.aj: package notbugs; import bugs.Advised; public class Ref { public void g() { new Advised().f(); } } I am attempting to build Advised.aj into a jar, and refer to it from Ref.aj, using the following ant build.xml: <?xml version="1.0"?> <project name="Bugs" basedir="C:\workplace\imds\Bugs" xmlns:aj="antlib:org.aspectj"> <taskdef uri="antlib:org.aspectj" resource="org/aspectj/antlib.xml" classpath="./aspectjtools.jar"/> <target name="clean"> <delete dir="bugs" includes="**/*.class"/> <delete dir="notbugs" includes="**/*.class"/> </target> <target name="task1"> <aj:iajc srcdir="." destdir="." source="1.5" target="1.5"> <classpath location=".\aspectjrt.jar"/> <include name="bugs/Advised.aj"/> </aj:iajc> </target> <target name="task2"> <aj:iajc source="1.5" target="1.5" srcdir="."> <classpath location=".\aspectjrt.jar"/> <aspectpath location="."/> <include name="notbugs/Ref.aj"/> </aj:iajc> </target> </project> From within Eclipse, there are no build errors because this is all one project. On the command line, however, once I execute ant task2, I get the following marvelous error message which suggests that ajc is trying to ITD f into a class it already ITDd f into before: [aj:iajc] error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() [aj:iajc] MessageHolder: (8 info) (1 error) [aj:iajc] [error 0]: error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() Let me also say that in my real use-case, the jar produced by task1 will contain aspects that should apply to clients thereof, and as such, that jar should indeed be in the aspectpath (not the classpath) for task2 (unless I am seriously misunderstanding something). How to stop this duplicate attempt to ITD? Josh --- Josh is correct that using aspectpath will pull in the aspects for application to other types, the problem is that when pulling in type Advised, we reapply known ITDs and it clashes with the one added in the original build of the type. Two possible fixes that I am looking at: - don't reapply the ITDs (they are added to ensure type system is consistent) to binary types pulled in from the aspectpath - recognize the ITD is clashing with a member previously applied through the same ITD I am not sure we can determine it came from the aspectpath at the point the clash is detected. I have option (2) already implemented, but I'll try a little more with option 1 before giving up ;)
resolved fixed
797ec4d
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2007-10-18T11:03:05Z
2007-10-18T09:33:20Z
weaver/src/org/aspectj/weaver/ResolvedType.java
} public boolean hasAnnotation(UnresolvedType ofType) { return false; } public final boolean isAssignableFrom(ResolvedType other) { if (!other.isPrimitiveType()) { if (!world.isInJava5Mode()) return false; return validBoxing.contains(this.getSignature()+other.getSignature()); } return assignTable[((Primitive)other).index][index]; } public final boolean isAssignableFrom(ResolvedType other, boolean allowMissing) { return isAssignableFrom(other); } public final boolean isCoerceableFrom(ResolvedType other) { if (this == other) return true; if (! other.isPrimitiveType()) return false; if (index > 6 || ((Primitive)other).index > 6) return false; return true; } public ResolvedType resolve(World world) { this.world = world; return super.resolve(world); } public final boolean needsNoConversionFrom(ResolvedType other) { if (! other.isPrimitiveType()) return false; return noConvertTable[((Primitive)other).index][index]; } private static final boolean[][] assignTable = {
206,732
Bug 206732 [itds] Problem with ITDs appearing to be applied twice (and clashing) for binary types
As reported by Josh on the mailing list: I have the following 2 files: Advised.aj: package bugs; public class Advised {} aspect ITD { public void Advised.f() {} } Ref.aj: package notbugs; import bugs.Advised; public class Ref { public void g() { new Advised().f(); } } I am attempting to build Advised.aj into a jar, and refer to it from Ref.aj, using the following ant build.xml: <?xml version="1.0"?> <project name="Bugs" basedir="C:\workplace\imds\Bugs" xmlns:aj="antlib:org.aspectj"> <taskdef uri="antlib:org.aspectj" resource="org/aspectj/antlib.xml" classpath="./aspectjtools.jar"/> <target name="clean"> <delete dir="bugs" includes="**/*.class"/> <delete dir="notbugs" includes="**/*.class"/> </target> <target name="task1"> <aj:iajc srcdir="." destdir="." source="1.5" target="1.5"> <classpath location=".\aspectjrt.jar"/> <include name="bugs/Advised.aj"/> </aj:iajc> </target> <target name="task2"> <aj:iajc source="1.5" target="1.5" srcdir="."> <classpath location=".\aspectjrt.jar"/> <aspectpath location="."/> <include name="notbugs/Ref.aj"/> </aj:iajc> </target> </project> From within Eclipse, there are no build errors because this is all one project. On the command line, however, once I execute ant task2, I get the following marvelous error message which suggests that ajc is trying to ITD f into a class it already ITDd f into before: [aj:iajc] error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() [aj:iajc] MessageHolder: (8 info) (1 error) [aj:iajc] [error 0]: error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() Let me also say that in my real use-case, the jar produced by task1 will contain aspects that should apply to clients thereof, and as such, that jar should indeed be in the aspectpath (not the classpath) for task2 (unless I am seriously misunderstanding something). How to stop this duplicate attempt to ITD? Josh --- Josh is correct that using aspectpath will pull in the aspects for application to other types, the problem is that when pulling in type Advised, we reapply known ITDs and it clashes with the one added in the original build of the type. Two possible fixes that I am looking at: - don't reapply the ITDs (they are added to ensure type system is consistent) to binary types pulled in from the aspectpath - recognize the ITD is clashing with a member previously applied through the same ITD I am not sure we can determine it came from the aspectpath at the point the clash is detected. I have option (2) already implemented, but I'll try a little more with option 1 before giving up ;)
resolved fixed
797ec4d
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2007-10-18T11:03:05Z
2007-10-18T09:33:20Z
weaver/src/org/aspectj/weaver/ResolvedType.java
{ true , true , true , true , true , true , true , false, false }, B { false, true , true , true , true , true , false, false, false }, C { false, false, true , false, false, false, false, false, false }, D { false, false, true , true , false, false, false, false, false }, F { false, false, true , true , true , true , false, false, false }, I { false, false, true , true , false, true , false, false, false }, J { false, false, true , true , true , true , true , false, false }, S { false, false, false, false, false, false, false, true , false }, V { false, false, false, false, false, false, false, false, true }, Z }; private static final boolean[][] noConvertTable = { { true , true , false, false, true , false, true , false, false }, B { false, true , false, false, true , false, false, false, false }, C { false, false, true , false, false, false, false, false, false }, D { false, false, false, true , false, false, false, false, false }, F { false, false, false, false, true , false, false, false, false }, I { false, false, false, false, false, true , false, false, false }, J { false, false, false, false, true , false, true , false, false }, S { false, false, false, false, false, false, false, true , false }, V { false, false, false, false, false, false, false, false, true }, Z }; ---- public final ResolvedMember[] getDeclaredFields() { return ResolvedMember.NONE; } public final ResolvedMember[] getDeclaredMethods() { return ResolvedMember.NONE;
206,732
Bug 206732 [itds] Problem with ITDs appearing to be applied twice (and clashing) for binary types
As reported by Josh on the mailing list: I have the following 2 files: Advised.aj: package bugs; public class Advised {} aspect ITD { public void Advised.f() {} } Ref.aj: package notbugs; import bugs.Advised; public class Ref { public void g() { new Advised().f(); } } I am attempting to build Advised.aj into a jar, and refer to it from Ref.aj, using the following ant build.xml: <?xml version="1.0"?> <project name="Bugs" basedir="C:\workplace\imds\Bugs" xmlns:aj="antlib:org.aspectj"> <taskdef uri="antlib:org.aspectj" resource="org/aspectj/antlib.xml" classpath="./aspectjtools.jar"/> <target name="clean"> <delete dir="bugs" includes="**/*.class"/> <delete dir="notbugs" includes="**/*.class"/> </target> <target name="task1"> <aj:iajc srcdir="." destdir="." source="1.5" target="1.5"> <classpath location=".\aspectjrt.jar"/> <include name="bugs/Advised.aj"/> </aj:iajc> </target> <target name="task2"> <aj:iajc source="1.5" target="1.5" srcdir="."> <classpath location=".\aspectjrt.jar"/> <aspectpath location="."/> <include name="notbugs/Ref.aj"/> </aj:iajc> </target> </project> From within Eclipse, there are no build errors because this is all one project. On the command line, however, once I execute ant task2, I get the following marvelous error message which suggests that ajc is trying to ITD f into a class it already ITDd f into before: [aj:iajc] error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() [aj:iajc] MessageHolder: (8 info) (1 error) [aj:iajc] [error 0]: error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() Let me also say that in my real use-case, the jar produced by task1 will contain aspects that should apply to clients thereof, and as such, that jar should indeed be in the aspectpath (not the classpath) for task2 (unless I am seriously misunderstanding something). How to stop this duplicate attempt to ITD? Josh --- Josh is correct that using aspectpath will pull in the aspects for application to other types, the problem is that when pulling in type Advised, we reapply known ITDs and it clashes with the one added in the original build of the type. Two possible fixes that I am looking at: - don't reapply the ITDs (they are added to ensure type system is consistent) to binary types pulled in from the aspectpath - recognize the ITD is clashing with a member previously applied through the same ITD I am not sure we can determine it came from the aspectpath at the point the clash is detected. I have option (2) already implemented, but I'll try a little more with option 1 before giving up ;)
resolved fixed
797ec4d
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2007-10-18T11:03:05Z
2007-10-18T09:33:20Z
weaver/src/org/aspectj/weaver/ResolvedType.java
} public final ResolvedType[] getDeclaredInterfaces() { return ResolvedType.NONE; } public final ResolvedMember[] getDeclaredPointcuts() { return ResolvedMember.NONE; } public final ResolvedType getSuperclass() { return null; } public ISourceContext getSourceContext() { return null; } } static class Missing extends ResolvedType { Missing() { super(MISSING_NAME, null); } public final String getName() { return MISSING_NAME; } public final boolean isMissing() { return true; } public boolean hasAnnotation(UnresolvedType ofType) {
206,732
Bug 206732 [itds] Problem with ITDs appearing to be applied twice (and clashing) for binary types
As reported by Josh on the mailing list: I have the following 2 files: Advised.aj: package bugs; public class Advised {} aspect ITD { public void Advised.f() {} } Ref.aj: package notbugs; import bugs.Advised; public class Ref { public void g() { new Advised().f(); } } I am attempting to build Advised.aj into a jar, and refer to it from Ref.aj, using the following ant build.xml: <?xml version="1.0"?> <project name="Bugs" basedir="C:\workplace\imds\Bugs" xmlns:aj="antlib:org.aspectj"> <taskdef uri="antlib:org.aspectj" resource="org/aspectj/antlib.xml" classpath="./aspectjtools.jar"/> <target name="clean"> <delete dir="bugs" includes="**/*.class"/> <delete dir="notbugs" includes="**/*.class"/> </target> <target name="task1"> <aj:iajc srcdir="." destdir="." source="1.5" target="1.5"> <classpath location=".\aspectjrt.jar"/> <include name="bugs/Advised.aj"/> </aj:iajc> </target> <target name="task2"> <aj:iajc source="1.5" target="1.5" srcdir="."> <classpath location=".\aspectjrt.jar"/> <aspectpath location="."/> <include name="notbugs/Ref.aj"/> </aj:iajc> </target> </project> From within Eclipse, there are no build errors because this is all one project. On the command line, however, once I execute ant task2, I get the following marvelous error message which suggests that ajc is trying to ITD f into a class it already ITDd f into before: [aj:iajc] error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() [aj:iajc] MessageHolder: (8 info) (1 error) [aj:iajc] [error 0]: error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() Let me also say that in my real use-case, the jar produced by task1 will contain aspects that should apply to clients thereof, and as such, that jar should indeed be in the aspectpath (not the classpath) for task2 (unless I am seriously misunderstanding something). How to stop this duplicate attempt to ITD? Josh --- Josh is correct that using aspectpath will pull in the aspects for application to other types, the problem is that when pulling in type Advised, we reapply known ITDs and it clashes with the one added in the original build of the type. Two possible fixes that I am looking at: - don't reapply the ITDs (they are added to ensure type system is consistent) to binary types pulled in from the aspectpath - recognize the ITD is clashing with a member previously applied through the same ITD I am not sure we can determine it came from the aspectpath at the point the clash is detected. I have option (2) already implemented, but I'll try a little more with option 1 before giving up ;)
resolved fixed
797ec4d
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2007-10-18T11:03:05Z
2007-10-18T09:33:20Z
weaver/src/org/aspectj/weaver/ResolvedType.java
return false; } public final ResolvedMember[] getDeclaredFields() { return ResolvedMember.NONE; } public final ResolvedMember[] getDeclaredMethods() { return ResolvedMember.NONE; } public final ResolvedType[] getDeclaredInterfaces() { return ResolvedType.NONE; } public final ResolvedMember[] getDeclaredPointcuts() { return ResolvedMember.NONE; } public final ResolvedType getSuperclass() { return null; } public final int getModifiers() { return 0; } public final boolean isAssignableFrom(ResolvedType other) { return false; } public final boolean isAssignableFrom(ResolvedType other, boolean allowMissing) { return false; } public final boolean isCoerceableFrom(ResolvedType other) { return false; } public boolean needsNoConversionFrom(ResolvedType other) {
206,732
Bug 206732 [itds] Problem with ITDs appearing to be applied twice (and clashing) for binary types
As reported by Josh on the mailing list: I have the following 2 files: Advised.aj: package bugs; public class Advised {} aspect ITD { public void Advised.f() {} } Ref.aj: package notbugs; import bugs.Advised; public class Ref { public void g() { new Advised().f(); } } I am attempting to build Advised.aj into a jar, and refer to it from Ref.aj, using the following ant build.xml: <?xml version="1.0"?> <project name="Bugs" basedir="C:\workplace\imds\Bugs" xmlns:aj="antlib:org.aspectj"> <taskdef uri="antlib:org.aspectj" resource="org/aspectj/antlib.xml" classpath="./aspectjtools.jar"/> <target name="clean"> <delete dir="bugs" includes="**/*.class"/> <delete dir="notbugs" includes="**/*.class"/> </target> <target name="task1"> <aj:iajc srcdir="." destdir="." source="1.5" target="1.5"> <classpath location=".\aspectjrt.jar"/> <include name="bugs/Advised.aj"/> </aj:iajc> </target> <target name="task2"> <aj:iajc source="1.5" target="1.5" srcdir="."> <classpath location=".\aspectjrt.jar"/> <aspectpath location="."/> <include name="notbugs/Ref.aj"/> </aj:iajc> </target> </project> From within Eclipse, there are no build errors because this is all one project. On the command line, however, once I execute ant task2, I get the following marvelous error message which suggests that ajc is trying to ITD f into a class it already ITDd f into before: [aj:iajc] error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() [aj:iajc] MessageHolder: (8 info) (1 error) [aj:iajc] [error 0]: error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() Let me also say that in my real use-case, the jar produced by task1 will contain aspects that should apply to clients thereof, and as such, that jar should indeed be in the aspectpath (not the classpath) for task2 (unless I am seriously misunderstanding something). How to stop this duplicate attempt to ITD? Josh --- Josh is correct that using aspectpath will pull in the aspects for application to other types, the problem is that when pulling in type Advised, we reapply known ITDs and it clashes with the one added in the original build of the type. Two possible fixes that I am looking at: - don't reapply the ITDs (they are added to ensure type system is consistent) to binary types pulled in from the aspectpath - recognize the ITD is clashing with a member previously applied through the same ITD I am not sure we can determine it came from the aspectpath at the point the clash is detected. I have option (2) already implemented, but I'll try a little more with option 1 before giving up ;)
resolved fixed
797ec4d
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2007-10-18T11:03:05Z
2007-10-18T09:33:20Z
weaver/src/org/aspectj/weaver/ResolvedType.java
return false; } public ISourceContext getSourceContext() { return null; } } /** * Look up a member, takes into account any ITDs on this type. * return null if not found */ public ResolvedMember lookupMemberNoSupers(Member member) { ResolvedMember ret = lookupDirectlyDeclaredMemberNoSupers(member); if (ret == null && interTypeMungers != null) { for (Iterator i = interTypeMungers.iterator(); i.hasNext();) { ConcreteTypeMunger tm = (ConcreteTypeMunger) i.next(); if (matches(tm.getSignature(), member)) { return tm.getSignature(); } } } return ret; } public ResolvedMember lookupMemberWithSupersAndITDs(Member member) { ResolvedMember ret = lookupMemberNoSupers(member); if (ret != null) return ret; ResolvedType supert = getSuperclass(); while (ret==null && supert!=null) { ret = supert.lookupMemberNoSupers(member);
206,732
Bug 206732 [itds] Problem with ITDs appearing to be applied twice (and clashing) for binary types
As reported by Josh on the mailing list: I have the following 2 files: Advised.aj: package bugs; public class Advised {} aspect ITD { public void Advised.f() {} } Ref.aj: package notbugs; import bugs.Advised; public class Ref { public void g() { new Advised().f(); } } I am attempting to build Advised.aj into a jar, and refer to it from Ref.aj, using the following ant build.xml: <?xml version="1.0"?> <project name="Bugs" basedir="C:\workplace\imds\Bugs" xmlns:aj="antlib:org.aspectj"> <taskdef uri="antlib:org.aspectj" resource="org/aspectj/antlib.xml" classpath="./aspectjtools.jar"/> <target name="clean"> <delete dir="bugs" includes="**/*.class"/> <delete dir="notbugs" includes="**/*.class"/> </target> <target name="task1"> <aj:iajc srcdir="." destdir="." source="1.5" target="1.5"> <classpath location=".\aspectjrt.jar"/> <include name="bugs/Advised.aj"/> </aj:iajc> </target> <target name="task2"> <aj:iajc source="1.5" target="1.5" srcdir="."> <classpath location=".\aspectjrt.jar"/> <aspectpath location="."/> <include name="notbugs/Ref.aj"/> </aj:iajc> </target> </project> From within Eclipse, there are no build errors because this is all one project. On the command line, however, once I execute ant task2, I get the following marvelous error message which suggests that ajc is trying to ITD f into a class it already ITDd f into before: [aj:iajc] error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() [aj:iajc] MessageHolder: (8 info) (1 error) [aj:iajc] [error 0]: error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() Let me also say that in my real use-case, the jar produced by task1 will contain aspects that should apply to clients thereof, and as such, that jar should indeed be in the aspectpath (not the classpath) for task2 (unless I am seriously misunderstanding something). How to stop this duplicate attempt to ITD? Josh --- Josh is correct that using aspectpath will pull in the aspects for application to other types, the problem is that when pulling in type Advised, we reapply known ITDs and it clashes with the one added in the original build of the type. Two possible fixes that I am looking at: - don't reapply the ITDs (they are added to ensure type system is consistent) to binary types pulled in from the aspectpath - recognize the ITD is clashing with a member previously applied through the same ITD I am not sure we can determine it came from the aspectpath at the point the clash is detected. I have option (2) already implemented, but I'll try a little more with option 1 before giving up ;)
resolved fixed
797ec4d
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2007-10-18T11:03:05Z
2007-10-18T09:33:20Z
weaver/src/org/aspectj/weaver/ResolvedType.java
if (ret==null) supert = supert.getSuperclass(); } return ret; } /** * as lookupMemberNoSupers, but does not include ITDs * * @param member * @return */ public ResolvedMember lookupDirectlyDeclaredMemberNoSupers(Member member) { ResolvedMember ret; if (member.getKind() == Member.FIELD) { ret = lookupMember(member, getDeclaredFields()); } else { ret = lookupMember(member, getDeclaredMethods()); } return ret; } /** * This lookup has specialized behaviour - a null result tells the * EclipseTypeMunger that it should make a default implementation of a * method on this type. * * @param member * @return
206,732
Bug 206732 [itds] Problem with ITDs appearing to be applied twice (and clashing) for binary types
As reported by Josh on the mailing list: I have the following 2 files: Advised.aj: package bugs; public class Advised {} aspect ITD { public void Advised.f() {} } Ref.aj: package notbugs; import bugs.Advised; public class Ref { public void g() { new Advised().f(); } } I am attempting to build Advised.aj into a jar, and refer to it from Ref.aj, using the following ant build.xml: <?xml version="1.0"?> <project name="Bugs" basedir="C:\workplace\imds\Bugs" xmlns:aj="antlib:org.aspectj"> <taskdef uri="antlib:org.aspectj" resource="org/aspectj/antlib.xml" classpath="./aspectjtools.jar"/> <target name="clean"> <delete dir="bugs" includes="**/*.class"/> <delete dir="notbugs" includes="**/*.class"/> </target> <target name="task1"> <aj:iajc srcdir="." destdir="." source="1.5" target="1.5"> <classpath location=".\aspectjrt.jar"/> <include name="bugs/Advised.aj"/> </aj:iajc> </target> <target name="task2"> <aj:iajc source="1.5" target="1.5" srcdir="."> <classpath location=".\aspectjrt.jar"/> <aspectpath location="."/> <include name="notbugs/Ref.aj"/> </aj:iajc> </target> </project> From within Eclipse, there are no build errors because this is all one project. On the command line, however, once I execute ant task2, I get the following marvelous error message which suggests that ajc is trying to ITD f into a class it already ITDd f into before: [aj:iajc] error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() [aj:iajc] MessageHolder: (8 info) (1 error) [aj:iajc] [error 0]: error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() Let me also say that in my real use-case, the jar produced by task1 will contain aspects that should apply to clients thereof, and as such, that jar should indeed be in the aspectpath (not the classpath) for task2 (unless I am seriously misunderstanding something). How to stop this duplicate attempt to ITD? Josh --- Josh is correct that using aspectpath will pull in the aspects for application to other types, the problem is that when pulling in type Advised, we reapply known ITDs and it clashes with the one added in the original build of the type. Two possible fixes that I am looking at: - don't reapply the ITDs (they are added to ensure type system is consistent) to binary types pulled in from the aspectpath - recognize the ITD is clashing with a member previously applied through the same ITD I am not sure we can determine it came from the aspectpath at the point the clash is detected. I have option (2) already implemented, but I'll try a little more with option 1 before giving up ;)
resolved fixed
797ec4d
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2007-10-18T11:03:05Z
2007-10-18T09:33:20Z
weaver/src/org/aspectj/weaver/ResolvedType.java
*/ public ResolvedMember lookupMemberIncludingITDsOnInterfaces(Member member) { return lookupMemberIncludingITDsOnInterfaces(member, this); } private ResolvedMember lookupMemberIncludingITDsOnInterfaces(Member member, ResolvedType onType) { ResolvedMember ret = onType.lookupMemberNoSupers(member); if (ret != null) { return ret; } else { ResolvedType superType = onType.getSuperclass(); if (superType != null) { ret = lookupMemberIncludingITDsOnInterfaces(member,superType); } if (ret == null) { ResolvedType[] superInterfaces = onType.getDeclaredInterfaces(); for (int i = 0; i < superInterfaces.length; i++) { ret = superInterfaces[i].lookupMethodInITDs(member); if (ret != null) return ret; } } } return ret; } protected List interTypeMungers = new ArrayList(0); public List getInterTypeMungers() { return interTypeMungers;
206,732
Bug 206732 [itds] Problem with ITDs appearing to be applied twice (and clashing) for binary types
As reported by Josh on the mailing list: I have the following 2 files: Advised.aj: package bugs; public class Advised {} aspect ITD { public void Advised.f() {} } Ref.aj: package notbugs; import bugs.Advised; public class Ref { public void g() { new Advised().f(); } } I am attempting to build Advised.aj into a jar, and refer to it from Ref.aj, using the following ant build.xml: <?xml version="1.0"?> <project name="Bugs" basedir="C:\workplace\imds\Bugs" xmlns:aj="antlib:org.aspectj"> <taskdef uri="antlib:org.aspectj" resource="org/aspectj/antlib.xml" classpath="./aspectjtools.jar"/> <target name="clean"> <delete dir="bugs" includes="**/*.class"/> <delete dir="notbugs" includes="**/*.class"/> </target> <target name="task1"> <aj:iajc srcdir="." destdir="." source="1.5" target="1.5"> <classpath location=".\aspectjrt.jar"/> <include name="bugs/Advised.aj"/> </aj:iajc> </target> <target name="task2"> <aj:iajc source="1.5" target="1.5" srcdir="."> <classpath location=".\aspectjrt.jar"/> <aspectpath location="."/> <include name="notbugs/Ref.aj"/> </aj:iajc> </target> </project> From within Eclipse, there are no build errors because this is all one project. On the command line, however, once I execute ant task2, I get the following marvelous error message which suggests that ajc is trying to ITD f into a class it already ITDd f into before: [aj:iajc] error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() [aj:iajc] MessageHolder: (8 info) (1 error) [aj:iajc] [error 0]: error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() Let me also say that in my real use-case, the jar produced by task1 will contain aspects that should apply to clients thereof, and as such, that jar should indeed be in the aspectpath (not the classpath) for task2 (unless I am seriously misunderstanding something). How to stop this duplicate attempt to ITD? Josh --- Josh is correct that using aspectpath will pull in the aspects for application to other types, the problem is that when pulling in type Advised, we reapply known ITDs and it clashes with the one added in the original build of the type. Two possible fixes that I am looking at: - don't reapply the ITDs (they are added to ensure type system is consistent) to binary types pulled in from the aspectpath - recognize the ITD is clashing with a member previously applied through the same ITD I am not sure we can determine it came from the aspectpath at the point the clash is detected. I have option (2) already implemented, but I'll try a little more with option 1 before giving up ;)
resolved fixed
797ec4d
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2007-10-18T11:03:05Z
2007-10-18T09:33:20Z
weaver/src/org/aspectj/weaver/ResolvedType.java
} public List getInterTypeParentMungers() { List l = new ArrayList(); for (Iterator iter = interTypeMungers.iterator(); iter.hasNext();) { ConcreteTypeMunger element = (ConcreteTypeMunger) iter.next(); if (element.getMunger() instanceof NewParentTypeMunger) l.add(element); } return l; } /** * ??? This method is O(N*M) where N = number of methods and M is number of * inter-type declarations in my super */ public List getInterTypeMungersIncludingSupers() { ArrayList ret = new ArrayList(); collectInterTypeMungers(ret); return ret; } public List getInterTypeParentMungersIncludingSupers() { ArrayList ret = new ArrayList(); collectInterTypeParentMungers(ret); return ret; } private void collectInterTypeParentMungers(List collector) { for (Iterator iter = getDirectSupertypes(); iter.hasNext();) { ResolvedType superType = (ResolvedType) iter.next();
206,732
Bug 206732 [itds] Problem with ITDs appearing to be applied twice (and clashing) for binary types
As reported by Josh on the mailing list: I have the following 2 files: Advised.aj: package bugs; public class Advised {} aspect ITD { public void Advised.f() {} } Ref.aj: package notbugs; import bugs.Advised; public class Ref { public void g() { new Advised().f(); } } I am attempting to build Advised.aj into a jar, and refer to it from Ref.aj, using the following ant build.xml: <?xml version="1.0"?> <project name="Bugs" basedir="C:\workplace\imds\Bugs" xmlns:aj="antlib:org.aspectj"> <taskdef uri="antlib:org.aspectj" resource="org/aspectj/antlib.xml" classpath="./aspectjtools.jar"/> <target name="clean"> <delete dir="bugs" includes="**/*.class"/> <delete dir="notbugs" includes="**/*.class"/> </target> <target name="task1"> <aj:iajc srcdir="." destdir="." source="1.5" target="1.5"> <classpath location=".\aspectjrt.jar"/> <include name="bugs/Advised.aj"/> </aj:iajc> </target> <target name="task2"> <aj:iajc source="1.5" target="1.5" srcdir="."> <classpath location=".\aspectjrt.jar"/> <aspectpath location="."/> <include name="notbugs/Ref.aj"/> </aj:iajc> </target> </project> From within Eclipse, there are no build errors because this is all one project. On the command line, however, once I execute ant task2, I get the following marvelous error message which suggests that ajc is trying to ITD f into a class it already ITDd f into before: [aj:iajc] error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() [aj:iajc] MessageHolder: (8 info) (1 error) [aj:iajc] [error 0]: error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() Let me also say that in my real use-case, the jar produced by task1 will contain aspects that should apply to clients thereof, and as such, that jar should indeed be in the aspectpath (not the classpath) for task2 (unless I am seriously misunderstanding something). How to stop this duplicate attempt to ITD? Josh --- Josh is correct that using aspectpath will pull in the aspects for application to other types, the problem is that when pulling in type Advised, we reapply known ITDs and it clashes with the one added in the original build of the type. Two possible fixes that I am looking at: - don't reapply the ITDs (they are added to ensure type system is consistent) to binary types pulled in from the aspectpath - recognize the ITD is clashing with a member previously applied through the same ITD I am not sure we can determine it came from the aspectpath at the point the clash is detected. I have option (2) already implemented, but I'll try a little more with option 1 before giving up ;)
resolved fixed
797ec4d
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2007-10-18T11:03:05Z
2007-10-18T09:33:20Z
weaver/src/org/aspectj/weaver/ResolvedType.java
superType.collectInterTypeParentMungers(collector); } collector.addAll(getInterTypeParentMungers()); } protected void collectInterTypeMungers(List collector) { for (Iterator iter = getDirectSupertypes(); iter.hasNext();) { ResolvedType superType = (ResolvedType) iter.next(); superType.collectInterTypeMungers(collector); } outer: for (Iterator iter1 = collector.iterator(); iter1.hasNext();) { ConcreteTypeMunger superMunger = (ConcreteTypeMunger) iter1.next(); if ( superMunger.getSignature() == null) continue; if ( !superMunger.getSignature().isAbstract()) continue; for (Iterator iter = getInterTypeMungers().iterator(); iter.hasNext();) { ConcreteTypeMunger myMunger = (ConcreteTypeMunger) iter.next(); if (conflictingSignature(myMunger.getSignature(), superMunger.getSignature())) { iter1.remove(); continue outer; } } if (!superMunger.getSignature().isPublic()) continue; for (Iterator iter = getMethods(); iter.hasNext(); ) {
206,732
Bug 206732 [itds] Problem with ITDs appearing to be applied twice (and clashing) for binary types
As reported by Josh on the mailing list: I have the following 2 files: Advised.aj: package bugs; public class Advised {} aspect ITD { public void Advised.f() {} } Ref.aj: package notbugs; import bugs.Advised; public class Ref { public void g() { new Advised().f(); } } I am attempting to build Advised.aj into a jar, and refer to it from Ref.aj, using the following ant build.xml: <?xml version="1.0"?> <project name="Bugs" basedir="C:\workplace\imds\Bugs" xmlns:aj="antlib:org.aspectj"> <taskdef uri="antlib:org.aspectj" resource="org/aspectj/antlib.xml" classpath="./aspectjtools.jar"/> <target name="clean"> <delete dir="bugs" includes="**/*.class"/> <delete dir="notbugs" includes="**/*.class"/> </target> <target name="task1"> <aj:iajc srcdir="." destdir="." source="1.5" target="1.5"> <classpath location=".\aspectjrt.jar"/> <include name="bugs/Advised.aj"/> </aj:iajc> </target> <target name="task2"> <aj:iajc source="1.5" target="1.5" srcdir="."> <classpath location=".\aspectjrt.jar"/> <aspectpath location="."/> <include name="notbugs/Ref.aj"/> </aj:iajc> </target> </project> From within Eclipse, there are no build errors because this is all one project. On the command line, however, once I execute ant task2, I get the following marvelous error message which suggests that ajc is trying to ITD f into a class it already ITDd f into before: [aj:iajc] error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() [aj:iajc] MessageHolder: (8 info) (1 error) [aj:iajc] [error 0]: error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() Let me also say that in my real use-case, the jar produced by task1 will contain aspects that should apply to clients thereof, and as such, that jar should indeed be in the aspectpath (not the classpath) for task2 (unless I am seriously misunderstanding something). How to stop this duplicate attempt to ITD? Josh --- Josh is correct that using aspectpath will pull in the aspects for application to other types, the problem is that when pulling in type Advised, we reapply known ITDs and it clashes with the one added in the original build of the type. Two possible fixes that I am looking at: - don't reapply the ITDs (they are added to ensure type system is consistent) to binary types pulled in from the aspectpath - recognize the ITD is clashing with a member previously applied through the same ITD I am not sure we can determine it came from the aspectpath at the point the clash is detected. I have option (2) already implemented, but I'll try a little more with option 1 before giving up ;)
resolved fixed
797ec4d
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2007-10-18T11:03:05Z
2007-10-18T09:33:20Z
weaver/src/org/aspectj/weaver/ResolvedType.java
ResolvedMember method = (ResolvedMember)iter.next(); if (conflictingSignature(method, superMunger.getSignature())) { iter1.remove(); continue outer; } } } collector.addAll(getInterTypeMungers()); } /** * Check: * 1) That we don't have any abstract type mungers unless this type is abstract. * 2) That an abstract ITDM on an interface is declared public. (Compiler limitation) (PR70794) */ public void checkInterTypeMungers() { if (isAbstract()) return; boolean itdProblem = false; for (Iterator iter = getInterTypeMungersIncludingSupers().iterator(); iter.hasNext();) { ConcreteTypeMunger munger = (ConcreteTypeMunger) iter.next(); itdProblem = checkAbstractDeclaration(munger) || itdProblem; Rule 2 } if (itdProblem) return;
206,732
Bug 206732 [itds] Problem with ITDs appearing to be applied twice (and clashing) for binary types
As reported by Josh on the mailing list: I have the following 2 files: Advised.aj: package bugs; public class Advised {} aspect ITD { public void Advised.f() {} } Ref.aj: package notbugs; import bugs.Advised; public class Ref { public void g() { new Advised().f(); } } I am attempting to build Advised.aj into a jar, and refer to it from Ref.aj, using the following ant build.xml: <?xml version="1.0"?> <project name="Bugs" basedir="C:\workplace\imds\Bugs" xmlns:aj="antlib:org.aspectj"> <taskdef uri="antlib:org.aspectj" resource="org/aspectj/antlib.xml" classpath="./aspectjtools.jar"/> <target name="clean"> <delete dir="bugs" includes="**/*.class"/> <delete dir="notbugs" includes="**/*.class"/> </target> <target name="task1"> <aj:iajc srcdir="." destdir="." source="1.5" target="1.5"> <classpath location=".\aspectjrt.jar"/> <include name="bugs/Advised.aj"/> </aj:iajc> </target> <target name="task2"> <aj:iajc source="1.5" target="1.5" srcdir="."> <classpath location=".\aspectjrt.jar"/> <aspectpath location="."/> <include name="notbugs/Ref.aj"/> </aj:iajc> </target> </project> From within Eclipse, there are no build errors because this is all one project. On the command line, however, once I execute ant task2, I get the following marvelous error message which suggests that ajc is trying to ITD f into a class it already ITDd f into before: [aj:iajc] error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() [aj:iajc] MessageHolder: (8 info) (1 error) [aj:iajc] [error 0]: error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() Let me also say that in my real use-case, the jar produced by task1 will contain aspects that should apply to clients thereof, and as such, that jar should indeed be in the aspectpath (not the classpath) for task2 (unless I am seriously misunderstanding something). How to stop this duplicate attempt to ITD? Josh --- Josh is correct that using aspectpath will pull in the aspects for application to other types, the problem is that when pulling in type Advised, we reapply known ITDs and it clashes with the one added in the original build of the type. Two possible fixes that I am looking at: - don't reapply the ITDs (they are added to ensure type system is consistent) to binary types pulled in from the aspectpath - recognize the ITD is clashing with a member previously applied through the same ITD I am not sure we can determine it came from the aspectpath at the point the clash is detected. I have option (2) already implemented, but I'll try a little more with option 1 before giving up ;)
resolved fixed
797ec4d
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2007-10-18T11:03:05Z
2007-10-18T09:33:20Z
weaver/src/org/aspectj/weaver/ResolvedType.java
for (Iterator iter = getInterTypeMungersIncludingSupers().iterator(); iter.hasNext();) { ConcreteTypeMunger munger = (ConcreteTypeMunger) iter.next(); if (munger.getSignature() != null && munger.getSignature().isAbstract()) { Rule 1 if (munger.getMunger().getKind() == ResolvedTypeMunger.MethodDelegate) { ; } else { world.getMessageHandler().handleMessage( new Message("must implement abstract inter-type declaration: " + munger.getSignature(), "", IMessage.ERROR, getSourceLocation(), null, new ISourceLocation[] { getMungerLocation(munger) })); } } } } /** * See PR70794. This method checks that if an abstract inter-type method declaration is made on * an interface then it must also be public. * This is a compiler limitation that could be made to work in the future (if someone * provides a worthwhile usecase) * * @return indicates if the munger failed the check */ private boolean checkAbstractDeclaration(ConcreteTypeMunger munger) { if (munger.getMunger()!=null && (munger.getMunger() instanceof NewMethodTypeMunger)) { ResolvedMember itdMember = munger.getSignature(); ResolvedType onType = itdMember.getDeclaringType().resolve(world); if (onType.isInterface() && itdMember.isAbstract() && !itdMember.isPublic()) { world.getMessageHandler().handleMessage( new Message(WeaverMessages.format(WeaverMessages.ITD_ABSTRACT_MUST_BE_PUBLIC_ON_INTERFACE,munger.getSignature(),onType),"",
206,732
Bug 206732 [itds] Problem with ITDs appearing to be applied twice (and clashing) for binary types
As reported by Josh on the mailing list: I have the following 2 files: Advised.aj: package bugs; public class Advised {} aspect ITD { public void Advised.f() {} } Ref.aj: package notbugs; import bugs.Advised; public class Ref { public void g() { new Advised().f(); } } I am attempting to build Advised.aj into a jar, and refer to it from Ref.aj, using the following ant build.xml: <?xml version="1.0"?> <project name="Bugs" basedir="C:\workplace\imds\Bugs" xmlns:aj="antlib:org.aspectj"> <taskdef uri="antlib:org.aspectj" resource="org/aspectj/antlib.xml" classpath="./aspectjtools.jar"/> <target name="clean"> <delete dir="bugs" includes="**/*.class"/> <delete dir="notbugs" includes="**/*.class"/> </target> <target name="task1"> <aj:iajc srcdir="." destdir="." source="1.5" target="1.5"> <classpath location=".\aspectjrt.jar"/> <include name="bugs/Advised.aj"/> </aj:iajc> </target> <target name="task2"> <aj:iajc source="1.5" target="1.5" srcdir="."> <classpath location=".\aspectjrt.jar"/> <aspectpath location="."/> <include name="notbugs/Ref.aj"/> </aj:iajc> </target> </project> From within Eclipse, there are no build errors because this is all one project. On the command line, however, once I execute ant task2, I get the following marvelous error message which suggests that ajc is trying to ITD f into a class it already ITDd f into before: [aj:iajc] error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() [aj:iajc] MessageHolder: (8 info) (1 error) [aj:iajc] [error 0]: error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() Let me also say that in my real use-case, the jar produced by task1 will contain aspects that should apply to clients thereof, and as such, that jar should indeed be in the aspectpath (not the classpath) for task2 (unless I am seriously misunderstanding something). How to stop this duplicate attempt to ITD? Josh --- Josh is correct that using aspectpath will pull in the aspects for application to other types, the problem is that when pulling in type Advised, we reapply known ITDs and it clashes with the one added in the original build of the type. Two possible fixes that I am looking at: - don't reapply the ITDs (they are added to ensure type system is consistent) to binary types pulled in from the aspectpath - recognize the ITD is clashing with a member previously applied through the same ITD I am not sure we can determine it came from the aspectpath at the point the clash is detected. I have option (2) already implemented, but I'll try a little more with option 1 before giving up ;)
resolved fixed
797ec4d
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2007-10-18T11:03:05Z
2007-10-18T09:33:20Z
weaver/src/org/aspectj/weaver/ResolvedType.java
Message.ERROR,getSourceLocation(),null, new ISourceLocation[]{getMungerLocation(munger)}) ); return true; } } return false; } /** * Get a source location for the munger. * Until intertype mungers remember where they came from, the source location * for the munger itself is null. In these cases use the * source location for the aspect containing the ITD. */ private ISourceLocation getMungerLocation(ConcreteTypeMunger munger) { ISourceLocation sloc = munger.getSourceLocation(); if (sloc == null) { sloc = munger.getAspectType().getSourceLocation(); } return sloc; } /** * Returns a ResolvedType object representing the declaring type of this type, or * null if this type does not represent a non-package-level-type. * <p/> * <strong>Warning</strong>: This is guaranteed to work for all member types. * For anonymous/local types, the only guarantee is given in JLS 13.1, where * it guarantees that if you call getDeclaringType() repeatedly, you will eventually
206,732
Bug 206732 [itds] Problem with ITDs appearing to be applied twice (and clashing) for binary types
As reported by Josh on the mailing list: I have the following 2 files: Advised.aj: package bugs; public class Advised {} aspect ITD { public void Advised.f() {} } Ref.aj: package notbugs; import bugs.Advised; public class Ref { public void g() { new Advised().f(); } } I am attempting to build Advised.aj into a jar, and refer to it from Ref.aj, using the following ant build.xml: <?xml version="1.0"?> <project name="Bugs" basedir="C:\workplace\imds\Bugs" xmlns:aj="antlib:org.aspectj"> <taskdef uri="antlib:org.aspectj" resource="org/aspectj/antlib.xml" classpath="./aspectjtools.jar"/> <target name="clean"> <delete dir="bugs" includes="**/*.class"/> <delete dir="notbugs" includes="**/*.class"/> </target> <target name="task1"> <aj:iajc srcdir="." destdir="." source="1.5" target="1.5"> <classpath location=".\aspectjrt.jar"/> <include name="bugs/Advised.aj"/> </aj:iajc> </target> <target name="task2"> <aj:iajc source="1.5" target="1.5" srcdir="."> <classpath location=".\aspectjrt.jar"/> <aspectpath location="."/> <include name="notbugs/Ref.aj"/> </aj:iajc> </target> </project> From within Eclipse, there are no build errors because this is all one project. On the command line, however, once I execute ant task2, I get the following marvelous error message which suggests that ajc is trying to ITD f into a class it already ITDd f into before: [aj:iajc] error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() [aj:iajc] MessageHolder: (8 info) (1 error) [aj:iajc] [error 0]: error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() Let me also say that in my real use-case, the jar produced by task1 will contain aspects that should apply to clients thereof, and as such, that jar should indeed be in the aspectpath (not the classpath) for task2 (unless I am seriously misunderstanding something). How to stop this duplicate attempt to ITD? Josh --- Josh is correct that using aspectpath will pull in the aspects for application to other types, the problem is that when pulling in type Advised, we reapply known ITDs and it clashes with the one added in the original build of the type. Two possible fixes that I am looking at: - don't reapply the ITDs (they are added to ensure type system is consistent) to binary types pulled in from the aspectpath - recognize the ITD is clashing with a member previously applied through the same ITD I am not sure we can determine it came from the aspectpath at the point the clash is detected. I have option (2) already implemented, but I'll try a little more with option 1 before giving up ;)
resolved fixed
797ec4d
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2007-10-18T11:03:05Z
2007-10-18T09:33:20Z
weaver/src/org/aspectj/weaver/ResolvedType.java
* get the top-level class, but it does not say anything about classes in between. * * @return the declaring UnresolvedType object, or null. */ public ResolvedType getDeclaringType() { if (isArray()) return null; String name = getName(); int lastDollar = name.lastIndexOf('$'); while (lastDollar >0) { ResolvedType ret = world.resolve(UnresolvedType.forName(name.substring(0, lastDollar)), true); if (!ResolvedType.isMissing(ret)) return ret; lastDollar = name.lastIndexOf('$', lastDollar-1); } return null; } public static boolean isVisible(int modifiers, ResolvedType targetType, ResolvedType fromType) { if (Modifier.isPublic(modifiers)) { return true; } else if (Modifier.isPrivate(modifiers)) { return targetType.getOutermostType().equals(fromType.getOutermostType()); } else if (Modifier.isProtected(modifiers)) { return samePackage(targetType, fromType) || targetType.isAssignableFrom(fromType); } else { return samePackage(targetType, fromType); } }
206,732
Bug 206732 [itds] Problem with ITDs appearing to be applied twice (and clashing) for binary types
As reported by Josh on the mailing list: I have the following 2 files: Advised.aj: package bugs; public class Advised {} aspect ITD { public void Advised.f() {} } Ref.aj: package notbugs; import bugs.Advised; public class Ref { public void g() { new Advised().f(); } } I am attempting to build Advised.aj into a jar, and refer to it from Ref.aj, using the following ant build.xml: <?xml version="1.0"?> <project name="Bugs" basedir="C:\workplace\imds\Bugs" xmlns:aj="antlib:org.aspectj"> <taskdef uri="antlib:org.aspectj" resource="org/aspectj/antlib.xml" classpath="./aspectjtools.jar"/> <target name="clean"> <delete dir="bugs" includes="**/*.class"/> <delete dir="notbugs" includes="**/*.class"/> </target> <target name="task1"> <aj:iajc srcdir="." destdir="." source="1.5" target="1.5"> <classpath location=".\aspectjrt.jar"/> <include name="bugs/Advised.aj"/> </aj:iajc> </target> <target name="task2"> <aj:iajc source="1.5" target="1.5" srcdir="."> <classpath location=".\aspectjrt.jar"/> <aspectpath location="."/> <include name="notbugs/Ref.aj"/> </aj:iajc> </target> </project> From within Eclipse, there are no build errors because this is all one project. On the command line, however, once I execute ant task2, I get the following marvelous error message which suggests that ajc is trying to ITD f into a class it already ITDd f into before: [aj:iajc] error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() [aj:iajc] MessageHolder: (8 info) (1 error) [aj:iajc] [error 0]: error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() Let me also say that in my real use-case, the jar produced by task1 will contain aspects that should apply to clients thereof, and as such, that jar should indeed be in the aspectpath (not the classpath) for task2 (unless I am seriously misunderstanding something). How to stop this duplicate attempt to ITD? Josh --- Josh is correct that using aspectpath will pull in the aspects for application to other types, the problem is that when pulling in type Advised, we reapply known ITDs and it clashes with the one added in the original build of the type. Two possible fixes that I am looking at: - don't reapply the ITDs (they are added to ensure type system is consistent) to binary types pulled in from the aspectpath - recognize the ITD is clashing with a member previously applied through the same ITD I am not sure we can determine it came from the aspectpath at the point the clash is detected. I have option (2) already implemented, but I'll try a little more with option 1 before giving up ;)
resolved fixed
797ec4d
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2007-10-18T11:03:05Z
2007-10-18T09:33:20Z
weaver/src/org/aspectj/weaver/ResolvedType.java
public static boolean hasBridgeModifier(int modifiers) { return (modifiers & Constants.ACC_BRIDGE)!=0; } private static boolean samePackage( ResolvedType targetType, ResolvedType fromType) { String p1 = targetType.getPackageName(); String p2 = fromType.getPackageName(); if (p1 == null) return p2 == null; if (p2 == null) return false; return p1.equals(p2); } /** * Checks if the generic type for 'this' and the generic type for 'other' are the same - * it can be passed raw or parameterized versions and will just compare the underlying * generic type. */ private boolean genericTypeEquals(ResolvedType other) { ResolvedType rt = other; if (rt.isParameterizedType() || rt.isRawType()) rt.getGenericType(); if (( (isParameterizedType() || isRawType()) && getGenericType().equals(rt)) || (this.equals(other))) return true; return false; } /** * Look up the actual occurence of a particular type in the hierarchy for * 'this' type. The input is going to be a generic type, and the caller * wants to know if it was used in its RAW or a PARAMETERIZED form in this
206,732
Bug 206732 [itds] Problem with ITDs appearing to be applied twice (and clashing) for binary types
As reported by Josh on the mailing list: I have the following 2 files: Advised.aj: package bugs; public class Advised {} aspect ITD { public void Advised.f() {} } Ref.aj: package notbugs; import bugs.Advised; public class Ref { public void g() { new Advised().f(); } } I am attempting to build Advised.aj into a jar, and refer to it from Ref.aj, using the following ant build.xml: <?xml version="1.0"?> <project name="Bugs" basedir="C:\workplace\imds\Bugs" xmlns:aj="antlib:org.aspectj"> <taskdef uri="antlib:org.aspectj" resource="org/aspectj/antlib.xml" classpath="./aspectjtools.jar"/> <target name="clean"> <delete dir="bugs" includes="**/*.class"/> <delete dir="notbugs" includes="**/*.class"/> </target> <target name="task1"> <aj:iajc srcdir="." destdir="." source="1.5" target="1.5"> <classpath location=".\aspectjrt.jar"/> <include name="bugs/Advised.aj"/> </aj:iajc> </target> <target name="task2"> <aj:iajc source="1.5" target="1.5" srcdir="."> <classpath location=".\aspectjrt.jar"/> <aspectpath location="."/> <include name="notbugs/Ref.aj"/> </aj:iajc> </target> </project> From within Eclipse, there are no build errors because this is all one project. On the command line, however, once I execute ant task2, I get the following marvelous error message which suggests that ajc is trying to ITD f into a class it already ITDd f into before: [aj:iajc] error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() [aj:iajc] MessageHolder: (8 info) (1 error) [aj:iajc] [error 0]: error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() Let me also say that in my real use-case, the jar produced by task1 will contain aspects that should apply to clients thereof, and as such, that jar should indeed be in the aspectpath (not the classpath) for task2 (unless I am seriously misunderstanding something). How to stop this duplicate attempt to ITD? Josh --- Josh is correct that using aspectpath will pull in the aspects for application to other types, the problem is that when pulling in type Advised, we reapply known ITDs and it clashes with the one added in the original build of the type. Two possible fixes that I am looking at: - don't reapply the ITDs (they are added to ensure type system is consistent) to binary types pulled in from the aspectpath - recognize the ITD is clashing with a member previously applied through the same ITD I am not sure we can determine it came from the aspectpath at the point the clash is detected. I have option (2) already implemented, but I'll try a little more with option 1 before giving up ;)
resolved fixed
797ec4d
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2007-10-18T11:03:05Z
2007-10-18T09:33:20Z
weaver/src/org/aspectj/weaver/ResolvedType.java
* hierarchy. * * returns null if it can't be found. */ public ResolvedType discoverActualOccurrenceOfTypeInHierarchy(ResolvedType lookingFor) { if (!lookingFor.isGenericType()) throw new BCException("assertion failed: method should only be called with generic type, but "+lookingFor+" is "+lookingFor.typeKind); if (this.equals(ResolvedType.OBJECT)) return null; if (genericTypeEquals(lookingFor)) return this; ResolvedType superT = getSuperclass(); if (superT.genericTypeEquals(lookingFor)) return superT; ResolvedType[] superIs = getDeclaredInterfaces(); for (int i = 0; i < superIs.length; i++) { ResolvedType superI = superIs[i]; if (superI.genericTypeEquals(lookingFor)) return superI; ResolvedType checkTheSuperI = superI.discoverActualOccurrenceOfTypeInHierarchy(lookingFor); if (checkTheSuperI!=null) return checkTheSuperI; } return superT.discoverActualOccurrenceOfTypeInHierarchy(lookingFor); } /** * Called for all type mungers but only does something if they share type variables * with a generic type which they target. When this happens this routine will check * for the target type in the target hierarchy and 'bind' any type parameters as * appropriate. For example, for the ITD "List<T> I<T>.x" against a type like this: * "class A implements I<String>" this routine will return a parameterized form of * the ITD "List<String> I.x" */ public ConcreteTypeMunger fillInAnyTypeParameters(ConcreteTypeMunger munger) { boolean debug = false;
206,732
Bug 206732 [itds] Problem with ITDs appearing to be applied twice (and clashing) for binary types
As reported by Josh on the mailing list: I have the following 2 files: Advised.aj: package bugs; public class Advised {} aspect ITD { public void Advised.f() {} } Ref.aj: package notbugs; import bugs.Advised; public class Ref { public void g() { new Advised().f(); } } I am attempting to build Advised.aj into a jar, and refer to it from Ref.aj, using the following ant build.xml: <?xml version="1.0"?> <project name="Bugs" basedir="C:\workplace\imds\Bugs" xmlns:aj="antlib:org.aspectj"> <taskdef uri="antlib:org.aspectj" resource="org/aspectj/antlib.xml" classpath="./aspectjtools.jar"/> <target name="clean"> <delete dir="bugs" includes="**/*.class"/> <delete dir="notbugs" includes="**/*.class"/> </target> <target name="task1"> <aj:iajc srcdir="." destdir="." source="1.5" target="1.5"> <classpath location=".\aspectjrt.jar"/> <include name="bugs/Advised.aj"/> </aj:iajc> </target> <target name="task2"> <aj:iajc source="1.5" target="1.5" srcdir="."> <classpath location=".\aspectjrt.jar"/> <aspectpath location="."/> <include name="notbugs/Ref.aj"/> </aj:iajc> </target> </project> From within Eclipse, there are no build errors because this is all one project. On the command line, however, once I execute ant task2, I get the following marvelous error message which suggests that ajc is trying to ITD f into a class it already ITDd f into before: [aj:iajc] error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() [aj:iajc] MessageHolder: (8 info) (1 error) [aj:iajc] [error 0]: error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() Let me also say that in my real use-case, the jar produced by task1 will contain aspects that should apply to clients thereof, and as such, that jar should indeed be in the aspectpath (not the classpath) for task2 (unless I am seriously misunderstanding something). How to stop this duplicate attempt to ITD? Josh --- Josh is correct that using aspectpath will pull in the aspects for application to other types, the problem is that when pulling in type Advised, we reapply known ITDs and it clashes with the one added in the original build of the type. Two possible fixes that I am looking at: - don't reapply the ITDs (they are added to ensure type system is consistent) to binary types pulled in from the aspectpath - recognize the ITD is clashing with a member previously applied through the same ITD I am not sure we can determine it came from the aspectpath at the point the clash is detected. I have option (2) already implemented, but I'll try a little more with option 1 before giving up ;)
resolved fixed
797ec4d
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2007-10-18T11:03:05Z
2007-10-18T09:33:20Z
weaver/src/org/aspectj/weaver/ResolvedType.java
ResolvedMember member = munger.getSignature(); if (munger.isTargetTypeParameterized()) { if (debug) System.err.println("Processing attempted parameterization of "+munger+" targetting type "+this); if (debug) System.err.println(" This type is "+this+" ("+typeKind+")"); if (debug) System.err.println(" Signature that needs parameterizing: "+member); ResolvedType onType = world.resolve(member.getDeclaringType()).getGenericType(); member.resolve(world); if (debug) System.err.println(" Actual target ontype: "+onType+" ("+onType.typeKind+")"); ResolvedType actualTarget = discoverActualOccurrenceOfTypeInHierarchy(onType); if (actualTarget==null) throw new BCException("assertion failed: asked "+this+" for occurrence of "+onType+" in its hierarchy??"); if (!actualTarget.isGenericType()) { if (debug) System.err.println("Occurrence in "+this+" is actually "+actualTarget+" ("+actualTarget.typeKind+")"); } munger = munger.parameterizedFor(actualTarget); if (debug) System.err.println("New sig: "+munger.getSignature()); if (debug) System.err.println("====================================="); } return munger; }
206,732
Bug 206732 [itds] Problem with ITDs appearing to be applied twice (and clashing) for binary types
As reported by Josh on the mailing list: I have the following 2 files: Advised.aj: package bugs; public class Advised {} aspect ITD { public void Advised.f() {} } Ref.aj: package notbugs; import bugs.Advised; public class Ref { public void g() { new Advised().f(); } } I am attempting to build Advised.aj into a jar, and refer to it from Ref.aj, using the following ant build.xml: <?xml version="1.0"?> <project name="Bugs" basedir="C:\workplace\imds\Bugs" xmlns:aj="antlib:org.aspectj"> <taskdef uri="antlib:org.aspectj" resource="org/aspectj/antlib.xml" classpath="./aspectjtools.jar"/> <target name="clean"> <delete dir="bugs" includes="**/*.class"/> <delete dir="notbugs" includes="**/*.class"/> </target> <target name="task1"> <aj:iajc srcdir="." destdir="." source="1.5" target="1.5"> <classpath location=".\aspectjrt.jar"/> <include name="bugs/Advised.aj"/> </aj:iajc> </target> <target name="task2"> <aj:iajc source="1.5" target="1.5" srcdir="."> <classpath location=".\aspectjrt.jar"/> <aspectpath location="."/> <include name="notbugs/Ref.aj"/> </aj:iajc> </target> </project> From within Eclipse, there are no build errors because this is all one project. On the command line, however, once I execute ant task2, I get the following marvelous error message which suggests that ajc is trying to ITD f into a class it already ITDd f into before: [aj:iajc] error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() [aj:iajc] MessageHolder: (8 info) (1 error) [aj:iajc] [error 0]: error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() Let me also say that in my real use-case, the jar produced by task1 will contain aspects that should apply to clients thereof, and as such, that jar should indeed be in the aspectpath (not the classpath) for task2 (unless I am seriously misunderstanding something). How to stop this duplicate attempt to ITD? Josh --- Josh is correct that using aspectpath will pull in the aspects for application to other types, the problem is that when pulling in type Advised, we reapply known ITDs and it clashes with the one added in the original build of the type. Two possible fixes that I am looking at: - don't reapply the ITDs (they are added to ensure type system is consistent) to binary types pulled in from the aspectpath - recognize the ITD is clashing with a member previously applied through the same ITD I am not sure we can determine it came from the aspectpath at the point the clash is detected. I have option (2) already implemented, but I'll try a little more with option 1 before giving up ;)
resolved fixed
797ec4d
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2007-10-18T11:03:05Z
2007-10-18T09:33:20Z
weaver/src/org/aspectj/weaver/ResolvedType.java
public void addInterTypeMunger(ConcreteTypeMunger munger) { ResolvedMember sig = munger.getSignature(); if (sig == null || munger.getMunger() == null || munger.getMunger().getKind() == ResolvedTypeMunger.PrivilegedAccess) { interTypeMungers.add(munger); return; } ConcreteTypeMunger originalMunger = munger; munger = fillInAnyTypeParameters(munger); sig = munger.getSignature(); if (sig.getKind() == Member.METHOD) { if (!compareToExistingMembers(munger, getMethodsWithoutIterator(false,true) )) return; if (this.isInterface()) { if (!compareToExistingMembers(munger, Arrays.asList(world.getCoreType(OBJECT).getDeclaredMethods()).iterator())) return; } } else if (sig.getKind() == Member.FIELD) { if (!compareToExistingMembers(munger, Arrays.asList(getDeclaredFields()).iterator())) return; } else { if (!compareToExistingMembers(munger, Arrays.asList(getDeclaredMethods()).iterator())) return;
206,732
Bug 206732 [itds] Problem with ITDs appearing to be applied twice (and clashing) for binary types
As reported by Josh on the mailing list: I have the following 2 files: Advised.aj: package bugs; public class Advised {} aspect ITD { public void Advised.f() {} } Ref.aj: package notbugs; import bugs.Advised; public class Ref { public void g() { new Advised().f(); } } I am attempting to build Advised.aj into a jar, and refer to it from Ref.aj, using the following ant build.xml: <?xml version="1.0"?> <project name="Bugs" basedir="C:\workplace\imds\Bugs" xmlns:aj="antlib:org.aspectj"> <taskdef uri="antlib:org.aspectj" resource="org/aspectj/antlib.xml" classpath="./aspectjtools.jar"/> <target name="clean"> <delete dir="bugs" includes="**/*.class"/> <delete dir="notbugs" includes="**/*.class"/> </target> <target name="task1"> <aj:iajc srcdir="." destdir="." source="1.5" target="1.5"> <classpath location=".\aspectjrt.jar"/> <include name="bugs/Advised.aj"/> </aj:iajc> </target> <target name="task2"> <aj:iajc source="1.5" target="1.5" srcdir="."> <classpath location=".\aspectjrt.jar"/> <aspectpath location="."/> <include name="notbugs/Ref.aj"/> </aj:iajc> </target> </project> From within Eclipse, there are no build errors because this is all one project. On the command line, however, once I execute ant task2, I get the following marvelous error message which suggests that ajc is trying to ITD f into a class it already ITDd f into before: [aj:iajc] error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() [aj:iajc] MessageHolder: (8 info) (1 error) [aj:iajc] [error 0]: error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() Let me also say that in my real use-case, the jar produced by task1 will contain aspects that should apply to clients thereof, and as such, that jar should indeed be in the aspectpath (not the classpath) for task2 (unless I am seriously misunderstanding something). How to stop this duplicate attempt to ITD? Josh --- Josh is correct that using aspectpath will pull in the aspects for application to other types, the problem is that when pulling in type Advised, we reapply known ITDs and it clashes with the one added in the original build of the type. Two possible fixes that I am looking at: - don't reapply the ITDs (they are added to ensure type system is consistent) to binary types pulled in from the aspectpath - recognize the ITD is clashing with a member previously applied through the same ITD I am not sure we can determine it came from the aspectpath at the point the clash is detected. I have option (2) already implemented, but I'll try a little more with option 1 before giving up ;)
resolved fixed
797ec4d
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2007-10-18T11:03:05Z
2007-10-18T09:33:20Z
weaver/src/org/aspectj/weaver/ResolvedType.java
} for (Iterator i = interTypeMungers.iterator(); i.hasNext(); ) { ConcreteTypeMunger existingMunger = (ConcreteTypeMunger)i.next(); if (conflictingSignature(existingMunger.getSignature(), munger.getSignature())) { if (isVisible(munger.getSignature().getModifiers(), munger.getAspectType(), existingMunger.getAspectType())) { int c = compareMemberPrecedence(sig, existingMunger.getSignature()); if (c == 0) { c = getWorld().compareByPrecedenceAndHierarchy(munger.getAspectType(), existingMunger.getAspectType()); } if (c < 0) { checkLegalOverride(munger.getSignature(), existingMunger.getSignature()); return; } else if (c > 0) { checkLegalOverride(existingMunger.getSignature(), munger.getSignature()); i.remove(); break; } else { interTypeConflictError(munger, existingMunger); interTypeConflictError(existingMunger, munger); return; }
206,732
Bug 206732 [itds] Problem with ITDs appearing to be applied twice (and clashing) for binary types
As reported by Josh on the mailing list: I have the following 2 files: Advised.aj: package bugs; public class Advised {} aspect ITD { public void Advised.f() {} } Ref.aj: package notbugs; import bugs.Advised; public class Ref { public void g() { new Advised().f(); } } I am attempting to build Advised.aj into a jar, and refer to it from Ref.aj, using the following ant build.xml: <?xml version="1.0"?> <project name="Bugs" basedir="C:\workplace\imds\Bugs" xmlns:aj="antlib:org.aspectj"> <taskdef uri="antlib:org.aspectj" resource="org/aspectj/antlib.xml" classpath="./aspectjtools.jar"/> <target name="clean"> <delete dir="bugs" includes="**/*.class"/> <delete dir="notbugs" includes="**/*.class"/> </target> <target name="task1"> <aj:iajc srcdir="." destdir="." source="1.5" target="1.5"> <classpath location=".\aspectjrt.jar"/> <include name="bugs/Advised.aj"/> </aj:iajc> </target> <target name="task2"> <aj:iajc source="1.5" target="1.5" srcdir="."> <classpath location=".\aspectjrt.jar"/> <aspectpath location="."/> <include name="notbugs/Ref.aj"/> </aj:iajc> </target> </project> From within Eclipse, there are no build errors because this is all one project. On the command line, however, once I execute ant task2, I get the following marvelous error message which suggests that ajc is trying to ITD f into a class it already ITDd f into before: [aj:iajc] error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() [aj:iajc] MessageHolder: (8 info) (1 error) [aj:iajc] [error 0]: error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() Let me also say that in my real use-case, the jar produced by task1 will contain aspects that should apply to clients thereof, and as such, that jar should indeed be in the aspectpath (not the classpath) for task2 (unless I am seriously misunderstanding something). How to stop this duplicate attempt to ITD? Josh --- Josh is correct that using aspectpath will pull in the aspects for application to other types, the problem is that when pulling in type Advised, we reapply known ITDs and it clashes with the one added in the original build of the type. Two possible fixes that I am looking at: - don't reapply the ITDs (they are added to ensure type system is consistent) to binary types pulled in from the aspectpath - recognize the ITD is clashing with a member previously applied through the same ITD I am not sure we can determine it came from the aspectpath at the point the clash is detected. I have option (2) already implemented, but I'll try a little more with option 1 before giving up ;)
resolved fixed
797ec4d
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2007-10-18T11:03:05Z
2007-10-18T09:33:20Z
weaver/src/org/aspectj/weaver/ResolvedType.java
} } } interTypeMungers.add(munger); } private boolean compareToExistingMembers(ConcreteTypeMunger munger, List existingMembersList) { return compareToExistingMembers(munger,existingMembersList.iterator()); } private boolean compareToExistingMembers(ConcreteTypeMunger munger, Iterator existingMembers) { ResolvedMember sig = munger.getSignature(); while (existingMembers.hasNext()) { ResolvedMember existingMember = (ResolvedMember)existingMembers.next(); if (existingMember.isBridgeMethod()) continue; if (conflictingSignature(existingMember, munger.getSignature())) { if (isVisible(existingMember.getModifiers(), this, munger.getAspectType())) { int c = compareMemberPrecedence(sig, existingMember);
206,732
Bug 206732 [itds] Problem with ITDs appearing to be applied twice (and clashing) for binary types
As reported by Josh on the mailing list: I have the following 2 files: Advised.aj: package bugs; public class Advised {} aspect ITD { public void Advised.f() {} } Ref.aj: package notbugs; import bugs.Advised; public class Ref { public void g() { new Advised().f(); } } I am attempting to build Advised.aj into a jar, and refer to it from Ref.aj, using the following ant build.xml: <?xml version="1.0"?> <project name="Bugs" basedir="C:\workplace\imds\Bugs" xmlns:aj="antlib:org.aspectj"> <taskdef uri="antlib:org.aspectj" resource="org/aspectj/antlib.xml" classpath="./aspectjtools.jar"/> <target name="clean"> <delete dir="bugs" includes="**/*.class"/> <delete dir="notbugs" includes="**/*.class"/> </target> <target name="task1"> <aj:iajc srcdir="." destdir="." source="1.5" target="1.5"> <classpath location=".\aspectjrt.jar"/> <include name="bugs/Advised.aj"/> </aj:iajc> </target> <target name="task2"> <aj:iajc source="1.5" target="1.5" srcdir="."> <classpath location=".\aspectjrt.jar"/> <aspectpath location="."/> <include name="notbugs/Ref.aj"/> </aj:iajc> </target> </project> From within Eclipse, there are no build errors because this is all one project. On the command line, however, once I execute ant task2, I get the following marvelous error message which suggests that ajc is trying to ITD f into a class it already ITDd f into before: [aj:iajc] error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() [aj:iajc] MessageHolder: (8 info) (1 error) [aj:iajc] [error 0]: error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() Let me also say that in my real use-case, the jar produced by task1 will contain aspects that should apply to clients thereof, and as such, that jar should indeed be in the aspectpath (not the classpath) for task2 (unless I am seriously misunderstanding something). How to stop this duplicate attempt to ITD? Josh --- Josh is correct that using aspectpath will pull in the aspects for application to other types, the problem is that when pulling in type Advised, we reapply known ITDs and it clashes with the one added in the original build of the type. Two possible fixes that I am looking at: - don't reapply the ITDs (they are added to ensure type system is consistent) to binary types pulled in from the aspectpath - recognize the ITD is clashing with a member previously applied through the same ITD I am not sure we can determine it came from the aspectpath at the point the clash is detected. I have option (2) already implemented, but I'll try a little more with option 1 before giving up ;)
resolved fixed
797ec4d
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2007-10-18T11:03:05Z
2007-10-18T09:33:20Z
weaver/src/org/aspectj/weaver/ResolvedType.java
if (c < 0) { checkLegalOverride(munger.getSignature(), existingMember); return false; } else if (c > 0) { checkLegalOverride(existingMember, munger.getSignature()); continue; } else { boolean sameReturnTypes = (existingMember.getReturnType().equals(sig.getReturnType())); if (sameReturnTypes) getWorld().getMessageHandler().handleMessage( MessageUtil.error(WeaverMessages.format(WeaverMessages.ITD_MEMBER_CONFLICT,munger.getAspectType().getName(), existingMember), munger.getSourceLocation()) ); } } else if (isDuplicateMemberWithinTargetType(existingMember,this,sig)) { getWorld().getMessageHandler().handleMessage( MessageUtil.error(WeaverMessages.format(WeaverMessages.ITD_MEMBER_CONFLICT,munger.getAspectType().getName(), existingMember), munger.getSourceLocation()) ); ; }
206,732
Bug 206732 [itds] Problem with ITDs appearing to be applied twice (and clashing) for binary types
As reported by Josh on the mailing list: I have the following 2 files: Advised.aj: package bugs; public class Advised {} aspect ITD { public void Advised.f() {} } Ref.aj: package notbugs; import bugs.Advised; public class Ref { public void g() { new Advised().f(); } } I am attempting to build Advised.aj into a jar, and refer to it from Ref.aj, using the following ant build.xml: <?xml version="1.0"?> <project name="Bugs" basedir="C:\workplace\imds\Bugs" xmlns:aj="antlib:org.aspectj"> <taskdef uri="antlib:org.aspectj" resource="org/aspectj/antlib.xml" classpath="./aspectjtools.jar"/> <target name="clean"> <delete dir="bugs" includes="**/*.class"/> <delete dir="notbugs" includes="**/*.class"/> </target> <target name="task1"> <aj:iajc srcdir="." destdir="." source="1.5" target="1.5"> <classpath location=".\aspectjrt.jar"/> <include name="bugs/Advised.aj"/> </aj:iajc> </target> <target name="task2"> <aj:iajc source="1.5" target="1.5" srcdir="."> <classpath location=".\aspectjrt.jar"/> <aspectpath location="."/> <include name="notbugs/Ref.aj"/> </aj:iajc> </target> </project> From within Eclipse, there are no build errors because this is all one project. On the command line, however, once I execute ant task2, I get the following marvelous error message which suggests that ajc is trying to ITD f into a class it already ITDd f into before: [aj:iajc] error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() [aj:iajc] MessageHolder: (8 info) (1 error) [aj:iajc] [error 0]: error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() Let me also say that in my real use-case, the jar produced by task1 will contain aspects that should apply to clients thereof, and as such, that jar should indeed be in the aspectpath (not the classpath) for task2 (unless I am seriously misunderstanding something). How to stop this duplicate attempt to ITD? Josh --- Josh is correct that using aspectpath will pull in the aspects for application to other types, the problem is that when pulling in type Advised, we reapply known ITDs and it clashes with the one added in the original build of the type. Two possible fixes that I am looking at: - don't reapply the ITDs (they are added to ensure type system is consistent) to binary types pulled in from the aspectpath - recognize the ITD is clashing with a member previously applied through the same ITD I am not sure we can determine it came from the aspectpath at the point the clash is detected. I have option (2) already implemented, but I'll try a little more with option 1 before giving up ;)
resolved fixed
797ec4d
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2007-10-18T11:03:05Z
2007-10-18T09:33:20Z
weaver/src/org/aspectj/weaver/ResolvedType.java
return; } } return true; } private boolean isDuplicateMemberWithinTargetType(ResolvedMember existingMember, ResolvedType targetType,ResolvedMember itdMember) { if ( (existingMember.isAbstract() || itdMember.isAbstract())) return false; UnresolvedType declaringType = existingMember.getDeclaringType(); if (!targetType.equals(declaringType)) return false; if (itdMember.isPrivate()) return false; if (itdMember.isPublic()) return true; if (!targetType.getPackageName().equals(itdMember.getDeclaringType().getPackageName())) return false; return true; } /** * @return true if the override is legal * note: calling showMessage with two locations issues TWO messages, not ONE message * with an additional source location. */ public boolean checkLegalOverride(ResolvedMember parent, ResolvedMember child) {
206,732
Bug 206732 [itds] Problem with ITDs appearing to be applied twice (and clashing) for binary types
As reported by Josh on the mailing list: I have the following 2 files: Advised.aj: package bugs; public class Advised {} aspect ITD { public void Advised.f() {} } Ref.aj: package notbugs; import bugs.Advised; public class Ref { public void g() { new Advised().f(); } } I am attempting to build Advised.aj into a jar, and refer to it from Ref.aj, using the following ant build.xml: <?xml version="1.0"?> <project name="Bugs" basedir="C:\workplace\imds\Bugs" xmlns:aj="antlib:org.aspectj"> <taskdef uri="antlib:org.aspectj" resource="org/aspectj/antlib.xml" classpath="./aspectjtools.jar"/> <target name="clean"> <delete dir="bugs" includes="**/*.class"/> <delete dir="notbugs" includes="**/*.class"/> </target> <target name="task1"> <aj:iajc srcdir="." destdir="." source="1.5" target="1.5"> <classpath location=".\aspectjrt.jar"/> <include name="bugs/Advised.aj"/> </aj:iajc> </target> <target name="task2"> <aj:iajc source="1.5" target="1.5" srcdir="."> <classpath location=".\aspectjrt.jar"/> <aspectpath location="."/> <include name="notbugs/Ref.aj"/> </aj:iajc> </target> </project> From within Eclipse, there are no build errors because this is all one project. On the command line, however, once I execute ant task2, I get the following marvelous error message which suggests that ajc is trying to ITD f into a class it already ITDd f into before: [aj:iajc] error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() [aj:iajc] MessageHolder: (8 info) (1 error) [aj:iajc] [error 0]: error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() Let me also say that in my real use-case, the jar produced by task1 will contain aspects that should apply to clients thereof, and as such, that jar should indeed be in the aspectpath (not the classpath) for task2 (unless I am seriously misunderstanding something). How to stop this duplicate attempt to ITD? Josh --- Josh is correct that using aspectpath will pull in the aspects for application to other types, the problem is that when pulling in type Advised, we reapply known ITDs and it clashes with the one added in the original build of the type. Two possible fixes that I am looking at: - don't reapply the ITDs (they are added to ensure type system is consistent) to binary types pulled in from the aspectpath - recognize the ITD is clashing with a member previously applied through the same ITD I am not sure we can determine it came from the aspectpath at the point the clash is detected. I have option (2) already implemented, but I'll try a little more with option 1 before giving up ;)
resolved fixed
797ec4d
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2007-10-18T11:03:05Z
2007-10-18T09:33:20Z
weaver/src/org/aspectj/weaver/ResolvedType.java
if (Modifier.isFinal(parent.getModifiers())) { world.showMessage(Message.ERROR, WeaverMessages.format(WeaverMessages.CANT_OVERRIDE_FINAL_MEMBER,parent), child.getSourceLocation(),null); return false; } boolean incompatibleReturnTypes = false; if (world.isInJava5Mode() && parent.getKind()==Member.METHOD) { ResolvedType rtParentReturnType = parent.getGenericReturnType().resolve(world); ResolvedType rtChildReturnType = child.getGenericReturnType().resolve(world); incompatibleReturnTypes = !rtParentReturnType.isAssignableFrom(rtChildReturnType); if (incompatibleReturnTypes) { incompatibleReturnTypes = !rtParentReturnType.isAssignableFrom(rtChildReturnType); } } else { incompatibleReturnTypes =!parent.getReturnType().equals(child.getReturnType()); } if (incompatibleReturnTypes) { world.showMessage(IMessage.ERROR, WeaverMessages.format(WeaverMessages.ITD_RETURN_TYPE_MISMATCH,parent,child), child.getSourceLocation(), parent.getSourceLocation()); return false; } if (parent.getKind() == Member.POINTCUT) { UnresolvedType[] pTypes = parent.getParameterTypes();
206,732
Bug 206732 [itds] Problem with ITDs appearing to be applied twice (and clashing) for binary types
As reported by Josh on the mailing list: I have the following 2 files: Advised.aj: package bugs; public class Advised {} aspect ITD { public void Advised.f() {} } Ref.aj: package notbugs; import bugs.Advised; public class Ref { public void g() { new Advised().f(); } } I am attempting to build Advised.aj into a jar, and refer to it from Ref.aj, using the following ant build.xml: <?xml version="1.0"?> <project name="Bugs" basedir="C:\workplace\imds\Bugs" xmlns:aj="antlib:org.aspectj"> <taskdef uri="antlib:org.aspectj" resource="org/aspectj/antlib.xml" classpath="./aspectjtools.jar"/> <target name="clean"> <delete dir="bugs" includes="**/*.class"/> <delete dir="notbugs" includes="**/*.class"/> </target> <target name="task1"> <aj:iajc srcdir="." destdir="." source="1.5" target="1.5"> <classpath location=".\aspectjrt.jar"/> <include name="bugs/Advised.aj"/> </aj:iajc> </target> <target name="task2"> <aj:iajc source="1.5" target="1.5" srcdir="."> <classpath location=".\aspectjrt.jar"/> <aspectpath location="."/> <include name="notbugs/Ref.aj"/> </aj:iajc> </target> </project> From within Eclipse, there are no build errors because this is all one project. On the command line, however, once I execute ant task2, I get the following marvelous error message which suggests that ajc is trying to ITD f into a class it already ITDd f into before: [aj:iajc] error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() [aj:iajc] MessageHolder: (8 info) (1 error) [aj:iajc] [error 0]: error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() Let me also say that in my real use-case, the jar produced by task1 will contain aspects that should apply to clients thereof, and as such, that jar should indeed be in the aspectpath (not the classpath) for task2 (unless I am seriously misunderstanding something). How to stop this duplicate attempt to ITD? Josh --- Josh is correct that using aspectpath will pull in the aspects for application to other types, the problem is that when pulling in type Advised, we reapply known ITDs and it clashes with the one added in the original build of the type. Two possible fixes that I am looking at: - don't reapply the ITDs (they are added to ensure type system is consistent) to binary types pulled in from the aspectpath - recognize the ITD is clashing with a member previously applied through the same ITD I am not sure we can determine it came from the aspectpath at the point the clash is detected. I have option (2) already implemented, but I'll try a little more with option 1 before giving up ;)
resolved fixed
797ec4d
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2007-10-18T11:03:05Z
2007-10-18T09:33:20Z
weaver/src/org/aspectj/weaver/ResolvedType.java
UnresolvedType[] cTypes = child.getParameterTypes(); if (!Arrays.equals(pTypes, cTypes)) { world.showMessage(IMessage.ERROR, WeaverMessages.format(WeaverMessages.ITD_PARAM_TYPE_MISMATCH,parent,child), child.getSourceLocation(), parent.getSourceLocation()); return false; } } if (isMoreVisible(parent.getModifiers(), child.getModifiers())) { world.showMessage(IMessage.ERROR, WeaverMessages.format(WeaverMessages.ITD_VISIBILITY_REDUCTION,parent,child), child.getSourceLocation(), parent.getSourceLocation()); return false; } ResolvedType[] childExceptions = world.resolve(child.getExceptions()); ResolvedType[] parentExceptions = world.resolve(parent.getExceptions()); ResolvedType runtimeException = world.resolve("java.lang.RuntimeException"); ResolvedType error = world.resolve("java.lang.Error"); outer: for (int i = 0, leni = childExceptions.length; i < leni; i++) { if (runtimeException.isAssignableFrom(childExceptions[i])) continue; if (error.isAssignableFrom(childExceptions[i])) continue; for (int j = 0, lenj = parentExceptions.length; j < lenj; j++) { if (parentExceptions[j].isAssignableFrom(childExceptions[i])) continue outer;
206,732
Bug 206732 [itds] Problem with ITDs appearing to be applied twice (and clashing) for binary types
As reported by Josh on the mailing list: I have the following 2 files: Advised.aj: package bugs; public class Advised {} aspect ITD { public void Advised.f() {} } Ref.aj: package notbugs; import bugs.Advised; public class Ref { public void g() { new Advised().f(); } } I am attempting to build Advised.aj into a jar, and refer to it from Ref.aj, using the following ant build.xml: <?xml version="1.0"?> <project name="Bugs" basedir="C:\workplace\imds\Bugs" xmlns:aj="antlib:org.aspectj"> <taskdef uri="antlib:org.aspectj" resource="org/aspectj/antlib.xml" classpath="./aspectjtools.jar"/> <target name="clean"> <delete dir="bugs" includes="**/*.class"/> <delete dir="notbugs" includes="**/*.class"/> </target> <target name="task1"> <aj:iajc srcdir="." destdir="." source="1.5" target="1.5"> <classpath location=".\aspectjrt.jar"/> <include name="bugs/Advised.aj"/> </aj:iajc> </target> <target name="task2"> <aj:iajc source="1.5" target="1.5" srcdir="."> <classpath location=".\aspectjrt.jar"/> <aspectpath location="."/> <include name="notbugs/Ref.aj"/> </aj:iajc> </target> </project> From within Eclipse, there are no build errors because this is all one project. On the command line, however, once I execute ant task2, I get the following marvelous error message which suggests that ajc is trying to ITD f into a class it already ITDd f into before: [aj:iajc] error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() [aj:iajc] MessageHolder: (8 info) (1 error) [aj:iajc] [error 0]: error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() Let me also say that in my real use-case, the jar produced by task1 will contain aspects that should apply to clients thereof, and as such, that jar should indeed be in the aspectpath (not the classpath) for task2 (unless I am seriously misunderstanding something). How to stop this duplicate attempt to ITD? Josh --- Josh is correct that using aspectpath will pull in the aspects for application to other types, the problem is that when pulling in type Advised, we reapply known ITDs and it clashes with the one added in the original build of the type. Two possible fixes that I am looking at: - don't reapply the ITDs (they are added to ensure type system is consistent) to binary types pulled in from the aspectpath - recognize the ITD is clashing with a member previously applied through the same ITD I am not sure we can determine it came from the aspectpath at the point the clash is detected. I have option (2) already implemented, but I'll try a little more with option 1 before giving up ;)
resolved fixed
797ec4d
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2007-10-18T11:03:05Z
2007-10-18T09:33:20Z
weaver/src/org/aspectj/weaver/ResolvedType.java
} return false; } if (parent.isStatic() && !child.isStatic()) { world.showMessage(IMessage.ERROR, WeaverMessages.format(WeaverMessages.ITD_OVERRIDDEN_STATIC,child,parent), child.getSourceLocation(),null); return false; } else if (child.isStatic() && !parent.isStatic()) { world.showMessage(IMessage.ERROR, WeaverMessages.format(WeaverMessages.ITD_OVERIDDING_STATIC,child,parent), child.getSourceLocation(),null); return false; } return true; } private int compareMemberPrecedence(ResolvedMember m1, ResolvedMember m2) { if (m2.isProtected() && m2.getName().charAt(0)=='c') { UnresolvedType declaring = m2.getDeclaringType();
206,732
Bug 206732 [itds] Problem with ITDs appearing to be applied twice (and clashing) for binary types
As reported by Josh on the mailing list: I have the following 2 files: Advised.aj: package bugs; public class Advised {} aspect ITD { public void Advised.f() {} } Ref.aj: package notbugs; import bugs.Advised; public class Ref { public void g() { new Advised().f(); } } I am attempting to build Advised.aj into a jar, and refer to it from Ref.aj, using the following ant build.xml: <?xml version="1.0"?> <project name="Bugs" basedir="C:\workplace\imds\Bugs" xmlns:aj="antlib:org.aspectj"> <taskdef uri="antlib:org.aspectj" resource="org/aspectj/antlib.xml" classpath="./aspectjtools.jar"/> <target name="clean"> <delete dir="bugs" includes="**/*.class"/> <delete dir="notbugs" includes="**/*.class"/> </target> <target name="task1"> <aj:iajc srcdir="." destdir="." source="1.5" target="1.5"> <classpath location=".\aspectjrt.jar"/> <include name="bugs/Advised.aj"/> </aj:iajc> </target> <target name="task2"> <aj:iajc source="1.5" target="1.5" srcdir="."> <classpath location=".\aspectjrt.jar"/> <aspectpath location="."/> <include name="notbugs/Ref.aj"/> </aj:iajc> </target> </project> From within Eclipse, there are no build errors because this is all one project. On the command line, however, once I execute ant task2, I get the following marvelous error message which suggests that ajc is trying to ITD f into a class it already ITDd f into before: [aj:iajc] error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() [aj:iajc] MessageHolder: (8 info) (1 error) [aj:iajc] [error 0]: error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() Let me also say that in my real use-case, the jar produced by task1 will contain aspects that should apply to clients thereof, and as such, that jar should indeed be in the aspectpath (not the classpath) for task2 (unless I am seriously misunderstanding something). How to stop this duplicate attempt to ITD? Josh --- Josh is correct that using aspectpath will pull in the aspects for application to other types, the problem is that when pulling in type Advised, we reapply known ITDs and it clashes with the one added in the original build of the type. Two possible fixes that I am looking at: - don't reapply the ITDs (they are added to ensure type system is consistent) to binary types pulled in from the aspectpath - recognize the ITD is clashing with a member previously applied through the same ITD I am not sure we can determine it came from the aspectpath at the point the clash is detected. I have option (2) already implemented, but I'll try a little more with option 1 before giving up ;)
resolved fixed
797ec4d
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2007-10-18T11:03:05Z
2007-10-18T09:33:20Z
weaver/src/org/aspectj/weaver/ResolvedType.java
if (declaring!=null) { if (declaring.getName().equals("java.lang.Object") && m2.getName().equals("clone")) return +1; } } if (Modifier.isAbstract(m1.getModifiers())) return -1; if (Modifier.isAbstract(m2.getModifiers())) return +1; if (m1.getDeclaringType().equals(m2.getDeclaringType())) return 0; ResolvedType t1 = m1.getDeclaringType().resolve(world); ResolvedType t2 = m2.getDeclaringType().resolve(world); if (t1.isAssignableFrom(t2)) { return -1; } if (t2.isAssignableFrom(t1)) { return +1; } return 0; } public static boolean isMoreVisible(int m1, int m2) { if (Modifier.isPrivate(m1)) return false; if (isPackage(m1)) return Modifier.isPrivate(m2); if (Modifier.isProtected(m1)) return (Modifier.isPrivate(m2) || isPackage(m2)); if (Modifier.isPublic(m1)) return ! Modifier.isPublic(m2); throw new RuntimeException("bad modifier: " + m1); } private static boolean isPackage(int i) { return (0 == (i & (Modifier.PUBLIC | Modifier.PRIVATE | Modifier.PROTECTED))); }
206,732
Bug 206732 [itds] Problem with ITDs appearing to be applied twice (and clashing) for binary types
As reported by Josh on the mailing list: I have the following 2 files: Advised.aj: package bugs; public class Advised {} aspect ITD { public void Advised.f() {} } Ref.aj: package notbugs; import bugs.Advised; public class Ref { public void g() { new Advised().f(); } } I am attempting to build Advised.aj into a jar, and refer to it from Ref.aj, using the following ant build.xml: <?xml version="1.0"?> <project name="Bugs" basedir="C:\workplace\imds\Bugs" xmlns:aj="antlib:org.aspectj"> <taskdef uri="antlib:org.aspectj" resource="org/aspectj/antlib.xml" classpath="./aspectjtools.jar"/> <target name="clean"> <delete dir="bugs" includes="**/*.class"/> <delete dir="notbugs" includes="**/*.class"/> </target> <target name="task1"> <aj:iajc srcdir="." destdir="." source="1.5" target="1.5"> <classpath location=".\aspectjrt.jar"/> <include name="bugs/Advised.aj"/> </aj:iajc> </target> <target name="task2"> <aj:iajc source="1.5" target="1.5" srcdir="."> <classpath location=".\aspectjrt.jar"/> <aspectpath location="."/> <include name="notbugs/Ref.aj"/> </aj:iajc> </target> </project> From within Eclipse, there are no build errors because this is all one project. On the command line, however, once I execute ant task2, I get the following marvelous error message which suggests that ajc is trying to ITD f into a class it already ITDd f into before: [aj:iajc] error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() [aj:iajc] MessageHolder: (8 info) (1 error) [aj:iajc] [error 0]: error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() Let me also say that in my real use-case, the jar produced by task1 will contain aspects that should apply to clients thereof, and as such, that jar should indeed be in the aspectpath (not the classpath) for task2 (unless I am seriously misunderstanding something). How to stop this duplicate attempt to ITD? Josh --- Josh is correct that using aspectpath will pull in the aspects for application to other types, the problem is that when pulling in type Advised, we reapply known ITDs and it clashes with the one added in the original build of the type. Two possible fixes that I am looking at: - don't reapply the ITDs (they are added to ensure type system is consistent) to binary types pulled in from the aspectpath - recognize the ITD is clashing with a member previously applied through the same ITD I am not sure we can determine it came from the aspectpath at the point the clash is detected. I have option (2) already implemented, but I'll try a little more with option 1 before giving up ;)
resolved fixed
797ec4d
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2007-10-18T11:03:05Z
2007-10-18T09:33:20Z
weaver/src/org/aspectj/weaver/ResolvedType.java
private void interTypeConflictError( ConcreteTypeMunger m1, ConcreteTypeMunger m2) { getWorld().showMessage(IMessage.ERROR, WeaverMessages.format(WeaverMessages.ITD_CONFLICT,m1.getAspectType().getName(), m2.getSignature(),m2.getAspectType().getName()), m2.getSourceLocation(), getSourceLocation()); } public ResolvedMember lookupSyntheticMember(Member member) { for (Iterator i = interTypeMungers.iterator(); i.hasNext(); ) { ConcreteTypeMunger m = (ConcreteTypeMunger)i.next(); ResolvedMember ret = m.getMatchingSyntheticMember(member); if (ret != null) { return ret; } } if (world.isJoinpointArrayConstructionEnabled() && this.isArray()) { if (member.getKind()==Member.CONSTRUCTOR) {
206,732
Bug 206732 [itds] Problem with ITDs appearing to be applied twice (and clashing) for binary types
As reported by Josh on the mailing list: I have the following 2 files: Advised.aj: package bugs; public class Advised {} aspect ITD { public void Advised.f() {} } Ref.aj: package notbugs; import bugs.Advised; public class Ref { public void g() { new Advised().f(); } } I am attempting to build Advised.aj into a jar, and refer to it from Ref.aj, using the following ant build.xml: <?xml version="1.0"?> <project name="Bugs" basedir="C:\workplace\imds\Bugs" xmlns:aj="antlib:org.aspectj"> <taskdef uri="antlib:org.aspectj" resource="org/aspectj/antlib.xml" classpath="./aspectjtools.jar"/> <target name="clean"> <delete dir="bugs" includes="**/*.class"/> <delete dir="notbugs" includes="**/*.class"/> </target> <target name="task1"> <aj:iajc srcdir="." destdir="." source="1.5" target="1.5"> <classpath location=".\aspectjrt.jar"/> <include name="bugs/Advised.aj"/> </aj:iajc> </target> <target name="task2"> <aj:iajc source="1.5" target="1.5" srcdir="."> <classpath location=".\aspectjrt.jar"/> <aspectpath location="."/> <include name="notbugs/Ref.aj"/> </aj:iajc> </target> </project> From within Eclipse, there are no build errors because this is all one project. On the command line, however, once I execute ant task2, I get the following marvelous error message which suggests that ajc is trying to ITD f into a class it already ITDd f into before: [aj:iajc] error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() [aj:iajc] MessageHolder: (8 info) (1 error) [aj:iajc] [error 0]: error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() Let me also say that in my real use-case, the jar produced by task1 will contain aspects that should apply to clients thereof, and as such, that jar should indeed be in the aspectpath (not the classpath) for task2 (unless I am seriously misunderstanding something). How to stop this duplicate attempt to ITD? Josh --- Josh is correct that using aspectpath will pull in the aspects for application to other types, the problem is that when pulling in type Advised, we reapply known ITDs and it clashes with the one added in the original build of the type. Two possible fixes that I am looking at: - don't reapply the ITDs (they are added to ensure type system is consistent) to binary types pulled in from the aspectpath - recognize the ITD is clashing with a member previously applied through the same ITD I am not sure we can determine it came from the aspectpath at the point the clash is detected. I have option (2) already implemented, but I'll try a little more with option 1 before giving up ;)
resolved fixed
797ec4d
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2007-10-18T11:03:05Z
2007-10-18T09:33:20Z
weaver/src/org/aspectj/weaver/ResolvedType.java
ResolvedMemberImpl ret = new ResolvedMemberImpl(Member.CONSTRUCTOR,this,Modifier.PUBLIC, ResolvedType.VOID,"<init>",world.resolve(member.getParameterTypes())); return ret; } } } return null; } public void clearInterTypeMungers() { if (isRawType()) getGenericType().clearInterTypeMungers(); interTypeMungers = new ArrayList(); } public boolean isTopmostImplementor(ResolvedType interfaceType) { if (isInterface()) return false; if (!interfaceType.isAssignableFrom(this,true)) return false; if (this.getSuperclass().isMissing()) return true; if (interfaceType.isAssignableFrom(this.getSuperclass(),true)) { return false; } return true; } public ResolvedType getTopmostImplementor(ResolvedType interfaceType) { if (isInterface()) return null; if (!interfaceType.isAssignableFrom(this)) return null;
206,732
Bug 206732 [itds] Problem with ITDs appearing to be applied twice (and clashing) for binary types
As reported by Josh on the mailing list: I have the following 2 files: Advised.aj: package bugs; public class Advised {} aspect ITD { public void Advised.f() {} } Ref.aj: package notbugs; import bugs.Advised; public class Ref { public void g() { new Advised().f(); } } I am attempting to build Advised.aj into a jar, and refer to it from Ref.aj, using the following ant build.xml: <?xml version="1.0"?> <project name="Bugs" basedir="C:\workplace\imds\Bugs" xmlns:aj="antlib:org.aspectj"> <taskdef uri="antlib:org.aspectj" resource="org/aspectj/antlib.xml" classpath="./aspectjtools.jar"/> <target name="clean"> <delete dir="bugs" includes="**/*.class"/> <delete dir="notbugs" includes="**/*.class"/> </target> <target name="task1"> <aj:iajc srcdir="." destdir="." source="1.5" target="1.5"> <classpath location=".\aspectjrt.jar"/> <include name="bugs/Advised.aj"/> </aj:iajc> </target> <target name="task2"> <aj:iajc source="1.5" target="1.5" srcdir="."> <classpath location=".\aspectjrt.jar"/> <aspectpath location="."/> <include name="notbugs/Ref.aj"/> </aj:iajc> </target> </project> From within Eclipse, there are no build errors because this is all one project. On the command line, however, once I execute ant task2, I get the following marvelous error message which suggests that ajc is trying to ITD f into a class it already ITDd f into before: [aj:iajc] error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() [aj:iajc] MessageHolder: (8 info) (1 error) [aj:iajc] [error 0]: error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() Let me also say that in my real use-case, the jar produced by task1 will contain aspects that should apply to clients thereof, and as such, that jar should indeed be in the aspectpath (not the classpath) for task2 (unless I am seriously misunderstanding something). How to stop this duplicate attempt to ITD? Josh --- Josh is correct that using aspectpath will pull in the aspects for application to other types, the problem is that when pulling in type Advised, we reapply known ITDs and it clashes with the one added in the original build of the type. Two possible fixes that I am looking at: - don't reapply the ITDs (they are added to ensure type system is consistent) to binary types pulled in from the aspectpath - recognize the ITD is clashing with a member previously applied through the same ITD I am not sure we can determine it came from the aspectpath at the point the clash is detected. I have option (2) already implemented, but I'll try a little more with option 1 before giving up ;)
resolved fixed
797ec4d
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2007-10-18T11:03:05Z
2007-10-18T09:33:20Z
weaver/src/org/aspectj/weaver/ResolvedType.java
ResolvedType higherType = this.getSuperclass().getTopmostImplementor(interfaceType); if (higherType!=null) return higherType; return this; } private ResolvedType findHigher(ResolvedType other) { if (this == other) return this; for(Iterator i = other.getDirectSupertypes(); i.hasNext(); ) { ResolvedType rtx = (ResolvedType)i.next(); boolean b = this.isAssignableFrom(rtx); if (b) return rtx; } return null; } public List getExposedPointcuts() { List ret = new ArrayList(); if (getSuperclass() != null) ret.addAll(getSuperclass().getExposedPointcuts()); for (Iterator i = Arrays.asList(getDeclaredInterfaces()).iterator(); i.hasNext(); ) { ResolvedType t = (ResolvedType)i.next(); addPointcutsResolvingConflicts(ret, Arrays.asList(t.getDeclaredPointcuts()), false); } addPointcutsResolvingConflicts(ret, Arrays.asList(getDeclaredPointcuts()), true); for (Iterator i = ret.iterator(); i.hasNext(); ) { ResolvedPointcutDefinition inherited = (ResolvedPointcutDefinition)i.next(); if (inherited.isAbstract()) { if (!this.isAbstract()) { getWorld().showMessage(IMessage.ERROR, WeaverMessages.format(WeaverMessages.POINCUT_NOT_CONCRETE,inherited,this.getName()),
206,732
Bug 206732 [itds] Problem with ITDs appearing to be applied twice (and clashing) for binary types
As reported by Josh on the mailing list: I have the following 2 files: Advised.aj: package bugs; public class Advised {} aspect ITD { public void Advised.f() {} } Ref.aj: package notbugs; import bugs.Advised; public class Ref { public void g() { new Advised().f(); } } I am attempting to build Advised.aj into a jar, and refer to it from Ref.aj, using the following ant build.xml: <?xml version="1.0"?> <project name="Bugs" basedir="C:\workplace\imds\Bugs" xmlns:aj="antlib:org.aspectj"> <taskdef uri="antlib:org.aspectj" resource="org/aspectj/antlib.xml" classpath="./aspectjtools.jar"/> <target name="clean"> <delete dir="bugs" includes="**/*.class"/> <delete dir="notbugs" includes="**/*.class"/> </target> <target name="task1"> <aj:iajc srcdir="." destdir="." source="1.5" target="1.5"> <classpath location=".\aspectjrt.jar"/> <include name="bugs/Advised.aj"/> </aj:iajc> </target> <target name="task2"> <aj:iajc source="1.5" target="1.5" srcdir="."> <classpath location=".\aspectjrt.jar"/> <aspectpath location="."/> <include name="notbugs/Ref.aj"/> </aj:iajc> </target> </project> From within Eclipse, there are no build errors because this is all one project. On the command line, however, once I execute ant task2, I get the following marvelous error message which suggests that ajc is trying to ITD f into a class it already ITDd f into before: [aj:iajc] error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() [aj:iajc] MessageHolder: (8 info) (1 error) [aj:iajc] [error 0]: error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() Let me also say that in my real use-case, the jar produced by task1 will contain aspects that should apply to clients thereof, and as such, that jar should indeed be in the aspectpath (not the classpath) for task2 (unless I am seriously misunderstanding something). How to stop this duplicate attempt to ITD? Josh --- Josh is correct that using aspectpath will pull in the aspects for application to other types, the problem is that when pulling in type Advised, we reapply known ITDs and it clashes with the one added in the original build of the type. Two possible fixes that I am looking at: - don't reapply the ITDs (they are added to ensure type system is consistent) to binary types pulled in from the aspectpath - recognize the ITD is clashing with a member previously applied through the same ITD I am not sure we can determine it came from the aspectpath at the point the clash is detected. I have option (2) already implemented, but I'll try a little more with option 1 before giving up ;)
resolved fixed
797ec4d
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2007-10-18T11:03:05Z
2007-10-18T09:33:20Z
weaver/src/org/aspectj/weaver/ResolvedType.java
inherited.getSourceLocation(), this.getSourceLocation()); } } } return ret; } private void addPointcutsResolvingConflicts(List acc, List added, boolean isOverriding) { for (Iterator i = added.iterator(); i.hasNext();) { ResolvedPointcutDefinition toAdd = (ResolvedPointcutDefinition) i.next(); for (Iterator j = acc.iterator(); j.hasNext();) { ResolvedPointcutDefinition existing = (ResolvedPointcutDefinition) j.next(); if (existing == toAdd) continue; if (!isVisible(existing.getModifiers(), existing.getDeclaringType().resolve(getWorld()), this)) { continue; } if (conflictingSignature(existing, toAdd)) { if (isOverriding) { checkLegalOverride(existing, toAdd); j.remove(); } else { getWorld().showMessage( IMessage.ERROR,
206,732
Bug 206732 [itds] Problem with ITDs appearing to be applied twice (and clashing) for binary types
As reported by Josh on the mailing list: I have the following 2 files: Advised.aj: package bugs; public class Advised {} aspect ITD { public void Advised.f() {} } Ref.aj: package notbugs; import bugs.Advised; public class Ref { public void g() { new Advised().f(); } } I am attempting to build Advised.aj into a jar, and refer to it from Ref.aj, using the following ant build.xml: <?xml version="1.0"?> <project name="Bugs" basedir="C:\workplace\imds\Bugs" xmlns:aj="antlib:org.aspectj"> <taskdef uri="antlib:org.aspectj" resource="org/aspectj/antlib.xml" classpath="./aspectjtools.jar"/> <target name="clean"> <delete dir="bugs" includes="**/*.class"/> <delete dir="notbugs" includes="**/*.class"/> </target> <target name="task1"> <aj:iajc srcdir="." destdir="." source="1.5" target="1.5"> <classpath location=".\aspectjrt.jar"/> <include name="bugs/Advised.aj"/> </aj:iajc> </target> <target name="task2"> <aj:iajc source="1.5" target="1.5" srcdir="."> <classpath location=".\aspectjrt.jar"/> <aspectpath location="."/> <include name="notbugs/Ref.aj"/> </aj:iajc> </target> </project> From within Eclipse, there are no build errors because this is all one project. On the command line, however, once I execute ant task2, I get the following marvelous error message which suggests that ajc is trying to ITD f into a class it already ITDd f into before: [aj:iajc] error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() [aj:iajc] MessageHolder: (8 info) (1 error) [aj:iajc] [error 0]: error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() Let me also say that in my real use-case, the jar produced by task1 will contain aspects that should apply to clients thereof, and as such, that jar should indeed be in the aspectpath (not the classpath) for task2 (unless I am seriously misunderstanding something). How to stop this duplicate attempt to ITD? Josh --- Josh is correct that using aspectpath will pull in the aspects for application to other types, the problem is that when pulling in type Advised, we reapply known ITDs and it clashes with the one added in the original build of the type. Two possible fixes that I am looking at: - don't reapply the ITDs (they are added to ensure type system is consistent) to binary types pulled in from the aspectpath - recognize the ITD is clashing with a member previously applied through the same ITD I am not sure we can determine it came from the aspectpath at the point the clash is detected. I have option (2) already implemented, but I'll try a little more with option 1 before giving up ;)
resolved fixed
797ec4d
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2007-10-18T11:03:05Z
2007-10-18T09:33:20Z
weaver/src/org/aspectj/weaver/ResolvedType.java
WeaverMessages.format(WeaverMessages.CONFLICTING_INHERITED_POINTCUTS,this.getName() + toAdd.getSignature()), existing.getSourceLocation(), toAdd.getSourceLocation()); j.remove(); } } } acc.add(toAdd); } } public ISourceLocation getSourceLocation() { return null; } public boolean isExposedToWeaver() { return false; } public WeaverStateInfo getWeaverState() { return null; } /** * Overridden by ReferenceType to return a sensible answer for parameterized and raw types. * * @return */ public ResolvedType getGenericType() { if (!(isParameterizedType() || isRawType())) throw new BCException("The type "+getBaseName()+" is not parameterized or raw - it has no generic type"); return null;
206,732
Bug 206732 [itds] Problem with ITDs appearing to be applied twice (and clashing) for binary types
As reported by Josh on the mailing list: I have the following 2 files: Advised.aj: package bugs; public class Advised {} aspect ITD { public void Advised.f() {} } Ref.aj: package notbugs; import bugs.Advised; public class Ref { public void g() { new Advised().f(); } } I am attempting to build Advised.aj into a jar, and refer to it from Ref.aj, using the following ant build.xml: <?xml version="1.0"?> <project name="Bugs" basedir="C:\workplace\imds\Bugs" xmlns:aj="antlib:org.aspectj"> <taskdef uri="antlib:org.aspectj" resource="org/aspectj/antlib.xml" classpath="./aspectjtools.jar"/> <target name="clean"> <delete dir="bugs" includes="**/*.class"/> <delete dir="notbugs" includes="**/*.class"/> </target> <target name="task1"> <aj:iajc srcdir="." destdir="." source="1.5" target="1.5"> <classpath location=".\aspectjrt.jar"/> <include name="bugs/Advised.aj"/> </aj:iajc> </target> <target name="task2"> <aj:iajc source="1.5" target="1.5" srcdir="."> <classpath location=".\aspectjrt.jar"/> <aspectpath location="."/> <include name="notbugs/Ref.aj"/> </aj:iajc> </target> </project> From within Eclipse, there are no build errors because this is all one project. On the command line, however, once I execute ant task2, I get the following marvelous error message which suggests that ajc is trying to ITD f into a class it already ITDd f into before: [aj:iajc] error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() [aj:iajc] MessageHolder: (8 info) (1 error) [aj:iajc] [error 0]: error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() Let me also say that in my real use-case, the jar produced by task1 will contain aspects that should apply to clients thereof, and as such, that jar should indeed be in the aspectpath (not the classpath) for task2 (unless I am seriously misunderstanding something). How to stop this duplicate attempt to ITD? Josh --- Josh is correct that using aspectpath will pull in the aspects for application to other types, the problem is that when pulling in type Advised, we reapply known ITDs and it clashes with the one added in the original build of the type. Two possible fixes that I am looking at: - don't reapply the ITDs (they are added to ensure type system is consistent) to binary types pulled in from the aspectpath - recognize the ITD is clashing with a member previously applied through the same ITD I am not sure we can determine it came from the aspectpath at the point the clash is detected. I have option (2) already implemented, but I'll try a little more with option 1 before giving up ;)
resolved fixed
797ec4d
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2007-10-18T11:03:05Z
2007-10-18T09:33:20Z
weaver/src/org/aspectj/weaver/ResolvedType.java
} /** * overriden by ReferenceType to return the gsig for a generic type * @return */ public String getGenericSignature() { return ""; } public ResolvedType parameterizedWith(UnresolvedType[] typeParameters) { if (!(isGenericType() || isParameterizedType())) return this; return TypeFactory.createParameterizedType(this.getGenericType(), typeParameters, getWorld()); } /** * Iff I am a parameterized type, and any of my parameters are type variable * references, return a version with those type parameters replaced in accordance * with the passed bindings. */ public UnresolvedType parameterize(Map typeBindings) { if (!isParameterizedType()) return this; boolean workToDo = false; for (int i = 0; i < typeParameters.length; i++) { if (typeParameters[i].isTypeVariableReference() || (typeParameters[i] instanceof BoundedReferenceType)) { workToDo = true; } }
206,732
Bug 206732 [itds] Problem with ITDs appearing to be applied twice (and clashing) for binary types
As reported by Josh on the mailing list: I have the following 2 files: Advised.aj: package bugs; public class Advised {} aspect ITD { public void Advised.f() {} } Ref.aj: package notbugs; import bugs.Advised; public class Ref { public void g() { new Advised().f(); } } I am attempting to build Advised.aj into a jar, and refer to it from Ref.aj, using the following ant build.xml: <?xml version="1.0"?> <project name="Bugs" basedir="C:\workplace\imds\Bugs" xmlns:aj="antlib:org.aspectj"> <taskdef uri="antlib:org.aspectj" resource="org/aspectj/antlib.xml" classpath="./aspectjtools.jar"/> <target name="clean"> <delete dir="bugs" includes="**/*.class"/> <delete dir="notbugs" includes="**/*.class"/> </target> <target name="task1"> <aj:iajc srcdir="." destdir="." source="1.5" target="1.5"> <classpath location=".\aspectjrt.jar"/> <include name="bugs/Advised.aj"/> </aj:iajc> </target> <target name="task2"> <aj:iajc source="1.5" target="1.5" srcdir="."> <classpath location=".\aspectjrt.jar"/> <aspectpath location="."/> <include name="notbugs/Ref.aj"/> </aj:iajc> </target> </project> From within Eclipse, there are no build errors because this is all one project. On the command line, however, once I execute ant task2, I get the following marvelous error message which suggests that ajc is trying to ITD f into a class it already ITDd f into before: [aj:iajc] error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() [aj:iajc] MessageHolder: (8 info) (1 error) [aj:iajc] [error 0]: error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() Let me also say that in my real use-case, the jar produced by task1 will contain aspects that should apply to clients thereof, and as such, that jar should indeed be in the aspectpath (not the classpath) for task2 (unless I am seriously misunderstanding something). How to stop this duplicate attempt to ITD? Josh --- Josh is correct that using aspectpath will pull in the aspects for application to other types, the problem is that when pulling in type Advised, we reapply known ITDs and it clashes with the one added in the original build of the type. Two possible fixes that I am looking at: - don't reapply the ITDs (they are added to ensure type system is consistent) to binary types pulled in from the aspectpath - recognize the ITD is clashing with a member previously applied through the same ITD I am not sure we can determine it came from the aspectpath at the point the clash is detected. I have option (2) already implemented, but I'll try a little more with option 1 before giving up ;)
resolved fixed
797ec4d
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2007-10-18T11:03:05Z
2007-10-18T09:33:20Z
weaver/src/org/aspectj/weaver/ResolvedType.java
if (!workToDo) { return this; } else { UnresolvedType[] newTypeParams = new UnresolvedType[typeParameters.length]; for (int i = 0; i < newTypeParams.length; i++) { newTypeParams[i] = typeParameters[i]; if (newTypeParams[i].isTypeVariableReference()) { TypeVariableReferenceType tvrt = (TypeVariableReferenceType) newTypeParams[i]; UnresolvedType binding = (UnresolvedType) typeBindings.get(tvrt.getTypeVariable().getName()); if (binding != null) newTypeParams[i] = binding; } else if (newTypeParams[i] instanceof BoundedReferenceType) { BoundedReferenceType brType = (BoundedReferenceType)newTypeParams[i]; newTypeParams[i] = brType.parameterize(typeBindings); } } return TypeFactory.createParameterizedType(getGenericType(), newTypeParams, getWorld()); } } public boolean hasParameterizedSuperType() { getParameterizedSuperTypes(); return parameterizedSuperTypes.length > 0; } public boolean hasGenericSuperType() { ResolvedType[] superTypes = getDeclaredInterfaces(); for (int i = 0; i < superTypes.length; i++) { if (superTypes[i].isGenericType()) return true; } return false;
206,732
Bug 206732 [itds] Problem with ITDs appearing to be applied twice (and clashing) for binary types
As reported by Josh on the mailing list: I have the following 2 files: Advised.aj: package bugs; public class Advised {} aspect ITD { public void Advised.f() {} } Ref.aj: package notbugs; import bugs.Advised; public class Ref { public void g() { new Advised().f(); } } I am attempting to build Advised.aj into a jar, and refer to it from Ref.aj, using the following ant build.xml: <?xml version="1.0"?> <project name="Bugs" basedir="C:\workplace\imds\Bugs" xmlns:aj="antlib:org.aspectj"> <taskdef uri="antlib:org.aspectj" resource="org/aspectj/antlib.xml" classpath="./aspectjtools.jar"/> <target name="clean"> <delete dir="bugs" includes="**/*.class"/> <delete dir="notbugs" includes="**/*.class"/> </target> <target name="task1"> <aj:iajc srcdir="." destdir="." source="1.5" target="1.5"> <classpath location=".\aspectjrt.jar"/> <include name="bugs/Advised.aj"/> </aj:iajc> </target> <target name="task2"> <aj:iajc source="1.5" target="1.5" srcdir="."> <classpath location=".\aspectjrt.jar"/> <aspectpath location="."/> <include name="notbugs/Ref.aj"/> </aj:iajc> </target> </project> From within Eclipse, there are no build errors because this is all one project. On the command line, however, once I execute ant task2, I get the following marvelous error message which suggests that ajc is trying to ITD f into a class it already ITDd f into before: [aj:iajc] error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() [aj:iajc] MessageHolder: (8 info) (1 error) [aj:iajc] [error 0]: error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() Let me also say that in my real use-case, the jar produced by task1 will contain aspects that should apply to clients thereof, and as such, that jar should indeed be in the aspectpath (not the classpath) for task2 (unless I am seriously misunderstanding something). How to stop this duplicate attempt to ITD? Josh --- Josh is correct that using aspectpath will pull in the aspects for application to other types, the problem is that when pulling in type Advised, we reapply known ITDs and it clashes with the one added in the original build of the type. Two possible fixes that I am looking at: - don't reapply the ITDs (they are added to ensure type system is consistent) to binary types pulled in from the aspectpath - recognize the ITD is clashing with a member previously applied through the same ITD I am not sure we can determine it came from the aspectpath at the point the clash is detected. I have option (2) already implemented, but I'll try a little more with option 1 before giving up ;)
resolved fixed
797ec4d
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2007-10-18T11:03:05Z
2007-10-18T09:33:20Z
weaver/src/org/aspectj/weaver/ResolvedType.java
} private ResolvedType[] parameterizedSuperTypes = null; /** * Similar to the above method, but accumulates the super types * * @return */ public ResolvedType[] getParameterizedSuperTypes() { if (parameterizedSuperTypes != null) return parameterizedSuperTypes; List accumulatedTypes = new ArrayList(); accumulateParameterizedSuperTypes(this,accumulatedTypes); ResolvedType[] ret = new ResolvedType[accumulatedTypes.size()]; parameterizedSuperTypes = (ResolvedType[]) accumulatedTypes.toArray(ret); return parameterizedSuperTypes; } private void accumulateParameterizedSuperTypes(ResolvedType forType, List parameterizedTypeList) { if (forType.isParameterizedType()) { parameterizedTypeList.add(forType); } if (forType.getSuperclass() != null) { accumulateParameterizedSuperTypes(forType.getSuperclass(), parameterizedTypeList); } ResolvedType[] interfaces = forType.getDeclaredInterfaces(); for (int i = 0; i < interfaces.length; i++) { accumulateParameterizedSuperTypes(interfaces[i], parameterizedTypeList); } } /**
206,732
Bug 206732 [itds] Problem with ITDs appearing to be applied twice (and clashing) for binary types
As reported by Josh on the mailing list: I have the following 2 files: Advised.aj: package bugs; public class Advised {} aspect ITD { public void Advised.f() {} } Ref.aj: package notbugs; import bugs.Advised; public class Ref { public void g() { new Advised().f(); } } I am attempting to build Advised.aj into a jar, and refer to it from Ref.aj, using the following ant build.xml: <?xml version="1.0"?> <project name="Bugs" basedir="C:\workplace\imds\Bugs" xmlns:aj="antlib:org.aspectj"> <taskdef uri="antlib:org.aspectj" resource="org/aspectj/antlib.xml" classpath="./aspectjtools.jar"/> <target name="clean"> <delete dir="bugs" includes="**/*.class"/> <delete dir="notbugs" includes="**/*.class"/> </target> <target name="task1"> <aj:iajc srcdir="." destdir="." source="1.5" target="1.5"> <classpath location=".\aspectjrt.jar"/> <include name="bugs/Advised.aj"/> </aj:iajc> </target> <target name="task2"> <aj:iajc source="1.5" target="1.5" srcdir="."> <classpath location=".\aspectjrt.jar"/> <aspectpath location="."/> <include name="notbugs/Ref.aj"/> </aj:iajc> </target> </project> From within Eclipse, there are no build errors because this is all one project. On the command line, however, once I execute ant task2, I get the following marvelous error message which suggests that ajc is trying to ITD f into a class it already ITDd f into before: [aj:iajc] error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() [aj:iajc] MessageHolder: (8 info) (1 error) [aj:iajc] [error 0]: error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() Let me also say that in my real use-case, the jar produced by task1 will contain aspects that should apply to clients thereof, and as such, that jar should indeed be in the aspectpath (not the classpath) for task2 (unless I am seriously misunderstanding something). How to stop this duplicate attempt to ITD? Josh --- Josh is correct that using aspectpath will pull in the aspects for application to other types, the problem is that when pulling in type Advised, we reapply known ITDs and it clashes with the one added in the original build of the type. Two possible fixes that I am looking at: - don't reapply the ITDs (they are added to ensure type system is consistent) to binary types pulled in from the aspectpath - recognize the ITD is clashing with a member previously applied through the same ITD I am not sure we can determine it came from the aspectpath at the point the clash is detected. I have option (2) already implemented, but I'll try a little more with option 1 before giving up ;)
resolved fixed
797ec4d
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2007-10-18T11:03:05Z
2007-10-18T09:33:20Z
weaver/src/org/aspectj/weaver/ResolvedType.java
* Types may have pointcuts just as they have methods and fields. */ public ResolvedPointcutDefinition findPointcut(String name, World world) { throw new UnsupportedOperationException("Not yet implemenented"); } /** * @return true if assignable to java.lang.Exception */ public boolean isException() { return (world.getCoreType(UnresolvedType.JAVA_LANG_EXCEPTION).isAssignableFrom(this)); } /** * @return true if it is an exception and it is a checked one, false otherwise. */ public boolean isCheckedException() { if (!isException()) return false; if (world.getCoreType(UnresolvedType.RUNTIME_EXCEPTION).isAssignableFrom(this)) return false; return true; } /** * Determines if variables of this type could be assigned values of another * with lots of help. * java.lang.Object is convertable from all types. * A primitive type is convertable from X iff it's assignable from X. * A reference type is convertable from X iff it's coerceable from X. * In other words, X isConvertableFrom Y iff the compiler thinks that _some_ value of Y * could be assignable to a variable of type X without loss of precision. *
206,732
Bug 206732 [itds] Problem with ITDs appearing to be applied twice (and clashing) for binary types
As reported by Josh on the mailing list: I have the following 2 files: Advised.aj: package bugs; public class Advised {} aspect ITD { public void Advised.f() {} } Ref.aj: package notbugs; import bugs.Advised; public class Ref { public void g() { new Advised().f(); } } I am attempting to build Advised.aj into a jar, and refer to it from Ref.aj, using the following ant build.xml: <?xml version="1.0"?> <project name="Bugs" basedir="C:\workplace\imds\Bugs" xmlns:aj="antlib:org.aspectj"> <taskdef uri="antlib:org.aspectj" resource="org/aspectj/antlib.xml" classpath="./aspectjtools.jar"/> <target name="clean"> <delete dir="bugs" includes="**/*.class"/> <delete dir="notbugs" includes="**/*.class"/> </target> <target name="task1"> <aj:iajc srcdir="." destdir="." source="1.5" target="1.5"> <classpath location=".\aspectjrt.jar"/> <include name="bugs/Advised.aj"/> </aj:iajc> </target> <target name="task2"> <aj:iajc source="1.5" target="1.5" srcdir="."> <classpath location=".\aspectjrt.jar"/> <aspectpath location="."/> <include name="notbugs/Ref.aj"/> </aj:iajc> </target> </project> From within Eclipse, there are no build errors because this is all one project. On the command line, however, once I execute ant task2, I get the following marvelous error message which suggests that ajc is trying to ITD f into a class it already ITDd f into before: [aj:iajc] error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() [aj:iajc] MessageHolder: (8 info) (1 error) [aj:iajc] [error 0]: error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() Let me also say that in my real use-case, the jar produced by task1 will contain aspects that should apply to clients thereof, and as such, that jar should indeed be in the aspectpath (not the classpath) for task2 (unless I am seriously misunderstanding something). How to stop this duplicate attempt to ITD? Josh --- Josh is correct that using aspectpath will pull in the aspects for application to other types, the problem is that when pulling in type Advised, we reapply known ITDs and it clashes with the one added in the original build of the type. Two possible fixes that I am looking at: - don't reapply the ITDs (they are added to ensure type system is consistent) to binary types pulled in from the aspectpath - recognize the ITD is clashing with a member previously applied through the same ITD I am not sure we can determine it came from the aspectpath at the point the clash is detected. I have option (2) already implemented, but I'll try a little more with option 1 before giving up ;)
resolved fixed
797ec4d
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2007-10-18T11:03:05Z
2007-10-18T09:33:20Z
weaver/src/org/aspectj/weaver/ResolvedType.java
* @param other the other type * @param world the {@link World} in which the possible assignment should be checked. * @return true iff variables of this type could be assigned values of other with possible conversion */ public final boolean isConvertableFrom(ResolvedType other) { if (this.equals(OBJECT)) return true; if (world.isInJava5Mode()) { if (this.isPrimitiveType()^other.isPrimitiveType()) { if (validBoxing.contains(this.getSignature()+other.getSignature())) return true; } } if (this.isPrimitiveType() || other.isPrimitiveType()) return this.isAssignableFrom(other); return this.isCoerceableFrom(other); } /** * Determines if the variables of this type could be assigned values * of another type without casting. This still allows for assignment conversion * as per JLS 2ed 5.2. For object types, this means supertypeOrEqual(THIS, OTHER). * * @param other the other type * @param world the {@link World} in which the possible assignment should be checked. * @return true iff variables of this type could be assigned values of other without casting * @throws NullPointerException if other is null */ public abstract boolean isAssignableFrom(ResolvedType other); public abstract boolean isAssignableFrom(ResolvedType other, boolean allowMissing);
206,732
Bug 206732 [itds] Problem with ITDs appearing to be applied twice (and clashing) for binary types
As reported by Josh on the mailing list: I have the following 2 files: Advised.aj: package bugs; public class Advised {} aspect ITD { public void Advised.f() {} } Ref.aj: package notbugs; import bugs.Advised; public class Ref { public void g() { new Advised().f(); } } I am attempting to build Advised.aj into a jar, and refer to it from Ref.aj, using the following ant build.xml: <?xml version="1.0"?> <project name="Bugs" basedir="C:\workplace\imds\Bugs" xmlns:aj="antlib:org.aspectj"> <taskdef uri="antlib:org.aspectj" resource="org/aspectj/antlib.xml" classpath="./aspectjtools.jar"/> <target name="clean"> <delete dir="bugs" includes="**/*.class"/> <delete dir="notbugs" includes="**/*.class"/> </target> <target name="task1"> <aj:iajc srcdir="." destdir="." source="1.5" target="1.5"> <classpath location=".\aspectjrt.jar"/> <include name="bugs/Advised.aj"/> </aj:iajc> </target> <target name="task2"> <aj:iajc source="1.5" target="1.5" srcdir="."> <classpath location=".\aspectjrt.jar"/> <aspectpath location="."/> <include name="notbugs/Ref.aj"/> </aj:iajc> </target> </project> From within Eclipse, there are no build errors because this is all one project. On the command line, however, once I execute ant task2, I get the following marvelous error message which suggests that ajc is trying to ITD f into a class it already ITDd f into before: [aj:iajc] error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() [aj:iajc] MessageHolder: (8 info) (1 error) [aj:iajc] [error 0]: error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() Let me also say that in my real use-case, the jar produced by task1 will contain aspects that should apply to clients thereof, and as such, that jar should indeed be in the aspectpath (not the classpath) for task2 (unless I am seriously misunderstanding something). How to stop this duplicate attempt to ITD? Josh --- Josh is correct that using aspectpath will pull in the aspects for application to other types, the problem is that when pulling in type Advised, we reapply known ITDs and it clashes with the one added in the original build of the type. Two possible fixes that I am looking at: - don't reapply the ITDs (they are added to ensure type system is consistent) to binary types pulled in from the aspectpath - recognize the ITD is clashing with a member previously applied through the same ITD I am not sure we can determine it came from the aspectpath at the point the clash is detected. I have option (2) already implemented, but I'll try a little more with option 1 before giving up ;)
resolved fixed
797ec4d
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2007-10-18T11:03:05Z
2007-10-18T09:33:20Z
weaver/src/org/aspectj/weaver/ResolvedType.java
/** * Determines if values of another type could possibly be cast to * this type. The rules followed are from JLS 2ed 5.5, "Casting Conversion". * <p/> * <p> This method should be commutative, i.e., for all UnresolvedType a, b and all World w: * <p/> * <blockquote><pre> * a.isCoerceableFrom(b, w) == b.isCoerceableFrom(a, w) * </pre></blockquote> * * @param other the other type * @param world the {@link World} in which the possible coersion should be checked. * @return true iff values of other could possibly be cast to this type. * @throws NullPointerException if other is null. */ public abstract boolean isCoerceableFrom(ResolvedType other); public boolean needsNoConversionFrom(ResolvedType o) { return isAssignableFrom(o); } /** * Implemented by ReferenceTypes */ public String getSignatureForAttribute() { throw new RuntimeException("Cannot ask this type "+this+" for a generic sig attribute"); } private FuzzyBoolean parameterizedWithAMemberTypeVariable = FuzzyBoolean.MAYBE;
206,732
Bug 206732 [itds] Problem with ITDs appearing to be applied twice (and clashing) for binary types
As reported by Josh on the mailing list: I have the following 2 files: Advised.aj: package bugs; public class Advised {} aspect ITD { public void Advised.f() {} } Ref.aj: package notbugs; import bugs.Advised; public class Ref { public void g() { new Advised().f(); } } I am attempting to build Advised.aj into a jar, and refer to it from Ref.aj, using the following ant build.xml: <?xml version="1.0"?> <project name="Bugs" basedir="C:\workplace\imds\Bugs" xmlns:aj="antlib:org.aspectj"> <taskdef uri="antlib:org.aspectj" resource="org/aspectj/antlib.xml" classpath="./aspectjtools.jar"/> <target name="clean"> <delete dir="bugs" includes="**/*.class"/> <delete dir="notbugs" includes="**/*.class"/> </target> <target name="task1"> <aj:iajc srcdir="." destdir="." source="1.5" target="1.5"> <classpath location=".\aspectjrt.jar"/> <include name="bugs/Advised.aj"/> </aj:iajc> </target> <target name="task2"> <aj:iajc source="1.5" target="1.5" srcdir="."> <classpath location=".\aspectjrt.jar"/> <aspectpath location="."/> <include name="notbugs/Ref.aj"/> </aj:iajc> </target> </project> From within Eclipse, there are no build errors because this is all one project. On the command line, however, once I execute ant task2, I get the following marvelous error message which suggests that ajc is trying to ITD f into a class it already ITDd f into before: [aj:iajc] error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() [aj:iajc] MessageHolder: (8 info) (1 error) [aj:iajc] [error 0]: error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() Let me also say that in my real use-case, the jar produced by task1 will contain aspects that should apply to clients thereof, and as such, that jar should indeed be in the aspectpath (not the classpath) for task2 (unless I am seriously misunderstanding something). How to stop this duplicate attempt to ITD? Josh --- Josh is correct that using aspectpath will pull in the aspects for application to other types, the problem is that when pulling in type Advised, we reapply known ITDs and it clashes with the one added in the original build of the type. Two possible fixes that I am looking at: - don't reapply the ITDs (they are added to ensure type system is consistent) to binary types pulled in from the aspectpath - recognize the ITD is clashing with a member previously applied through the same ITD I am not sure we can determine it came from the aspectpath at the point the clash is detected. I have option (2) already implemented, but I'll try a little more with option 1 before giving up ;)
resolved fixed
797ec4d
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2007-10-18T11:03:05Z
2007-10-18T09:33:20Z
weaver/src/org/aspectj/weaver/ResolvedType.java
/** * return true if the parameterization of this type includes a member type variable. Member * type variables occur in generic methods/ctors. */ public boolean isParameterizedWithAMemberTypeVariable() { if (parameterizedWithAMemberTypeVariable==FuzzyBoolean.MAYBE) { if (typeParameters==null || typeParameters.length==0) { parameterizedWithAMemberTypeVariable = FuzzyBoolean.NO; return false; } for (int i = 0; i < typeParameters.length; i++) { UnresolvedType aType = (ResolvedType)typeParameters[i]; if (aType.isTypeVariableReference() && ((TypeVariableReference)aType).getTypeVariable().getDeclaringElementKind()!=TypeVariable.TYPE) { parameterizedWithAMemberTypeVariable = FuzzyBoolean.YES; return true; } if (aType.isParameterizedType()) { boolean b = aType.isParameterizedWithAMemberTypeVariable(); if (b) { parameterizedWithAMemberTypeVariable = FuzzyBoolean.YES; return true; } } if (aType.isGenericWildcard()) {
206,732
Bug 206732 [itds] Problem with ITDs appearing to be applied twice (and clashing) for binary types
As reported by Josh on the mailing list: I have the following 2 files: Advised.aj: package bugs; public class Advised {} aspect ITD { public void Advised.f() {} } Ref.aj: package notbugs; import bugs.Advised; public class Ref { public void g() { new Advised().f(); } } I am attempting to build Advised.aj into a jar, and refer to it from Ref.aj, using the following ant build.xml: <?xml version="1.0"?> <project name="Bugs" basedir="C:\workplace\imds\Bugs" xmlns:aj="antlib:org.aspectj"> <taskdef uri="antlib:org.aspectj" resource="org/aspectj/antlib.xml" classpath="./aspectjtools.jar"/> <target name="clean"> <delete dir="bugs" includes="**/*.class"/> <delete dir="notbugs" includes="**/*.class"/> </target> <target name="task1"> <aj:iajc srcdir="." destdir="." source="1.5" target="1.5"> <classpath location=".\aspectjrt.jar"/> <include name="bugs/Advised.aj"/> </aj:iajc> </target> <target name="task2"> <aj:iajc source="1.5" target="1.5" srcdir="."> <classpath location=".\aspectjrt.jar"/> <aspectpath location="."/> <include name="notbugs/Ref.aj"/> </aj:iajc> </target> </project> From within Eclipse, there are no build errors because this is all one project. On the command line, however, once I execute ant task2, I get the following marvelous error message which suggests that ajc is trying to ITD f into a class it already ITDd f into before: [aj:iajc] error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() [aj:iajc] MessageHolder: (8 info) (1 error) [aj:iajc] [error 0]: error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() Let me also say that in my real use-case, the jar produced by task1 will contain aspects that should apply to clients thereof, and as such, that jar should indeed be in the aspectpath (not the classpath) for task2 (unless I am seriously misunderstanding something). How to stop this duplicate attempt to ITD? Josh --- Josh is correct that using aspectpath will pull in the aspects for application to other types, the problem is that when pulling in type Advised, we reapply known ITDs and it clashes with the one added in the original build of the type. Two possible fixes that I am looking at: - don't reapply the ITDs (they are added to ensure type system is consistent) to binary types pulled in from the aspectpath - recognize the ITD is clashing with a member previously applied through the same ITD I am not sure we can determine it came from the aspectpath at the point the clash is detected. I have option (2) already implemented, but I'll try a little more with option 1 before giving up ;)
resolved fixed
797ec4d
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2007-10-18T11:03:05Z
2007-10-18T09:33:20Z
weaver/src/org/aspectj/weaver/ResolvedType.java
if (aType.isExtends()) { boolean b = false; UnresolvedType upperBound = aType.getUpperBound(); if (upperBound.isParameterizedType()) { b = upperBound.isParameterizedWithAMemberTypeVariable(); } else if (upperBound.isTypeVariableReference() && ((TypeVariableReference)upperBound).getTypeVariable().getDeclaringElementKind()==TypeVariable.METHOD) { b = true; } if (b) { parameterizedWithAMemberTypeVariable = FuzzyBoolean.YES; return true; } } if (aType.isSuper()) { boolean b = false; UnresolvedType lowerBound = aType.getLowerBound(); if (lowerBound.isParameterizedType()) { b = lowerBound.isParameterizedWithAMemberTypeVariable(); } else if (lowerBound.isTypeVariableReference() && ((TypeVariableReference)lowerBound).getTypeVariable().getDeclaringElementKind()==TypeVariable.METHOD) { b = true; } if (b) { parameterizedWithAMemberTypeVariable = FuzzyBoolean.YES; return true; } } } } parameterizedWithAMemberTypeVariable=FuzzyBoolean.NO;
206,732
Bug 206732 [itds] Problem with ITDs appearing to be applied twice (and clashing) for binary types
As reported by Josh on the mailing list: I have the following 2 files: Advised.aj: package bugs; public class Advised {} aspect ITD { public void Advised.f() {} } Ref.aj: package notbugs; import bugs.Advised; public class Ref { public void g() { new Advised().f(); } } I am attempting to build Advised.aj into a jar, and refer to it from Ref.aj, using the following ant build.xml: <?xml version="1.0"?> <project name="Bugs" basedir="C:\workplace\imds\Bugs" xmlns:aj="antlib:org.aspectj"> <taskdef uri="antlib:org.aspectj" resource="org/aspectj/antlib.xml" classpath="./aspectjtools.jar"/> <target name="clean"> <delete dir="bugs" includes="**/*.class"/> <delete dir="notbugs" includes="**/*.class"/> </target> <target name="task1"> <aj:iajc srcdir="." destdir="." source="1.5" target="1.5"> <classpath location=".\aspectjrt.jar"/> <include name="bugs/Advised.aj"/> </aj:iajc> </target> <target name="task2"> <aj:iajc source="1.5" target="1.5" srcdir="."> <classpath location=".\aspectjrt.jar"/> <aspectpath location="."/> <include name="notbugs/Ref.aj"/> </aj:iajc> </target> </project> From within Eclipse, there are no build errors because this is all one project. On the command line, however, once I execute ant task2, I get the following marvelous error message which suggests that ajc is trying to ITD f into a class it already ITDd f into before: [aj:iajc] error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() [aj:iajc] MessageHolder: (8 info) (1 error) [aj:iajc] [error 0]: error at C:\workplace\imds\Bugs\bugs\Advised.aj:5::77 inter-type declaration from bugs.ITD conflicts with existing member: void bugs.Advised.f() Let me also say that in my real use-case, the jar produced by task1 will contain aspects that should apply to clients thereof, and as such, that jar should indeed be in the aspectpath (not the classpath) for task2 (unless I am seriously misunderstanding something). How to stop this duplicate attempt to ITD? Josh --- Josh is correct that using aspectpath will pull in the aspects for application to other types, the problem is that when pulling in type Advised, we reapply known ITDs and it clashes with the one added in the original build of the type. Two possible fixes that I am looking at: - don't reapply the ITDs (they are added to ensure type system is consistent) to binary types pulled in from the aspectpath - recognize the ITD is clashing with a member previously applied through the same ITD I am not sure we can determine it came from the aspectpath at the point the clash is detected. I have option (2) already implemented, but I'll try a little more with option 1 before giving up ;)
resolved fixed
797ec4d
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2007-10-18T11:03:05Z
2007-10-18T09:33:20Z
weaver/src/org/aspectj/weaver/ResolvedType.java
} return parameterizedWithAMemberTypeVariable.alwaysTrue(); } protected boolean ajMembersNeedParameterization() { if (isParameterizedType()) return true; if (getSuperclass() != null) return getSuperclass().ajMembersNeedParameterization(); return false; } protected Map getAjMemberParameterizationMap() { Map myMap = getMemberParameterizationMap(); if (myMap.size() == 0) { if (getSuperclass() != null) return getSuperclass().getAjMemberParameterizationMap(); } return myMap; } public void setBinaryPath(String binaryPath) { this.binaryPath = binaryPath; } /** * Returns the path to the jar or class file from which this * binary aspect came or null if not a binary aspect */ public String getBinaryPath() { return binaryPath; } }
211,674
Bug 211674 [ataspectj] after throwing annotation style is too sensitive to parameter positions
Reported on the list by Ashley Williams: Having converted my aspects to use the @AspectJ style, I'm now getting a strange error message when a compile my tracing aspect,. First here is the section of code: @Pointcut("execution(@Tracing * *(..)) && @annotation(tracing)") void annotatedMethods(Tracing tracing) { } @AfterThrowing(pointcut = "annotatedMethods(tracing)", throwing = "t") public void logException(JoinPoint thisJoinPoint, Tracing tracing, Throwable t) { Level level = Level.toLevel(tracing.level()); if (logger.isEnabledFor(level)) { logger.log(level, formatter.formatSignatureThrowing(thisJoinPoint), t); } } So I am matching on all methods annotated with @Tracing and logging the subclass of Throwable that may have been thrown. However when I run my test case i get the following error: java.lang.VerifyError: (class: com/db/abfo/tracing/PojoOne, method: calculate signature: ()V) catch_type not a subclass of Throwable This used to work when I used the aspectj after throwing language extention form: pointcut annotatedMethods(Tracing tracing) : execution(@Tracing * *(..)) && @annotation(tracing); after(Tracing tracing) throwing(Throwable t) : annotatedMethods(tracing) { Level level = tracing.level().getLevel(); if (logger.isEnabledFor(level)) { logger.log(level, formatter.formatSignatureThrowing(thisJoinPoint), t); } }
resolved fixed
9de03b7
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2007-12-02T09:24:51Z
2007-12-01T17:26:40Z
tests/src/org/aspectj/systemtest/ajc154/Ajc154Tests.java
/******************************************************************************* * Copyright (c) 2006 IBM * 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.ajc154; import java.io.File; import java.util.HashSet; import java.util.Set; import org.aspectj.apache.bcel.classfile.ConstantPool; import org.aspectj.apache.bcel.classfile.JavaClass; import org.aspectj.apache.bcel.classfile.LineNumberTable; import org.aspectj.apache.bcel.classfile.Method;
211,674
Bug 211674 [ataspectj] after throwing annotation style is too sensitive to parameter positions
Reported on the list by Ashley Williams: Having converted my aspects to use the @AspectJ style, I'm now getting a strange error message when a compile my tracing aspect,. First here is the section of code: @Pointcut("execution(@Tracing * *(..)) && @annotation(tracing)") void annotatedMethods(Tracing tracing) { } @AfterThrowing(pointcut = "annotatedMethods(tracing)", throwing = "t") public void logException(JoinPoint thisJoinPoint, Tracing tracing, Throwable t) { Level level = Level.toLevel(tracing.level()); if (logger.isEnabledFor(level)) { logger.log(level, formatter.formatSignatureThrowing(thisJoinPoint), t); } } So I am matching on all methods annotated with @Tracing and logging the subclass of Throwable that may have been thrown. However when I run my test case i get the following error: java.lang.VerifyError: (class: com/db/abfo/tracing/PojoOne, method: calculate signature: ()V) catch_type not a subclass of Throwable This used to work when I used the aspectj after throwing language extention form: pointcut annotatedMethods(Tracing tracing) : execution(@Tracing * *(..)) && @annotation(tracing); after(Tracing tracing) throwing(Throwable t) : annotatedMethods(tracing) { Level level = tracing.level().getLevel(); if (logger.isEnabledFor(level)) { logger.log(level, formatter.formatSignatureThrowing(thisJoinPoint), t); } }
resolved fixed
9de03b7
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2007-12-02T09:24:51Z
2007-12-01T17:26:40Z
tests/src/org/aspectj/systemtest/ajc154/Ajc154Tests.java
import org.aspectj.apache.bcel.generic.ConstantPoolGen; import org.aspectj.apache.bcel.generic.MethodGen; import org.aspectj.apache.bcel.util.ClassPath; import org.aspectj.apache.bcel.util.SyntheticRepository; import org.aspectj.testing.XMLBasedAjcTestCase; import org.aspectj.weaver.patterns.PatternParser; import org.aspectj.weaver.tools.ContextBasedMatcher; import org.aspectj.weaver.tools.FuzzyBoolean; import org.aspectj.weaver.tools.MatchingContext; import org.aspectj.weaver.tools.PointcutDesignatorHandler; import junit.framework.Test; /** * These are tests for AspectJ1.5.4 */ public class Ajc154Tests extends org.aspectj.testing.XMLBasedAjcTestCase { public void testNPEWithMissingAtAspectAnnotationInPointcutLibrary_pr162539_1() { runTest("NPE with missing @aspect annotation in pointcut library - 1"); } public void testNPEWithMissingAtAspectAnnotationInPointcutLibrary_pr162539_2() { runTest("NPE with missing @aspect annotation in pointcut library - 2"); } public void testWrongNumberOfTypeParameters_pr176991() { runTest("wrong number of type parameters");} public void testArgNamesDoesNotWork_pr148381_1() { runTest("argNames does not work - simple");} public void testArgNamesDoesNotWork_pr148381_2() { runTest("argNames does not work - error1");} public void testArgNamesDoesNotWork_pr148381_3() { runTest("argNames does not work - error2");} public void testArgNamesDoesNotWork_pr148381_4() { runTest("argNames does not work - error3");} public void testDecpProblemWhenTargetAlreadyImplements_pr169432_1() { runTest("declare parents problem when target already implements interface - 1");} public void testDecpProblemWhenTargetAlreadyImplements_pr169432_2() { runTest("declare parents problem when target already implements interface - 2");} public void testDecpProblemWhenTargetAlreadyImplements_pr169432_3() { runTest("declare parents problem when target already implements interface - 3");}
211,674
Bug 211674 [ataspectj] after throwing annotation style is too sensitive to parameter positions
Reported on the list by Ashley Williams: Having converted my aspects to use the @AspectJ style, I'm now getting a strange error message when a compile my tracing aspect,. First here is the section of code: @Pointcut("execution(@Tracing * *(..)) && @annotation(tracing)") void annotatedMethods(Tracing tracing) { } @AfterThrowing(pointcut = "annotatedMethods(tracing)", throwing = "t") public void logException(JoinPoint thisJoinPoint, Tracing tracing, Throwable t) { Level level = Level.toLevel(tracing.level()); if (logger.isEnabledFor(level)) { logger.log(level, formatter.formatSignatureThrowing(thisJoinPoint), t); } } So I am matching on all methods annotated with @Tracing and logging the subclass of Throwable that may have been thrown. However when I run my test case i get the following error: java.lang.VerifyError: (class: com/db/abfo/tracing/PojoOne, method: calculate signature: ()V) catch_type not a subclass of Throwable This used to work when I used the aspectj after throwing language extention form: pointcut annotatedMethods(Tracing tracing) : execution(@Tracing * *(..)) && @annotation(tracing); after(Tracing tracing) throwing(Throwable t) : annotatedMethods(tracing) { Level level = tracing.level().getLevel(); if (logger.isEnabledFor(level)) { logger.log(level, formatter.formatSignatureThrowing(thisJoinPoint), t); } }
resolved fixed
9de03b7
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2007-12-02T09:24:51Z
2007-12-01T17:26:40Z
tests/src/org/aspectj/systemtest/ajc154/Ajc154Tests.java
public void testVariousLtwAroundProblems_pr209019_1() { runTest("various issues with ltw and around advice - 1"); } public void testVariousLtwAroundProblems_pr209019_2() { runTest("various issues with ltw and around advice - 2"); } public void testVariousLtwAroundProblems_pr209019_3() { runTest("various issues with ltw and around advice - 3"); } public void testVariousLtwAroundProblems_pr209019_4() { runTest("various issues with ltw and around advice - 4"); } public void testAbstractAnnotationStylePointcutWithContext_pr202088() { runTest("abstract annotation style pointcut with context");} public void testNoErrorForAtDecpInNormalClass_pr169428() { runTest( "no error for atDecp in normal class");} public void testJarsZipsNonStandardSuffix_pr186673() { runTest("jars and zips with non-standard suffix");} public void testItdOnGenericInnerInterface_pr203646() { runTest("npe with itd on inner generic interface");} public void testItdOnGenericInnerInterface_pr203646_A() { runTest("npe with itd on inner generic interface - exampleA");} public void testItdOnGenericInnerInterface_pr203646_B() { runTest("npe with itd on inner generic interface - exampleB");} public void testItdOnGenericInnerInterface_pr203646_C() { runTest("npe with itd on inner generic interface - exampleC");} public void testItdOnGenericInnerInterface_pr203646_D() { runTest("npe with itd on inner generic interface - exampleD");} public void testItdOnGenericInnerInterface_pr203646_F() { runTest("npe with itd on inner generic interface - exampleF");} public void testItdOnGenericInnerInterface_pr203646_G() { runTest("npe with itd on inner generic interface - exampleG");} public void testItdClashForTypesFromAspectPath_pr206732() { runTest("itd clash for types from aspectpath"); } public void testCopingWithGarbage_pr175806_1() throws ClassNotFoundException { runTest("coping with bad tables"); JavaClass jc = getClassFrom(ajc.getSandboxDirectory(),"A"); Method[] meths = jc.getMethods(); Method oneWeWant = null;
211,674
Bug 211674 [ataspectj] after throwing annotation style is too sensitive to parameter positions
Reported on the list by Ashley Williams: Having converted my aspects to use the @AspectJ style, I'm now getting a strange error message when a compile my tracing aspect,. First here is the section of code: @Pointcut("execution(@Tracing * *(..)) && @annotation(tracing)") void annotatedMethods(Tracing tracing) { } @AfterThrowing(pointcut = "annotatedMethods(tracing)", throwing = "t") public void logException(JoinPoint thisJoinPoint, Tracing tracing, Throwable t) { Level level = Level.toLevel(tracing.level()); if (logger.isEnabledFor(level)) { logger.log(level, formatter.formatSignatureThrowing(thisJoinPoint), t); } } So I am matching on all methods annotated with @Tracing and logging the subclass of Throwable that may have been thrown. However when I run my test case i get the following error: java.lang.VerifyError: (class: com/db/abfo/tracing/PojoOne, method: calculate signature: ()V) catch_type not a subclass of Throwable This used to work when I used the aspectj after throwing language extention form: pointcut annotatedMethods(Tracing tracing) : execution(@Tracing * *(..)) && @annotation(tracing); after(Tracing tracing) throwing(Throwable t) : annotatedMethods(tracing) { Level level = tracing.level().getLevel(); if (logger.isEnabledFor(level)) { logger.log(level, formatter.formatSignatureThrowing(thisJoinPoint), t); } }
resolved fixed
9de03b7
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2007-12-02T09:24:51Z
2007-12-01T17:26:40Z
tests/src/org/aspectj/systemtest/ajc154/Ajc154Tests.java
for (int i = 0; i < meths.length && oneWeWant==null; i++) { Method method = meths[i]; if (method.getName().equals("main")) oneWeWant = meths[i]; } /** * For the main method: Stack=2, Locals=3, Args_size=1 0: iconst_5 1: istore_1 2: ldc #18; //String 3 4: astore_2 5: getstatic #24; //Field java/lang/System.out:Ljava/io/PrintStream; 8: aload_2 9: invokevirtual #30; //Method java/io/PrintStream.println:(Ljava/lang/String;)V 12: goto 23 15: pop 16: getstatic #24; //Field java/lang/System.out:Ljava/io/PrintStream; 19: iload_1 20: invokevirtual #33; //Method java/io/PrintStream.println:(I)V 23: return Exception table: from to target type 2 15 15 Class java/lang/Exception LineNumberTable: line 4: 0 line 6: 2 line 7: 5 line 8: 15
211,674
Bug 211674 [ataspectj] after throwing annotation style is too sensitive to parameter positions
Reported on the list by Ashley Williams: Having converted my aspects to use the @AspectJ style, I'm now getting a strange error message when a compile my tracing aspect,. First here is the section of code: @Pointcut("execution(@Tracing * *(..)) && @annotation(tracing)") void annotatedMethods(Tracing tracing) { } @AfterThrowing(pointcut = "annotatedMethods(tracing)", throwing = "t") public void logException(JoinPoint thisJoinPoint, Tracing tracing, Throwable t) { Level level = Level.toLevel(tracing.level()); if (logger.isEnabledFor(level)) { logger.log(level, formatter.formatSignatureThrowing(thisJoinPoint), t); } } So I am matching on all methods annotated with @Tracing and logging the subclass of Throwable that may have been thrown. However when I run my test case i get the following error: java.lang.VerifyError: (class: com/db/abfo/tracing/PojoOne, method: calculate signature: ()V) catch_type not a subclass of Throwable This used to work when I used the aspectj after throwing language extention form: pointcut annotatedMethods(Tracing tracing) : execution(@Tracing * *(..)) && @annotation(tracing); after(Tracing tracing) throwing(Throwable t) : annotatedMethods(tracing) { Level level = tracing.level().getLevel(); if (logger.isEnabledFor(level)) { logger.log(level, formatter.formatSignatureThrowing(thisJoinPoint), t); } }
resolved fixed
9de03b7
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2007-12-02T09:24:51Z
2007-12-01T17:26:40Z
tests/src/org/aspectj/systemtest/ajc154/Ajc154Tests.java
line 9: 16 line 11: 23 LocalVariableTable: Start Length Slot Name Signature 0 24 0 argv [Ljava/lang/String; 2 22 1 i I 5 10 2 s Ljava/lang/String; */ ConstantPool cp = oneWeWant.getConstantPool(); ConstantPoolGen cpg = new ConstantPoolGen(cp); oneWeWant.getLineNumberTable().getLineNumberTable()[2].setStartPC(6); MethodGen toTransform = new MethodGen(oneWeWant,"A",cpg,false); LineNumberTable lnt = toTransform.getMethod().getLineNumberTable(); assertTrue("Should have been 'rounded down' to position 5 but is "+lnt.getLineNumberTable()[2].getStartPC(), lnt.getLineNumberTable()[2].getStartPC()==5); } public void testCopingWithGarbage_pr175806_2() throws ClassNotFoundException { runTest("coping with bad tables"); JavaClass jc = getClassFrom(ajc.getSandboxDirectory(),"A"); Method[] meths = jc.getMethods(); Method oneWeWant = null;
211,674
Bug 211674 [ataspectj] after throwing annotation style is too sensitive to parameter positions
Reported on the list by Ashley Williams: Having converted my aspects to use the @AspectJ style, I'm now getting a strange error message when a compile my tracing aspect,. First here is the section of code: @Pointcut("execution(@Tracing * *(..)) && @annotation(tracing)") void annotatedMethods(Tracing tracing) { } @AfterThrowing(pointcut = "annotatedMethods(tracing)", throwing = "t") public void logException(JoinPoint thisJoinPoint, Tracing tracing, Throwable t) { Level level = Level.toLevel(tracing.level()); if (logger.isEnabledFor(level)) { logger.log(level, formatter.formatSignatureThrowing(thisJoinPoint), t); } } So I am matching on all methods annotated with @Tracing and logging the subclass of Throwable that may have been thrown. However when I run my test case i get the following error: java.lang.VerifyError: (class: com/db/abfo/tracing/PojoOne, method: calculate signature: ()V) catch_type not a subclass of Throwable This used to work when I used the aspectj after throwing language extention form: pointcut annotatedMethods(Tracing tracing) : execution(@Tracing * *(..)) && @annotation(tracing); after(Tracing tracing) throwing(Throwable t) : annotatedMethods(tracing) { Level level = tracing.level().getLevel(); if (logger.isEnabledFor(level)) { logger.log(level, formatter.formatSignatureThrowing(thisJoinPoint), t); } }
resolved fixed
9de03b7
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2007-12-02T09:24:51Z
2007-12-01T17:26:40Z
tests/src/org/aspectj/systemtest/ajc154/Ajc154Tests.java
for (int i = 0; i < meths.length && oneWeWant==null; i++) { Method method = meths[i]; if (method.getName().equals("main")) oneWeWant = meths[i]; } ConstantPool cp = oneWeWant.getConstantPool(); ConstantPoolGen cpg = new ConstantPoolGen(cp); oneWeWant.getLocalVariableTable().getLocalVariable(1).setStartPC(3); MethodGen toTransform = new MethodGen(oneWeWant,"A",cpg,true); } public void testGenericAspectGenericPointcut_pr174449() { runTest("problem with generic aspect and generic pointcut");} public void testGenericAspectGenericPointcut_noinline_pr174449() { runTest("problem with generic aspect and generic pointcut - noinline");} public void testGenericMethodsAndOrdering_ok_pr171953_2() { runTest("problem with generic methods and ordering - ok");} public void testGenericMethodsAndOrdering_bad_pr171953_2() { runTest("problem with generic methods and ordering - bad");} public void testItdAndJoinpointSignatureCollection_ok_pr171953() { runTest("problem with itd and join point signature collection - ok");} public void testItdAndJoinpointSignatureCollection_bad_pr171953() { runTest("problem with itd and join point signature collection - bad");} public void testGenericMethodsAndItds_pr171952() { runTest("generic methods and ITDs");} public void testItdsParameterizedParameters_pr170467() { runTest("itds and parameterized parameters");} public void testComplexGenerics_pr168044() { runTest("complex generics - 1");} public void testIncorrectlyMarkingFieldTransient_pr168063() { runTest("incorrectly marking field transient");} public void testInheritedAnnotations_pr169706() { runTest("inherited annotations");} public void testGenericFieldNPE_pr165885() { runTest("generic field npe");} public void testIncorrectOptimizationOfIstore_pr166084() { runTest("incorrect optimization of istore"); }