Author: rob.stryker(a)jboss.com
Date: 2008-01-21 22:28:51 -0500 (Mon, 21 Jan 2008)
New Revision: 5858
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/runtime/ProjectRuntimeClasspathProvider.java
Log:
JBIDE-1657 comment made there. Throwing CoreException instead
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/runtime/ProjectRuntimeClasspathProvider.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/runtime/ProjectRuntimeClasspathProvider.java 2008-01-22
03:22:00 UTC (rev 5857)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/runtime/ProjectRuntimeClasspathProvider.java 2008-01-22
03:28:51 UTC (rev 5858)
@@ -28,7 +28,9 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IAdapterFactory;
import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Status;
import org.eclipse.jdt.core.ClasspathContainerInitializer;
import org.eclipse.jdt.core.IClasspathContainer;
import org.eclipse.jdt.core.IClasspathEntry;
@@ -39,6 +41,7 @@
import org.eclipse.wst.common.project.facet.core.runtime.IRuntimeComponent;
import org.eclipse.wst.server.core.IRuntime;
import org.eclipse.wst.server.core.ServerCore;
+import org.jboss.ide.eclipse.as.classpath.core.ClasspathCorePlugin;
import
org.jboss.ide.eclipse.as.classpath.core.runtime.WebtoolsProjectJBossClasspathContainerInitializer.WebtoolsProjectJBossClasspathContainer;
/**
@@ -107,9 +110,13 @@
private IPath path;
private IRuntime rt;
- public RuntimeClasspathContainer(IPath path) {
+ public RuntimeClasspathContainer(IPath path) throws CoreException {
this.path = path;
this.rt = ServerCore.findRuntime(path.segment(1));
+ if( rt == null )
+ throw new CoreException(
+ new Status( IStatus.ERROR, ClasspathCorePlugin.PLUGIN_ID,
+ "Runtime " + path.segment(1) + " does not exist. This classpath
container cannot be initialized. "));
}
public IClasspathEntry[] getClasspathEntries() {
@@ -117,7 +124,7 @@
}
public String getDescription() {
- return "All JBoss Libraries [" + rt.getName() + "]";
+ return "All JBoss Libraries [" + (rt == null ? "null" :
rt.getName()) + "]";
}
public int getKind() {
Show replies by date