From 89d6f7f40776a7b0115479f821b685810ab6beb6 Mon Sep 17 00:00:00 2001 From: Stefan Bodewig Date: Wed, 3 Jan 2001 12:49:17 +0000 Subject: [PATCH] Fixed some typos, avoid NullPointerException when dependency cache and actually existing class files have run out of sync (would try to access information about a non-existent class file). git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@268391 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/tools/ant/taskdefs/optional/depend/Depend.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/depend/Depend.java b/src/main/org/apache/tools/ant/taskdefs/optional/depend/Depend.java index 1a2c99a8f..abde8a150 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/depend/Depend.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/depend/Depend.java @@ -168,7 +168,7 @@ public class Depend extends MatchingTask { File depFile = new File(cache, info.relativeName + ".dep"); if (depFile.exists() && depFile.lastModified() > info.absoluteFile.lastModified()) { // depFile exists and is newer than the class file - // need to read dependency list from tyhe file. + // need to read dependency list from the file. dependencyList = readDependencyList(depFile); } } @@ -235,7 +235,7 @@ public class Depend extends MatchingTask { deleteAffectedFiles(affectedClassName); } else { - // without closer we may delete an inner class but not the + // without closure we may delete an inner class but not the // top level class which will not trigger a recompile. if (affectedClassName.indexOf("$") != -1) { @@ -245,7 +245,8 @@ public class Depend extends MatchingTask { log("Top level class = " + topLevelClassName, Project.MSG_INFO); ClassFileInfo topLevelClassInfo = (ClassFileInfo)classFileInfoMap.get(topLevelClassName); - if (topLevelClassInfo.absoluteFile.exists()) { + if (topLevelClassInfo != null && + topLevelClassInfo.absoluteFile.exists()) { log("Deleting file " + topLevelClassInfo.absoluteFile.getPath() + " since " + "one of its inner classes was removed", Project.MSG_VERBOSE); topLevelClassInfo.absoluteFile.delete();