File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed
main/java/com/marcospassos/phpserializer
test/java/com/marcospassos/phpserializer Expand file tree Collapse file tree 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)
8181 buffer .append ("\" :" );
8282
8383 subWriter = new Writer ();
84+ subWriter .pointer = pointer + 1 ;
8485
8586 return subWriter ;
8687 }
@@ -102,7 +103,9 @@ void writeSerializableObjectEnd() {
102103 buffer .append (data );
103104 buffer .append ("}" );
104105
105- pointer += subWriter .getPointer ();
106+ pointer = subWriter .getPointer () + 1 ;
107+
108+ subWriter = null ;
106109 }
107110
108111 /**
Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ public void writeSerializableObject() throws Exception
4949 writer .writeSerializableObjectEnd ();
5050
5151 assertEquals ("C:3:\" Foo\" :20:{a:1:{i:0;s:3:\" bar\" ;}}" , writer .getResult ());
52- assertEquals (3 , writer .getPointer ());
52+ assertEquals (4 , writer .getPointer ());
5353 }
5454
5555 @ Test (expected = IllegalStateException .class )
You can’t perform that action at this time.
0 commit comments