aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--api/src/main/java/org/osjava/jardiff/FieldInfo.java11
-rw-r--r--api/src/main/java/org/osjava/jardiff/MethodInfo.java10
2 files changed, 17 insertions, 4 deletions
diff --git a/api/src/main/java/org/osjava/jardiff/FieldInfo.java b/api/src/main/java/org/osjava/jardiff/FieldInfo.java
index ef86ea7..c159ba9 100644
--- a/api/src/main/java/org/osjava/jardiff/FieldInfo.java
+++ b/api/src/main/java/org/osjava/jardiff/FieldInfo.java
@@ -16,6 +16,8 @@
*/
package org.osjava.jardiff;
+import java.util.Arrays;
+
/**
* Information about a field of a class.
*
@@ -47,8 +49,8 @@ public final class FieldInfo extends AbstractInfo
* @param signature The signature of this field.
* @param value The initial value of the field.
*/
- public FieldInfo(int access, String name, String desc, String signature,
- Object value) {
+ public FieldInfo(final int access, final String name, final String desc, final String signature,
+ final Object value) {
super(access, name);
this.desc = desc;
this.signature = signature;
@@ -73,4 +75,9 @@ public final class FieldInfo extends AbstractInfo
public final Object getValue() {
return value;
}
+
+ public String toString() {
+ final String t = null != value ? value.getClass().getName() : null;
+ return "desc["+desc+"], sig["+signature+"], value[type "+t+", data "+value;
+ }
}
diff --git a/api/src/main/java/org/osjava/jardiff/MethodInfo.java b/api/src/main/java/org/osjava/jardiff/MethodInfo.java
index 0a59c60..797faa4 100644
--- a/api/src/main/java/org/osjava/jardiff/MethodInfo.java
+++ b/api/src/main/java/org/osjava/jardiff/MethodInfo.java
@@ -16,6 +16,8 @@
*/
package org.osjava.jardiff;
+import java.util.Arrays;
+
/**
* A class to hold information about a method.
*
@@ -46,8 +48,8 @@ public final class MethodInfo extends AbstractInfo
* @param signature The signature of the method.
* @param exceptions The exceptions thrown by the method.
*/
- public MethodInfo(int access, String name, String desc, String signature,
- String[] exceptions) {
+ public MethodInfo(final int access, final String name, final String desc, final String signature,
+ final String[] exceptions) {
super(access, name);
this.desc = desc;
this.signature = signature;
@@ -72,4 +74,8 @@ public final class MethodInfo extends AbstractInfo
public final String[] getExceptions() {
return exceptions;
}
+
+ public String toString() {
+ return "desc["+desc+"], sig["+signature+"], throws "+(null != exceptions ? Arrays.asList(exceptions) : "nil");
+ }
}