Bug 145689 - Compile Errors Still Sometimes not Shown in Problems View
Summary: Compile Errors Still Sometimes not Shown in Problems View
Status: RESOLVED FIXED
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: DEVELOPMENT   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 1.5.3   Edit
Assignee: aspectj inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 151818
  Show dependency tree
 
Reported: 2006-06-07 00:17 EDT by Ron Bodkin CLA
Modified: 2009-07-14 12:50 EDT (History)
2 users (show)

See Also:


Attachments
trace when converting from Java to AspectJ (with outjar) (440.58 KB, text/plain)
2006-06-07 09:53 EDT, Ron Bodkin CLA
no flags Details
trace after editing code to create syntax error. (268.04 KB, text/plain)
2006-06-07 09:54 EDT, Ron Bodkin CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ron Bodkin CLA 2006-06-07 00:17:57 EDT
I converted a fairly large pure Java project to be an AspectJ project and find that when I get syntax errors the AspectJ compile stops short without producing an outjar but no problems are listed for it in the problems view. This is with no aspects involved: this is actually a defect in AJDT acting as a pure Java builder.

This is with a recent dev build (20060512123514).
Comment 1 Matt Chapman CLA 2006-06-07 05:56:43 EDT
Before converting, please can you open the AJDT event trace view and enable all Compiler categories in the trace. Then convert the project, and paste in the output here. There is still a known situation in which this problem can occur, so it would be good to know if this is the same. Also, that dev build is nearly a month old, and there have been some fixes since then, so please could you try with the latest?
Comment 2 Ron Bodkin CLA 2006-06-07 09:52:16 EDT
It looks like one error (probably an unrelated bug) is happening because two other AspectJ projects depended on this one being in their classpath but they aren't correctly reading output from an outjar. I could file that as a separate bug.

Anyhow I've attached the full trace for when I convert the project and then when I change a single nethod name to create a missing method error (which AJDT isn't reporting).
Comment 3 Ron Bodkin CLA 2006-06-07 09:53:30 EDT
Created attachment 43710 [details]
trace when converting from Java to AspectJ (with outjar)
Comment 4 Ron Bodkin CLA 2006-06-07 09:54:59 EDT
Created attachment 43711 [details]
trace after editing code to create syntax error.

both traces were from the latest AJDT 20060605111535
Comment 5 Matt Chapman CLA 2006-06-07 11:56:47 EDT
Thanks for the traces. The compiler is issuing errors against resources which it hasn't indicated it has processed. Passing over for further investigation.
Comment 6 Andrew Clement CLA 2006-06-07 12:00:10 EDT
suspected dup of bug 126118 which also deals with errors that occur very early in the process not getting through.
Comment 7 Andrew Clement CLA 2006-06-27 04:27:30 EDT
does the java project have many dependencies, can it be sent to me as a standalone entity?  without recreating this, it will be damn tough to fix.
Comment 8 Andrew Clement CLA 2006-06-27 09:31:29 EDT
I am not quite sure which messages we think are vanishing since there are so many in that trace, is it all of them?

Anyway, I'm looking through the trace attached in comment #4.  I'm looking at the final compile in that which starts at timestamp "6:51:48 AM".

I can see a lot of errors reported like this:
=============
6:51:51 AM addSourcelineTask message=com.dcx.NGST.gui.screens.HomeScreenControllerMore cannot be resolved to a type file=C:\ngst\app\java\macro\src\com\dcx\NGST\macro\gui\screens\HomeScreenControllerMore.java line=25
6:51:51 AM addSourcelineTask message=The method buildPanel() is undefined for the type Object file=C:\ngst\app\java\macro\src\com\dcx\NGST\macro\gui\screens\HomeScreenControllerMore.java line=43
6:51:51 AM addSourcelineTask message=buttonFactory cannot be resolved file=C:\ngst\app\java\macro\src\com\dcx\NGST\macro\gui\screens\HomeScreenControllerMore.java line=45
6:51:51 AM addSourcelineTask message=emptyButton11 cannot be resolved file=C:\ngst\app\java\macro\src\com\dcx\NGST\macro\gui\screens\HomeScreenControllerMore.java line=55
================

A little further up I can see the line:
=================
6:51:49 AM AJC: compiled: C:\ngst\app\java\macro\src\com\dcx\NGST\macro\gui\screens\HomeScreenControllerMore.java
=================

It is a similar story for the others that I look at.  The errors come out and there has already been a 'compiled:' line fed back to indicate the resource has been processed.  Does AJDT not like the fact that the error has been reported against a resource earlier than the most recent one it has been told about?

Or have I missed the point...
i'll carry on playing to recreate this.
Comment 9 Andrew Clement CLA 2006-06-27 09:59:39 EDT
interestingly when the error message comes out about not adding the marker, it says:

6:51:51 AM Not adding marker for problem because it's against a resource which is not in the list of affected resources provided by the compiler. Resource=L/macro/src/com/dcx/NGST/macro/gui/screens/HomeScreenControllerMore.java Problem message=com.dcx.NGST.gui.screens.HomeScreenControllerMore cannot be resolved to a type line=25

Does the 'L' on the front of the resource indicate a linked source folder or some such?
Comment 10 Andrew Clement CLA 2006-06-27 10:12:05 EDT
Ron, what kind of configuration are you using?  Do you have an external location defined for your projects? linked source folders?
Comment 11 Ron Bodkin CLA 2006-06-27 10:21:46 EDT
This configuration is not using linked source folders...

ngst project:
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
	<classpathentry kind="src" path="src"/>
	<classpathentry kind="src" path="testsrc"/>
	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
	<classpathentry kind="src" path="/API"/>
...
	<classpathentry combineaccessrules="false" kind="src" path="/lib"/>
	<classpathentry kind="lib" path="/lib/concurrent-1.3.4.jar"/>
...
	<classpathentry combineaccessrules="false" kind="src" path="/StepLangSupportObjects"/>
	<classpathentry combineaccessrules="false" kind="src" path="/RoutineViews"/>
	<classpathentry kind="var" path="ASPECTJRT_LIB"/>
	<classpathentry kind="output" path="eclipse-target"/>
</classpath>

macro:
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
	<classpathentry kind="src" path="src"/>
	<classpathentry kind="src" path="testsrc"/>
	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
	<classpathentry kind="src" path="/API"/>
...
	<classpathentry combineaccessrules="false" kind="src" path="/lib"/>
	<classpathentry kind="lib" path="/lib/concurrent-1.3.4.jar"/>
...
	<classpathentry combineaccessrules="false" kind="src" path="/StepLangSupportObjects"/>
	<classpathentry combineaccessrules="false" kind="src" path="/RoutineViews"/>
	<classpathentry kind="var" path="ASPECTJRT_LIB"/>
	<classpathentry kind="output" path="eclipse-target"/>
</classpath>


<?xml version="1.0" encoding="UTF-8"?>
<classpath>
	<classpathentry kind="src" path="src"/>
	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
	<classpathentry kind="src" path="/API"/>
...
	<classpathentry combineaccessrules="false" kind="src" path="/lib"/>
	<classpathentry kind="lib" path="/lib/cglib-2.0-rc2.jar"/>
...
	<classpathentry kind="var" path="ASPECTJRT_LIB"/>
	<classpathentry kind="output" path="eclipse-target"/>
</classpath>
Comment 12 Matt Chapman CLA 2006-06-27 10:37:13 EDT
Ron, could you send us a zip of the projects? I think we'll be able to figure out what's going wrong here if we can step through it ourselves.
Comment 13 Ron Bodkin CLA 2006-06-27 12:37:15 EDT
Let me see what I can do. The code is confidential customer code so I can't provide it without permission, but maybe I can recreate the problem in a simpler environment without confidential code. I've also seen problems like this in open source code, so I'll try to reproduce a similar problem with the Glassbox code. Stay tuned...
Comment 14 Ron Bodkin CLA 2006-06-27 14:36:03 EDT
I recreated the problem in the Glassbox project and sent a project to Matt Chapman and Andy in an email. Please let me know if you need any more help to track this down.
Comment 15 Matt Chapman CLA 2006-06-27 14:36:21 EDT
I've reproduced this with glassbox:

19:36:01 Build kind = FULLBUILD
19:36:01 Project=glassboxMonitor, kind of build requested=Full AspectJ
compilation
19:36:01 Builder: Tidied output folder(s), deleted 0 .class files
19:36:01 Preparing for build: not going to be incremental because no successful
previous full build
19:36:02 addSourcelineTask message=The type
javax.servlet.http.HttpServletRequest cannot be resolved. It is indirectly
referenced from required .class files
file=E:\AJDTversions\eclipse-SDK-3.2RC7-win32\eclipse\runtime-EclipseApplication\glassboxMonitor\testsrc\glassbox\util\logging\LoggingTest.java
line=0
19:36:02 AJDE Callback: finish()
19:36:02 Timer event: 1012ms: Total time spent in AJDE
19:36:02 Timer event: 30ms: Create element map (0 rels in project:
glassboxMonitor)
19:36:02 Types affected during build = 0
19:36:02 Not adding marker for problem because it's against a resource which is
not in the list of affected resources provided by the compiler.
Resource=L/glassboxMonitor/testsrc/glassbox/util/logging/LoggingTest.java
Problem message=The type javax.servlet.http.HttpServletRequest cannot be
resolved. It is indirectly referenced from required .class files line=0
19:36:02 Timer event: 0ms: Add markers (0 markers)
19:36:02 Timer event: 1152ms: Total time spent in AJBuilder.build()
Comment 16 Andrew Clement CLA 2006-06-28 11:11:34 EDT
I have also recreated this now.  With the new projects we've been sent, it is a definetly a different bug than what is described in comment #4, comment #8 and comment #9 but it exhibits the similar symptom of the error message not reaching the users problems view.   So i can work on fixing this case but it wont fix the original case.

The reason the compiler has not reported that it has compiled the file is because it hasn't.  Post diet parse of the units we attempt to complete the type system holding everything together, before continuing with full compilation.  If a jar is removed from the required list that contains a type required to make the type system consistent then an error (like this one) is created post diet parse and before compilation.

At the moment I'm trying to think back as to why we made AJDT only record problems against resources it had heard about through "compiled:" "woven:" messages.  My recollection is that it is what enabled us to tidy up the right bunch of messages just prior to the subsequent incremental compile - if all messages of unknown origin just got dumped at the project level, we'd never know it was safe to remove them until you did a full build.

I really don't want to add a bunch of new messages coming from the compiler 'diet parsed: XXX' - so I wonder what harm it would be to allow AJDT to put it on the resource, we clearly have a resource in mind that it relates to "L/glassboxMonitor/testsrc/glassbox/util/logging/LoggingTest.java" (whatever the L is doing there... who knows). hmmm.
Comment 17 Andrew Clement CLA 2006-06-28 11:23:35 EDT
So the 'L' is because AJDT has done the hard work and discovered which file it is.  It just decided (CompilerTaskListManager:236) that it wasnt on the affected resources list.
Comment 18 Andrew Clement CLA 2006-06-28 11:33:44 EDT
I wonder if we should consider everything an affected resource *if* we are doing a full build (more correctly, if the compiler determined it needed to do a full build) - because removing a jar causes this bug to appear and removing a jar is considered a path change and a path change means a full build.  If I look at the comment against the affectedResources check it mentions bug 128803 - and that talks about doing checks so duplicate warnings aren't reported, but if we are full building we will know to clear up *everything* (because everything can be considered an affected resource) and so duplicates cant happen.
Comment 19 Matt Chapman CLA 2006-06-28 16:51:47 EDT
Yes, AJDT knows the resource and could add an error marker for it. That does sound reasonable, disregarding the affected list when the compiler reports a full build.  I'll look into it. Note that the problem also occurs with AJDT 1.3.1.
Comment 20 Matt Chapman CLA 2006-06-30 06:17:15 EDT
The above logic seems to work, initially at least. We just need a way for the compiler to tell AJDT whether the previous build was full or incremental (currently this is only possible in debug mode, when we register a state listener).
Comment 21 Andrew Clement CLA 2006-07-24 07:03:35 EDT
Modified BuildProgressMonitor so that the finish method takes a boolean indicating if the build just completed was a full build or not.  Changes are in AspectJ HEAD.
Comment 22 Andrew Clement CLA 2006-07-27 04:15:42 EDT
fix delivered in AJ and AJDT now...