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 144435 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.
updated patch
286453.txt (text/plain), 7.26 KB, created by
Thomas Watson
on 2009-08-13 13:05:08 EDT
(
hide
)
Description:
updated patch
Filename:
MIME Type:
Creator:
Thomas Watson
Created:
2009-08-13 13:05:08 EDT
Size:
7.26 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.52 >diff -u -r1.52 Main.java >--- src/org/eclipse/equinox/launcher/Main.java 13 Aug 2009 16:40:41 -0000 1.52 >+++ src/org/eclipse/equinox/launcher/Main.java 13 Aug 2009 17:05:06 -0000 >@@ -188,6 +188,9 @@ > private static final String PROP_NL = "osgi.nl"; //$NON-NLS-1$ > static final String PROP_NOSHUTDOWN = "osgi.noShutdown"; //$NON-NLS-1$ > private static final String PROP_DEBUG = "osgi.debug"; //$NON-NLS-1$ >+ private static final String PROP_OS = "osgi.os"; //$NON-NLS-1$ >+ private static final String PROP_WS = "osgi.ws"; //$NON-NLS-1$ >+ private static final String PROP_ARCH = "osgi.arch"; //$NON-NLS-1$ > > private static final String PROP_EXITCODE = "eclipse.exitcode"; //$NON-NLS-1$ > private static final String PROP_EXITDATA = "eclipse.exitdata"; //$NON-NLS-1$ >@@ -289,6 +292,13 @@ > private String getWS() { > if (ws != null) > return ws; >+ >+ String osgiWs = System.getProperty(PROP_WS); >+ if (osgiWs != null) { >+ ws = osgiWs; >+ return ws; >+ } >+ > String osName = getOS(); > if (osName.equals(Constants.OS_WIN32)) > return Constants.WS_WIN32; >@@ -307,9 +317,26 @@ > 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; >+ String osgiOs = System.getProperty(PROP_OS); >+ if (osgiOs != null) { >+ os = osgiOs; >+ return os; >+ } > String osName = System.getProperties().getProperty("os.name"); //$NON-NLS-1$ > if (osName.regionMatches(true, 0, Constants.OS_WIN32, 0, 3)) > return Constants.OS_WIN32; >@@ -339,6 +366,11 @@ > private String getArch() { > if (arch != null) > return arch; >+ String osgiArch = System.getProperty(PROP_ARCH); >+ if (osgiArch != null) { >+ arch = osgiArch; >+ return arch; >+ } > String name = System.getProperties().getProperty("os.arch");//$NON-NLS-1$ > // Map i386 architecture to x86 > if (name.equalsIgnoreCase(Constants.INTERNAL_ARCH_I386)) >@@ -350,6 +382,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 +412,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(PROP_WS, alternateWS); >+ } > } >- 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 Raw
Actions:
View
Attachments on
bug 286453
:
144316
| 144435