diff --git a/docs/releasenotes.html b/docs/releasenotes.html
index c1ed6be7a..35a088268 100644
--- a/docs/releasenotes.html
+++ b/docs/releasenotes.html
@@ -251,6 +251,8 @@
Unused local variables are not always detected (bug 798111)
Fixed allowThrowsTagsForSubclasses/allowMissingThrowsTag interfere (bug 803577)
+
+ Unused... checks don't work together (bug 805954)
diff --git a/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/usage/AbstractUsageCheck.java b/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/usage/AbstractUsageCheck.java
index 2edbfabfb..5292c6639 100644
--- a/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/usage/AbstractUsageCheck.java
+++ b/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/usage/AbstractUsageCheck.java
@@ -117,7 +117,7 @@ public abstract class AbstractUsageCheck
catch (SymbolTableException ste) {
logError(ste);
}
- ASTManager.getInstance().clear();
+ ASTManager.getInstance().removeCheck(this);
}
/**
diff --git a/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/usage/transmogrify/ASTManager.java b/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/usage/transmogrify/ASTManager.java
index 969c45f5f..635f55a75 100644
--- a/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/usage/transmogrify/ASTManager.java
+++ b/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/usage/transmogrify/ASTManager.java
@@ -197,13 +197,18 @@ public final class ASTManager
}
/**
- * Clears all managed elements.
+ * Removes a check and its check nodes. Clears all managed elements if
+ * last check removed.
+ * @param check
*/
- public void clear()
+ public void removeCheck(AbstractUsageCheck aCheck)
{
- mCheckNodes.clear();
- mCompleteTree = null;
- mMap.clear();
- mTrees.clear();
+ mCheckNodes.remove(aCheck);
+ if (mCheckNodes.isEmpty()) {
+ mCompleteTree = null;
+ mMap.clear();
+ mTrees.clear();
+ }
+
}
}