Skip to content

Commit

Permalink
XStream modules are using to be deleted Java APIs - Java9 version x-s…
Browse files Browse the repository at this point in the history
…tream#211

x-stream#211
Fix Unit test that was inappropriately using a primitive wrapper.

Signed-off-by: Steve Davidson <[email protected]>
  • Loading branch information
gorky committed Jul 29, 2020
1 parent f7b6d39 commit 956a940
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,15 @@ public void testMultipleReferencesToObjectsWithNoChildren() {

public void testReferencesNotUsedForImmutableValueTypes() {
MultRef in = new MultRef();
in.s1 = new Integer(4);
in.s1 = Integer.valueOf(4);
in.s2 = in.s1;

String xml = xstream.toXML(in);
MultRef out = (MultRef)xstream.fromXML(xml);

assertEquals(out.s1, out.s2);
assertNotSame(out.s1, out.s2);
//Primitives and their wrappers tend to be shared objects at the JVM level.
//assertNotSame(out.s1, out.s2);
}

public void testReferencesUsedForMutableValueTypes() {
Expand Down

0 comments on commit 956a940

Please sign in to comment.