Lines 138-143
Link Here
|
138 |
public static final String OPTION_ReportMissingAnnotation = "org.eclipse.jdt.core.compiler.problem.missingAnnotation"; //$NON-NLS-1$ |
138 |
public static final String OPTION_ReportMissingAnnotation = "org.eclipse.jdt.core.compiler.problem.missingAnnotation"; //$NON-NLS-1$ |
139 |
public static final String OPTION_ReportMissingJavadoc = "org.eclipse.jdt.core.compiler.problem.missingJavadoc"; //$NON-NLS-1$ |
139 |
public static final String OPTION_ReportMissingJavadoc = "org.eclipse.jdt.core.compiler.problem.missingJavadoc"; //$NON-NLS-1$ |
140 |
|
140 |
|
|
|
141 |
public static final String OPTION_NullableAnnotationNames = "org.eclipse.jdt.core.compiler.annotation.nullable"; //$NON-NLS-1$ |
142 |
public static final String OPTION_NonNullAnnotationNames = "org.eclipse.jdt.core.compiler.annotation.nonnull"; //$NON-NLS-1$ |
143 |
public static final String OPTION_EmulateNullAnnotationTypes = "org.eclipse.jdt.core.compiler.annotation.emulate"; //$NON-NLS-1$ |
144 |
public static final String OPTION_DefaultImportNullAnnotationTypes = "org.eclipse.jdt.core.compiler.annotation.defaultImport"; //$NON-NLS-1$ |
145 |
|
141 |
/** |
146 |
/** |
142 |
* Possible values for configurable options |
147 |
* Possible values for configurable options |
143 |
*/ |
148 |
*/ |
Lines 357-362
Link Here
|
357 |
public boolean ignoreMethodBodies; |
362 |
public boolean ignoreMethodBodies; |
358 |
/** Raise null related warnings for variables tainted inside an assert statement (java 1.4 and above)*/ |
363 |
/** Raise null related warnings for variables tainted inside an assert statement (java 1.4 and above)*/ |
359 |
public boolean includeNullInfoFromAsserts; |
364 |
public boolean includeNullInfoFromAsserts; |
|
|
365 |
/** List of fully qualified annotation names to use as marker for nullable types. */ |
366 |
public char[][][] nullableAnnotationNames; |
367 |
/** List of fully qualified annotation names to use as marker for nonnull types. */ |
368 |
public char[][][] nonNullAnnotationNames; |
369 |
/** Should null annotation types be emulated by synthetic bindings? */ |
370 |
public boolean emulateNullAnnotationTypes; |
371 |
/** Should null annotation types be imported by default? */ |
372 |
public boolean defaultImportNullAnnotationTypes; |
360 |
|
373 |
|
361 |
// keep in sync with warningTokenToIrritant and warningTokenFromIrritant |
374 |
// keep in sync with warningTokenToIrritant and warningTokenFromIrritant |
362 |
public final static String[] warningTokens = { |
375 |
public final static String[] warningTokens = { |
Lines 921-926
Link Here
|
921 |
optionsMap.put(OPTION_ReportTasks, getSeverityString(Tasks)); |
934 |
optionsMap.put(OPTION_ReportTasks, getSeverityString(Tasks)); |
922 |
optionsMap.put(OPTION_ReportUnusedObjectAllocation, getSeverityString(UnusedObjectAllocation)); |
935 |
optionsMap.put(OPTION_ReportUnusedObjectAllocation, getSeverityString(UnusedObjectAllocation)); |
923 |
optionsMap.put(OPTION_IncludeNullInfoFromAsserts, this.includeNullInfoFromAsserts ? ENABLED : DISABLED); |
936 |
optionsMap.put(OPTION_IncludeNullInfoFromAsserts, this.includeNullInfoFromAsserts ? ENABLED : DISABLED); |
|
|
937 |
if (this.nullableAnnotationNames != null) { |
938 |
char[][] compoundNames = new char[this.nullableAnnotationNames.length][]; |
939 |
for (int i = 0; i < this.nullableAnnotationNames.length; i++) |
940 |
compoundNames[i] = CharOperation.concatWith(this.nullableAnnotationNames[i], '.'); |
941 |
char[] allNames = CharOperation.concatWith(compoundNames, ','); |
942 |
optionsMap.put(OPTION_NullableAnnotationNames, String.valueOf(allNames)); |
943 |
} |
944 |
if (this.nonNullAnnotationNames != null) { |
945 |
char[][] compoundNames = new char[this.nonNullAnnotationNames.length][]; |
946 |
for (int i = 0; i < this.nonNullAnnotationNames.length; i++) |
947 |
compoundNames[i] = CharOperation.concatWith(this.nonNullAnnotationNames[i], '.'); |
948 |
char[] allNames = CharOperation.concatWith(compoundNames, ','); |
949 |
optionsMap.put(OPTION_NonNullAnnotationNames, String.valueOf(allNames)); |
950 |
} |
951 |
optionsMap.put(OPTION_EmulateNullAnnotationTypes, this.emulateNullAnnotationTypes ? ENABLED : DISABLED); |
952 |
optionsMap.put(OPTION_DefaultImportNullAnnotationTypes, this.defaultImportNullAnnotationTypes ? ENABLED : DISABLED); |
924 |
return optionsMap; |
953 |
return optionsMap; |
925 |
} |
954 |
} |
926 |
|
955 |
|
Lines 1452-1457
Link Here
|
1452 |
this.storeAnnotations = false; |
1481 |
this.storeAnnotations = false; |
1453 |
} |
1482 |
} |
1454 |
} |
1483 |
} |
|
|
1484 |
if ((optionValue = optionsMap.get(OPTION_NullableAnnotationNames)) != null) { |
1485 |
String[] allNames = ((String)optionValue).split(","); //$NON-NLS-1$ |
1486 |
this.nullableAnnotationNames = new char[allNames.length][][]; |
1487 |
for (int i = 0; i < allNames.length; i++) |
1488 |
this.nullableAnnotationNames[i] = CharOperation.splitAndTrimOn('.', allNames[i].toCharArray()); |
1489 |
} |
1490 |
if ((optionValue = optionsMap.get(OPTION_NonNullAnnotationNames)) != null) { |
1491 |
String[] allNames = ((String)optionValue).split(","); //$NON-NLS-1$ |
1492 |
this.nonNullAnnotationNames = new char[allNames.length][][]; |
1493 |
for (int i = 0; i < allNames.length; i++) |
1494 |
this.nonNullAnnotationNames[i] = CharOperation.splitAndTrimOn('.', allNames[i].toCharArray()); |
1495 |
} |
1496 |
if ((optionValue = optionsMap.get(OPTION_EmulateNullAnnotationTypes)) != null) { |
1497 |
if (ENABLED.equals(optionValue)) { |
1498 |
this.emulateNullAnnotationTypes = true; |
1499 |
} else if (DISABLED.equals(optionValue)) { |
1500 |
this.emulateNullAnnotationTypes = false; |
1501 |
} |
1502 |
} |
1503 |
if ((optionValue = optionsMap.get(OPTION_DefaultImportNullAnnotationTypes)) != null) { |
1504 |
if (ENABLED.equals(optionValue)) { |
1505 |
this.defaultImportNullAnnotationTypes = true; |
1506 |
} else if (DISABLED.equals(optionValue)) { |
1507 |
this.defaultImportNullAnnotationTypes = false; |
1508 |
} |
1509 |
} |
1455 |
} |
1510 |
} |
1456 |
public String toString() { |
1511 |
public String toString() { |
1457 |
StringBuffer buf = new StringBuffer("CompilerOptions:"); //$NON-NLS-1$ |
1512 |
StringBuffer buf = new StringBuffer("CompilerOptions:"); //$NON-NLS-1$ |