865 xout.println("Agg. Gen. Cls Names : " + aggregateGeneratedClassNames);
866 }
867
868 public String toString() {
869 return "javac Filer";
870 }
871
872 /**
873 * Upon close, register files opened by create{Source, Class}File
874 * for annotation processing.
875 */
876 private void closeFileObject(ModuleSymbol mod, String typeName, FileObject fileObject) {
877 /*
878 * If typeName is non-null, the file object was opened as a
879 * source or class file by the user. If a file was opened as
880 * a resource, typeName will be null and the file is *not*
881 * subject to annotation processing.
882 */
883 if ((typeName != null)) {
884 if (!(fileObject instanceof JavaFileObject))
885 throw new AssertionError("JavaFileOject not found for " + fileObject);
886 JavaFileObject javaFileObject = (JavaFileObject)fileObject;
887 switch(javaFileObject.getKind()) {
888 case SOURCE:
889 generatedSourceNames.add(typeName);
890 generatedSourceFileObjects.add(javaFileObject);
891 openTypeNames.remove(typeName);
892 break;
893
894 case CLASS:
895 generatedClasses.computeIfAbsent(mod, m -> Collections.synchronizedMap(new LinkedHashMap<>())).put(typeName, javaFileObject);
896 openTypeNames.remove(typeName);
897 break;
898
899 default:
900 break;
901 }
902 }
903 }
904
905 }
|
865 xout.println("Agg. Gen. Cls Names : " + aggregateGeneratedClassNames);
866 }
867
868 public String toString() {
869 return "javac Filer";
870 }
871
872 /**
873 * Upon close, register files opened by create{Source, Class}File
874 * for annotation processing.
875 */
876 private void closeFileObject(ModuleSymbol mod, String typeName, FileObject fileObject) {
877 /*
878 * If typeName is non-null, the file object was opened as a
879 * source or class file by the user. If a file was opened as
880 * a resource, typeName will be null and the file is *not*
881 * subject to annotation processing.
882 */
883 if ((typeName != null)) {
884 if (!(fileObject instanceof JavaFileObject))
885 throw new AssertionError("JavaFileObject not found for " + fileObject);
886 JavaFileObject javaFileObject = (JavaFileObject)fileObject;
887 switch(javaFileObject.getKind()) {
888 case SOURCE:
889 generatedSourceNames.add(typeName);
890 generatedSourceFileObjects.add(javaFileObject);
891 openTypeNames.remove(typeName);
892 break;
893
894 case CLASS:
895 generatedClasses.computeIfAbsent(mod, m -> Collections.synchronizedMap(new LinkedHashMap<>())).put(typeName, javaFileObject);
896 openTypeNames.remove(typeName);
897 break;
898
899 default:
900 break;
901 }
902 }
903 }
904
905 }
|