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 167540 Details for
Bug 309795
workspace didn't compile after restart - always have to reload Target Platform
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]
updated patch
pde-pooled-bundle-urls-2.patch (text/plain), 10.90 KB, created by
Darin Wright
on 2010-05-07 15:03:49 EDT
(
hide
)
Description:
updated patch
Filename:
MIME Type:
Creator:
Darin Wright
Created:
2010-05-07 15:03:49 EDT
Size:
10.90 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.pde.core >Index: src/org/eclipse/pde/internal/core/ExternalModelManager.java >=================================================================== >RCS file: /cvsroot/eclipse/pde/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ExternalModelManager.java,v >retrieving revision 1.63 >diff -u -r1.63 ExternalModelManager.java >--- src/org/eclipse/pde/internal/core/ExternalModelManager.java 25 Feb 2010 19:44:45 -0000 1.63 >+++ src/org/eclipse/pde/internal/core/ExternalModelManager.java 7 May 2010 19:02:42 -0000 >@@ -11,10 +11,10 @@ > package org.eclipse.pde.internal.core; > > import java.io.File; >+import java.net.MalformedURLException; > import java.net.URL; > import java.util.*; > import org.eclipse.core.runtime.Path; >-import org.eclipse.pde.core.plugin.IPluginBase; > import org.eclipse.pde.core.plugin.IPluginModelBase; > import org.eclipse.pde.internal.core.target.AbstractTargetHandle; > import org.eclipse.pde.internal.core.target.provisional.NameVersionDescriptor; >@@ -63,38 +63,6 @@ > } > } > } >- // enable pooled bundles properly (only if part of the profile) >- String pooled = pref.getString(ICoreConstants.POOLED_BUNDLES); >- if (pooled != null && pooled.trim().length() > 0) { >- if (ICoreConstants.VALUE_SAVED_NONE.equals(pooled)) { >- // all pooled bundles are disabled >- for (int i = 0; i < fModels.length; i++) { >- if (AbstractTargetHandle.BUNDLE_POOL.isPrefixOf(new Path(fModels[i].getInstallLocation()))) { >- fModels[i].setEnabled(false); >- } >- } >- } else { >- StringTokenizer tokenizer = new StringTokenizer(pooled, ","); //$NON-NLS-1$ >- Set enabled = new HashSet(); >- while (tokenizer.hasMoreTokens()) { >- String id = tokenizer.nextToken(); >- if (tokenizer.hasMoreTokens()) { >- String ver = tokenizer.nextToken(); >- if (ICoreConstants.VALUE_SAVED_NONE.equals(ver)) { // indicates null version >- ver = null; >- } >- enabled.add(new NameVersionDescriptor(id, ver)); >- } >- } >- for (int i = 0; i < fModels.length; i++) { >- if (AbstractTargetHandle.BUNDLE_POOL.isPrefixOf(new Path(fModels[i].getInstallLocation()))) { >- IPluginBase base = fModels[i].getPluginBase(); >- NameVersionDescriptor desc = new NameVersionDescriptor(base.getId(), base.getVersion()); >- fModels[i].setEnabled(enabled.contains(desc)); >- } >- } >- } >- } > } > > public void setModels(IPluginModelBase[] models) { >@@ -111,24 +79,55 @@ > if (tokenizer.countTokens() == 0) > return base; > >- File[] extraLocations = new File[tokenizer.countTokens()]; >- for (int i = 0; i < extraLocations.length; i++) { >+ List extraLocations = new ArrayList(tokenizer.countTokens()); >+ boolean addPool = false; >+ while (tokenizer.hasMoreTokens()) { > String location = tokenizer.nextToken(); >- File dir = new File(location, "plugins"); //$NON-NLS-1$ >- if (!dir.exists() || !dir.isDirectory()) >- dir = new File(location); >- extraLocations[i] = dir; >+ if (AbstractTargetHandle.BUNDLE_POOL.isPrefixOf(new Path(location))) { >+ addPool = true; >+ } else { >+ File dir = new File(location, "plugins"); //$NON-NLS-1$ >+ if (!dir.exists() || !dir.isDirectory()) >+ dir = new File(location); >+ extraLocations.add(dir); >+ } > } >- URL[] additional = PluginPathFinder.scanLocations(extraLocations); >+ URL[] additional = PluginPathFinder.scanLocations((File[]) extraLocations.toArray(new File[extraLocations.size()])); >+ URL[] result = append(base, additional); > >- if (additional.length == 0) >- return base; >+ // add pooled bundles (only if part of the profile) >+ if (addPool) { >+ String pooled = pref.getString(ICoreConstants.POOLED_URLS); >+ if (pooled != null && pooled.trim().length() > 0) { >+ if (ICoreConstants.VALUE_SAVED_NONE.equals(pooled)) { >+ // none >+ } else { >+ tokenizer = new StringTokenizer(pooled, ","); //$NON-NLS-1$ >+ List urls = new ArrayList(tokenizer.countTokens()); >+ while (tokenizer.hasMoreTokens()) { >+ String fileName = tokenizer.nextToken(); >+ try { >+ urls.add(AbstractTargetHandle.BUNDLE_POOL.append(fileName).toFile().toURL()); >+ } catch (MalformedURLException e) { >+ PDECore.log(e); >+ } >+ } >+ additional = (URL[]) urls.toArray(new URL[urls.size()]); >+ result = append(result, additional); >+ } >+ } >+ } > >+ return result; >+ } >+ >+ private URL[] append(URL[] base, URL[] additional) { >+ if (additional.length == 0) { >+ return base; >+ } > URL[] result = new URL[base.length + additional.length]; > System.arraycopy(base, 0, result, 0, base.length); > System.arraycopy(additional, 0, result, base.length, additional.length); >- > return result; > } >- > } >Index: src/org/eclipse/pde/internal/core/ICoreConstants.java >=================================================================== >RCS file: /cvsroot/eclipse/pde/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ICoreConstants.java,v >retrieving revision 1.84 >diff -u -r1.84 ICoreConstants.java >--- src/org/eclipse/pde/internal/core/ICoreConstants.java 8 Apr 2010 20:57:50 -0000 1.84 >+++ src/org/eclipse/pde/internal/core/ICoreConstants.java 7 May 2010 19:02:42 -0000 >@@ -37,8 +37,20 @@ > String GROUP_PLUGINS_VIEW = "group_plugins"; //$NON-NLS-1$ > String ADDITIONAL_LOCATIONS = "additional_locations"; //$NON-NLS-1$ > String TARGET_PLATFORM_REALIZATION = "target_platform_realization"; //$NON-NLS-1$ >+ >+ /** >+ * This preference was only used during 3.5, it has been replaced in 3.6 >+ * with POOLED_URLS. >+ * >+ * @deprecated >+ */ > String POOLED_BUNDLES = "pooled_bundles"; //$NON-NLS-1$ > /** >+ * Comma separated list of bundle URLs used from the bundle pool. >+ * @since 3.6 >+ */ >+ String POOLED_URLS = "pooled_urls"; //$NON-NLS-1$ >+ /** > * List of feature ids and versions that are available in the target platform. Features > * are comma separated, with each entry taking the form of [id]@[version] > * >Index: src/org/eclipse/pde/internal/core/PluginModelManager.java >=================================================================== >RCS file: /cvsroot/eclipse/pde/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/PluginModelManager.java,v >retrieving revision 1.140 >diff -u -r1.140 PluginModelManager.java >--- src/org/eclipse/pde/internal/core/PluginModelManager.java 29 Apr 2010 17:59:04 -0000 1.140 >+++ src/org/eclipse/pde/internal/core/PluginModelManager.java 7 May 2010 19:02:42 -0000 >@@ -525,6 +525,23 @@ > > // Create default target platform definition if required > initDefaultTargetPlatformDefinition(); >+ >+ // re-load the target if the corrupt POOLED_BUNDLES preference was being used >+ PDEPreferencesManager pref = PDECore.getDefault().getPreferencesManager(); >+ String pooled = pref.getString(ICoreConstants.POOLED_BUNDLES); >+ if (pooled != null && pooled.trim().length() > 0) { >+ if (!ICoreConstants.VALUE_SAVED_NONE.equals(pooled.trim())) { >+ ITargetPlatformService service = (ITargetPlatformService) PDECore.getDefault().acquireService(ITargetPlatformService.class.getName()); >+ if (service != null) { >+ try { >+ ITargetHandle handle = service.getWorkspaceTargetHandle(); >+ LoadTargetDefinitionJob.load(handle.getTargetDefinition()); >+ } catch (CoreException e) { >+ PDECore.log(e); >+ } >+ } >+ } >+ } > } > > /** >Index: src/org/eclipse/pde/internal/core/TargetPreferenceModifyListener.java >=================================================================== >RCS file: /cvsroot/eclipse/pde/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/TargetPreferenceModifyListener.java,v >retrieving revision 1.3 >diff -u -r1.3 TargetPreferenceModifyListener.java >--- src/org/eclipse/pde/internal/core/TargetPreferenceModifyListener.java 25 Nov 2009 19:38:00 -0000 1.3 >+++ src/org/eclipse/pde/internal/core/TargetPreferenceModifyListener.java 7 May 2010 19:02:42 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2009 IBM Corporation and others. >+ * Copyright (c) 2009, 2010 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -37,6 +37,7 @@ > node.remove(ICoreConstants.NL); > node.remove(ICoreConstants.PLATFORM_PATH); > node.remove(ICoreConstants.POOLED_BUNDLES); >+ node.remove(ICoreConstants.POOLED_URLS); > node.remove(ICoreConstants.PROGRAM_ARGS); > node.remove(ICoreConstants.OS); > for (int i = 0; i < 4; i++) { >Index: src/org/eclipse/pde/internal/core/target/provisional/LoadTargetDefinitionJob.java >=================================================================== >RCS file: /cvsroot/eclipse/pde/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/target/provisional/LoadTargetDefinitionJob.java,v >retrieving revision 1.28 >diff -u -r1.28 LoadTargetDefinitionJob.java >--- src/org/eclipse/pde/internal/core/target/provisional/LoadTargetDefinitionJob.java 14 Apr 2010 16:10:53 -0000 1.28 >+++ src/org/eclipse/pde/internal/core/target/provisional/LoadTargetDefinitionJob.java 7 May 2010 19:02:42 -0000 >@@ -376,7 +376,7 @@ > considerPool = considerPool || inPool; > if (!duplicates.contains(desc)) { > if (inPool) { >- pooled.add(desc); >+ pooled.add(file); > } > infos.add(bundleInfo); > included.add(bundleInfo); >@@ -466,29 +466,23 @@ > if (pooled.isEmpty()) { > if (considerPool) { > // all pooled bundles are excluded >- pref.setValue(ICoreConstants.POOLED_BUNDLES, ICoreConstants.VALUE_SAVED_NONE); >+ pref.setValue(ICoreConstants.POOLED_URLS, ICoreConstants.VALUE_SAVED_NONE); > } else { > // nothing in the pool >- pref.setValue(ICoreConstants.POOLED_BUNDLES, ""); //$NON-NLS-1$ >+ pref.setValue(ICoreConstants.POOLED_URLS, ""); //$NON-NLS-1$ > } > } else { > StringBuffer buf = new StringBuffer(); > Iterator iterator2 = pooled.iterator(); > while (iterator2.hasNext()) { >- NameVersionDescriptor desc = (NameVersionDescriptor) iterator2.next(); >- buf.append(desc.getId()); >- buf.append(','); >- String version = desc.getVersion(); >- if (version == null) { >- buf.append(ICoreConstants.VALUE_SAVED_NONE); // indicates null version >- } else { >- buf.append(version); >- } >+ File bundle = (File) iterator2.next(); >+ buf.append(bundle.getName()); // only store file name to make workspace portable > if (iterator2.hasNext()) { > buf.append(','); > } > } >- pref.setValue(ICoreConstants.POOLED_BUNDLES, buf.toString()); >+ pref.setValue(ICoreConstants.POOLED_URLS, buf.toString()); >+ pref.setValue(ICoreConstants.POOLED_BUNDLES, ""); // NO LONGER USED //$NON-NLS-1$ > } > > // Save the feature list for the external feature model manager to EXTERNAL_FEATURES
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 309795
:
165416
|
165417
|
165484
|
167531
|
167540
|
167745