File tree 2 files changed +5
-2
lines changed
main/java/com/marcospassos/phpserializer
test/java/com/marcospassos/phpserializer
2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -81,6 +81,7 @@ public Writer writeSerializableObjectStart(String className)
81
81
buffer .append ("\" :" );
82
82
83
83
subWriter = new Writer ();
84
+ subWriter .pointer = pointer + 1 ;
84
85
85
86
return subWriter ;
86
87
}
@@ -102,7 +103,9 @@ void writeSerializableObjectEnd() {
102
103
buffer .append (data );
103
104
buffer .append ("}" );
104
105
105
- pointer += subWriter .getPointer ();
106
+ pointer = subWriter .getPointer () + 1 ;
107
+
108
+ subWriter = null ;
106
109
}
107
110
108
111
/**
Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ public void writeSerializableObject() throws Exception
49
49
writer .writeSerializableObjectEnd ();
50
50
51
51
assertEquals ("C:3:\" Foo\" :20:{a:1:{i:0;s:3:\" bar\" ;}}" , writer .getResult ());
52
- assertEquals (3 , writer .getPointer ());
52
+ assertEquals (4 , writer .getPointer ());
53
53
}
54
54
55
55
@ Test (expected = IllegalStateException .class )
You can’t perform that action at this time.
0 commit comments