Summary: | Inconsistent classfile encountered: The undefined type parameter xxx is referenced from within yyy | ||
---|---|---|---|
Product: | [Tools] AspectJ | Reporter: | Matthew Adams <matthew> |
Component: | Compiler | Assignee: | aspectj inbox <aspectj-inbox> |
Status: | RESOLVED FIXED | QA Contact: | |
Severity: | normal | ||
Priority: | P3 | CC: | aclement, matthew |
Version: | 1.7.1 | ||
Target Milestone: | 1.7.2 | ||
Hardware: | Macintosh | ||
OS: | Mac OS X | ||
Whiteboard: |
Description
Matthew Adams
2012-09-17 14:25:23 EDT
by the 'app/app-test' I mean I get these errors: [ERROR] Failed to execute goal on project foundation-domain: Could not resolve dependencies for project com.scispike:foundation-domain:jar:0.1.0.BUILD-SNAPSHOT: The following artifacts could not be resolved: org.example:app-support:jar:0.1.0.BUILD-SNAPSHOT, org.example:app-test-support:jar:0.1.0.BUILD-SNAPSHOT: Failure to find org.example:app-support:jar:0.1.0.BUILD-SNAPSHOT in http://maven.springframework.org/release was cached in the local repository, resolution will not be reattempted until the update interval of maven.springframework.org has elapsed or updates are forced -> [Help 1] Until I remove the lines: <dependency> <groupId>org.example</groupId> <artifactId>app-support</artifactId> <version>${project.parent.version}</version> </dependency> <dependency> <groupId>org.example</groupId> <artifactId>app-test-support</artifactId> <version>${project.parent.version}</version> <scope>test</scope> </dependency> With those gone, and using the commit you referenced and running mvn clean verify, I now see the error, hurray! For some reason I was under the impression this was a new problem in 1.7.1 that didn't happen with 1.7.0 - but I've tried 1.7.1/1.7.0/1.6.12 and they all have the same problem. I'm glad you can repro. Ah, I know now why those dependencies are there that you had to remove. That's a copy/paste bug, which I've fixed & committed in the head. Sorry 'bout that! If you want me to fix it back at the commit that contains the error, then I'll have to do that, too. Let me know if that's something you want me to do. From debugging Matthews code, distilled the entire problem to this: Code.aj==== import java.io.*; interface Persistable<ID extends Serializable> { } public aspect Code { public interface I<ID extends Serializable> extends Persistable<ID> { } public static void foo() {} public boolean I.equals(Persistable<?> that) { return false; } } === Clazz.java=== public class Clazz { public static void main(String[] argv) { Code.foo(); } } === ajc -1.5 Code.aj ajc -1.5 Clazz.java org.aspectj.org.eclipse.jdt.internal.compiler.problem.AbortCompilation: Pb(538) Inconsistent classfile encountered: The undefined type parameter ID is referenced from within Code FYI, not that you need it now that you've distilled the problem, but I created a new branch called "aspectj-bug-389750" as a branch of commit 368b7dc827ef0237bdb6d460320cf1e7fbedf7da (the one containing the aj error) and fixed the poms there. fix committed. The problem is due to missing type variables in the generic signature for the ITD helper methods that get generated. They are missing because they are declared on the target type and we need to copy them over to the ITD. I confirmed this fixes it for your failing scenario that I could previously recreate. Great, Andy! In which release do you expect this to be included? it'll be in 1.7.2. I'll put a 1.7.2 snapshot on the spring maven repo. It'll be in AJDT shortly too. I grabbed 1.7.2.BUILD-SNAPSHOT & everything tested ok. |