testcase
diff --git a/object_test.go b/object_test.go
index 76654c7..7c77967 100644
--- a/object_test.go
+++ b/object_test.go
@@ -749,3 +749,21 @@
}
}
}
+
+type Person183 struct {
+ Name string
+}
+
+func (Person183) JavaClassName() string {
+ return `test.Person183`
+}
+
+func TestIssue183_DecodeExcessStructField(t *testing.T) {
+ RegisterPOJO(&Person183{})
+ got, err := decodeJavaResponse(`customReplyPerson183`, ``, false)
+ if err != nil {
+ t.Error(err)
+ }
+
+ t.Logf("%T %+v", got, got)
+}
diff --git a/test_hessian/src/main/java/test/TestCustomReply.java b/test_hessian/src/main/java/test/TestCustomReply.java
index 813d7eb..ccb4d8c 100644
--- a/test_hessian/src/main/java/test/TestCustomReply.java
+++ b/test_hessian/src/main/java/test/TestCustomReply.java
@@ -425,6 +425,14 @@
output.flush();
}
+ public void customReplyPerson183() throws Exception {
+ Person183 p = new Person183();
+ p.name = "pname";
+ p.age = 13;
+ output.writeObject(p);
+ output.flush();
+ }
+
public void customReplyExtendClass() throws Exception {
Dog dog = new Dog();
dog.name = "a dog";
@@ -486,3 +494,8 @@
}
}
+
+class Person183 implements Serializable {
+ public String name;
+ public Integer age;
+}