Community
Participate
Working Groups
The Bundle.getEntry(String) method will return null if the the path "/" is used. A path of "/" indicates the root of the bundle and should never return null.
A fix is in HEAD.
*** Bug 83865 has been marked as a duplicate of this bug. ***
Meta-comment... during performance analysis of Eclipse I/O, I noticed that Bundle.getEntry("/") is called a lot and each time File.exists() is ultimately called. It might be worth adding a check for this case to reduce I/O events, since it's pretty safe to assume that if the bundle exists, it has a root entry.
reopening to track the performance suggestion.
Can we get this fixed in the 3.0 stream please.
risk assessment? Dan, can you quantify "called a lot"?
Re: Comment #6 Good question! Bundle.getEntry was called 46 times from startup until the Java perspective opened. Opening the JVE editor added 154 calls. The code modification to capture this data is below (from AbstractBundle): private static long getEntry = 0; public URL getEntry(String fileName) { //XXX dbk AbstractBundle.getEntry if (fileName.equals("/")) { getEntry++; System.out.println("AbstractBundle.getEntry #" + getEntry); } ... } It's a little surprising that the JVE is calling this 3x more than the base Eclipse / Java perspective. We'll look into that.
Time to update the milestone to M6... ?
but then we don't get to use our time machines...
Hey guys, is there a "real time" target miletone plan for this?
Not sure how that happend. It was supposed to be set to 3.1. There are no commitments as yet. The impact has not been investigated.
The performance improvement from comment 3 could be done. But I'm more concerned about why Bundle.getEntry("/") is getting called so much ... One place where this gets called often is when Platform URL gets resolved in org.eclipse.core.internal.runtime.PlatformURLPluginConnection.resolve(). This could easily be fixed to not call Bundle.getEntry("/"). I will attach a patch ...
Created attachment 18367 [details] patch to remove calls to Bundle.getEntry("/") This patch avoids calling Bundle.getEntry("/") for the common case where the resource to a platform URL exists. In cases where it does not exist we have to call Bundle.getEntry("/") to construct a URL which will throw a FileNotFoundExcepion when used.
The last patch has been released in HEAD. Tom are you planning to do more?
I do not plan to make any more changes. Any enhancements to make Bundle.getEntry("/") faster would only affect non- jar'ed bundles since since the File.exists() check is only done for non-jar'ed bundles. I think it is a better thing to make Bundle.getEntry("/") not called as often (or at all in normal situations). This will improve both jar'ed and non- jar'ed bundles. should this be closed then?
No more improvements planned. Closing.