CHAPTER 8 THE JAVA COMPILER API 165
CHAPTER 8 THE JAVA COMPILER API 165 “Source: %s%n” + “Message: %s%n”, diagnostic.getCode(), diagnostic.getKind(), diagnostic.getPosition(), diagnostic.getStartPosition(), diagnostic.getEndPosition(), diagnostic.getSource(), diagnostic.getMessage(null)); fileManager.close(); System.out.println(”Success: ” + success); } } After compiling SecondCompile, running the program will generate .class files for the Bar and Baz classes in the classes subdirectory. It will also display information from the Diagnostic of the warning messages, as shown here: > java SecondCompile Code: compiler.note.deprecated.filename Kind: NOTE Position: -1 Start Position: -1 End Position: -1 Source: null Message: Note: Bar.java uses or overrides a deprecated API. Code: compiler.note.deprecated.recompile Kind: NOTE Position: -1 Start Position: -1 End Position: -1 Source: null Message: Note: Recompile with -Xlint:deprecation for details. Code: compiler.note.unchecked.filename Kind: NOTE Position: -1 Start Position: -1 End Position: -1 Source: null Message: Note: Bar.java uses unchecked or unsafe operations. Code: compiler.note.unchecked.recompile Kind: NOTE Position: -1 Start Position: -1 End Position: -1
Note: If you are looking for good and high quality web space to host and run your application check Lunarwebhost Java Web Hosting services