Skip to content
This repository was archived by the owner on Feb 26, 2023. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Silence the JavacFiler warning 'compiler.warn.proc.unclosed.type.files'
This prevents warnings like:

   warning: Unclosed files for the types '[dummy1407426008266]'; these types will not undergo annotation processing

Files created via the createResource method are not registered for annotation
processing (as opposed to files created by the createSourceFile method), so we
avoid the JavacFiler warning and we don't have to open/close a stream.
  • Loading branch information
JessThrysoee committed Aug 14, 2014
commit b909651d8c8823071f9ca43b8a17e327d4555ff8
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@

import javax.annotation.processing.Filer;
import javax.annotation.processing.ProcessingEnvironment;
import javax.tools.JavaFileObject;
import javax.tools.FileObject;
import javax.tools.StandardLocation;

public class FileHelper {

Expand All @@ -45,9 +46,9 @@ public static Option<File> findRootProject(ProcessingEnvironment processingEnv)
public static Option<FileHolder> findRootProjectHolder(ProcessingEnvironment processingEnv) {
Filer filer = processingEnv.getFiler();

JavaFileObject dummySourceFile;
FileObject dummySourceFile;
try {
dummySourceFile = filer.createSourceFile("dummy" + System.currentTimeMillis());
dummySourceFile = filer.createResource(StandardLocation.SOURCE_OUTPUT, "", "dummy" + System.currentTimeMillis());
} catch (IOException ignored) {
return Option.absent();
}
Expand Down