Bug 23635 - Compilation Errors Inconsistent
Summary: Compilation Errors Inconsistent
Status: RESOLVED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0.1   Edit
Hardware: PC Windows NT
: P3 normal (vote)
Target Milestone: 2.1 M1   Edit
Assignee: Kent Johnson CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-09-17 07:08 EDT by Jim CLA
Modified: 2003-03-23 12:20 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jim CLA 2002-09-17 07:08:11 EDT
Built project showed 2 compile errors in Package Explorer and Tasks windows. 
But when a full project build was done you could see in the 'Progress 
Information' window that there were over 100 errors being found. The 2 errors 
being shown were simple buildpath errors:

Error			The project was not built since its classpath is 
incomplete. Can not find the class file for javax.crypto.SecretKey. Fix the 
classpath then try rebuilding this project	axis		

Error			This compilation unit indirectly references the missing 
type javax.crypto.SecretKey (typically some required class file is referencing 
a type outside the classpath)	SignedSOAPEnvelope.java	axis/WEB-
INF/src/samples/security	line 0 in SignedSOAPEnvelope.java

Both fixed by the addition of the jce jar to the buildpath.

Now when project is building you can see that 'Progress Information' window is 
still coming up over 100 errors. These are now flagged in the Package Explorer 
and Task windows.

If the jce.jar is removed from the buildpath, Progress Info window shows over 
100 errors on a project build, but as before only 2 errors are flagged in 
Package Explorer and Task windows.
Comment 1 Philipe Mulet CLA 2002-09-17 12:01:34 EDT
The build action by default will abort in presence of build path errors (see 
option: Window>Preferences>Java>Compiler>Other>Abort building on build path 
errors).

Now I agree that we shouldn't show you more in the progress.

Comment 2 Kent Johnson CLA 2002-09-17 12:43:03 EDT
The progress dialog shows problems found per project, not just errors.

Does your task window have any filters enabled which may be hiding deprecated 
warnings, for example?

Were you rebuilding only the project which had classpath errors, or all 
projects in your workspace? The 100 problems may have been warnings issued 
against another project.
Comment 3 Jim CLA 2002-09-18 04:58:12 EDT
Even if i uncheck the Window>Preferences>Java>Compiler>Other>Abort building on 
build path errors, the same still occurs.

I have the default enabled on the Task filters. They are mostly errors.

I currently only have 2 projects defined in my workspace....one of them being 
JUnit which has no errors against it.

Once i add in the jce.jar (from the JDK1.4) to fix the 2 errors i mentioned 
initially, i see all the other errors and warnings....which is what i want. 
Perhaps there is a problem with the checkbox to abort a build on errors?
Comment 4 Kent Johnson CLA 2002-09-18 12:38:56 EDT
Sorry I should have read the errors closer...

In the past developers had a hard time trying to see why their project's build 
failed because of missing jar files... the task list contained 100 errors, but 
only 1-2 explained why the build did not finish.

The compiler notices a missing .class file and aborts the build halfway. It has 
already found numerous errors before it notices that a .class is missing and it 
cannot continue. To make it obvious that the project was only partially built, 
we decided to throw away all the errors/warnings that were found and only 
present 2 errors... so the user can fix the serious problem and continue.

Until fatal errors such as missing jar files are presented differently in the 
task list, we feel this is the best way to inform users that they have a 
serious problem which must be addressed before anything else.

Do you agree?
Comment 5 Jim CLA 2002-09-19 04:56:01 EDT
Agree with this. Perhaps in future could have some kind of way of flagging the 
fatal errors.

My problem was that i only had 2 projects defined. 1 was JUnit which was ok. 
The other was a Tomcat project for Axis. Within this Axis project, as well as 
my code i had imported the Axis source and samples etc. The build error was to 
do with one of the Axis sample packages....which was of no particular interest 
to me at the time, so i had no great desire to fix any problems to do with it. 
But this meant that i could not see the compile errors relating to my own 
source. 

Is the answer to set up a separate project for all the 3rd party source and 
samples, so my own source build would not be related to the Axis source etc?

In relation to this, a lot of the Axis samples had many compile errors relating 
to classes that could not be resolved. This was because some of the sample 
packages contained class files without the source......so they could be 
deployed as web services with a supplied wsdd file. An alternative would just 
be to manually cut and paste the class files to the output directory, but is 
there a way to prevent the output folder from scrubbing on a build?
Comment 6 Kent Johnson CLA 2002-09-19 10:05:13 EDT
"Is the answer to set up a separate project..."

Yes it is. You should/can define a separate project for each 3rd party project. 
This allows you to control/ignore problems on a per project basis.

"An alternative would just be to manually cut and paste the class files to the 
output directory..."

The preferred method is to place the .class files in a binary folder on the 
classpath. Putting .class files directly in the output folder does not work.

Open the properties dialog of your project and go to the 'Java Build Path-
>Libraries->Advanced' dialog to define a .class folder.