Author: scabanovich
Date: 2007-09-12 10:36:58 -0400 (Wed, 12 Sep 2007)
New Revision: 3588
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/XMetaElementImpl.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/engines/impl/XProcess.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/XModelImpl.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/plugin/XModelSaveParticipant.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/undo/XUndoManager.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/XModelObjectUtil.java
Log:
JBIDE-893
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/XMetaElementImpl.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/XMetaElementImpl.java 2007-09-12
14:03:17 UTC (rev 3587)
+++
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/XMetaElementImpl.java 2007-09-12
14:36:58 UTC (rev 3588)
@@ -47,12 +47,9 @@
if(parameter == null) return null;
if(parameter.startsWith("%")) {
int j = parameter.length() - 1;
- try {
- parameter = getMetaModel().getMapping(mapping)
- .getValue(parameter.substring(1, j));
- } catch (Exception e) {
- return null;
- }
+ XMapping m = getMetaModel().getMapping(mapping);
+ if(m == null) return null;
+ parameter = m.getValue(parameter.substring(1, j));
}
return parameter;
}
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/engines/impl/XProcess.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/engines/impl/XProcess.java 2007-09-12
14:03:17 UTC (rev 3587)
+++
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/engines/impl/XProcess.java 2007-09-12
14:36:58 UTC (rev 3588)
@@ -57,8 +57,8 @@
public final void stop() {
if(!isRunning()) return;
- try { process.destroy(); } catch (Exception e) {}
- try { waitFor(); } catch (Exception e) {}
+ process.destroy();
+ waitFor();
clear();
}
@@ -86,8 +86,10 @@
exit = process.waitFor();
if(errc != null) errc.waitFor();
if(outc != null) outc.waitFor();
- } catch (Exception e) {}
- return exit;
+ return exit;
+ } catch (InterruptedException e) {
+ return exit;
+ }
}
protected void write(String s) {}
@@ -121,19 +123,19 @@
public HookMonitor() {
if(!isRunning()) return;
- try {
- sdhook = new Thread(new SD());
- Runtime.getRuntime().addShutdownHook(sdhook);
- new Thread(this).start();
- } catch (Exception t) {}
+ sdhook = new Thread(new SD());
+ Runtime.getRuntime().addShutdownHook(sdhook);
+ new Thread(this).start();
}
public void run() {
- try { process.waitFor(); } catch (Exception e) {}
+ try {
+ process.waitFor();
+ } catch (InterruptedException e) {
+ //do nothing
+ }
stop();
- try {
- Runtime.getRuntime().removeShutdownHook(sdhook);
- } catch (Exception t) {}
+ Runtime.getRuntime().removeShutdownHook(sdhook);
}
}
}
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/XModelImpl.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/XModelImpl.java 2007-09-12
14:03:17 UTC (rev 3587)
+++
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/XModelImpl.java 2007-09-12
14:36:58 UTC (rev 3588)
@@ -509,8 +509,9 @@
if(loaderCount <= 0) return;
try {
loaderMonitor.wait();
- } catch (Exception e) {
+ } catch (InterruptedException e) {
//ignore
+ return;
}
}
}
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/plugin/XModelSaveParticipant.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/plugin/XModelSaveParticipant.java 2007-09-12
14:03:17 UTC (rev 3587)
+++
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/plugin/XModelSaveParticipant.java 2007-09-12
14:36:58 UTC (rev 3588)
@@ -36,21 +36,6 @@
toSave.clear();
XModelObject[] modified = getModified();
if(modified.length == 0) return;
-/*
- String mes = "Struts project ";
- for (int i = 0; i < modified.length; i++) {
- if(i > 0) mes += ", ";
- mes += modified[i].getPresentationString();
- }
- mes += " is modified.\n Do you want to save changes?";
- try {
- MessageDialog d = new MessageDialog(null, "Save", null, mes,
MessageDialog.QUESTION, new String[]{"Yes", "No"}, 0);
- int q = d.open();
- if(q != 0) return;
- } catch (Exception e) {
- XStudioPlugin.log("Warning: could not call save dialog from
XStudioSaveParticipant.", e);
- }
-*/
for (int i = 0; i < modified.length; i++) toSave.add(modified[i].getModel());
}
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/undo/XUndoManager.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/undo/XUndoManager.java 2007-09-12
14:03:17 UTC (rev 3587)
+++
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/undo/XUndoManager.java 2007-09-12
14:36:58 UTC (rev 3588)
@@ -12,6 +12,7 @@
import org.jboss.tools.common.model.XModel;
import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.plugin.ModelPlugin;
public class XUndoManager {
private XModel model = null;
@@ -142,7 +143,7 @@
try {
if(t.canUndo()) t.undo();
} catch (Exception e) {
- //ignore
+ ModelPlugin.getPluginLog().logError(e);
}
current = t.prev();
current.setNext(null);
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/XModelObjectUtil.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/XModelObjectUtil.java 2007-09-12
14:03:17 UTC (rev 3587)
+++
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/XModelObjectUtil.java 2007-09-12
14:36:58 UTC (rev 3588)
@@ -89,13 +89,6 @@
s = s.substring(j + 1);
String v = found.getProperty(q);
if(v == null) {
- if(v == null && context != null) {
- try {
- v = context.lookup(q).toString();
- } catch (Exception e) {
- //ignore
- }
- }
v = (model == null) ? null : model.getProperties().getProperty(q);
if(v == null && model != null) {
int d = q.lastIndexOf('.');
Show replies by date