Bug 34708 - unreliable full build/refresh using linked source folders
Summary: unreliable full build/refresh using linked source folders
Status: RESOLVED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.1   Edit
Hardware: PC Windows 2000
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-03-11 14:41 EST by Frank Sauer CLA
Modified: 2009-08-30 02:34 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Frank Sauer CLA 2003-03-11 14:41:42 EST
We see a strange discrepancy between a full build and an auto-build (when a 
resource is saved and automatically compiled). We see this compile error on a
full build:

CSS.System cannot be resolved	ProcessComplianceOutput.java	line 251

Even though this class *is* available on the build path. When this file is
modified and saved, it *does* compile without errors.....

The CSS.System is a *package* The class being imported is 
CSS.System.EventsHelper, but the error indicates that the package 
is the problem. Other classes in this package suffer from the same problem.
However, classes in CSS.EDIExport package (same jar) are resolved fine.

This problem does *NOT* occur when the source folder is *NOT* a linked resource
Comment 1 Kent Johnson CLA 2003-03-11 16:17:33 EST
Which build are you running?

Is any other tool modifying the linked folder?
Comment 2 Frank Sauer CLA 2003-03-11 16:28:21 EST
I'm running 2.1 RC2, and a colleage is seeing the same behavior in 2.1 M5.
The linked folder is a Clearcase managed folder on a server, but at the 
time of this test, nobody was modifying it. The jar with the classes that
can't be resolved during a full build is an external jar on the build path.
Comment 3 Jerome Lanneluc CLA 2003-03-12 10:16:00 EST
Do you have anything relevant in the .log file?
Comment 4 Frank Sauer CLA 2003-03-12 10:22:02 EST
no, nothing in the log that seems to relate to this problem.
Comment 5 Kent Johnson CLA 2003-03-12 11:22:29 EST
Can you search all the folders on the buildpath to see if any include the 
package CSS.System?

What happens if you move the external jar inside the workspace?
Comment 6 Frank Sauer CLA 2003-03-12 13:25:01 EST
CSS.* only appears in the jar in question. Moving the jar into a lib folder
inside the project, not linked and added with 'Add jar' makes no difference.

The only thing (that I've found) that makes this work is to *NOT* use a linked
source folder.... It's almost as if 'System' is treated specially or something,
because other packages in the same jar are resolved fine.
Comment 7 Kent Johnson CLA 2003-03-12 14:36:06 EST
This is very wierd.

Is there any chance you can provide a small testcase in a project by itself 
pointing at the external jar file?
Comment 8 Frank Sauer CLA 2003-03-13 13:25:13 EST
I've been trying to create a small project reproducing the problem,
but so far I've been unable to. The project where this occurs is huge.
Update: Another project not using linked source folder, but with the
entire project on the remote clearcase monitored server is now also showing
the same behavior. It boils down to:

1) full build fails with unresolvable package CSS.System,
2) editing a file with the above error to trigger an auto build makes the
   error go away,
3) other packages/classes in the same jar resolve fine

regardles of the kind of source folders.

I also tried unpacking the jar containing CSS.System into a folder and
adding it as a class folder to the project's build path, no relief...
Comment 9 Kent Johnson CLA 2003-03-13 13:51:57 EST
Can you provide a sample of one of the errors? Try copying a problem method 
into a type by itself.

System is a well know type name in java.lang so its possible the compiler is 
getting confused.

I have defined a package named CSS.System with some types & placed them in a 
jar file on my path, but I have no problem resolving the type names.
Comment 10 Frank Sauer CLA 2003-03-13 14:00:27 EST
here's one:

package com.psc.css.business.export.edi837;
// other imports
import CSS.System.EventsHelper;
import com.vitria.fc.meta.EventDef;
//other imports

public class BatchProcessing {

   public static final EventDef errorEventDef = 
          (EventDef)(EventsHelper.getMetaObject().findDef("ErrorEvent"));

// other stuff
}

this gives the error:

The import CSS.System cannot be resolved	BatchProcessing.java	



Is that what you were looking for?

The above is an excerpt from a file I do not currently have checked out,
so it read-only. I have the EXACT SAME line in another file that I am currently
editing and thus auto-compiling all the time, and there it works fine....???
Comment 11 Kent Johnson CLA 2003-03-13 14:39:22 EST
No luck, it works fine for me.

Can you take this excerpt and put it in its own independent project pointing at 
the jar file and have it fail?

If so can you please add that project + jar file as an attachment to this PR.
Comment 12 Frank Sauer CLA 2003-03-13 16:03:34 EST
No luck here either. Tried several different project setups, with and without
linked folders, etc. Interestingly, if I highlight the offending class
in the import statement in the project with the error, and use 'Search 
declarations' using the workspace as the scope, it finds the class file
in the right jar....
Still, the build doesn't find it until I modify the source file with the 
import statement.
Comment 13 Olivier Thomann CLA 2003-03-14 09:01:28 EST
Could it be related to the read-only file? When you tried to reproduce it, did
you set one of the file to be read-only?
Comment 14 Frank Sauer CLA 2003-03-14 09:33:59 EST
yes I did, forgot to mention that, but I did make the class importing the
CSS.System.EventsHelper read-only. No difference.....
Comment 15 Kent Johnson CLA 2003-03-14 15:01:56 EST
Ok let's start again.

1. This is very reproduceable on every full build, right?

2. Is your workspace one large project? How many source files are in the 
project & in how many source folders? How many output folders: only 1 or 1 per 
source folder?

3. How many source files have 'strange' errors after a full build? Are all the 
errors the same (ie. import statements which cannot resolve CSS.System)? Or are 
their other packages which cannot be found?

4. It doesn't matter where the problematic jar file is relative to your 
workspace or whether its expanded into a folder, correct?
Comment 16 Frank Sauer CLA 2003-03-14 15:29:29 EST
1. This is very reproduceable on every full build, right?

yes. very

2. Is your workspace one large project? How many source files are in the 
project & in how many source folders? How many output folders: only 1 or 1 per 
source folder?

this project has one toplevel source folder (src) and one output folder
(classes). There are 73 packages containing a total of 612 java files.
The build path has about 35 jars on it. There are other projects too, but those
are not involved in this scenarios. This project does not have any dependencies
on other projects or vice-versa.

3. How many source files have 'strange' errors after a full build? Are all the 
errors the same (ie. import statements which cannot resolve CSS.System)? Or are 
their other packages which cannot be found?

All errors are related to the CSS.System package not resolving and this 
occurs in 7 different files in different packages

4. It doesn't matter where the problematic jar file is relative to your 
workspace or whether its expanded into a folder, correct?

I've tried jar inside workspace with 'add Jar' and 'add external jar'
I've not tried adding the source to the project's source folder and
actually building it... (these are CORBA stubs built elsewhere)

-------

Here's another scenario under which the errors dissapear:

1) open the readonly file in an editor (has the error)
2) use clearcase to check out the file
3) Eclipse detects change and shows dialog asking to reload
4) click reload, eclipse reloads, compiles and error goes away

No change or modification is required, simply a change from 
read-only to read-write is enough...
Comment 17 Philipe Mulet CLA 2003-03-17 08:21:50 EST
Highly suspect this is a dup of bug 35128, however this seems to be only full 
build scenario failing, where 35128 is only incremental scenario failing.
Comment 18 Philipe Mulet CLA 2003-03-17 09:34:29 EST
Frank - I can post you a patch which you can try to see if it improves this 
issue for you ? 
Comment 19 Frank Sauer CLA 2003-03-17 09:37:33 EST
PLEASE! I'd love to try it
Comment 20 Philipe Mulet CLA 2003-03-17 09:41:01 EST
Please get the patch at:

http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/jdt-core-
home/patches/org.eclipse.jdt.core_2.1.0.zip
Comment 21 Frank Sauer CLA 2003-03-17 10:08:58 EST
your patch fixed the issue. THANK YOU!
Comment 22 Philipe Mulet CLA 2003-03-17 10:49:29 EST
Excellent, we will keep trying to understand this very codepath (your steps are 
a little different from bug 35128).

Marking as duplicate.

*** This bug has been marked as a duplicate of 35128 ***
Comment 23 Kent Johnson CLA 2003-03-17 13:28:25 EST
Frank: We updated the patch.

Can you try it again and let us know that the new one works?

thanks
Comment 24 Frank Sauer CLA 2003-03-17 13:40:10 EST
still works, thanks again.
I keep being amazed at the turnaround and 
responsiveness of this buf fixing process
for eclipse. Keep up the good work! 
Comment 25 Frank Sauer CLA 2003-04-09 14:05:37 EDT
This bug is partially back in the 2.1 general release.
When I use clearcase external to eclipse to check out a file, eclipse
detects the change, I click ok to reload it and Eclipse goes ahead and
recompiles the file, no problems. However, the *EDITOR ONLY* starts
showing the same compile problems as mentioned in the original bug report.
The task list and explorer do not show the problem, only the editor.
Comment 26 Philipe Mulet CLA 2003-04-11 04:31:57 EDT
Kent, would the SearchableEnvironment be causing grief here ?
Comment 27 Kent Johnson CLA 2003-04-11 13:37:23 EDT
The original bug we had & fixed was inside the LookupEnvironment of the 
Compiler. All other name environments are called by the LookupEnvironment to 
find types on disk.

I suspect that this is something else.

Frank: Since this happens only in the editor, any luck it happens everytime you 
browse the type?

Can you reduce the testcase to something small?
Comment 28 Frank Sauer CLA 2003-04-11 15:01:18 EDT
I'm not sure I can reduce it to something small, but the following is the exact
scenario:

1) I'm looking at a java source while it is read only (checked in) and there
   are no errors/warnings in the task list nor markers in the editor.
2) I use the clearcase explorer outside eclipse to check out this file and thus
   make it read/write
3) Eclipse detects the change and pops up the dialog to reload the file
4) It compiles the class and now shows markers in the editor for all CSS.System
   stuff, but the builder itself (i.e. tasklist) shows no errors.

These markers do not go away upon checkin. I'm uncertain as to when they
went away and why (since they're not there now, they must have dissapeared
at some point after I submitted the initial reopen report)
Comment 29 Kent Johnson CLA 2003-04-24 13:35:39 EDT
Frank: Can you still reproduce this problem consistently?

Does it happen to numerous types or just a few? Does it happen to the same ones 
all the time?
Comment 30 Frank Sauer CLA 2003-04-24 14:20:16 EDT
Yes, it's consistent, but only with types that are in the CSS.System package
and only in the editors, the builder doesn't trip anymore.
Comment 31 Kent Johnson CLA 2003-04-24 14:31:17 EDT
So are these all the types which are defined in the CSS.System package or all 
the types which import this package?
Comment 32 Frank Sauer CLA 2003-04-24 14:47:21 EDT
the behavior occurs in classes importing the CSS.System.* stuff. These are
CORBA IDL stubs generated elsewhere and available in a jar on the build path.
Comment 33 Philipe Mulet CLA 2005-04-07 07:34:56 EDT
Deferring post 3.1
Comment 34 Eclipse Webmaster CLA 2009-08-30 02:34:27 EDT
As of now 'LATER' and 'REMIND' resolutions are no longer supported.
Please reopen this bug if it is still valid for you.