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 144316 Details for
Bug 286453
[launcher] Try an alternate guess at default ws
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
286453.txt (text/plain), 6.24 KB, created by
Andrew Niefer
on 2009-08-12 17:36:56 EDT
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Andrew Niefer
Created:
2009-08-12 17:36:56 EDT
Size:
6.24 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.equinox.launcher >Index: src/org/eclipse/equinox/launcher/Main.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/framework/bundles/org.eclipse.equinox.launcher/src/org/eclipse/equinox/launcher/Main.java,v >retrieving revision 1.51 >diff -u -r1.51 Main.java >--- src/org/eclipse/equinox/launcher/Main.java 10 Jul 2009 20:49:13 -0000 1.51 >+++ src/org/eclipse/equinox/launcher/Main.java 12 Aug 2009 21:38:29 -0000 >@@ -289,6 +289,13 @@ > private String getWS() { > if (ws != null) > return ws; >+ >+ String osgiWs = System.getProperty("osgi.ws"); //$NON-NLS-1$ >+ if (osgiWs != null) { >+ ws = osgiWs; >+ return ws; >+ } >+ > String osName = getOS(); > if (osName.equals(Constants.OS_WIN32)) > return Constants.WS_WIN32; >@@ -307,6 +314,18 @@ > return Constants.WS_UNKNOWN; > } > >+ private String getAlternateWS(String defaultWS) { >+ // We'll have already tried the default, so we only need to map >+ // in one direction. (default -> alternate) >+ if (Constants.WS_CARBON.equals(defaultWS)) >+ return Constants.WS_COCOA; >+ if (Constants.WS_GTK.equals(defaultWS)) >+ return Constants.WS_MOTIF; >+ if (Constants.WS_WIN32.equals(defaultWS)) >+ return Constants.WS_WPF; >+ return Constants.WS_UNKNOWN; >+ } >+ > private String getOS() { > if (os != null) > return os; >@@ -350,6 +369,19 @@ > return name; > } > >+ private String getFragmentString(String fragmentOS, String fragmentWS, String fragmentArch) { >+ StringBuffer buffer = new StringBuffer(PLUGIN_ID); >+ buffer.append('.'); >+ buffer.append(fragmentWS); >+ buffer.append('.'); >+ buffer.append(fragmentOS); >+ if (!(fragmentOS.equals(Constants.OS_MACOSX) && !Constants.ARCH_X86_64.equals(fragmentArch))) { >+ buffer.append('.'); >+ buffer.append(fragmentArch); >+ } >+ return buffer.toString(); >+ } >+ > /** > * Sets up the JNI bridge to native calls > */ >@@ -367,61 +399,67 @@ > if (libPath == null) { > //find our fragment name > String fragmentOS = getOS(); >+ String fragmentWS = getWS(); > String fragmentArch = getArch(); >- StringBuffer buffer = new StringBuffer(PLUGIN_ID); >- buffer.append('.'); >- buffer.append(getWS()); >- buffer.append('.'); >- buffer.append(fragmentOS); >- if (!(fragmentOS.equals(Constants.OS_MACOSX) && !Constants.ARCH_X86_64.equals(fragmentArch))) { >- buffer.append('.'); >- buffer.append(fragmentArch); >+ >+ libPath = getLibraryPath(getFragmentString(fragmentOS, fragmentWS, fragmentArch), defaultPath); >+ if (libPath == null && ws == null) { >+ // no ws was specified and we didn't find the default fragment, try an alternate ws >+ String alternateWS = getAlternateWS(fragmentWS); >+ libPath = getLibraryPath(getFragmentString(fragmentOS, alternateWS, fragmentArch), defaultPath); >+ if (libPath != null) { >+ System.getProperties().put("osgi.ws", alternateWS); //$NON-NLS-1$ >+ } > } >- String fragmentName = buffer.toString(); >- String fragment = null; >- if (inDevelopmentMode) { >- String devPathList = devClassPathProps.getProperty(PLUGIN_ID); >- String[] locations = getArrayFromList(devPathList); >- if (locations.length > 0) { >- File location = new File(locations[0]); >- if (location.isAbsolute()) { >- String dir = location.getParent(); >- fragment = searchFor(fragmentName, dir); >- if (fragment != null) >- libPath = getLibraryFromFragment(fragment); >- } >+ } >+ library = libPath; >+ if (library != null) >+ bridge = new JNIBridge(library); >+ } >+ >+ private String getLibraryPath(String fragmentName, URL[] defaultPath) { >+ String libPath = null; >+ String fragment = null; >+ if (inDevelopmentMode) { >+ String devPathList = devClassPathProps.getProperty(PLUGIN_ID); >+ String[] locations = getArrayFromList(devPathList); >+ if (locations.length > 0) { >+ File location = new File(locations[0]); >+ if (location.isAbsolute()) { >+ String dir = location.getParent(); >+ fragment = searchFor(fragmentName, dir); >+ if (fragment != null) >+ libPath = getLibraryFromFragment(fragment); > } > } >- if (libPath == null && bootLocation != null) { >- URL[] urls = defaultPath; >- if (urls != null && urls.length > 0) { >- //the last one is most interesting >- for (int i = urls.length - 1; i >= 0 && libPath == null; i--) { >- File entryFile = new File(urls[i].getFile()); >- String dir = entryFile.getParent(); >- if (inDevelopmentMode) { >- String devDir = dir + "/" + PLUGIN_ID + "/fragments"; //$NON-NLS-1$ //$NON-NLS-2$ >- fragment = searchFor(fragmentName, devDir); >- } >- if (fragment == null) >- fragment = searchFor(fragmentName, dir); >- if (fragment != null) >- libPath = getLibraryFromFragment(fragment); >+ } >+ if (libPath == null && bootLocation != null) { >+ URL[] urls = defaultPath; >+ if (urls != null && urls.length > 0) { >+ //the last one is most interesting >+ for (int i = urls.length - 1; i >= 0 && libPath == null; i--) { >+ File entryFile = new File(urls[i].getFile()); >+ String dir = entryFile.getParent(); >+ if (inDevelopmentMode) { >+ String devDir = dir + "/" + PLUGIN_ID + "/fragments"; //$NON-NLS-1$ //$NON-NLS-2$ >+ fragment = searchFor(fragmentName, devDir); > } >+ if (fragment == null) >+ fragment = searchFor(fragmentName, dir); >+ if (fragment != null) >+ libPath = getLibraryFromFragment(fragment); > } > } >- if (libPath == null) { >- URL install = getInstallLocation(); >- String location = install.getFile(); >- location += "/plugins/"; //$NON-NLS-1$ >- fragment = searchFor(fragmentName, location); >- if (fragment != null) >- libPath = getLibraryFromFragment(fragment); >- } > } >- library = libPath; >- if (library != null) >- bridge = new JNIBridge(library); >+ if (libPath == null) { >+ URL install = getInstallLocation(); >+ String location = install.getFile(); >+ location += "/plugins/"; //$NON-NLS-1$ >+ fragment = searchFor(fragmentName, location); >+ if (fragment != null) >+ libPath = getLibraryFromFragment(fragment); >+ } >+ return libPath; > } > > private String getLibraryFromFragment(String fragment) {
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 286453
:
144316
|
144435