@@ -407,6 +407,7 @@ public final class IntrospectionHelper { | |||||
+ " doesn't support the \"" + attributeName + "\" attribute."; | + " doesn't support the \"" + attributeName + "\" attribute."; | ||||
throw new UnsupportedAttributeException(msg, attributeName); | throw new UnsupportedAttributeException(msg, attributeName); | ||||
} | } | ||||
if (as != null) { // possible if value == null | |||||
try { | try { | ||||
as.setObject(p, element, value); | as.setObject(p, element, value); | ||||
} catch (final IllegalAccessException ie) { | } catch (final IllegalAccessException ie) { | ||||
@@ -415,6 +416,7 @@ public final class IntrospectionHelper { | |||||
} catch (final InvocationTargetException ite) { | } catch (final InvocationTargetException ite) { | ||||
throw extractBuildException(ite); | throw extractBuildException(ite); | ||||
} | } | ||||
} | |||||
} | } | ||||
/** | /** | ||||
@@ -1772,10 +1772,12 @@ public class Javadoc extends Task { | |||||
useExternalFile, tmpList, srcListWriter); | useExternalFile, tmpList, srcListWriter); | ||||
if (useExternalFile) { | if (useExternalFile) { | ||||
srcListWriter.flush(); | |||||
srcListWriter.flush(); //NOSONAR | |||||
} | } | ||||
} catch (final IOException e) { | } catch (final IOException e) { | ||||
tmpList.delete(); | |||||
if (tmpList != null) { | |||||
tmpList.delete(); | |||||
} | |||||
throw new BuildException("Error creating temporary file", | throw new BuildException("Error creating temporary file", | ||||
e, getLocation()); | e, getLocation()); | ||||
} finally { | } finally { | ||||
@@ -384,10 +384,12 @@ public class XmlProperty extends org.apache.tools.ant.Task { | |||||
if (containingPath != null && nodeName.equals(PATH)) { | if (containingPath != null && nodeName.equals(PATH)) { | ||||
// A "path" attribute for a node within a Path object. | // A "path" attribute for a node within a Path object. | ||||
containingPath.setPath(attributeValue); | containingPath.setPath(attributeValue); | ||||
} else if (container instanceof Path && nodeName.equals(REF_ID)) { | |||||
} else if (containingPath != null | |||||
&& container instanceof Path && nodeName.equals(REF_ID)) { | |||||
// A "refid" attribute for a node within a Path object. | // A "refid" attribute for a node within a Path object. | ||||
containingPath.setPath(attributeValue); | containingPath.setPath(attributeValue); | ||||
} else if (container instanceof Path && nodeName.equals(LOCATION)) { | |||||
} else if (containingPath != null && container instanceof Path | |||||
&& nodeName.equals(LOCATION)) { | |||||
// A "location" attribute for a node within a | // A "location" attribute for a node within a | ||||
// Path object. | // Path object. | ||||
containingPath.setLocation(resolveFile(attributeValue)); | containingPath.setLocation(resolveFile(attributeValue)); | ||||
@@ -197,7 +197,7 @@ public class Depend extends MatchingTask { | |||||
dependencyList = new Vector(); | dependencyList = new Vector(); | ||||
className = line.substring(prependLength); | className = line.substring(prependLength); | ||||
dependencyMap.put(className, dependencyList); | dependencyMap.put(className, dependencyList); | ||||
} else { | |||||
} else if (dependencyList != null) { | |||||
dependencyList.addElement(line); | dependencyList.addElement(line); | ||||
} | } | ||||
} | } | ||||
@@ -553,7 +553,7 @@ public class JDependTask extends Task { | |||||
} | } | ||||
jdepend.analyze(); | jdepend.analyze(); | ||||
if (pw.checkError()) { | |||||
if (pw != null && pw.checkError()) { | |||||
throw new IOException("Encountered an error writing JDepend" | throw new IOException("Encountered an error writing JDepend" | ||||
+ " output"); | + " output"); | ||||
} | } | ||||
@@ -133,7 +133,9 @@ public class AntSoundPlayer implements LineListener, BuildListener { | |||||
} else { | } else { | ||||
playClip(audioClip, loops); | playClip(audioClip, loops); | ||||
} | } | ||||
audioClip.drain(); | |||||
if (audioClip != null) { | |||||
audioClip.drain(); | |||||
} | |||||
} finally { | } finally { | ||||
if (audioClip != null) { | if (audioClip != null) { | ||||
audioClip.close(); | audioClip.close(); | ||||
@@ -333,7 +333,7 @@ public class TarEntry implements TarConstants { | |||||
* @return True if the entries are equal. | * @return True if the entries are equal. | ||||
*/ | */ | ||||
public boolean equals(TarEntry it) { | public boolean equals(TarEntry it) { | ||||
return getName().equals(it.getName()); | |||||
return it != null && getName().equals(it.getName()); | |||||
} | } | ||||
/** | /** | ||||