Bug 126118 - Problems not being reported with unknown classpath entry
Summary: Problems not being reported with unknown classpath entry
Status: NEW
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: DEVELOPMENT   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: aspectj inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-02-01 18:43 EST by Ron Bodkin CLA
Modified: 2006-05-12 11:39 EDT (History)
0 users

See Also:


Attachments
Test project (1.26 KB, application/x-zip-compressed)
2006-02-02 05:54 EST, Sian January 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-02-01 18:43:29 EST
AJDT compiles are hanging for me (and Mohan) on a project with a missing source folder and a missing JRE entry (reported by a user of the Glassbox Inspector project who tried to run a zip distribution). Removing the missing source folder and pointing the JRE at the system default fixes the problem.

The bad distribution is available here: http://www.glassbox.com/glassbox/InspectorDownload.do?mediaItemId=77
 (hopefully I can keep this available after I update to fix the problems in the built version).
Comment 1 Sian January CLA 2006-02-02 05:54:39 EST
Created attachment 34007 [details]
Test project
Comment 2 Sian January CLA 2006-02-02 05:57:34 EST
I have attached a smaller test project.  The problem seems to be the strange JRE entry in the .classpath file - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/sun 1.3.1_17"/>

When I tried to debug this it seemed to be org.aspectj.ajdt.internal.CompilerAdapter.configureProjectOptions(..) that was hanging.

Passing the bug to AspectJ.
	
Comment 3 Helen Beeken CLA 2006-02-03 10:17:28 EST
The hang is comming from JDT code. Following this through with the debugger, it's hanging on a call to 

JavaModelManager.getJavaModelManager();

within org.eclipse.jdt.internal.core.JavaProject.getResolvedClasspath(..) (line 1927). 

However, if the same project is used for a javaproject (same classpath just without the aspectjrt) then the project doesn't compile and there's a problem in the problems view saying that "the project hasn't been built since its build path is incomplete....". Therefore, we need to do a similar thing - if the build path is incomplete then don't even try to do a build.
Comment 4 Helen Beeken CLA 2006-02-06 08:22:49 EST
This is an AJDT bug. 

Within AspectJ, the failure is occuring within CompilerAdapter.configureProjectProperties() at the call:

    config.setSourcePathResources(properties.getSourcePathResources());

where properties is a ProjectPropertiesAdapter. 

If you compile an aj project without a jre on the classpath and without using the AJDT ProjectPropertiesAdapter then we fail with an error message "can't find type java.lang.Object.....". It is only when running through AJDT that the error occurs. In the case of AJDT, "properties" is an org.eclipse.ajdt.internal.ui.ajde.ProjectProperties. It is the implementation of getSourcePathResources() within here which is causing the hang.

As a note, the implementation of getClasspath() returns all those entries which it can find, so in the case of a missing jre, it doesn't have this on the classpath (this is called at the beginning of the CompilerAdapter.configureProjectProperties() method). Also, the JavaBuilder.build(..) method catches a MissingClassFileException and it is here that the "incomplete classpath" error message in the problems view comes from. 
Comment 5 Matt Chapman CLA 2006-05-12 06:27:29 EDT
With the latest AJDT 1.4.0 dev for Eclipse 3.2RC3, the hang now longer occurs, presumably because of JDT changes. The symptom is now that the compiler issues an appropriate error, but this is not associated with the affected resource, so it doesn't appear properly in AJDT. This is similar to issue #1 in bug 132314. Passing over to compiler.
Comment 6 Helen Beeken CLA 2006-05-12 11:39:26 EDT
The example in this bug is a missing jre. In this case an AbortException is thrown when we're doing AjLookupEnvironment.completeTypeBindings(..). This all happens within Compiler.compile(..) before the call to process. Consequently the before/after processing doesn't take place and the type isn't added to the list of resultsPendingWeave. Thus, when we come to notifyRequestor() after realising that there was a problem there are no resultsPendingWeave and no error is reported.