Bug 25520

Summary: Possible problem in JavaProject#findPackageFragmentRoots(IClasspathEntry)
Product: [Eclipse Project] JDT Reporter: Luc Bourlier <eclipse>
Component: CoreAssignee: Philipe Mulet <philippe_mulet>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P2 CC: Darin_Swanson
Version: 2.0   
Target Milestone: 2.1 M3   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Luc Bourlier CLA 2002-10-29 18:39:03 EST
Build 20021029

In org.eclipse.jdt.debug.test.core, we have two tests which used to work fine
(SourceLocationTests#testPositiveSystemLibrarySourceLocation() and
SourceLocationTests#testNegativeSystemLibrarySourceLocation()) but fail in the
latest integration build.

The point is that before, when
JavaProject#getPackageFragmentRoots(IClasspathEntry) was called,
getResolvedClasspath(..) was call on the IClasspathEntry, and the variables were
resolved. In the new code, getResolvedClasspath(..) is no more called.

If I change the code of computePackageFragmentRoots(IClasspathEntry) with the
following code, I get the tests to work:

public IPackageFragmentRoot[] computePackageFragmentRoots(IClasspathEntry entry) {
  try {
    return computePackageFragmentRoots(getResolvedClasspath(new
IClasspathEntry[]{entry}, true, false), false);
  } catch (JavaModelException e) {
    return new IPackageFragmentRoot[] {};
  }
}

Is it a problem in your code, when you change/create the method you forgot to
add this method call ? or is it us which use the method in a wrong way ?
Comment 1 Philipe Mulet CLA 2002-10-30 05:12:57 EST
No this would be a bug in our code, as a consequence from a fix for bug 25433.
Need to fix asap.
Comment 2 Philipe Mulet CLA 2002-10-30 06:07:00 EST
Fix proposal is the right one.

Fixed.
Comment 3 Philipe Mulet CLA 2002-10-30 07:31:11 EST
Actually, moved resolution to #findPackageFragmentRoots, since other internal 
clients shouldn't be penalized when already passing resolved path in.
Comment 4 Darin Swanson CLA 2002-10-30 12:15:48 EST
We have commented out the two tests that are failing for the Oct 30 integration 
build.
Comment 5 David Audel CLA 2002-11-15 03:48:24 EST
Verified.