Author: max.andersen(a)jboss.com
Date: 2007-07-18 02:17:52 -0400 (Wed, 18 Jul 2007)
New Revision: 2488
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamCoreBuilder.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java
Log:
fixed bogus exception handling and NPE for cases where a builder is executed on a non-seam
project
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamCoreBuilder.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamCoreBuilder.java 2007-07-18
00:47:06 UTC (rev 2487)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamCoreBuilder.java 2007-07-18
06:17:52 UTC (rev 2488)
@@ -10,6 +10,7 @@
******************************************************************************/
package org.jboss.tools.seam.core;
+import java.io.IOException;
import java.util.Map;
import org.eclipse.core.resources.IProject;
@@ -75,6 +76,10 @@
protected IProject[] build(int kind, Map args, IProgressMonitor monitor)
throws CoreException {
SeamProject sp = getSeamProject();
+ if(sp==null) {
+ return null; //
+ }
+
sp.resolveStorage(kind != FULL_BUILD);
if(sp.getClassPath().update()) {
@@ -93,8 +98,8 @@
}
try {
sp.store();
- } catch (Exception e) {
- SeamCorePlugin.getPluginLog().logError("Error storing build results");
+ } catch (IOException e) {
+ SeamCorePlugin.getPluginLog().logError("Error storing build results for " +
sp.getProject().getName(), e);
}
return null;
}
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java 2007-07-18
00:47:06 UTC (rev 2487)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java 2007-07-18
06:17:52 UTC (rev 2488)
@@ -11,6 +11,7 @@
package org.jboss.tools.seam.internal.core;
import java.io.File;
+import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
@@ -174,8 +175,9 @@
/**
* Stores results of last build, so that on exit/enter Eclipse
* load them without rebuilding project
+ * @throws IOException
*/
- public void store() throws Exception {
+ public void store() throws IOException {
File file = getStorageFile();
file.getParentFile().mkdirs();
Show replies by date