Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » Problem in GroupingChecker.getPackageRoots
Problem in GroupingChecker.getPackageRoots [message #130597] Mon, 04 May 2009 19:26 Go to next message
Jens Muehlenhoff is currently offline Jens MuehlenhoffFriend
Messages: 20
Registered: July 2009
Junior Member
Hello,

I have the new milestone build installed. Now I want to test a bigger project with the equinox
environment. Currenntly I could not start the configuraion becaus I get a NPE. It look like the
resolving of RootPackes fails.

osgi> Exception in thread "Refresh Packages" java.lang.NullPointerException
at org.eclipse.osgi.internal.module.GroupingChecker$PackageRoot s.subSet(GroupingChecker.java:337)
at org.eclipse.osgi.internal.module.GroupingChecker$PackageRoot s.superSet(GroupingChecker.java:352)
at org.eclipse.osgi.internal.module.GroupingChecker.createPacka geRoots(GroupingChecker.java:185)
at org.eclipse.osgi.internal.module.GroupingChecker.getPackageR oots(GroupingChecker.java:129)
at
org.eclipse.osgi.internal.module.GroupingChecker$PackageRoot s.isConsistentClassSpace(GroupingChecker.java:285)


While debuging I see some strange things in the code.

PackageRoots getPackageRoots(ResolverBundle bundle, String packageName, ArrayList visited)
{
PackageRoots packageRoots = (PackageRoots) packages.get(packageName);
if (packageRoots == null) {
packageRoots = createPackageRoots(bundle, packageName,
visited == null ? new ArrayList(1) : visited);
^^^^^^^^^^^^^^^^
// in the createPackageRoots method there will be some adds on the given list,
// in this case we will loose the add and so there will be extra calls
// on the other hand it looks really strange to pass an null value as visited array
// if the createPackageRoots returns a null (in case we already visited this bundle) it will be
// passed to the packages and will overwrite a older value

packages.put(packageName, packageRoots);
}
return packageRoots != null ? packageRoots : nullPackageRoots;
// at this place we check to do not return a null value, thats ok, but if you have a look
// at the placed where this method is called, there is an extra check for null value, not for
// nullPackageRoots
}

private PackageRoots createPackageRoots(ResolverBundle bundle, String packageName,
ArrayList visited)
{
if (visited.contains(bundle)) {
return null;
^^^^^^^^^^^
// the call of this method in the getPackageRoots does not handel the return of a null value

}
visited.add(bundle); // prevent endless cycles

...

PackageRoots requiredRoots = getPackageRoots(supplier, packageName, visited);
if (requiredRoots != null) {
^^^^^^^^^^^^^^^^^^^^^^
// this check will never fail, because we always return a correct package Roots or the
// contains of nullPackageRoots member variable, so if will never fail and all nullPackages will
// case the NPE
roots.add(requiredRoots);
}


After a lot of runs I figured out, that I get most of the time the exception but some times it seems
to be working. Thats very strange.

What do you mean. Is this a bug or a feature. If it is a bug, where should a file it.

Reagrds

Jens
Re: Problem in GroupingChecker.getPackageRoots [message #130741 is a reply to message #130597] Tue, 05 May 2009 22:10 Go to previous message
Jens Muehlenhoff is currently offline Jens MuehlenhoffFriend
Messages: 20
Registered: July 2009
Junior Member
Hello,

this happens always after I start the ide. After a "clear configuration area before launching" it
works. It looks like there is an init error in the equinox stuff.
Previous Topic:Re: Per-user plugin/dependencies broken between 3.4.1->3.4.2 (and beyond)
Next Topic:Problem with generating p2 metadata from classic update site
Goto Forum:
  


Current Time: Fri Apr 26 14:55:56 GMT 2024

Powered by FUDForum. Page generated in 0.03165 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top