diff options
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> |