Author: dgolovin
Date: 2011-12-19 14:57:28 -0500 (Mon, 19 Dec 2011)
New Revision: 37438
Modified:
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/EclipseJavaUtil.java
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/web/WebUtils.java
Log:
fix for PMD warnings
1. is not null check removed from instanceof condition
2. ps.toArray(new Object[0]) changed to ps.toArray(new Object[ps.size()])
Modified:
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/EclipseJavaUtil.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/EclipseJavaUtil.java 2011-12-19
18:28:44 UTC (rev 37437)
+++
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/EclipseJavaUtil.java 2011-12-19
19:57:28 UTC (rev 37438)
@@ -245,7 +245,7 @@
}
if(checkParents) {
IJavaElement parent = element.getParent();
- if(parent!=null && parent instanceof IMember) {
+ if(parent instanceof IMember) {
return findAnnotationByShortName((IMember)parent, name, true);
}
}
Modified:
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/web/WebUtils.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/web/WebUtils.java 2011-12-19
18:28:44 UTC (rev 37437)
+++
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/web/WebUtils.java 2011-12-19
19:57:28 UTC (rev 37438)
@@ -47,7 +47,7 @@
}
}
}
- return ps.toArray(new IPath[0]);
+ return ps.toArray(new IPath[ps.size()]);
}
return new IPath[0];
}
@@ -63,7 +63,7 @@
ps.add(c.getFullPath());
}
}
- return ps.toArray(new IPath[0]);
+ return ps.toArray(new IPath[ps.size()]);
}
return new IPath[0];
}
Show replies by date