if (annotation == null) {
logger.log(TreeLogger.ERROR, "No SerialTypes annotation on CometSerializer type: " + typeName);
throw new UnableToCompleteException();
}
SerializableTypeOracleBuilder typesSentToBrowserBuilder = new SerializableTypeOracleBuilder(logger, context.getPropertyOracle(), typeOracle);
SerializableTypeOracleBuilder typesSentFromBrowserBuilder = new SerializableTypeOracleBuilder(logger, context.getPropertyOracle(), typeOracle);
for (Class<? extends Serializable> serializable : annotation.value()) {
int rank = 0;
if (serializable.isArray()) {
while (serializable.isArray()) {
serializable = (Class<? extends Serializable>) serializable.getComponentType();
rank++;
}
}
JType resolvedType = typeOracle.getType(serializable.getCanonicalName());
while (rank > 0) {
resolvedType = typeOracle.getArrayType(resolvedType);
rank--;
}
typesSentToBrowserBuilder.addRootType(logger, resolvedType);
}
OutputStream pathInfo = context.tryCreateResource(logger, typeName + ".rpc.log");
PrintWriter writer = new PrintWriter(new OutputStreamWriter(pathInfo));
writer.write("====================================\n");
writer.write("Types potentially sent from browser:\n");
writer.write("====================================\n\n");
writer.flush();
typesSentToBrowserBuilder.setLogOutputWriter(writer);
SerializableTypeOracle typesSentFromBrowser = typesSentFromBrowserBuilder.build(logger);
writer.write("===================================\n");
writer.write("Types potentially sent from server:\n");
writer.write("===================================\n\n");
writer.flush();
typesSentFromBrowserBuilder.setLogOutputWriter(writer);
SerializableTypeOracle typesSentToBrowser = typesSentToBrowserBuilder.build(logger);
writer.close();
if (pathInfo != null) {