aboutsummaryrefslogtreecommitdiffstats
path: root/api/src/main/java/org/osjava/jardiff/JarDiff.java
diff options
context:
space:
mode:
authorJulien Eluard <[email protected]>2014-10-27 19:32:10 -0300
committerJulien Eluard <[email protected]>2014-10-27 19:32:10 -0300
commit3a986013a1799caf74a63e5a87737a0d901418a6 (patch)
tree40192180581c602f8a103a0591d61f8a0d8ba5cf /api/src/main/java/org/osjava/jardiff/JarDiff.java
parent91a8fe7a96a32ae11f59320e424a9212f55aecb0 (diff)
parent327e7fdf59a05f16a050b4132abe4b8b4b0d93be (diff)
Merge pull request #51 from syev/master
Fix #50: Handling of members access permission changes
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);