Monthly Archives: September 2012

When a LinkedList is not good enough – OR – copying a Set to a List

I had a need to remove duplicates from a pre-existing list. I tried: Seems easy enough, but the list kept returning no elements. I started clicking through the code and found the LinkedList constructor that takes a collection eventually calls … Continue reading

Posted in Collections, Java | Tagged , , , , , , , , | Leave a comment

JVM showing wrong time

If you JVM is showing the wrong time, it may be because it is picking up the wrong timezone. Specify the following to fix it: -Duser.timezone=”America/Louisville”

Posted in Java, Joda-Time | Tagged , , | Leave a comment

Running out of heap space when running JUnit tests

The project finally got so large that the JUnit tests would run out of heap space during the tests. I added space to the IDEA maven runner, but that didn’t work. You have to add it to the maven-surefire plugin.

Posted in Java, JUnit, Maven | Leave a comment

Creating an xml Source object from a String

I needed to create an xml source object so I could force an unmarshaller to return a specific type of object.

Posted in Java, JAXB | Leave a comment

Unmarshalling ambiguous objects

In a previous post, I showed how to use @XmlSeeAlso to inform the JAXB context of inheriting classes. This is great during marshalling. The real pain was on unmarshalling. A requirement we had was that there were two objects that … Continue reading

Posted in Java, JAXB, xml | Leave a comment