diff options
author | Sven Gothel <[email protected]> | 2015-04-03 23:25:40 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2015-04-03 23:25:40 +0200 |
commit | a6d08112c8e09e3bb32dcdb8397919d664c9c14c (patch) | |
tree | a696cad593850e6f36effc418de2740420479bcf /api/src/main/java/org/osjava/jardiff/Tools.java | |
parent | 367de26fdba6baa12265dd614110ac618063dce4 (diff) |
Add CompatibilityType.BACKWARD_COMPATIBLE_BINARY: Allowing changes in throw-clause and field-value
Diffstat (limited to 'api/src/main/java/org/osjava/jardiff/Tools.java')
-rw-r--r-- | api/src/main/java/org/osjava/jardiff/Tools.java | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/api/src/main/java/org/osjava/jardiff/Tools.java b/api/src/main/java/org/osjava/jardiff/Tools.java index 7fb00ff..da03cd6 100644 --- a/api/src/main/java/org/osjava/jardiff/Tools.java +++ b/api/src/main/java/org/osjava/jardiff/Tools.java @@ -38,6 +38,17 @@ public final class Tools } /** + * Returns {@code true} if description has changed, i.e. the + * {@link MethodInfo#getDesc()} describing the return value. + * @param oldDesc + * @param newDesc + */ + public static boolean isDescChange(final String oldDesc, final String newDesc) { + return null == oldDesc && null != newDesc || + null != oldDesc && !oldDesc.equals(newDesc); + } + + /** * Get the java class name given an internal class name. * This method currently replaces all instances of $ and / with . this * may not be according to the java language spec, and will almost @@ -300,6 +311,14 @@ public final class Tools } } + public static boolean isFieldTypeChange(final Object oldValue, final Object newValue) { + if (oldValue == null || newValue == null) { + return oldValue != newValue; + } else { + return !oldValue.getClass().equals(newValue.getClass()); + } + } + /** * Returns whether a field's oldValue differs with newValue. * <p> |