Author: scabanovich
Date: 2007-11-22 10:46:21 -0500 (Thu, 22 Nov 2007)
New Revision: 5045
Modified:
trunk/common/plugins/org.jboss.tools.common.verification/src/org/jboss/tools/common/verification/vrules/VHelper.java
trunk/common/plugins/org.jboss.tools.common.verification/src/org/jboss/tools/common/verification/vrules/impl/VTaskImpl.java
Log:
NPE prevented
Modified:
trunk/common/plugins/org.jboss.tools.common.verification/src/org/jboss/tools/common/verification/vrules/VHelper.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.verification/src/org/jboss/tools/common/verification/vrules/VHelper.java 2007-11-22
15:45:20 UTC (rev 5044)
+++
trunk/common/plugins/org.jboss.tools.common.verification/src/org/jboss/tools/common/verification/vrules/VHelper.java 2007-11-22
15:46:21 UTC (rev 5045)
@@ -43,6 +43,7 @@
* to given object and its children.
*/
public static VRule[] getRules(VManager manager, VObject object) {
+ if(manager == null || object == null) return null;
List<VRule> result = new ArrayList<VRule>();
VEntity entity = object.getEntity();
VRuleSet[] ruleSets = manager.getRuleSets();
Modified:
trunk/common/plugins/org.jboss.tools.common.verification/src/org/jboss/tools/common/verification/vrules/impl/VTaskImpl.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.verification/src/org/jboss/tools/common/verification/vrules/impl/VTaskImpl.java 2007-11-22
15:45:20 UTC (rev 5044)
+++
trunk/common/plugins/org.jboss.tools.common.verification/src/org/jboss/tools/common/verification/vrules/impl/VTaskImpl.java 2007-11-22
15:46:21 UTC (rev 5045)
@@ -8,7 +8,6 @@
import java.util.ArrayList;
import java.util.List;
-import org.jboss.tools.common.model.plugin.ModelPlugin;
import org.jboss.tools.common.verification.vrules.*;
import org.jboss.tools.common.verification.vrules.plugin.VerificationPlugin;
@@ -45,7 +44,11 @@
if(sleeping) {
synchronized(this) {
sleeping = false;
- try { notifyAll(); } catch (Exception e) {}
+ try {
+ notifyAll();
+ } catch (IllegalMonitorStateException e) {
+ //ignore
+ }
}
}
}
@@ -70,7 +73,7 @@
public void run() {
notifyStarted();
- for (index = 0; index < rules.length; index++) {
+ if(rules != null) for (index = 0; index < rules.length; index++) {
if (!running) break;
VRule rule = rules[index];
if (rule.isEnabled() && rule.getAction() != null
@@ -87,7 +90,11 @@
synchronized(this) {
if(sleeping) {
notifyPause();
- try { wait(); } catch (Exception e) {}
+ try {
+ wait();
+ } catch (InterruptedException e) {
+ //ignore
+ }
if(!sleeping) notifyResume();
}
}
Show replies by date