Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 79090 Details for
Bug 204341
[prov] osgi.install.area not set correctly when using a bundle pool
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
patch
204341_org.eclipse.equinox.launcher.txt (text/plain), 4.33 KB, created by
Thomas Watson
on 2007-09-24 16:56:39 EDT
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Thomas Watson
Created:
2007-09-24 16:56:39 EDT
Size:
4.33 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.equinox.launcher >Index: src/org/eclipse/equinox/launcher/Main.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.equinox.launcher/src/org/eclipse/equinox/launcher/Main.java,v >retrieving revision 1.31 >diff -u -r1.31 Main.java >--- src/org/eclipse/equinox/launcher/Main.java 27 Aug 2007 18:41:56 -0000 1.31 >+++ src/org/eclipse/equinox/launcher/Main.java 24 Sep 2007 20:36:19 -0000 >@@ -216,6 +216,7 @@ > protected File logFile = null; > protected BufferedWriter log = null; > protected boolean newSession = true; >+ private String launcher = null; > > /** > * A structured form for a version identifier. >@@ -1397,7 +1398,7 @@ > // look for the launcher location > if (args[i - 1].equalsIgnoreCase(LAUNCHER)) { > //not doing anything with this right now, but still consume it >- //launcher = arg; >+ launcher = arg; > found = true; > } > >@@ -1619,6 +1620,37 @@ > return installLocation; > } > >+ File installFile = getLauncherLocation(); >+ if (installFile == null) >+ installFile = getCodeSourceLocation(); >+ // normalize to not have leading / so we can check the form >+ String path = installFile.toString().replace('\\', '/'); >+ // TODO need a better test for windows >+ // If on Windows then canonicalize the drive letter to be lowercase. >+ // remember that there may be UNC paths >+ if (File.separatorChar == '\\') >+ if (Character.isUpperCase(path.charAt(0))) { >+ char[] chars = path.toCharArray(); >+ chars[0] = Character.toLowerCase(chars[0]); >+ path = new String(chars); >+ } >+ installFile = new File(path); >+ try { >+ // create a file URL (via File) to normalize the form (e.g., put >+ // the leading / on if necessary) >+ URL installURL = installFile.toURL(); >+ path = installURL.getFile(); >+ installLocation = new URL(installURL.getProtocol(), installURL.getHost(), installURL.getPort(), path); >+ System.getProperties().put(PROP_INSTALL_AREA, installLocation.toExternalForm()); >+ } catch (MalformedURLException e) { >+ // TODO Very unlikely case. log here. >+ } >+ if (debug) >+ System.out.println("Install location:\n " + installLocation); //$NON-NLS-1$ >+ return installLocation; >+ } >+ >+ private File getCodeSourceLocation() { > ProtectionDomain domain = Main.class.getProtectionDomain(); > CodeSource source = null; > URL result = null; >@@ -1637,38 +1669,22 @@ > result = source.getLocation(); > > String path = decode(result.getFile()); >- // normalize to not have leading / so we can check the form >- File file = new File(path); >- path = file.toString().replace('\\', '/'); >- // TODO need a better test for windows >- // If on Windows then canonicalize the drive letter to be lowercase. >- // remember that there may be UNC paths >- if (File.separatorChar == '\\') >- if (Character.isUpperCase(path.charAt(0))) { >- char[] chars = path.toCharArray(); >- chars[0] = Character.toLowerCase(chars[0]); >- path = new String(chars); >- } > if (path.toLowerCase().endsWith(".jar")) //$NON-NLS-1$ > path = path.substring(0, path.lastIndexOf("/") + 1); //$NON-NLS-1$ > if (path.toLowerCase().endsWith("/plugins/")) //$NON-NLS-1$ > path = path.substring(0, path.length() - "/plugins/".length()); //$NON-NLS-1$ >- try { >- try { >- // create a file URL (via File) to normalize the form (e.g., put >- // the leading / on if necessary) >- path = new File(path).toURL().getFile(); >- } catch (MalformedURLException e1) { >- // will never happen. The path is straight from a URL. >- } >- installLocation = new URL(result.getProtocol(), result.getHost(), result.getPort(), path); >- System.getProperties().put(PROP_INSTALL_AREA, installLocation.toExternalForm()); >- } catch (MalformedURLException e) { >- // TODO Very unlikely case. log here. >- } >- if (debug) >- System.out.println("Install location:\n " + installLocation); //$NON-NLS-1$ >- return installLocation; >+ return new File(path); >+ } >+ >+ private File getLauncherLocation() { >+ if (launcher == null) >+ return null; >+ File exe = new File(launcher); >+ if (exe.getParent() == null) >+ return null; >+ File launcherDir = new File(exe.getParent()); >+ return (launcherDir.exists() && launcherDir.isDirectory()) ? launcherDir : null; >+ > } > > /*
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 204341
: 79090