Bug 126803 - Compile error in LocationElementTokenizer.java in source build
Summary: Compile error in LocationElementTokenizer.java in source build
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.2 M5   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-02-07 16:06 EST by Sonia Dimitrov CLA
Modified: 2006-02-15 11:11 EST (History)
3 users (show)

See Also:


Attachments
Proposed patch (9.68 KB, patch)
2006-02-09 13:00 EST, Olivier Thomann CLA
no flags Details | Diff
Regression test (365 bytes, application/octet-stream)
2006-02-09 13:06 EST, Olivier Thomann CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sonia Dimitrov CLA 2006-02-07 16:06:18 EST
The following compile error occurs when running a source build from I20060207-1305 (http://download.eclipse.org/downloads/drops/I20060207-1305/eclipse-sourceBuild-srcIncluded-I20060207-1305.zip)

# 2/7/06 3:56:43 PM EST
# Eclipse Java Compiler 0.637, pre-3.2.0 milestone-5, Copyright IBM Corp 2000, 2006. All rights reserved.
----------
1. ERROR in D:\src1\plugins\org.eclipse.ui.workbench\Eclipse UI\org\eclipse\ui\internal\menus\LocationElementTokenizer.java
 (at line 34)
	interface ILocationElementTokenizer {
	          ^^^^^^^^^^^^^^^^^^^^^^^^^
The type ILocationElementTokenizer is already defined
----------
1 problem (1 error)

The same error does not occur in the releng-style build on Linux.
Comment 1 Olivier Thomann CLA 2006-02-07 16:18:36 EST
I am investigating.
Comment 2 Olivier Thomann CLA 2006-02-07 18:33:02 EST
The problem is gone if the file LocationElementTokenizer.java in plugins\org.eclipse.ui.workbench\Eclipse UI\org\eclipse\ui\internal\menus is renamed in ILocationElementTokenizer.java.
Since this is what has been done in the HEAD branch, there is no need for further investigation.
Kent, would you have an idea why this could occur?
Comment 3 Olivier Thomann CLA 2006-02-07 18:39:26 EST
This change should go in a rebuild.
So Platform/UI should submit at least this change in tomorrow's rebuild.
Comment 4 Nick Edgar CLA 2006-02-07 19:20:41 EST
Olivier pinged me, and I had a look at the situation.  There have been many subsequent changes in HEAD, so I'm hesitant to do a submission with all these changes.  Plus, I'm timing out here.  Since it's just the source build that's affected, I suggest we live with it until next week's I-build.
Comment 5 Philipe Mulet CLA 2006-02-07 21:19:38 EST
Kent - independantly from the fact UI has fixed their code. Isn't this surfacing a false collision scenario in our builder ?
Comment 6 Kent Johnson CLA 2006-02-08 12:22:27 EST
Olivier thinks its a problem with the build script - he'll look into it more.
Comment 7 Sonia Dimitrov CLA 2006-02-08 14:26:17 EST
It appears the -enableJavadoc compile arg is part of the problem.  The plug-in compiles without error when this is omitted.
Comment 8 Olivier Thomann CLA 2006-02-08 15:45:14 EST
This is a bug in the batch compiler.
Comment 9 Kent Johnson CLA 2006-02-08 16:02:26 EST
Suspect the bug is FileSystem.initializeKnownFileNames()

Likely caused by path separators
Comment 10 Olivier Thomann CLA 2006-02-09 13:00:58 EST
Created attachment 34432 [details]
Proposed patch

With this patch I get a slight improvement in the compilation time.
Ensure that the cache contains only name using '/' and never '\'.
This is why the build worked on Linux and not on Windows.

I'll try to build up a regression test.

Philippe, I changed the initialFileNames cache to be a set to prevent iterating the array for search class name. Could you please review it?
Comment 11 Olivier Thomann CLA 2006-02-09 13:06:58 EST
Created attachment 34433 [details]
Regression test

Call the batch compiler with the following command line:
d:\tests_sources\p\X.java d:\tests_sources\p\Y.java
-d d:\tests_sources
-classpath d:\tests_sources
-time
-nowarn
-g
-enableJavadoc

It is important to compile both source files at the same time.
Comment 12 Olivier Thomann CLA 2006-02-09 13:55:34 EST
All tests passed with this patch.
Comment 13 Philipe Mulet CLA 2006-02-10 08:12:13 EST
Patch looks good. I noticed a Hashtable was still there.
Do we need sync there ? I believe not.

private Hashtable directoryCache;
Comment 14 Olivier Thomann CLA 2006-02-10 20:56:05 EST
Philippe, this is old code that was package visible and I changed it to be private.
I will release this patch and the regression test.
Comment 15 Olivier Thomann CLA 2006-02-10 21:06:30 EST
Fixed and released in HEAD.
Comment 16 Olivier Thomann CLA 2006-02-10 21:15:57 EST
Added org.eclipse.jdt.core.tests.compiler.regression.LocalVariableTest.test010
Comment 17 David Audel CLA 2006-02-15 11:11:46 EST
Verified for 3.2 M5 using build I20060215-0010