Author: dgolovin
Date: 2011-09-22 13:31:23 -0400 (Thu, 22 Sep 2011)
New Revision: 34965
Modified:
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/java/ParametedType.java
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/java/ParametedTypeFactory.java
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/java/impl/AnnotationDeclaration.java
Log:
fixed PMD violations, removed try { } catch (Exception e) blocks where it placed around
blocks that doesn't throw checked exceptions
Modified:
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/java/ParametedType.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/java/ParametedType.java 2011-09-22
17:29:43 UTC (rev 34964)
+++
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/java/ParametedType.java 2011-09-22
17:31:23 UTC (rev 34965)
@@ -169,11 +169,7 @@
String sc = type.getSuperclassTypeSignature();
boolean objectArray = false;
if(sc != null) {
- try {
- sc = resolveParameters(sc);
- } catch (Exception e) {
- CommonPlugin.getDefault().logError(e);
- }
+ sc = resolveParameters(sc);
} else if(!"java.lang.Object".equals(type.getFullyQualifiedName())) {
sc = ParametedTypeFactory.OBJECT;
} else if("java.lang.Object".equals(type.getFullyQualifiedName())
&& arrayPrefix.length() > 0) {
@@ -330,7 +326,7 @@
}
boolean areTypeParametersAssignableTo(ParametedType other) {
- if(other.parameterTypes.size() == 0) return true;
+ if(other.parameterTypes.isEmpty()) return true;
if(this.parameterTypes.size() != other.parameterTypes.size()) return false;
for (int i = 0; i < parameterTypes.size(); i++) {
ParametedType p1 = parameterTypes.get(i);
Modified:
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/java/ParametedTypeFactory.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/java/ParametedTypeFactory.java 2011-09-22
17:29:43 UTC (rev 34964)
+++
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/java/ParametedTypeFactory.java 2011-09-22
17:31:23 UTC (rev 34965)
@@ -69,10 +69,7 @@
if(p != null) parametedType.addParameter(p);
} catch (JavaModelException e) {
CommonPlugin.getDefault().logError(e);
- } catch (Exception ee) {
- CommonPlugin.getDefault().logError(ee);
}
-
}
}
return parametedType;
@@ -152,7 +149,7 @@
String[] paramSignatures = null;
try {
paramSignatures = Signature.getTypeArguments(typeSignature);
- } catch (Exception e) {
+ } catch (IllegalArgumentException e) {
CommonPlugin.getDefault().logError(e);
}
if(paramSignatures != null) for (String paramSignature: paramSignatures) {
Modified:
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/java/impl/AnnotationDeclaration.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/java/impl/AnnotationDeclaration.java 2011-09-22
17:29:43 UTC (rev 34964)
+++
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/java/impl/AnnotationDeclaration.java 2011-09-22
17:31:23 UTC (rev 34965)
@@ -57,11 +57,9 @@
public Object getMemberValue(String name) {
if(name == null) name = "value"; //$NON-NLS-1$
IMemberValuePair[] pairs = getMemberValuePairs();
- if(pairs != null) {
- for (IMemberValuePair pair: pairs) {
- if(name.equals(pair.getMemberName())) {
- return resolveMemberValue(pair);
- }
+ for (IMemberValuePair pair: pairs) {
+ if(name.equals(pair.getMemberName())) {
+ return resolveMemberValue(pair);
}
}
return null;
Show replies by date