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


It looks like this is old code from back when org.eclipse.osgi was a exploded "directory" bundle.  Even if we properly looked in the org.eclipse.osgi jar there is no default splash located there.

I opened https://bugs.eclipse.org/bugs/show_bug.cgi?id=186452 to track this.

Tom



"Steven E. Harris" <seh@xxxxxxxxx>
Sent by: equinox-dev-bounces@xxxxxxxxxxx

05/10/2007 11:12 AM

Please respond to
Equinox development mailing list <equinox-dev@xxxxxxxxxxx>

To
equinox-dev@xxxxxxxxxxx
cc
Subject
[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
"org.eclipse.".

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

_______________________________________________
equinox-dev mailing list
equinox-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/equinox-dev