aboutsummaryrefslogtreecommitdiffstats
path: root/api/src/main/java/org/osjava/jardiff/JarDiff.java
diff options
context:
space:
mode:
Diffstat (limited to 'api/src/main/java/org/osjava/jardiff/JarDiff.java')
-rw-r--r--api/src/main/java/org/osjava/jardiff/JarDiff.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/api/src/main/java/org/osjava/jardiff/JarDiff.java b/api/src/main/java/org/osjava/jardiff/JarDiff.java
index 432993a..24d92ff 100644
--- a/api/src/main/java/org/osjava/jardiff/JarDiff.java
+++ b/api/src/main/java/org/osjava/jardiff/JarDiff.java
@@ -392,13 +392,17 @@ public class JarDiff
addedFields.add(entry.getKey());
}
+ // We add all the old methods that match the criteria
changedMethods.addAll(removedMethods);
- changedMethods.retainAll(addedMethods);
+ // We keep the intersection of these with all the new methods
+ // to detect as changed a method that no longer match the
+ // criteria (i.e. a method that was public and is now private)
+ changedMethods.retainAll(newMethods.keySet());
removedMethods.removeAll(changedMethods);
removedMethods.removeAll(extNewMethods.keySet());
addedMethods.removeAll(changedMethods);
changedFields.addAll(removedFields);
- changedFields.retainAll(addedFields);
+ changedFields.retainAll(newFields.keySet());
removedFields.removeAll(changedFields);
removedFields.removeAll(extNewFields.keySet());
addedFields.removeAll(changedFields);