Community
Participate
Working Groups
This bug is similar to bug 276373. If retrieving a classpath entry for a path that is relative to the project, and the classpath entry is specified absolutely on the project, the correct classpath entry is not returned. Test project and JUnit test to follow.
Jay, please investigate.
Created attachment 139351 [details] test project This project is for use with the following test. Simply put in your JUnit target workspace and adjust the following: - the classpath entry for the external library jar should match your directory structure - add a classpath variable VARIABLE_LIB that points to the variableLib.jar - add a user library USER_LIB that includes the userLib.jar
Created attachment 139352 [details] junit test plugin Contains two JUnit test classes: TestIsOnClasspath, TestGetClasspathEntryFor. Only the second is important for this bug. The first is to test bug 276373. My results: testSimple - pass testInternalJar - pass testExternalJar - fail testVariableJar - fail testUserLibraryJar - pass (I was surprised! But the user library setup figures out that the jar being added is an internal resource.) testWebAppLibJar - fail
One additional note: while this method is internal, it is used by JavaModelManager.createJarPackageFragmentRootFrom(IFile, IJavaProject), which is where we're hitting our problems. Creating a jar package fragment root from a jar file that is in the project and is on the classpath, although *absolutely* specified in the java build properties (or absolutely specified by the particular classpath container), returns null.
Created attachment 139354 [details] patch possibility This patch fixes my test failures.
Created attachment 140930 [details] Patch with tests Patch looks fine. I have added/modified the required tests.
This and bug 276373 are blocking one of our milestone targeted bugs. Can this fix possibly be moved to maintenance?
Released in HEAD for 3.6M1 on Jay's behalf.
(In reply to comment #7) > This and bug 276373 are blocking one of our milestone targeted bugs. Can this > fix possibly be moved to maintenance? Olivier, what do you think ?
Blocking Dali JPA Tools is not an option. Please backport for 3.5.1. Reopening to get it fixed for 3.5.1.
Fix backported and released to R3_5_maintenance branch.
Verified for 3.6M1 using I20090802-2000.
Ooops, should not have been set as VERIFIED...
...as this will be done only while the 3.5.1 verification process.
I have verified the fix for 3.6 M1 and 3.5 maintenance build M20090807-0800.