@@ -77,8 +77,8 @@ public class XML {
7777 /** XPath evaluation mechanism. */
7878 private final XPath xpath ;
7979
80- private final boolean debug = "debug" . equals ( System . getProperty (
81- "scijava.log.level" ));
80+ private final boolean debug =
81+ "debug" . equals ( System . getProperty ( " scijava.log.level" ));
8282
8383 /** Parses XML from the given file. */
8484 public XML (final File file ) throws IOException {
@@ -122,7 +122,7 @@ public XML(final String path, final Document doc) {
122122 System .err .println (Classes .location (XPathFactory .class ));
123123 }
124124
125- XPath xp = null ;
125+ XPath xp ;
126126 final Thread thread = Thread .currentThread ();
127127 final ClassLoader contextClassLoader = thread .getContextClassLoader ();
128128 try {
@@ -219,7 +219,7 @@ public String toString() {
219219 /** Gets the CData beneath the given node. */
220220 public static String cdata (final Node item ) {
221221 final NodeList children = item .getChildNodes ();
222- if (children == null || children .getLength () == 0 ) return null ;
222+ if (children .getLength () == 0 ) return null ;
223223 for (int i = 0 ; i < children .getLength (); i ++) {
224224 final Node child = children .item (i );
225225 if (child .getNodeType () != Node .TEXT_NODE ) continue ;
@@ -231,7 +231,7 @@ public static String cdata(final Node item) {
231231 /** Gets the CData beneath the given element's specified child. */
232232 public static String cdata (final Element el , final String child ) {
233233 NodeList children = el .getElementsByTagName (child );
234- if (children == null || children .getLength () == 0 ) return null ;
234+ if (children .getLength () == 0 ) return null ;
235235 return cdata (children .item (0 ));
236236 }
237237
@@ -269,8 +269,7 @@ private static Document loadXML(final File file) throws IOException {
269269 /** Loads an XML document from the given URL. */
270270 private static Document loadXML (final URL url ) throws IOException {
271271 try (final InputStream in = url .openStream ()) {
272- final Document document = loadXML (in );
273- return document ;
272+ return loadXML (in );
274273 }
275274 }
276275
0 commit comments