Author: dgolovin
Date: 2011-09-22 14:24:16 -0400 (Thu, 22 Sep 2011)
New Revision: 34969
Modified:
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/xml/SAXValidator.java
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/xml/XMLUtilities.java
Log:
fixed PMD violations OptimizableToArrayCall
Modified:
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/xml/SAXValidator.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/xml/SAXValidator.java 2011-09-22
18:22:17 UTC (rev 34968)
+++
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/xml/SAXValidator.java 2011-09-22
18:24:16 UTC (rev 34969)
@@ -140,7 +140,7 @@
} finally {
// Thread.currentThread().setContextClassLoader(cc);
}
- return h.errors.toArray(new String[0]);
+ return h.errors.toArray(new String[h.errors.size()]);
}
/**
Modified:
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/xml/XMLUtilities.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/xml/XMLUtilities.java 2011-09-22
18:22:17 UTC (rev 34968)
+++
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/xml/XMLUtilities.java 2011-09-22
18:24:16 UTC (rev 34969)
@@ -61,7 +61,7 @@
al.add((Element)n);
}
}
- return al.toArray(new Element[0]);
+ return al.toArray(new Element[al.size()]);
}
public static Element getUniqueChild(Element parent, String name){
@@ -282,7 +282,7 @@
return new
String[]{Messages.XMLUtilities_SAXExceptionMessage+":0:0",e.toString()};
//$NON-NLS-1$
}
}
- return h.errors.toArray(new String[0]);
+ return h.errors.toArray(new String[h.errors.size()]);
}
public static final void serialize(Element element, String filename) throws
IOException {
Show replies by date