Author: scabanovich
Date: 2008-04-04 08:46:49 -0400 (Fri, 04 Apr 2008)
New Revision: 7329
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.verification/src/org/jboss/tools/jsf/verification/vrules/JSFCheckClass.java
Log:
JBIDE-895
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.verification/src/org/jboss/tools/jsf/verification/vrules/JSFCheckClass.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.verification/src/org/jboss/tools/jsf/verification/vrules/JSFCheckClass.java 2008-04-04
12:45:30 UTC (rev 7328)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.verification/src/org/jboss/tools/jsf/verification/vrules/JSFCheckClass.java 2008-04-04
12:46:49 UTC (rev 7329)
@@ -11,6 +11,7 @@
package org.jboss.tools.jsf.verification.vrules;
import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.JavaModelException;
import org.jboss.tools.common.model.*;
import org.jboss.tools.common.model.util.EclipseJavaUtil;
import org.jboss.tools.common.verification.vrules.*;
@@ -30,17 +31,26 @@
IType type = object.getModel().getValidType(value);
if(type != null) {
String mustImpl = null;
- try { mustImpl = checkImplements(object, type); } catch (Exception e) {}
+ try {
+ mustImpl = checkImplements(object, type);
+ } catch (JavaModelException e) {
+ //ignore
+ }
if(mustImpl != null) return fireImplements(object, attr, attr, value, mustImpl);
String mustExtend = null;
- try { mustExtend = checkExtends(object, type); } catch (Exception e) {}
+ try {
+ mustExtend = checkExtends(object, type);
+ } catch (JavaModelException e) {
+ //ignore
+ }
if(mustExtend != null) return fireExtends(object, attr, attr, value, mustExtend);
return null;
}
return fire(object, attr, attr, value);
}
- private String checkImplements(VObject object, IType type) throws Exception {
+ private String checkImplements(VObject object, IType type) throws JavaModelException {
+ if(object == null || type == null) return null;
if("java.lang.Class".equals(type.getFullyQualifiedName())) return null;
String impl = rule.getProperty("implements");
if(impl == null || impl.length() == 0) return null;
@@ -59,7 +69,8 @@
return checkImplements(object, type);
}
- private String checkExtends(VObject object, IType type) throws Exception {
+ private String checkExtends(VObject object, IType type) throws JavaModelException {
+ if(object == null || type == null) return null;
if(type.isInterface()) return null;
if("java.lang.Class".equals(type.getFullyQualifiedName())) return null;
String ext = rule.getProperty("extends");
Show replies by date