Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » AspectJ » Inconsistent workspace state with declare parents
Inconsistent workspace state with declare parents [message #1839069] Fri, 12 March 2021 12:01
Arslan Ash is currently offline Arslan AshFriend
Messages: 1
Registered: March 2021
Junior Member
I'm using declare parents to insert base classes at the top of a class hierarchy. I'm then getting inconsistent results as to whether the methods in those base classes are actually visible to subclasses a couple of layers down the inheritance tree. The end result is that for some, but not all, inserted parent classes:



* I get an undefined method error decoration in the AJ editor wherever I call one of the new methods on a derived class
* Verbose ajbuilder compiler messages show the same undefined method error
* The Problems view shows the same undefined method error


However:

* The expected inheritance hierarchy exists in the generated class files
* The outline quick view (ctrl+O, ctrl+O) shows the method present as expected
* I can highlight one of the problem method calls marked with the red squiggly, and navigate to the method definition using F3
* Compilation in stages using ANT and iajc does work. I.e. I compile some of the sources to a jar, then compile the next set with that jar on the classpath.
* iajc compilation in one stage shows the similar (but slightly different) errors to ajbuilder


From the little I know of Eclipse internals, it seems to me that the emitted class files and the java model are consistent with each other but different to the AST.

All this is too vague to troubleshoot, I know. However, right now my only reproducible test case is a 500MB set of sources and libraries, so what I'm after is any insight into possible underlying mechanisms so as to help me narrow things down to a manageable test case.

I've speculated that there's something about the project structure that is causing ajbuilder to incorrectly calculate dependencies and therefore get the compilation and weaving order wrong. To test this, I turned on verbose compiler messages and compared the output before and after inserting an empty inner class to a particular source file. The result was:


* Every inner class in the project went from being woven before its enclosing class to being woven after the enclosing class
* Another class which was a sibling in the class hierarchy to the one I edited was suddenly able to expose the new methods from the inserted base class i.e. one of the undefined method errors in its callers went away.


Other than that, the compile and weaving order was identical.
Previous Topic:Download AJDT Tools Manually
Next Topic:AspectJ in Scala
Goto Forum:
  


Current Time: Fri Apr 26 14:58:11 GMT 2024

Powered by FUDForum. Page generated in 0.03000 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top