if (this.serializedEventList == null) {
return Collections.emptyList();
}
try {
DataInputDeserializer deserializer = new DataInputDeserializer(this.serializedEventList);
int numEvents = deserializer.readInt();
ArrayList<AbstractEvent> events = new ArrayList<AbstractEvent>(numEvents);
for (int i = 0; i < numEvents; i++) {
String className = deserializer.readUTF();
Class<? extends AbstractEvent> clazz;
try {
clazz = Class.forName(className).asSubclass(AbstractEvent.class);
} catch (ClassNotFoundException e) {
throw new RuntimeException("Could not load event class '" + className + "'.", e);