[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[equinox-dev] How Equinox locates a default splash image

In org.eclipse.equinox.launcher.Main, we find the following code near
the end of the getSplashLocation() method:

,----[ org.eclipse.equinox.launcher.Main in 3.3M7 ]
| // can't find it on the splashPath so look for a default splash
| String temp = bootPath[0].getFile(); // take the first path element
| temp = temp.replace('/', File.separatorChar);
| int ix = temp.lastIndexOf("plugins" + File.separator); //$NON-NLS-1$
| if (ix != -1) {
|     int pix = temp.indexOf(File.separator, ix + 8);
|     if (pix != -1) {
|         temp = temp.substring(0, pix);
|         result = searchForSplash(new String[] {temp});
|         if (result != null)
|             System.getProperties().put(PROP_SPLASHLOCATION, result);
|     }
| }

When this method gets called in my configuration, bootPath (an array
of URLs) has one entry:

  /c:/Documents and Settings/somepath/plugins/org.eclipse.osgi_3.3.0.v20070430.jar

Following the code above, the slashes are translated, then it searches
for "plugins/", assigning the index to "ix". Obviously this substring
is there, so "ix" takes on a positive value.

Next, it searches for another file separator past the "plugins/"
substring, as the "ix + 8" offset skips to the portion beginning with

Now, it must be looking for /another/ file separator because it's
assuming that the first boot path entry contains some subdirectory
right below "plugins", and it tries to search beneath that
subdirectory. But in my case, the boot path is a JAR, so there are no
subdirectories that get searched, as "pix" above turns out to be -1.

Is this a bug? Was the intention to search within the "plugins"
directory, not in the first directory /below/ the "plugins" directory?

Steven E. Harris