aboutsummaryrefslogtreecommitdiffstats
path: root/api/src
diff options
context:
space:
mode:
authorTimo Westkämper <[email protected]>2014-04-16 23:01:36 +0300
committerTimo Westkämper <[email protected]>2014-04-16 23:01:36 +0300
commit418e3db25eb9f526ce8b766047d1a04c5f5ba6db (patch)
treedaef49a347372cf2fa6fcafc9bb3fd1163720372 /api/src
parent332272a97dc71f8b69ccf58cd17a0811a21de222 (diff)
Fix comparison
Diffstat (limited to 'api/src')
-rw-r--r--api/src/main/java/org/osjava/jardiff/JarDiff.java27
1 files changed, 14 insertions, 13 deletions
diff --git a/api/src/main/java/org/osjava/jardiff/JarDiff.java b/api/src/main/java/org/osjava/jardiff/JarDiff.java
index c55adc8..0926b60 100644
--- a/api/src/main/java/org/osjava/jardiff/JarDiff.java
+++ b/api/src/main/java/org/osjava/jardiff/JarDiff.java
@@ -366,33 +366,34 @@ public class JarDiff
if (criteria.validClass(oci) || criteria.validClass(nci)) {
Map oldMethods = oci.getMethodMap();
Map oldFields = oci.getFieldMap();
- Map extOldMethods = new HashMap(oldMethods);
- Map extOldFields = new HashMap(oldFields);
+ Map newMethods = nci.getMethodMap();
+ Map newFields = nci.getFieldMap();
+
+ Map extNewMethods = new HashMap(newMethods);
+ Map extNewFields = new HashMap(newFields);
- String superClass = oci.getSupername();
- while (superClass != null && oldClassInfo.containsKey(superClass)) {
- ClassInfo sci = (ClassInfo) oldClassInfo.get(superClass);
+ String superClass = nci.getSupername();
+ while (superClass != null && newClassInfo.containsKey(superClass)) {
+ ClassInfo sci = (ClassInfo) newClassInfo.get(superClass);
Iterator j = sci.getFieldMap().entrySet().iterator();
while (j.hasNext()) {
Map.Entry entry = (Map.Entry) j.next();
if (!((FieldInfo)entry.getValue()).isPrivate()
- && !extOldFields.containsKey(entry.getKey())) {
- extOldFields.put(entry.getKey(), entry.getValue());
+ && !extNewFields.containsKey(entry.getKey())) {
+ extNewFields.put(entry.getKey(), entry.getValue());
}
}
j = sci.getMethodMap().entrySet().iterator();
while (j.hasNext()) {
Map.Entry entry = (Map.Entry) j.next();
if (!((MethodInfo)entry.getValue()).isPrivate()
- && !extOldMethods.containsKey(entry.getKey())) {
- extOldMethods.put(entry.getKey(), entry.getValue());
+ && !extNewMethods.containsKey(entry.getKey())) {
+ extNewMethods.put(entry.getKey(), entry.getValue());
}
}
superClass = sci.getSupername();
}
- Map newMethods = nci.getMethodMap();
- Map newFields = nci.getFieldMap();
Iterator j = oldMethods.entrySet().iterator();
while (j.hasNext()) {
Map.Entry entry = (Map.Entry) j.next();
@@ -421,12 +422,12 @@ public class JarDiff
changedMethods.addAll(removedMethods);
changedMethods.retainAll(addedMethods);
removedMethods.removeAll(changedMethods);
- removedMethods.removeAll(extOldMethods.keySet());
+ removedMethods.removeAll(extNewMethods.keySet());
addedMethods.removeAll(changedMethods);
changedFields.addAll(removedFields);
changedFields.retainAll(addedFields);
removedFields.removeAll(changedFields);
- removedFields.removeAll(extOldFields.keySet());
+ removedFields.removeAll(extNewFields.keySet());
addedFields.removeAll(changedFields);
j = changedMethods.iterator();
while (j.hasNext()) {