Author: snjeza
Date: 2011-08-05 18:31:47 -0400 (Fri, 05 Aug 2011)
New Revision: 33642
Modified:
branches/jbosstools-3.2.x/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/fixes/WTPRuntimeFix.java
Log:
JBIDE-9361 Imported project examples with multiple projects don't have build path set
correctly
Modified:
branches/jbosstools-3.2.x/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/fixes/WTPRuntimeFix.java
===================================================================
---
branches/jbosstools-3.2.x/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/fixes/WTPRuntimeFix.java 2011-08-05
22:25:48 UTC (rev 33641)
+++
branches/jbosstools-3.2.x/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/fixes/WTPRuntimeFix.java 2011-08-05
22:31:47 UTC (rev 33642)
@@ -85,6 +85,7 @@
try {
IFacetedProject facetedProject = ProjectFacetsManager.create(eclipseProject);
if (facetedProject == null) {
+ fixNonFacetedEsbProject(project, fix, eclipseProject);
continue;
}
org.eclipse.wst.common.project.facet.core.runtime.IRuntime wtpRuntime =
facetedProject.getPrimaryRuntime();
@@ -97,9 +98,11 @@
wtpRuntime = RuntimeManager.getRuntime(runtime.getId());
facetedProject.addTargetedRuntime(wtpRuntime, monitor);
facetedProject.setPrimaryRuntime(wtpRuntime, monitor);
- fixEsb(eclipseProject, fix, wtpRuntime);
+ fixEsb(eclipseProject, fix, runtime);
}
}
+ } else {
+ fixNonFacetedEsbProject(project, fix, eclipseProject);
}
} catch (CoreException e) {
ProjectExamplesActivator.log(e);
@@ -109,8 +112,16 @@
return ret;
}
+ private void fixNonFacetedEsbProject(Project project, ProjectFix fix,
+ IProject eclipseProject) throws JavaModelException {
+ IRuntime runtime = getBestRuntime(project, fix);
+ if (runtime != null) {
+ fixEsb(eclipseProject, fix, runtime);
+ }
+ }
+
private void fixEsb(IProject eclipseProject,
- ProjectFix fix, org.eclipse.wst.common.project.facet.core.runtime.IRuntime wtpRuntime)
throws JavaModelException {
+ ProjectFix fix, IRuntime runtime) throws JavaModelException {
String required_components = fix.getProperties().get(REQUIRED_COMPONENTS);
if (required_components == null) {
return;
@@ -135,7 +146,6 @@
IClasspathEntry[] entries = javaProject.getRawClasspath();
IClasspathEntry[] newEntries = new IClasspathEntry[entries.length];
boolean changed = false;
- IRuntime runtime = getRuntime(wtpRuntime);
for (int i = 0; i < entries.length; i++) {
IClasspathEntry entry = entries[i];
if (entry.getEntryKind() == IClasspathEntry.CPE_CONTAINER) {
Show replies by date