if (shouldBeTransformed(inspection)) {
try {
out.writeBoolean(true); // flag 'anonymous'
TransformedInspection transformed = new TransformedInspection(inspection);
MigratedInspection migrated = new MigratedInspection(transformed);
out.writeObject(transformed.getOriginalClass().getName());
out.writeObject(migrated.toBytecode());
out.writeObject(migrated.toSerializedForm());
} catch (Exception e) {
throw new RuntimeException("Could not transform and replicate class " + inspections.getClass() + ":\n" + e.getMessage(), e);
}
} else {
out.writeBoolean(false); // flag 'not anonymous'