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 122801 Details for
Bug 260831
Targetplatfrom materializer doesn't materialize platform specific bundles
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 p2
clipboard.txt (text/plain), 9.25 KB, created by
Markus Kuppe
on 2009-01-16 08:15:27 EST
(
hide
)
Description:
patch p2
Filename:
MIME Type:
Creator:
Markus Kuppe
Created:
2009-01-16 08:15:27 EST
Size:
9.25 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.buckminster.core >Index: src/java/org/eclipse/buckminster/core/materializer/PlatformIndependentFeature.java >=================================================================== >--- src/java/org/eclipse/buckminster/core/materializer/PlatformIndependentFeature.java (revision 9866) >+++ src/java/org/eclipse/buckminster/core/materializer/PlatformIndependentFeature.java (working copy) >@@ -23,16 +23,9 @@ > * An {@link IFeature} that ignores platform specific information. Thus installs even non matching platform > * specific bundles. > */ >-public class PlatformIgnoringFeature extends Feature >+public class PlatformIndependentFeature extends Feature > { > >- private MaterializationContext context; >- >- public PlatformIgnoringFeature(MaterializationContext aContext) >- { >- context = aContext; >- } >- > /* > * (non-Javadoc) > * > >Property changes on: src/java/org/eclipse/buckminster/core/materializer/PlatformIndependentFeature.java >___________________________________________________________________ >Added: svn:mergeinfo > >Index: plugin.xml >=================================================================== >--- plugin.xml (revision 9863) >+++ plugin.xml (working copy) >@@ -302,4 +302,14 @@ > priority="0"> > </targetPlatform> > </extension> >+ <extension >+ point="org.eclipse.core.runtime.adapters"> >+ <factory >+ adaptableType="org.eclipse.update.core.Feature" >+ class="org.eclipse.buckminster.core.internal.FeatureAdapterFactory"> >+ <adapter >+ type="org.eclipse.buckminster.core.materializer.PlatformIndependentFeature"> >+ </adapter> >+ </factory> >+ </extension> > </plugin> >Index: src/java/org/eclipse/buckminster/core/materializer/TargetPlatformMaterializer.java >=================================================================== >--- src/java/org/eclipse/buckminster/core/materializer/TargetPlatformMaterializer.java (revision 9866) >+++ src/java/org/eclipse/buckminster/core/materializer/TargetPlatformMaterializer.java (working copy) >@@ -74,48 +74,6 @@ > return installSite.getSite(); > } > >- /** >- * @param aFeature >- * The feature to convert into a new IFeature instance that treats platform specific bundles as regular >- * ones. Thus installs even non matching bundles. >- * @param context >- * @return >- * @throws CoreException >- */ >- private IFeature convertFeature(IFeature aFeature, MaterializationContext context) throws CoreException >- { >- // A shallow copy should be sufficient >- IFeature piFeature = new PlatformIgnoringFeature(context); >- try >- { >- Class<?> clazz = aFeature.getClass(); >- while(clazz != null) >- { >- Field[] fields = clazz.getDeclaredFields(); >- for(int i = 0; i < fields.length; i++) >- { >- Field field = fields[i]; >- if(!(Modifier.isStatic(field.getModifiers()) && Modifier.isFinal(field.getModifiers())) >- || field.isEnumConstant()) >- { >- field.setAccessible(true); >- field.set(piFeature, field.get(aFeature)); >- } >- } >- clazz = clazz.getSuperclass(); >- } >- } >- catch(IllegalArgumentException e) >- { >- throw BuckminsterException.wrap(e); >- } >- catch(IllegalAccessException e) >- { >- throw BuckminsterException.wrap(e); >- } >- return piFeature; >- } >- > @Override > public IPath getDefaultInstallRoot(MaterializationContext context, Resolution resolution) throws CoreException > { >@@ -215,7 +173,7 @@ > for(ISiteFeatureReference featureRef : featureRefs) > { > IFeature feature = featureRef.getFeature(MonitorUtils.subMonitor(monitor, 50)); >- IFeature platformIngoringFeature = convertFeature(feature, context); >+ IFeature platformIngoringFeature = (IFeature)feature.getAdapter(PlatformIndependentFeature.class); > destinationSite.install(platformIngoringFeature, null, MonitorUtils.subMonitor(monitor, 50)); > } > } >Index: src/java/org/eclipse/buckminster/core/materializer/PlatformIgnoringFeature.java >=================================================================== >--- src/java/org/eclipse/buckminster/core/materializer/PlatformIgnoringFeature.java (revision 9866) >+++ src/java/org/eclipse/buckminster/core/materializer/PlatformIgnoringFeature.java (working copy) >@@ -1,64 +0,0 @@ >-/******************************************************************* >- * Copyright (c) 2009, Versant GmbH. >- * The code, documentation and other materials contained herein >- * are the sole and exclusive property of Versant GmbH. and may >- * not be disclosed, used, modified, copied or distributed without >- * prior written consent or license from Versant GmbH. >- ******************************************************************/ >- >-package org.eclipse.buckminster.core.materializer; >- >-import java.util.ArrayList; >-import java.util.List; >- >-import org.eclipse.core.runtime.PluginVersionIdentifier; >-import org.eclipse.update.core.Feature; >-import org.eclipse.update.core.IFeature; >-import org.eclipse.update.core.IPluginEntry; >-import org.eclipse.update.core.VersionedIdentifier; >- >-/** >- * @author Markus Alexander Kuppe <buckminster-dev_eclipse.org at lemmster dot de> >- * >- * An {@link IFeature} that ignores platform specific information. Thus installs even non matching platform >- * specific bundles. >- */ >-public class PlatformIgnoringFeature extends Feature >-{ >- >- private MaterializationContext context; >- >- public PlatformIgnoringFeature(MaterializationContext aContext) >- { >- context = aContext; >- } >- >- /* >- * (non-Javadoc) >- * >- * @see org.eclipse.update.core.Feature#getPluginEntries() >- */ >- @Override >- public IPluginEntry[] getPluginEntries() >- { >- IPluginEntry[] pluginEntries = getRawPluginEntries(); >- >- // normally this could simply return pluginEntries, but because of https://bugs.eclipse.org/213437 it filters >- List<IPluginEntry> result = new ArrayList<IPluginEntry>(); >- for(int i = 0; i < pluginEntries.length; i++) >- { >- IPluginEntry iPluginEntry = pluginEntries[i]; >- VersionedIdentifier versionedIdentifier = iPluginEntry.getVersionedIdentifier(); >- String identifier = versionedIdentifier.getIdentifier(); >- PluginVersionIdentifier version = versionedIdentifier.getVersion(); >- if((identifier.startsWith("org.eclipse.swt.") || identifier.startsWith("org.eclipse.equinox.launcher.")) >- && (version.getMajorComponent() == 0 && version.getMinorComponent() == 0 && version >- .getServiceComponent() == 0)) >- { >- continue; >- } >- result.add(iPluginEntry); >- } >- return result.toArray(new IPluginEntry[result.size()]); >- } >-} >Index: src/java/org/eclipse/buckminster/core/internal/FeatureAdapterFactory.java >=================================================================== >--- src/java/org/eclipse/buckminster/core/internal/FeatureAdapterFactory.java (revision 0) >+++ src/java/org/eclipse/buckminster/core/internal/FeatureAdapterFactory.java (revision 0) >@@ -0,0 +1,88 @@ >+/******************************************************************* >+ * Copyright (c) 2009, Versant GmbH. >+ * The code, documentation and other materials contained herein >+ * are the sole and exclusive property of Versant GmbH. and may >+ * not be disclosed, used, modified, copied or distributed without >+ * prior written consent or license from Versant GmbH. >+ ******************************************************************/ >+ >+package org.eclipse.buckminster.core.internal; >+ >+import java.lang.reflect.Field; >+import java.lang.reflect.Modifier; >+ >+import org.eclipse.buckminster.core.materializer.PlatformIndependentFeature; >+import org.eclipse.core.runtime.IAdapterFactory; >+import org.eclipse.update.core.Feature; >+import org.eclipse.update.core.IFeature; >+ >+/** >+ * @author Markus Alexander Kuppe <buckminster-dev_eclipse.org at lemmster dot de> >+ * >+ */ >+public class FeatureAdapterFactory implements IAdapterFactory >+{ >+ >+ /** >+ * @param aFeature >+ * The feature to convert into a new IFeature instance that treats platform specific bundles as regular >+ * ones. Thus installs even non matching bundles. >+ */ >+ private IFeature convertFeature(Feature aFeature) >+ { >+ // A shallow copy should be sufficient >+ IFeature piFeature = new PlatformIndependentFeature(); >+ try >+ { >+ Class<?> clazz = aFeature.getClass(); >+ while(clazz != null) >+ { >+ Field[] fields = clazz.getDeclaredFields(); >+ for(int i = 0; i < fields.length; i++) >+ { >+ Field field = fields[i]; >+ if(!(Modifier.isStatic(field.getModifiers()) && Modifier.isFinal(field.getModifiers())) >+ || field.isEnumConstant()) >+ { >+ field.setAccessible(true); >+ field.set(piFeature, field.get(aFeature)); >+ } >+ } >+ clazz = clazz.getSuperclass(); >+ } >+ } >+ catch(IllegalArgumentException e) >+ { >+ return aFeature; >+ } >+ catch(IllegalAccessException e) >+ { >+ return aFeature; >+ } >+ return piFeature; >+ } >+ >+ /* >+ * (non-Javadoc) >+ * >+ * @see org.eclipse.core.runtime.IAdapterFactory#getAdapter(java.lang.Object, java.lang.Class) >+ */ >+ public Object getAdapter(Object adaptableObject, Class adapterType) >+ { >+ if(adaptableObject instanceof Feature && adapterType == PlatformIndependentFeature.class) >+ { >+ return convertFeature((Feature)adaptableObject); >+ } >+ return adaptableObject; >+ } >+ >+ /* >+ * (non-Javadoc) >+ * >+ * @see org.eclipse.core.runtime.IAdapterFactory#getAdapterList() >+ */ >+ public Class[] getAdapterList() >+ { >+ return new Class[] { IFeature.class }; >+ } >+}
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 260831
:
122394
|
122395
| 122801 |
122802