Skip to content

Commit 17c0881

Browse files
committed
Added the "-Xlint" option to javax.tools.compiler tasks to get complete diagnostics generated by that compiler (which are more extensive in later versions of Java than those
generated by the familiar Java 8 compiler. Changes to be committed: modified: CompilerOptions.java modified: JavaxToolsCompiler.java
1 parent b0fdc37 commit 17c0881

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

drjava/src/edu/rice/cs/drjava/model/compiler/CompilerOptions.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ public static void updateWarnings() {
7474

7575
public static HashMap<String,String> getOptions(boolean warningsEnabled) {
7676
HashMap<String,String> options = new HashMap<String,String>();
77+
7778
if (warningsEnabled) {
7879
if (SHOW_UNCHECKED) {
7980
options.put("-Xlint:unchecked","");
@@ -97,7 +98,7 @@ public static HashMap<String,String> getOptions(boolean warningsEnabled) {
9798

9899
if (SHOW_FALLTHROUGH) {
99100
options.put("-Xlint:fallthrough","");
100-
options.put("-Xlint:switchcheck",""); //Some compilers appear to use this option instead. Anyone know anything about this?
101+
// options.put("-Xlint:switchcheck",""); //Some compilers appear to use this option instead. Anyone know anything about this?
101102
}
102103
}
103104

drjava/src/edu/rice/cs/drjava/model/compiler/JavaxToolsCompiler.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ public List<? extends DJError> compile(List<? extends File> files, List<? extend
6868
// Prepare the compilation options
6969
/* Question (by Corky): is the "-source" option necessary? The JavaxTools compiler is part of the executing JVM. */
7070
List<String> optionList = new ArrayList<>();
71+
optionList.add("-Xlint");
7172
if (sourceVersion != null) {
7273
optionList.add("-source");
7374
optionList.add(sourceVersion);

0 commit comments

Comments
 (0)