Do not serialize generator in SourceFile.Generated.
@@ -559,7 +559,10 @@ public class SourceFile implements StaticSourceFile, Serializable {
*/
static class Generated extends SourceFile {
private static final long serialVersionUID = 1L;
- private final Generator generator;
+ // Avoid serializing generator and remove the burden to make classes that implement
+ // Generator serializable. There should be no need to obtain generated source in the
+ // second stage of compilation.
+ private final transient Generator generator;
// Not private, so that LazyInput can extend it.
Generated(String fileName, String originalPath, Generator generator) {
