Skip to content

Commit

Permalink
Fix for JDK compilers.
Browse files Browse the repository at this point in the history
  • Loading branch information
joehni committed Mar 24, 2018
1 parent 7d2c2ab commit c7bcb66
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.image.BufferedImage;
import java.awt.image.RenderedImage;
import java.io.ByteArrayOutputStream;
import java.io.IOException;

Expand Down Expand Up @@ -51,7 +52,7 @@ public void testInBWCanBeMarshalled() throws IOException {
final String xml = xstream.toXML(image);

final ByteArrayOutputStream baosSerialized = new ByteArrayOutputStream();
ImageIO.write(xstream.fromXML(xml), "tiff", baosSerialized);
ImageIO.write(xstream.<RenderedImage>fromXML(xml), "tiff", baosSerialized);

assertArrayEquals(baosOriginal.toByteArray(), baosSerialized.toByteArray());
}
Expand All @@ -71,7 +72,7 @@ public void testInRGBACanBeMarshalled() throws IOException {
final String xml = xstream.toXML(image);

final ByteArrayOutputStream baosSerialized = new ByteArrayOutputStream();
ImageIO.write(xstream.fromXML(xml), "png", baosSerialized);
ImageIO.write(xstream.<RenderedImage>fromXML(xml), "png", baosSerialized);

assertArrayEquals(baosOriginal.toByteArray(), baosSerialized.toByteArray());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ public static class Zoo extends StandardObject {
private final Set<Animal> animals;

public Zoo() {
this(new HashSet<>());
this(new HashSet<Animal>());
}

public Zoo(final Set<Animal> set) {
Expand Down Expand Up @@ -469,7 +469,7 @@ public void testWithDifferentDefaultImplementation() {
}

public void testWithSortedSet() {
final Zoo zoo = new Zoo(new TreeSet<>());
final Zoo zoo = new Zoo(new TreeSet<Animal>());
zoo.add(new Animal("Lion"));
zoo.add(new Animal("Ape"));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,23 @@ protected XStream createXStream() {
}

public void testAnnotation() {
final String expected = "" + "<root>\n" + " <string>one</string>\n" + " <string>two</string>\n" + "</root>";
final String expected = "" //
+ "<root>\n"
+ " <string>one</string>\n"
+ " <string>two</string>\n"
+ "</root>";
final ImplicitRootOne implicitRoot = new ImplicitRootOne();
implicitRoot.getValues().add("one");
implicitRoot.getValues().add("two");
assertBothWays(implicitRoot, expected);
}

public void testAnnotationWithItemFieldName() {
final String expected = "" + "<root>\n" + " <value>one</value>\n" + " <value>two</value>\n" + "</root>";
final String expected = "" //
+ "<root>\n"
+ " <value>one</value>\n"
+ " <value>two</value>\n"
+ "</root>";
final ImplicitRootTwo implicitRoot = new ImplicitRootTwo();
implicitRoot.getValues().add("one");
implicitRoot.getValues().add("two");
Expand Down Expand Up @@ -133,7 +141,7 @@ public void testAnnotationHandlesParameterizedTypes() {
+ "</implicit>";
final ImplicitParameterizedType root = new ImplicitParameterizedType();
root.signatureLines = new ArrayList<>();
root.signatureLines.add(new ArrayList<>());
root.signatureLines.add(new ArrayList<Point>());
root.signatureLines.get(0).add(new Point(33, 11));
assertBothWays(root, xml);
}
Expand Down

0 comments on commit c7bcb66

Please sign in to comment.