Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Compile Error

Maybe a little more info will help to track this down.  I have the following interfaces:

public interface Finder {
...
}

public interface PartitionedFinder<P extends Partitioned<?>> extends Finder{
...
}

public interface LocalizedFinder<L extends Localized> extends Finder{
...
}

Each one of these interfaces has a corresponding aspect that defines default intertype implementations of it's methods.  Then I have this abstract class:

public abstract class OnetFinder<S, P extends Partitioned<?>, L extends Localized, O extends OnetElement<?>> 
implements Finder, PartitionedFinder<O>, LocalizedFinder<O> {
...
}

Up to this point it works great.  No compile errors and I can see from within the cross references view that the intertype methods are identified in the aspects, and all applied to OnetFinder.  Then I try to subclass OnetFinder:

public class CMEFinder extends OnetFinder<CMEStub, PartitionedCME, LocalizedCME, ContentModelElement>{
...
}

And here is where the problems come in.  I get an error that one of the methods from PartitionedFinder and one of the methods from LocalizedFinder, that are declared as intertype methods, need to be implemented, and all the advice markers and cross references disappear for every class.  The methods that aren't getting inherited properly are:

public <T extends Localized> List<T> bestLanguageMatch(List<T> list, List<String> languageOrder);

And

public <T extends Partitioned<?>> List<T> bestPartitionMatch(List<T> list, List<String> partitionOrder);

The strange thing there is that the cross references view showed both of those methods as being correctly applied to OnetFinder before I subclassed it.  They are also the only generic methods involved, so it seems that has something to do with that.  Hopefully that helps.

Dave Whittaker
Iradix, LLC
(p) 212.513.0874 x100
(f) 212.504.8213

On Jul 31, 2008, at 5:41 PM, Andy Clement wrote:

the recent dev builds of AJDT1.6.0 should also include the changes for 221885 to try and address your original problem.  However, are you definetly on the most recent AJDT driver for Eclipse 3.4?  On Eclipse 3.4 I am on AJDT 1.6.0.200807041530 - this includes a plugin AspectJ Weaver 1.6.1.20080703120000 (which is the final version of AspectJ 1.6.1)

The reason I ask is that the stack:

7/31/08 3:39:38 PM EDT: [ERROR] Internal compiler error
java.lang.ClassCastException: org.aspectj.weaver.UnresolvedTypeVariableReferenceType
       at org.aspectj.weaver.BoundedReferenceType.parameterize(BoundedReferenceType.java:64)
       at org.aspectj.weaver.ResolvedType.parameterize(ResolvedType.java:1906)
       at org.aspectj.weaver.ResolvedMemberImpl.parameterize(ResolvedMemberImpl.java:682)

can't occur on the most recent drivers (I don't believe) because of the changes in AspectJ.  Line 64 in BoundReferenceType is no longer where the parameterize() method is.  The latest AJDT is always here for Eclipse 3.4:


The other log entry you keep seeing looks like another manifestation of https://bugs.eclipse.org/bugs/show_bug.cgi?id=226163 - which usually means there is a real error but it is being hidden behind a crash during parser recovery.  Given this entry on the stack: checkNonNLSAfterBodyEnd( - you could try turning off the check that strings are marked NON-NLS to see if that helps temporarily alleviate it.

Andy.

2008/7/31 Dave Whittaker <dave@xxxxxxxxxx>
Hi Andy,

Actually, I just upgraded to Eclipse 3.4 this week, so I'm running the latest 1.6.0 from the dev repository.  Any tips on how I can get some more debug information on where and why this is occurring?  I'm also seeing this in the Eclipse log.  The exception is thrown from JDT but there are calls from AJDT further up in the stack.

!ENTRY org.eclipse.jdt.ui 4 2 2008-07-29 18:53:25.188
!MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.jdt.ui"
.
!STACK 0
java.lang.ArrayIndexOutOfBoundsException: -1
        at org.aspectj.org.eclipse.jdt.internal.compiler.parser.RecoveryScanner.
getNextToken(RecoveryScanner.java:143)
        at org.aspectj.org.eclipse.jdt.internal.compiler.parser.TheOriginalJDTPa
rserClass.checkNonNLSAfterBodyEnd(TheOriginalJDTParserClass.java:1142)
        at org.aspectj.org.eclipse.jdt.internal.compiler.parser.TheOriginalJDTPa
rserClass.parseStatements(TheOriginalJDTParserClass.java:7906)
        at org.aspectj.org.eclipse.jdt.internal.compiler.parser.TheOriginalJDTPa
rserClass$1$MethodVisitor.endVisitMethod(TheOriginalJDTParserClass.java:8161)
        at org.aspectj.org.eclipse.jdt.internal.compiler.parser.TheOriginalJDTPa
rserClass$1$MethodVisitor.endVisit(TheOriginalJDTParserClass.java:8147)
        at org.aspectj.org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.t
raverse(MethodDeclaration.java:247)
        at org.aspectj.org.eclipse.jdt.internal.compiler.parser.TheOriginalJDTPa
rserClass.recoverStatements(TheOriginalJDTParserClass.java:8253)
        at org.aspectj.org.eclipse.jdt.internal.compiler.parser.TheOriginalJDTPa
rserClass.parse(TheOriginalJDTParserClass.java:7461)
        at org.aspectj.org.eclipse.jdt.internal.compiler.parser.TheOriginalJDTPa
rserClass.parse(TheOriginalJDTParserClass.java:7738)
        at org.aspectj.org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.p
arseStatements(MethodDeclaration.java:124)
        at org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.par
seMethod(TypeDeclaration.java:825)
        at org.aspectj.org.eclipse.jdt.internal.compiler.parser.TheOriginalJDTPa
rserClass.getMethodBodies(TheOriginalJDTParserClass.java:6654)
        at org.eclipse.ajdt.core.parserbridge.AJSourceElementParser.parseCompila
tionUnit(AJSourceElementParser.java:1643)
        at org.eclipse.ajdt.internal.ui.editor.CompilationUnitAnnotationModelWra
pper.beginReporting(CompilationUnitAnnotationModelWrapper.java:216)
        at org.eclipse.jdt.internal.core.ReconcileWorkingCopyOperation.reportPro
blems(ReconcileWorkingCopyOperation.java:129)
        at org.eclipse.jdt.internal.core.ReconcileWorkingCopyOperation.executeOp
eration(ReconcileWorkingCopyOperation.java:104)
        at org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperati
on.java:709)
        at org.eclipse.jdt.internal.core.JavaModelOperation.runOperation(JavaMod
elOperation.java:770)
        at org.eclipse.jdt.internal.core.CompilationUnit.reconcile(CompilationUn
it.java:1224)
        at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.reconci
le(JavaReconcilingStrategy.java:124)
        at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.access$
0(JavaReconcilingStrategy.java:108)
        at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy$1.run(J
avaReconcilingStrategy.java:89)
        at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
        at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.reconci
le(JavaReconcilingStrategy.java:87)
        at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.reconci
le(JavaReconcilingStrategy.java:149)
        at org.eclipse.jdt.internal.ui.text.CompositeReconcilingStrategy.reconci
le(CompositeReconcilingStrategy.java:86)
        at org.eclipse.jdt.internal.ui.text.JavaCompositeReconcilingStrategy.rec
oncile(JavaCompositeReconcilingStrategy.java:102)
        at org.eclipse.jface.text.reconciler.MonoReconciler.process(MonoReconcil
er.java:77)
        at org.eclipse.jface.text.reconciler.AbstractReconciler$BackgroundThread
.run(AbstractReconciler.java:206)

Dave Whittaker
Iradix, LLC
(p) 212.513.0874 x100
(f) 212.504.8213

On Jul 31, 2008, at 4:23 PM, Andy Clement wrote:

Hi,

This looks like the bug you raised a little while ago https://bugs.eclipse.org/bugs/show_bug.cgi?id=221885 and we didn't resolve properly.  Are you on AJDT 1.5.3 now?

cheers,
Andy.

2008/7/31 Dave Whittaker <dave@xxxxxxxxxx>
I'm getting an error that I hope somebody can help me out with.  I'm trying to do some Intertype declarations for generic interfaces.  All of a sudden, AJDT seems to have stopped compiling and applying my aspects all together, and if I try to compile from Maven I get the stack trace below.  Does anyone have any ideas what could be causing this?  I'd be happy to furnish more information on my project, just let me know what will help.

7/31/08 3:39:38 PM EDT: [ERROR] Internal compiler error
java.lang.ClassCastException: org.aspectj.weaver.UnresolvedTypeVariableReferenceType
       at org.aspectj.weaver.BoundedReferenceType.parameterize(BoundedReferenceType.java:64)
       at org.aspectj.weaver.ResolvedType.parameterize(ResolvedType.java:1906)
       at org.aspectj.weaver.ResolvedMemberImpl.parameterize(ResolvedMemberImpl.java:682)
       at org.aspectj.weaver.ResolvedMemberImpl.parameterizedWith(ResolvedMemberImpl.java:640)
       at org.aspectj.weaver.NewMethodTypeMunger.parameterizedFor(NewMethodTypeMunger.java:103)
       at org.aspectj.ajdt.internal.compiler.lookup.EclipseTypeMunger.parameterizedFor(EclipseTypeMunger.java:202)
       at org.aspectj.weaver.ResolvedType.fillInAnyTypeParameters(ResolvedType.java:1395)
       at org.aspectj.weaver.ResolvedType.addInterTypeMunger(ResolvedType.java:1420)
       at org.aspectj.ajdt.internal.compiler.lookup.AjLookupEnvironment.weaveInterTypeDeclarations(AjLookupEnvironment.java:639)
       at org.aspectj.ajdt.internal.compiler.lookup.AjLookupEnvironment.weaveInterTypeDeclarations(AjLookupEnvironment.java:513)
       at org.aspectj.ajdt.internal.compiler.lookup.AjLookupEnvironment.completeTypeBindings(AjLookupEnvironment.java:223)
       at org.aspectj.org.eclipse.jdt.internal.compiler.Compiler.beginToCompile(Compiler.java:301)
       at org.aspectj.org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:315)
       at org.aspectj.ajdt.internal.core.builder.AjBuildManager.performCompilation(AjBuildManager.java:987)
       at org.aspectj.ajdt.internal.core.builder.AjBuildManager.doBuild(AjBuildManager.java:264)
       at org.aspectj.ajdt.internal.core.builder.AjBuildManager.batchBuild(AjBuildManager.java:180)
       at org.aspectj.ajdt.ajc.AjdtCommand.doCommand(AjdtCommand.java:112)
       at org.aspectj.ajdt.ajc.AjdtCommand.runCommand(AjdtCommand.java:60)
       at org.aspectj.tools.ajc.Main.run(Main.java:378)
       at org.aspectj.tools.ajc.Main.runMain(Main.java:253)
       at org.codehaus.mojo.aspectj.AbstractAjcCompiler.execute(AbstractAjcCompiler.java:378)
       at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:579)
       at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:498)
       at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmentForProject(DefaultLifecycleExecutor.java:265)
       at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:191)
       at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:149)
       at org.apache.maven.DefaultMaven.execute_aroundBody0(DefaultMaven.java:223)
       at org.apache.maven.DefaultMaven.execute_aroundBody1$advice(DefaultMaven.java:304)
       at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:1)
       at org.apache.maven.embedder.MavenEmbedder.execute_aroundBody2(MavenEmbedder.java:904)
       at org.apache.maven.embedder.MavenEmbedder.execute_aroundBody3$advice(MavenEmbedder.java:304)
       at org.apache.maven.embedder.MavenEmbedder.execute(MavenEmbedder.java:1)
       at org.maven.ide.eclipse.internal.project.MavenProjectManagerImpl$MavenExecutor.execute(MavenProjectManagerImpl.java:1036)
       at org.maven.ide.eclipse.internal.project.MavenProjectManagerImpl$1.execute(MavenProjectManagerImpl.java:1063)
       at org.maven.ide.eclipse.internal.project.MavenProjectManagerImpl.execute(MavenProjectManagerImpl.java:992)
       at org.maven.ide.eclipse.internal.project.MavenProjectManagerImpl.execute(MavenProjectManagerImpl.java:1060)
       at org.maven.ide.eclipse.project.MavenProjectFacade.execute(MavenProjectFacade.java:285)
       at org.maven.ide.eclipse.container.MavenBuilder.executePostBuild(MavenBuilder.java:136)
       at org.maven.ide.eclipse.container.MavenBuilder.build(MavenBuilder.java:73)
       at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:633)
       at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
       at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:170)
       at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:201)
       at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:253)
       at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
       at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:256)
       at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:309)
       at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:341)
       at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:140)
       at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:238)
       at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users

_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users


_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users


_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users


Back to the top