Lines 2169-2175
Link Here
|
2169 |
break; |
2169 |
break; |
2170 |
case '-' : |
2170 |
case '-' : |
2171 |
warnTokenStart = 7; |
2171 |
warnTokenStart = 7; |
2172 |
isEnabling = false; // mentionned warnings are disabled |
2172 |
isEnabling = false; // specified warnings are disabled |
2173 |
allowPlusOrMinus = true; |
2173 |
allowPlusOrMinus = true; |
2174 |
break; |
2174 |
break; |
2175 |
default: |
2175 |
default: |
Lines 2187-2193
Link Here
|
2187 |
this.options.put(CompilerOptions.OPTION_ReportDeprecation, CompilerOptions.WARNING); |
2187 |
this.options.put(CompilerOptions.OPTION_ReportDeprecation, CompilerOptions.WARNING); |
2188 |
} |
2188 |
} |
2189 |
|
2189 |
|
2190 |
nextToken: while (tokenizer.hasMoreTokens()) { |
2190 |
while (tokenizer.hasMoreTokens()) { |
2191 |
String token = tokenizer.nextToken(); |
2191 |
String token = tokenizer.nextToken(); |
2192 |
tokenCounter++; |
2192 |
tokenCounter++; |
2193 |
switch(token.charAt(0)) { |
2193 |
switch(token.charAt(0)) { |
Lines 2196-2203
Link Here
|
2196 |
isEnabling = true; |
2196 |
isEnabling = true; |
2197 |
token = token.substring(1); |
2197 |
token = token.substring(1); |
2198 |
} else { |
2198 |
} else { |
2199 |
tokenCounter = 0; |
2199 |
throw new IllegalArgumentException( |
2200 |
break nextToken; |
2200 |
this.bind("configure.invalidUsageOfPlusOption", token)); //$NON-NLS-1$ |
2201 |
} |
2201 |
} |
2202 |
break; |
2202 |
break; |
2203 |
case '-' : |
2203 |
case '-' : |
Lines 2205-2214
Link Here
|
2205 |
isEnabling = false; |
2205 |
isEnabling = false; |
2206 |
token = token.substring(1); |
2206 |
token = token.substring(1); |
2207 |
} else { |
2207 |
} else { |
2208 |
tokenCounter = 0; |
2208 |
throw new IllegalArgumentException( |
2209 |
break nextToken; |
2209 |
this.bind("configure.invalidUsageOfMinusOption", token)); //$NON-NLS-1$ |
2210 |
} |
2210 |
} |
2211 |
break; |
|
|
2212 |
} |
2211 |
} |
2213 |
handleWarningToken(token, isEnabling); |
2212 |
handleWarningToken(token, isEnabling); |
2214 |
} |
2213 |
} |
Lines 2218-2223
Link Here
|
2218 |
} |
2217 |
} |
2219 |
continue; |
2218 |
continue; |
2220 |
} |
2219 |
} |
|
|
2220 |
if (currentArg.startsWith("-error")) { //$NON-NLS-1$ |
2221 |
mode = DEFAULT; |
2222 |
String errorOption = currentArg; |
2223 |
int length = currentArg.length(); |
2224 |
if (length <= 7) { |
2225 |
throw new IllegalArgumentException( |
2226 |
this.bind("configure.invalidErrorConfiguration", errorOption)); //$NON-NLS-1$ |
2227 |
} |
2228 |
int errorTokenStart; |
2229 |
boolean isEnabling, allowPlusOrMinus; |
2230 |
switch (errorOption.charAt(7)) { |
2231 |
case '+' : |
2232 |
errorTokenStart = 8; |
2233 |
isEnabling = true; |
2234 |
allowPlusOrMinus = true; |
2235 |
break; |
2236 |
case '-' : |
2237 |
errorTokenStart = 8; |
2238 |
isEnabling = false; // specified errors are disabled |
2239 |
allowPlusOrMinus = true; |
2240 |
break; |
2241 |
default: |
2242 |
disableErrors(); |
2243 |
errorTokenStart = 7; |
2244 |
isEnabling = true; |
2245 |
allowPlusOrMinus = false; |
2246 |
} |
2247 |
|
2248 |
StringTokenizer tokenizer = |
2249 |
new StringTokenizer(errorOption.substring(errorTokenStart, errorOption.length()), ","); //$NON-NLS-1$ |
2250 |
int tokenCounter = 0; |
2251 |
|
2252 |
while (tokenizer.hasMoreTokens()) { |
2253 |
String token = tokenizer.nextToken(); |
2254 |
tokenCounter++; |
2255 |
switch(token.charAt(0)) { |
2256 |
case '+' : |
2257 |
if (allowPlusOrMinus) { |
2258 |
isEnabling = true; |
2259 |
token = token.substring(1); |
2260 |
} else { |
2261 |
throw new IllegalArgumentException( |
2262 |
this.bind("configure.invalidUsageOfPlusOption", token)); //$NON-NLS-1$ |
2263 |
} |
2264 |
break; |
2265 |
case '-' : |
2266 |
if (allowPlusOrMinus) { |
2267 |
isEnabling = false; |
2268 |
token = token.substring(1); |
2269 |
} else { |
2270 |
throw new IllegalArgumentException( |
2271 |
this.bind("configure.invalidUsageOfMinusOption", token)); //$NON-NLS-1$ |
2272 |
} |
2273 |
break; |
2274 |
} |
2275 |
handleErrorToken(token, isEnabling); |
2276 |
} |
2277 |
if (tokenCounter == 0) { |
2278 |
throw new IllegalArgumentException( |
2279 |
this.bind("configure.invalidErrorOption", currentArg)); //$NON-NLS-1$ |
2280 |
} |
2281 |
continue; |
2282 |
} |
2221 |
if (currentArg.equals("-target")) { //$NON-NLS-1$ |
2283 |
if (currentArg.equals("-target")) { //$NON-NLS-1$ |
2222 |
mode = INSIDE_TARGET; |
2284 |
mode = INSIDE_TARGET; |
2223 |
continue; |
2285 |
continue; |
Lines 2226-2236
Link Here
|
2226 |
this.options.put( |
2288 |
this.options.put( |
2227 |
CompilerOptions.OPTION_PreserveUnusedLocal, |
2289 |
CompilerOptions.OPTION_PreserveUnusedLocal, |
2228 |
CompilerOptions.PRESERVE); |
2290 |
CompilerOptions.PRESERVE); |
2229 |
mode = DEFAULT; |
2291 |
mode = DEFAULT; |
2230 |
continue; |
2292 |
continue; |
2231 |
} |
2293 |
} |
2232 |
if (currentArg.equals("-enableJavadoc")) {//$NON-NLS-1$ |
2294 |
if (currentArg.equals("-enableJavadoc")) {//$NON-NLS-1$ |
2233 |
mode = DEFAULT; |
2295 |
mode = DEFAULT; |
2234 |
this.enableJavadocOn = true; |
2296 |
this.enableJavadocOn = true; |
2235 |
continue; |
2297 |
continue; |
2236 |
} |
2298 |
} |
Lines 2562-2570
Link Here
|
2562 |
// configure warnings for javadoc contents |
2624 |
// configure warnings for javadoc contents |
2563 |
if (this.warnJavadocOn) { |
2625 |
if (this.warnJavadocOn) { |
2564 |
this.options.put( |
2626 |
this.options.put( |
2565 |
CompilerOptions.OPTION_ReportInvalidJavadoc, |
|
|
2566 |
CompilerOptions.WARNING); |
2567 |
this.options.put( |
2568 |
CompilerOptions.OPTION_ReportInvalidJavadocTags, |
2627 |
CompilerOptions.OPTION_ReportInvalidJavadocTags, |
2569 |
CompilerOptions.ENABLED); |
2628 |
CompilerOptions.ENABLED); |
2570 |
this.options.put( |
2629 |
this.options.put( |
Lines 2574-2590
Link Here
|
2574 |
CompilerOptions.OPTION_ReportInvalidJavadocTagsNotVisibleRef, |
2633 |
CompilerOptions.OPTION_ReportInvalidJavadocTagsNotVisibleRef, |
2575 |
CompilerOptions.ENABLED); |
2634 |
CompilerOptions.ENABLED); |
2576 |
this.options.put( |
2635 |
this.options.put( |
2577 |
CompilerOptions.OPTION_ReportMissingJavadocTags, |
|
|
2578 |
CompilerOptions.WARNING); |
2579 |
this.options.put( |
2580 |
CompilerOptions.OPTION_ReportMissingJavadocTagsVisibility, |
2636 |
CompilerOptions.OPTION_ReportMissingJavadocTagsVisibility, |
2581 |
CompilerOptions.PRIVATE); |
2637 |
CompilerOptions.PRIVATE); |
2582 |
} |
2638 |
} |
2583 |
if (this.warnAllJavadocOn) { |
|
|
2584 |
this.options.put( |
2585 |
CompilerOptions.OPTION_ReportMissingJavadocComments, |
2586 |
CompilerOptions.WARNING); |
2587 |
} |
2588 |
|
2639 |
|
2589 |
if (printUsageRequired || (filesCount == 0 && classCount == 0)) { |
2640 |
if (printUsageRequired || (filesCount == 0 && classCount == 0)) { |
2590 |
if (usageSection == null) { |
2641 |
if (usageSection == null) { |
Lines 2670-2675
Link Here
|
2670 |
} |
2721 |
} |
2671 |
this.options.put(CompilerOptions.OPTION_TaskTags, Util.EMPTY_STRING); |
2722 |
this.options.put(CompilerOptions.OPTION_TaskTags, Util.EMPTY_STRING); |
2672 |
} |
2723 |
} |
|
|
2724 |
protected void disableErrors() { |
2725 |
Object[] entries = this.options.entrySet().toArray(); |
2726 |
for (int i = 0, max = entries.length; i < max; i++) { |
2727 |
Map.Entry entry = (Map.Entry) entries[i]; |
2728 |
if (!(entry.getKey() instanceof String)) |
2729 |
continue; |
2730 |
if (!(entry.getValue() instanceof String)) |
2731 |
continue; |
2732 |
if (((String) entry.getValue()).equals(CompilerOptions.ERROR)) { |
2733 |
this.options.put(entry.getKey(), CompilerOptions.IGNORE); |
2734 |
} |
2735 |
} |
2736 |
} |
2673 |
public String extractDestinationPathFromSourceFile(CompilationResult result) { |
2737 |
public String extractDestinationPathFromSourceFile(CompilationResult result) { |
2674 |
ICompilationUnit compilationUnit = result.compilationUnit; |
2738 |
ICompilationUnit compilationUnit = result.compilationUnit; |
2675 |
if (compilationUnit != null) { |
2739 |
if (compilationUnit != null) { |
Lines 3058-3070
Link Here
|
3058 |
* Handle a single warning token. |
3122 |
* Handle a single warning token. |
3059 |
*/ |
3123 |
*/ |
3060 |
protected void handleWarningToken(String token, boolean isEnabling) { |
3124 |
protected void handleWarningToken(String token, boolean isEnabling) { |
|
|
3125 |
handleErrorOrWarningToken(token, isEnabling, ProblemSeverities.Warning); |
3126 |
} |
3127 |
protected void handleErrorToken(String token, boolean isEnabling) { |
3128 |
handleErrorOrWarningToken(token, isEnabling, ProblemSeverities.Error); |
3129 |
} |
3130 |
private void setSeverity(String compilerOptions, int severity, boolean isEnabling) { |
3131 |
if (isEnabling) { |
3132 |
switch(severity) { |
3133 |
case ProblemSeverities.Error : |
3134 |
this.options.put(compilerOptions, CompilerOptions.ERROR); |
3135 |
break; |
3136 |
case ProblemSeverities.Warning : |
3137 |
this.options.put(compilerOptions, CompilerOptions.WARNING); |
3138 |
break; |
3139 |
default: |
3140 |
this.options.put(compilerOptions, CompilerOptions.IGNORE); |
3141 |
} |
3142 |
} else { |
3143 |
switch(severity) { |
3144 |
case ProblemSeverities.Error : |
3145 |
String currentValue = (String) this.options.get(compilerOptions); |
3146 |
if (CompilerOptions.ERROR.equals(currentValue)) { |
3147 |
this.options.put(compilerOptions, CompilerOptions.IGNORE); |
3148 |
} |
3149 |
break; |
3150 |
case ProblemSeverities.Warning : |
3151 |
currentValue = (String) this.options.get(compilerOptions); |
3152 |
if (CompilerOptions.WARNING.equals(currentValue)) { |
3153 |
this.options.put(compilerOptions, CompilerOptions.IGNORE); |
3154 |
} |
3155 |
break; |
3156 |
default: |
3157 |
this.options.put(compilerOptions, CompilerOptions.IGNORE); |
3158 |
} |
3159 |
} |
3160 |
} |
3161 |
private void handleErrorOrWarningToken(String token, boolean isEnabling, int severity) { |
3061 |
if (token.length() == 0) return; |
3162 |
if (token.length() == 0) return; |
3062 |
switch(token.charAt(0)) { |
3163 |
switch(token.charAt(0)) { |
3063 |
case 'a' : |
3164 |
case 'a' : |
3064 |
if (token.equals("allDeprecation")) { //$NON-NLS-1$ |
3165 |
if (token.equals("allDeprecation")) { //$NON-NLS-1$ |
3065 |
this.options.put( |
3166 |
setSeverity(CompilerOptions.OPTION_ReportDeprecation, severity, isEnabling); |
3066 |
CompilerOptions.OPTION_ReportDeprecation, |
|
|
3067 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
3068 |
this.options.put( |
3167 |
this.options.put( |
3069 |
CompilerOptions.OPTION_ReportDeprecationInDeprecatedCode, |
3168 |
CompilerOptions.OPTION_ReportDeprecationInDeprecatedCode, |
3070 |
isEnabling ? CompilerOptions.ENABLED : CompilerOptions.DISABLED); |
3169 |
isEnabling ? CompilerOptions.ENABLED : CompilerOptions.DISABLED); |
Lines 3074-3139
Link Here
|
3074 |
return; |
3173 |
return; |
3075 |
} else if (token.equals("allJavadoc")) { //$NON-NLS-1$ |
3174 |
} else if (token.equals("allJavadoc")) { //$NON-NLS-1$ |
3076 |
this.warnAllJavadocOn = this.warnJavadocOn = isEnabling; |
3175 |
this.warnAllJavadocOn = this.warnJavadocOn = isEnabling; |
|
|
3176 |
setSeverity(CompilerOptions.OPTION_ReportInvalidJavadoc, severity, isEnabling); |
3177 |
setSeverity(CompilerOptions.OPTION_ReportMissingJavadocTags, severity, isEnabling); |
3178 |
setSeverity(CompilerOptions.OPTION_ReportMissingJavadocComments, severity, isEnabling); |
3077 |
return; |
3179 |
return; |
3078 |
} else if (token.equals("assertIdentifier")) { //$NON-NLS-1$ |
3180 |
} else if (token.equals("assertIdentifier")) { //$NON-NLS-1$ |
3079 |
this.options.put( |
3181 |
setSeverity(CompilerOptions.OPTION_ReportAssertIdentifier, severity, isEnabling); |
3080 |
CompilerOptions.OPTION_ReportAssertIdentifier, |
|
|
3081 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
3082 |
return; |
3182 |
return; |
3083 |
} else if (token.equals("allDeadCode")) { //$NON-NLS-1$ |
3183 |
} else if (token.equals("allDeadCode")) { //$NON-NLS-1$ |
|
|
3184 |
setSeverity(CompilerOptions.OPTION_ReportDeadCode, severity, isEnabling); |
3084 |
this.options.put( |
3185 |
this.options.put( |
3085 |
CompilerOptions.OPTION_ReportDeadCode, |
3186 |
CompilerOptions.OPTION_ReportDeadCodeInTrivialIfStatement, |
3086 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
3187 |
isEnabling ? CompilerOptions.ENABLED : CompilerOptions.DISABLED); |
3087 |
this.options.put( |
3188 |
return; |
3088 |
CompilerOptions.OPTION_ReportDeadCodeInTrivialIfStatement, |
|
|
3089 |
isEnabling ? CompilerOptions.ENABLED : CompilerOptions.DISABLED); |
3090 |
return; |
3091 |
} else if (token.equals("allOver-ann")) { //$NON-NLS-1$ |
3189 |
} else if (token.equals("allOver-ann")) { //$NON-NLS-1$ |
|
|
3190 |
setSeverity(CompilerOptions.OPTION_ReportMissingOverrideAnnotation, severity, isEnabling); |
3092 |
this.options.put( |
3191 |
this.options.put( |
3093 |
CompilerOptions.OPTION_ReportMissingOverrideAnnotation, |
3192 |
CompilerOptions.OPTION_ReportMissingOverrideAnnotationForInterfaceMethodImplementation, |
3094 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
3193 |
isEnabling ? CompilerOptions.ENABLED : CompilerOptions.DISABLED); |
3095 |
this.options.put( |
|
|
3096 |
CompilerOptions.OPTION_ReportMissingOverrideAnnotationForInterfaceMethodImplementation, |
3097 |
isEnabling ? CompilerOptions.ENABLED : CompilerOptions.DISABLED); |
3098 |
return; |
3194 |
return; |
3099 |
} |
3195 |
} |
3100 |
break; |
3196 |
break; |
3101 |
case 'b' : |
3197 |
case 'b' : |
3102 |
if (token.equals("boxing")) { //$NON-NLS-1$ |
3198 |
if (token.equals("boxing")) { //$NON-NLS-1$ |
3103 |
this.options.put( |
3199 |
setSeverity(CompilerOptions.OPTION_ReportAutoboxing, severity, isEnabling); |
3104 |
CompilerOptions.OPTION_ReportAutoboxing, |
|
|
3105 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
3106 |
return; |
3200 |
return; |
3107 |
} |
3201 |
} |
3108 |
break; |
3202 |
break; |
3109 |
case 'c' : |
3203 |
case 'c' : |
3110 |
if (token.equals("constructorName")) { //$NON-NLS-1$ |
3204 |
if (token.equals("constructorName")) { //$NON-NLS-1$ |
3111 |
this.options.put( |
3205 |
setSeverity(CompilerOptions.OPTION_ReportMethodWithConstructorName, severity, isEnabling); |
3112 |
CompilerOptions.OPTION_ReportMethodWithConstructorName, |
|
|
3113 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
3114 |
return; |
3206 |
return; |
3115 |
} else if (token.equals("conditionAssign")) { //$NON-NLS-1$ |
3207 |
} else if (token.equals("conditionAssign")) { //$NON-NLS-1$ |
3116 |
this.options.put( |
3208 |
setSeverity(CompilerOptions.OPTION_ReportPossibleAccidentalBooleanAssignment, severity, isEnabling); |
3117 |
CompilerOptions.OPTION_ReportPossibleAccidentalBooleanAssignment, |
|
|
3118 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
3119 |
return; |
3209 |
return; |
3120 |
} else if (token.equals("compareIdentical")) { //$NON-NLS-1$ |
3210 |
} else if (token.equals("compareIdentical")) { //$NON-NLS-1$ |
3121 |
this.options.put( |
3211 |
setSeverity(CompilerOptions.OPTION_ReportComparingIdentical, severity, isEnabling); |
3122 |
CompilerOptions.OPTION_ReportComparingIdentical, |
|
|
3123 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
3124 |
return; |
3212 |
return; |
3125 |
} else if (token.equals("charConcat") /*|| token.equals("noImplicitStringConversion")/*backward compatible*/) {//$NON-NLS-1$ |
3213 |
} else if (token.equals("charConcat") /*|| token.equals("noImplicitStringConversion")/*backward compatible*/) {//$NON-NLS-1$ |
3126 |
this.options.put( |
3214 |
setSeverity(CompilerOptions.OPTION_ReportNoImplicitStringConversion, severity, isEnabling); |
3127 |
CompilerOptions.OPTION_ReportNoImplicitStringConversion, |
|
|
3128 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
3129 |
return; |
3215 |
return; |
3130 |
} |
3216 |
} |
3131 |
break; |
3217 |
break; |
3132 |
case 'd' : |
3218 |
case 'd' : |
3133 |
if (token.equals("deprecation")) { //$NON-NLS-1$ |
3219 |
if (token.equals("deprecation")) { //$NON-NLS-1$ |
3134 |
this.options.put( |
3220 |
setSeverity(CompilerOptions.OPTION_ReportDeprecation, severity, isEnabling); |
3135 |
CompilerOptions.OPTION_ReportDeprecation, |
|
|
3136 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
3137 |
this.options.put( |
3221 |
this.options.put( |
3138 |
CompilerOptions.OPTION_ReportDeprecationInDeprecatedCode, |
3222 |
CompilerOptions.OPTION_ReportDeprecationInDeprecatedCode, |
3139 |
CompilerOptions.DISABLED); |
3223 |
CompilerOptions.DISABLED); |
Lines 3142-3160
Link Here
|
3142 |
CompilerOptions.DISABLED); |
3226 |
CompilerOptions.DISABLED); |
3143 |
return; |
3227 |
return; |
3144 |
} else if (token.equals("dep-ann")) { //$NON-NLS-1$ |
3228 |
} else if (token.equals("dep-ann")) { //$NON-NLS-1$ |
3145 |
this.options.put( |
3229 |
setSeverity(CompilerOptions.OPTION_ReportMissingDeprecatedAnnotation, severity, isEnabling); |
3146 |
CompilerOptions.OPTION_ReportMissingDeprecatedAnnotation, |
|
|
3147 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
3148 |
return; |
3230 |
return; |
3149 |
} else if (token.equals("discouraged")) { //$NON-NLS-1$ |
3231 |
} else if (token.equals("discouraged")) { //$NON-NLS-1$ |
3150 |
this.options.put( |
3232 |
setSeverity(CompilerOptions.OPTION_ReportDiscouragedReference, severity, isEnabling); |
3151 |
CompilerOptions.OPTION_ReportDiscouragedReference, |
|
|
3152 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
3153 |
return; |
3233 |
return; |
3154 |
} else if (token.equals("deadCode")) { //$NON-NLS-1$ |
3234 |
} else if (token.equals("deadCode")) { //$NON-NLS-1$ |
3155 |
this.options.put( |
3235 |
setSeverity(CompilerOptions.OPTION_ReportDeadCode, severity, isEnabling); |
3156 |
CompilerOptions.OPTION_ReportDeadCode, |
|
|
3157 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
3158 |
this.options.put( |
3236 |
this.options.put( |
3159 |
CompilerOptions.OPTION_ReportDeadCodeInTrivialIfStatement, |
3237 |
CompilerOptions.OPTION_ReportDeadCodeInTrivialIfStatement, |
3160 |
CompilerOptions.DISABLED); |
3238 |
CompilerOptions.DISABLED); |
Lines 3164-3332
Link Here
|
3164 |
case 'e' : |
3242 |
case 'e' : |
3165 |
if (token.equals("enumSwitch") //$NON-NLS-1$ |
3243 |
if (token.equals("enumSwitch") //$NON-NLS-1$ |
3166 |
|| token.equals("incomplete-switch")) { //$NON-NLS-1$ |
3244 |
|| token.equals("incomplete-switch")) { //$NON-NLS-1$ |
3167 |
this.options.put( |
3245 |
setSeverity(CompilerOptions.OPTION_ReportIncompleteEnumSwitch, severity, isEnabling); |
3168 |
CompilerOptions.OPTION_ReportIncompleteEnumSwitch, |
|
|
3169 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
3170 |
return; |
3246 |
return; |
3171 |
} else if (token.equals("emptyBlock")) {//$NON-NLS-1$ |
3247 |
} else if (token.equals("emptyBlock")) {//$NON-NLS-1$ |
3172 |
this.options.put( |
3248 |
setSeverity(CompilerOptions.OPTION_ReportUndocumentedEmptyBlock, severity, isEnabling); |
3173 |
CompilerOptions.OPTION_ReportUndocumentedEmptyBlock, |
|
|
3174 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
3175 |
return; |
3249 |
return; |
3176 |
} else if (token.equals("enumIdentifier")) { //$NON-NLS-1$ |
3250 |
} else if (token.equals("enumIdentifier")) { //$NON-NLS-1$ |
3177 |
this.options.put( |
3251 |
setSeverity(CompilerOptions.OPTION_ReportEnumIdentifier, severity, isEnabling); |
3178 |
CompilerOptions.OPTION_ReportEnumIdentifier, |
|
|
3179 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
3180 |
return; |
3252 |
return; |
3181 |
} |
3253 |
} |
3182 |
break; |
3254 |
break; |
3183 |
case 'f' : |
3255 |
case 'f' : |
3184 |
if (token.equals("fieldHiding")) { //$NON-NLS-1$ |
3256 |
if (token.equals("fieldHiding")) { //$NON-NLS-1$ |
3185 |
this.options.put( |
3257 |
setSeverity(CompilerOptions.OPTION_ReportFieldHiding, severity, isEnabling); |
3186 |
CompilerOptions.OPTION_ReportFieldHiding, |
|
|
3187 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
3188 |
return; |
3258 |
return; |
3189 |
} else if (token.equals("finalBound")) {//$NON-NLS-1$ |
3259 |
} else if (token.equals("finalBound")) {//$NON-NLS-1$ |
3190 |
this.options.put( |
3260 |
setSeverity(CompilerOptions.OPTION_ReportFinalParameterBound, severity, isEnabling); |
3191 |
CompilerOptions.OPTION_ReportFinalParameterBound, |
|
|
3192 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
3193 |
return; |
3261 |
return; |
3194 |
} else if (token.equals("finally")) { //$NON-NLS-1$ |
3262 |
} else if (token.equals("finally")) { //$NON-NLS-1$ |
3195 |
this.options.put( |
3263 |
setSeverity(CompilerOptions.OPTION_ReportFinallyBlockNotCompletingNormally, severity, isEnabling); |
3196 |
CompilerOptions.OPTION_ReportFinallyBlockNotCompletingNormally, |
|
|
3197 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
3198 |
return; |
3264 |
return; |
3199 |
} else if (token.equals("forbidden")) { //$NON-NLS-1$ |
3265 |
} else if (token.equals("forbidden")) { //$NON-NLS-1$ |
3200 |
this.options.put( |
3266 |
setSeverity(CompilerOptions.OPTION_ReportForbiddenReference, severity, isEnabling); |
3201 |
CompilerOptions.OPTION_ReportForbiddenReference, |
|
|
3202 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
3203 |
return; |
3267 |
return; |
3204 |
} else if (token.equals("fallthrough")) { //$NON-NLS-1$ |
3268 |
} else if (token.equals("fallthrough")) { //$NON-NLS-1$ |
3205 |
this.options.put( |
3269 |
setSeverity(CompilerOptions.OPTION_ReportFallthroughCase, severity, isEnabling); |
3206 |
CompilerOptions.OPTION_ReportFallthroughCase, |
|
|
3207 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
3208 |
return; |
3270 |
return; |
3209 |
} |
3271 |
} |
3210 |
break; |
3272 |
break; |
3211 |
case 'h' : |
3273 |
case 'h' : |
3212 |
if (token.equals("hiding")) { //$NON-NLS-1$ |
3274 |
if (token.equals("hiding")) { //$NON-NLS-1$ |
3213 |
this.options.put( |
3275 |
setSeverity(CompilerOptions.OPTION_ReportHiddenCatchBlock, severity, isEnabling); |
3214 |
CompilerOptions.OPTION_ReportHiddenCatchBlock, |
3276 |
setSeverity(CompilerOptions.OPTION_ReportLocalVariableHiding, severity, isEnabling); |
3215 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
3277 |
setSeverity(CompilerOptions.OPTION_ReportFieldHiding, severity, isEnabling); |
3216 |
this.options.put( |
3278 |
setSeverity(CompilerOptions.OPTION_ReportTypeParameterHiding, severity, isEnabling); |
3217 |
CompilerOptions.OPTION_ReportLocalVariableHiding, |
|
|
3218 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
3219 |
this.options.put( |
3220 |
CompilerOptions.OPTION_ReportFieldHiding, |
3221 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
3222 |
this.options.put( |
3223 |
CompilerOptions.OPTION_ReportTypeParameterHiding, |
3224 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
3225 |
return; |
3279 |
return; |
3226 |
} else if (token.equals("hashCode")) { //$NON-NLS-1$ |
3280 |
} else if (token.equals("hashCode")) { //$NON-NLS-1$ |
3227 |
this.options.put( |
3281 |
setSeverity(CompilerOptions.OPTION_ReportMissingHashCodeMethod, severity, isEnabling); |
3228 |
CompilerOptions.OPTION_ReportMissingHashCodeMethod, |
|
|
3229 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
3230 |
return; |
3282 |
return; |
3231 |
} |
3283 |
} |
3232 |
break; |
3284 |
break; |
3233 |
case 'i' : |
3285 |
case 'i' : |
3234 |
if (token.equals("indirectStatic")) { //$NON-NLS-1$ |
3286 |
if (token.equals("indirectStatic")) { //$NON-NLS-1$ |
3235 |
this.options.put( |
3287 |
setSeverity(CompilerOptions.OPTION_ReportIndirectStaticAccess, severity, isEnabling); |
3236 |
CompilerOptions.OPTION_ReportIndirectStaticAccess, |
|
|
3237 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
3238 |
return; |
3288 |
return; |
3239 |
} else if (token.equals("intfNonInherited") || token.equals("interfaceNonInherited")/*backward compatible*/) { //$NON-NLS-1$ //$NON-NLS-2$ |
3289 |
} else if (token.equals("intfNonInherited") || token.equals("interfaceNonInherited")/*backward compatible*/) { //$NON-NLS-1$ //$NON-NLS-2$ |
3240 |
this.options.put( |
3290 |
setSeverity(CompilerOptions.OPTION_ReportIncompatibleNonInheritedInterfaceMethod, severity, isEnabling); |
3241 |
CompilerOptions.OPTION_ReportIncompatibleNonInheritedInterfaceMethod, |
|
|
3242 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
3243 |
return; |
3291 |
return; |
3244 |
} else if (token.equals("intfAnnotation")) { //$NON-NLS-1$ |
3292 |
} else if (token.equals("intfAnnotation")) { //$NON-NLS-1$ |
3245 |
this.options.put( |
3293 |
setSeverity(CompilerOptions.OPTION_ReportAnnotationSuperInterface, severity, isEnabling); |
3246 |
CompilerOptions.OPTION_ReportAnnotationSuperInterface, |
|
|
3247 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
3248 |
return; |
3294 |
return; |
3249 |
} else if (token.equals("intfRedundant") /*|| token.equals("redundantSuperinterface")*/) { //$NON-NLS-1$ |
3295 |
} else if (token.equals("intfRedundant") /*|| token.equals("redundantSuperinterface")*/) { //$NON-NLS-1$ |
3250 |
this.options.put( |
3296 |
setSeverity(CompilerOptions.OPTION_ReportRedundantSuperinterface, severity, isEnabling); |
3251 |
CompilerOptions.OPTION_ReportRedundantSuperinterface, |
|
|
3252 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
3253 |
return; |
3297 |
return; |
3254 |
} |
3298 |
} |
3255 |
break; |
3299 |
break; |
3256 |
case 'j' : |
3300 |
case 'j' : |
3257 |
if (token.equals("javadoc")) {//$NON-NLS-1$ |
3301 |
if (token.equals("javadoc")) {//$NON-NLS-1$ |
3258 |
this.warnJavadocOn = isEnabling; |
3302 |
this.warnJavadocOn = isEnabling; |
|
|
3303 |
setSeverity(CompilerOptions.OPTION_ReportInvalidJavadoc, severity, isEnabling); |
3304 |
setSeverity(CompilerOptions.OPTION_ReportMissingJavadocTags, severity, isEnabling); |
3259 |
return; |
3305 |
return; |
3260 |
} |
3306 |
} |
3261 |
break; |
3307 |
break; |
3262 |
case 'l' : |
3308 |
case 'l' : |
3263 |
if (token.equals("localHiding")) { //$NON-NLS-1$ |
3309 |
if (token.equals("localHiding")) { //$NON-NLS-1$ |
3264 |
this.options.put( |
3310 |
setSeverity(CompilerOptions.OPTION_ReportLocalVariableHiding, severity, isEnabling); |
3265 |
CompilerOptions.OPTION_ReportLocalVariableHiding, |
|
|
3266 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
3267 |
return; |
3311 |
return; |
3268 |
} |
3312 |
} |
3269 |
break; |
3313 |
break; |
3270 |
case 'm' : |
3314 |
case 'm' : |
3271 |
if (token.equals("maskedCatchBlock") || token.equals("maskedCatchBlocks")/*backward compatible*/) { //$NON-NLS-1$ //$NON-NLS-2$ |
3315 |
if (token.equals("maskedCatchBlock") || token.equals("maskedCatchBlocks")/*backward compatible*/) { //$NON-NLS-1$ //$NON-NLS-2$ |
3272 |
this.options.put( |
3316 |
setSeverity(CompilerOptions.OPTION_ReportHiddenCatchBlock, severity, isEnabling); |
3273 |
CompilerOptions.OPTION_ReportHiddenCatchBlock, |
|
|
3274 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
3275 |
return; |
3317 |
return; |
3276 |
} |
3318 |
} |
3277 |
break; |
3319 |
break; |
3278 |
case 'n' : |
3320 |
case 'n' : |
3279 |
if (token.equals("nls")) { //$NON-NLS-1$ |
3321 |
if (token.equals("nls")) { //$NON-NLS-1$ |
3280 |
this.options.put( |
3322 |
setSeverity(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, severity, isEnabling); |
3281 |
CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, |
|
|
3282 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
3283 |
return; |
3323 |
return; |
3284 |
} else if (token.equals("noEffectAssign")) { //$NON-NLS-1$ |
3324 |
} else if (token.equals("noEffectAssign")) { //$NON-NLS-1$ |
3285 |
this.options.put( |
3325 |
setSeverity(CompilerOptions.OPTION_ReportNoEffectAssignment, severity, isEnabling); |
3286 |
CompilerOptions.OPTION_ReportNoEffectAssignment, |
|
|
3287 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
3288 |
return; |
3326 |
return; |
3289 |
} else if (/*token.equals("charConcat") ||*/ token.equals("noImplicitStringConversion")/*backward compatible*/) {//$NON-NLS-1$ |
3327 |
} else if (/*token.equals("charConcat") ||*/ token.equals("noImplicitStringConversion")/*backward compatible*/) {//$NON-NLS-1$ |
3290 |
this.options.put( |
3328 |
setSeverity(CompilerOptions.OPTION_ReportNoImplicitStringConversion, severity, isEnabling); |
3291 |
CompilerOptions.OPTION_ReportNoImplicitStringConversion, |
|
|
3292 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
3293 |
return; |
3329 |
return; |
3294 |
} else if (token.equals("null")) { //$NON-NLS-1$ |
3330 |
} else if (token.equals("null")) { //$NON-NLS-1$ |
3295 |
this.options.put( |
3331 |
setSeverity(CompilerOptions.OPTION_ReportNullReference, severity, isEnabling); |
3296 |
CompilerOptions.OPTION_ReportNullReference, |
3332 |
setSeverity(CompilerOptions.OPTION_ReportPotentialNullReference, severity, isEnabling); |
3297 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
3333 |
setSeverity(CompilerOptions.OPTION_ReportRedundantNullCheck, severity, isEnabling); |
3298 |
this.options.put( |
|
|
3299 |
CompilerOptions.OPTION_ReportPotentialNullReference, |
3300 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
3301 |
this.options.put( |
3302 |
CompilerOptions.OPTION_ReportRedundantNullCheck, |
3303 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
3304 |
return; |
3334 |
return; |
3305 |
} else if (token.equals("nullDereference")) { //$NON-NLS-1$ |
3335 |
} else if (token.equals("nullDereference")) { //$NON-NLS-1$ |
3306 |
this.options.put( |
3336 |
setSeverity(CompilerOptions.OPTION_ReportNullReference, severity, isEnabling); |
3307 |
CompilerOptions.OPTION_ReportNullReference, |
|
|
3308 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
3309 |
if (!isEnabling) { |
3337 |
if (!isEnabling) { |
3310 |
this.options.put( |
3338 |
setSeverity(CompilerOptions.OPTION_ReportPotentialNullReference, ProblemSeverities.Ignore, isEnabling); |
3311 |
CompilerOptions.OPTION_ReportPotentialNullReference, |
3339 |
setSeverity(CompilerOptions.OPTION_ReportRedundantNullCheck, ProblemSeverities.Ignore, isEnabling); |
3312 |
CompilerOptions.IGNORE); |
|
|
3313 |
this.options.put( |
3314 |
CompilerOptions.OPTION_ReportRedundantNullCheck, |
3315 |
CompilerOptions.IGNORE); |
3316 |
} |
3340 |
} |
3317 |
return; |
3341 |
return; |
3318 |
} |
3342 |
} |
3319 |
break; |
3343 |
break; |
3320 |
case 'o' : |
3344 |
case 'o' : |
3321 |
if (token.equals("over-sync") /*|| token.equals("syncOverride")*/) { //$NON-NLS-1$ |
3345 |
if (token.equals("over-sync") /*|| token.equals("syncOverride")*/) { //$NON-NLS-1$ |
3322 |
this.options.put( |
3346 |
setSeverity(CompilerOptions.OPTION_ReportMissingSynchronizedOnInheritedMethod, severity, isEnabling); |
3323 |
CompilerOptions.OPTION_ReportMissingSynchronizedOnInheritedMethod, |
|
|
3324 |
isEnabling ? CompilerOptions.ERROR : CompilerOptions.IGNORE); |
3325 |
return; |
3347 |
return; |
3326 |
} else if (token.equals("over-ann")) { //$NON-NLS-1$ |
3348 |
} else if (token.equals("over-ann")) { //$NON-NLS-1$ |
3327 |
this.options.put( |
3349 |
setSeverity(CompilerOptions.OPTION_ReportMissingOverrideAnnotation, severity, isEnabling); |
3328 |
CompilerOptions.OPTION_ReportMissingOverrideAnnotation, |
|
|
3329 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
3330 |
this.options.put( |
3350 |
this.options.put( |
3331 |
CompilerOptions.OPTION_ReportMissingOverrideAnnotationForInterfaceMethodImplementation, |
3351 |
CompilerOptions.OPTION_ReportMissingOverrideAnnotationForInterfaceMethodImplementation, |
3332 |
CompilerOptions.DISABLED); |
3352 |
CompilerOptions.DISABLED); |
Lines 3335-3361
Link Here
|
3335 |
break; |
3355 |
break; |
3336 |
case 'p' : |
3356 |
case 'p' : |
3337 |
if (token.equals("pkgDefaultMethod") || token.equals("packageDefaultMethod")/*backward compatible*/ ) { //$NON-NLS-1$ //$NON-NLS-2$ |
3357 |
if (token.equals("pkgDefaultMethod") || token.equals("packageDefaultMethod")/*backward compatible*/ ) { //$NON-NLS-1$ //$NON-NLS-2$ |
3338 |
this.options.put( |
3358 |
setSeverity(CompilerOptions.OPTION_ReportOverridingPackageDefaultMethod, severity, isEnabling); |
3339 |
CompilerOptions.OPTION_ReportOverridingPackageDefaultMethod, |
|
|
3340 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
3341 |
return; |
3359 |
return; |
3342 |
} else if (token.equals("paramAssign")) { //$NON-NLS-1$ |
3360 |
} else if (token.equals("paramAssign")) { //$NON-NLS-1$ |
3343 |
this.options.put( |
3361 |
setSeverity(CompilerOptions.OPTION_ReportParameterAssignment, severity, isEnabling); |
3344 |
CompilerOptions.OPTION_ReportParameterAssignment, |
|
|
3345 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
3346 |
return; |
3362 |
return; |
3347 |
} |
3363 |
} |
3348 |
break; |
3364 |
break; |
3349 |
case 'r' : |
3365 |
case 'r' : |
3350 |
if (token.equals("raw")) {//$NON-NLS-1$ |
3366 |
if (token.equals("raw")) {//$NON-NLS-1$ |
3351 |
this.options.put( |
3367 |
setSeverity(CompilerOptions.OPTION_ReportRawTypeReference, severity, isEnabling); |
3352 |
CompilerOptions.OPTION_ReportRawTypeReference, |
|
|
3353 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
3354 |
return; |
3368 |
return; |
3355 |
} else if (/*token.equals("intfRedundant") ||*/ token.equals("redundantSuperinterface")) { //$NON-NLS-1$ |
3369 |
} else if (/*token.equals("intfRedundant") ||*/ token.equals("redundantSuperinterface")) { //$NON-NLS-1$ |
3356 |
this.options.put( |
3370 |
setSeverity(CompilerOptions.OPTION_ReportRedundantSuperinterface, severity, isEnabling); |
3357 |
CompilerOptions.OPTION_ReportRedundantSuperinterface, |
|
|
3358 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
3359 |
return; |
3371 |
return; |
3360 |
} |
3372 |
} |
3361 |
break; |
3373 |
break; |
Lines 3366-3394
Link Here
|
3366 |
isEnabling ? CompilerOptions.ENABLED : CompilerOptions.DISABLED); |
3378 |
isEnabling ? CompilerOptions.ENABLED : CompilerOptions.DISABLED); |
3367 |
return; |
3379 |
return; |
3368 |
} else if (token.equals("syntheticAccess") || token.equals("synthetic-access")) { //$NON-NLS-1$ //$NON-NLS-2$ |
3380 |
} else if (token.equals("syntheticAccess") || token.equals("synthetic-access")) { //$NON-NLS-1$ //$NON-NLS-2$ |
3369 |
this.options.put( |
3381 |
setSeverity(CompilerOptions.OPTION_ReportSyntheticAccessEmulation, severity, isEnabling); |
3370 |
CompilerOptions.OPTION_ReportSyntheticAccessEmulation, |
|
|
3371 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
3372 |
return; |
3382 |
return; |
3373 |
} else if (token.equals("staticReceiver")) { //$NON-NLS-1$ |
3383 |
} else if (token.equals("staticReceiver")) { //$NON-NLS-1$ |
3374 |
this.options.put( |
3384 |
setSeverity(CompilerOptions.OPTION_ReportNonStaticAccessToStatic, severity, isEnabling); |
3375 |
CompilerOptions.OPTION_ReportNonStaticAccessToStatic, |
|
|
3376 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
3377 |
return; |
3385 |
return; |
3378 |
} else if (/*token.equals("over-sync") ||*/ token.equals("syncOverride")) { //$NON-NLS-1$ |
3386 |
} else if (/*token.equals("over-sync") ||*/ token.equals("syncOverride")) { //$NON-NLS-1$ |
3379 |
this.options.put( |
3387 |
setSeverity(CompilerOptions.OPTION_ReportMissingSynchronizedOnInheritedMethod, severity, isEnabling); |
3380 |
CompilerOptions.OPTION_ReportMissingSynchronizedOnInheritedMethod, |
|
|
3381 |
isEnabling ? CompilerOptions.ERROR : CompilerOptions.IGNORE); |
3382 |
return; |
3388 |
return; |
3383 |
} else if (token.equals("semicolon")) {//$NON-NLS-1$ |
3389 |
} else if (token.equals("semicolon")) {//$NON-NLS-1$ |
3384 |
this.options.put( |
3390 |
setSeverity(CompilerOptions.OPTION_ReportEmptyStatement, severity, isEnabling); |
3385 |
CompilerOptions.OPTION_ReportEmptyStatement, |
|
|
3386 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
3387 |
return; |
3391 |
return; |
3388 |
} else if (token.equals("serial")) {//$NON-NLS-1$ |
3392 |
} else if (token.equals("serial")) {//$NON-NLS-1$ |
3389 |
this.options.put( |
3393 |
setSeverity(CompilerOptions.OPTION_ReportMissingSerialVersion, severity, isEnabling); |
3390 |
CompilerOptions.OPTION_ReportMissingSerialVersion, |
|
|
3391 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
3392 |
return; |
3394 |
return; |
3393 |
} else if (token.equals("suppress")) {//$NON-NLS-1$ |
3395 |
} else if (token.equals("suppress")) {//$NON-NLS-1$ |
3394 |
this.options.put( |
3396 |
this.options.put( |
Lines 3396-3412
Link Here
|
3396 |
isEnabling ? CompilerOptions.ENABLED : CompilerOptions.DISABLED); |
3398 |
isEnabling ? CompilerOptions.ENABLED : CompilerOptions.DISABLED); |
3397 |
return; |
3399 |
return; |
3398 |
} else if (token.equals("static-access")) { //$NON-NLS-1$ |
3400 |
} else if (token.equals("static-access")) { //$NON-NLS-1$ |
3399 |
this.options.put( |
3401 |
setSeverity(CompilerOptions.OPTION_ReportNonStaticAccessToStatic, severity, isEnabling); |
3400 |
CompilerOptions.OPTION_ReportNonStaticAccessToStatic, |
3402 |
setSeverity(CompilerOptions.OPTION_ReportIndirectStaticAccess, severity, isEnabling); |
3401 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
|
|
3402 |
this.options.put( |
3403 |
CompilerOptions.OPTION_ReportIndirectStaticAccess, |
3404 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
3405 |
return; |
3403 |
return; |
3406 |
} else if (token.equals("super")) { //$NON-NLS-1$ |
3404 |
} else if (token.equals("super")) { //$NON-NLS-1$ |
3407 |
this.options.put( |
3405 |
setSeverity(CompilerOptions.OPTION_ReportOverridingMethodWithoutSuperInvocation, severity, isEnabling); |
3408 |
CompilerOptions.OPTION_ReportOverridingMethodWithoutSuperInvocation, |
|
|
3409 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
3410 |
return; |
3406 |
return; |
3411 |
} |
3407 |
} |
3412 |
break; |
3408 |
break; |
Lines 3425-3540
Link Here
|
3425 |
this.options.put( |
3421 |
this.options.put( |
3426 |
CompilerOptions.OPTION_TaskTags, |
3422 |
CompilerOptions.OPTION_TaskTags, |
3427 |
isEnabling ? taskTags : Util.EMPTY_STRING); |
3423 |
isEnabling ? taskTags : Util.EMPTY_STRING); |
|
|
3424 |
|
3425 |
setSeverity(CompilerOptions.OPTION_ReportTasks, severity, isEnabling); |
3428 |
return; |
3426 |
return; |
3429 |
} else if (token.equals("typeHiding")) { //$NON-NLS-1$ |
3427 |
} else if (token.equals("typeHiding")) { //$NON-NLS-1$ |
3430 |
this.options.put( |
3428 |
setSeverity(CompilerOptions.OPTION_ReportTypeParameterHiding, severity, isEnabling); |
3431 |
CompilerOptions.OPTION_ReportTypeParameterHiding, |
|
|
3432 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
3433 |
return; |
3429 |
return; |
3434 |
} |
3430 |
} |
3435 |
break; |
3431 |
break; |
3436 |
case 'u' : |
3432 |
case 'u' : |
3437 |
if (token.equals("unusedLocal") || token.equals("unusedLocals")/*backward compatible*/) { //$NON-NLS-1$ //$NON-NLS-2$ |
3433 |
if (token.equals("unusedLocal") || token.equals("unusedLocals")/*backward compatible*/) { //$NON-NLS-1$ //$NON-NLS-2$ |
3438 |
this.options.put( |
3434 |
setSeverity(CompilerOptions.OPTION_ReportUnusedLocal, severity, isEnabling); |
3439 |
CompilerOptions.OPTION_ReportUnusedLocal, |
|
|
3440 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
3441 |
return; |
3435 |
return; |
3442 |
} else if (token.equals("unusedArgument") || token.equals("unusedArguments")/*backward compatible*/) { //$NON-NLS-1$ //$NON-NLS-2$ |
3436 |
} else if (token.equals("unusedArgument") || token.equals("unusedArguments")/*backward compatible*/) { //$NON-NLS-1$ //$NON-NLS-2$ |
3443 |
this.options.put( |
3437 |
setSeverity(CompilerOptions.OPTION_ReportUnusedParameter, severity, isEnabling); |
3444 |
CompilerOptions.OPTION_ReportUnusedParameter, |
|
|
3445 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
3446 |
return; |
3438 |
return; |
3447 |
} else if (token.equals("unusedImport") || token.equals("unusedImports")/*backward compatible*/) { //$NON-NLS-1$ //$NON-NLS-2$ |
3439 |
} else if (token.equals("unusedImport") || token.equals("unusedImports")/*backward compatible*/) { //$NON-NLS-1$ //$NON-NLS-2$ |
3448 |
this.options.put( |
3440 |
setSeverity(CompilerOptions.OPTION_ReportUnusedImport, severity, isEnabling); |
3449 |
CompilerOptions.OPTION_ReportUnusedImport, |
|
|
3450 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
3451 |
return; |
3441 |
return; |
3452 |
} else if (token.equals("unusedPrivate")) { //$NON-NLS-1$ |
3442 |
} else if (token.equals("unusedPrivate")) { //$NON-NLS-1$ |
3453 |
this.options.put( |
3443 |
setSeverity(CompilerOptions.OPTION_ReportUnusedPrivateMember, severity, isEnabling); |
3454 |
CompilerOptions.OPTION_ReportUnusedPrivateMember, |
|
|
3455 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
3456 |
return; |
3444 |
return; |
3457 |
} else if (token.equals("unusedLabel")) { //$NON-NLS-1$ |
3445 |
} else if (token.equals("unusedLabel")) { //$NON-NLS-1$ |
3458 |
this.options.put( |
3446 |
setSeverity(CompilerOptions.OPTION_ReportUnusedLabel, severity, isEnabling); |
3459 |
CompilerOptions.OPTION_ReportUnusedLabel, |
|
|
3460 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
3461 |
return; |
3447 |
return; |
3462 |
} else if (token.equals("uselessTypeCheck")) {//$NON-NLS-1$ |
3448 |
} else if (token.equals("uselessTypeCheck")) {//$NON-NLS-1$ |
3463 |
this.options.put( |
3449 |
setSeverity(CompilerOptions.OPTION_ReportUnnecessaryTypeCheck, severity, isEnabling); |
3464 |
CompilerOptions.OPTION_ReportUnnecessaryTypeCheck, |
|
|
3465 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
3466 |
return; |
3450 |
return; |
3467 |
} else if (token.equals("unchecked") || token.equals("unsafe")) {//$NON-NLS-1$ //$NON-NLS-2$ |
3451 |
} else if (token.equals("unchecked") || token.equals("unsafe")) {//$NON-NLS-1$ //$NON-NLS-2$ |
3468 |
this.options.put( |
3452 |
setSeverity(CompilerOptions.OPTION_ReportUncheckedTypeOperation, severity, isEnabling); |
3469 |
CompilerOptions.OPTION_ReportUncheckedTypeOperation, |
|
|
3470 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
3471 |
return; |
3453 |
return; |
3472 |
} else if (token.equals("unnecessaryElse")) {//$NON-NLS-1$ |
3454 |
} else if (token.equals("unnecessaryElse")) {//$NON-NLS-1$ |
3473 |
this.options.put( |
3455 |
setSeverity(CompilerOptions.OPTION_ReportUnnecessaryElse, severity, isEnabling); |
3474 |
CompilerOptions.OPTION_ReportUnnecessaryElse, |
|
|
3475 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
3476 |
return; |
3456 |
return; |
3477 |
} else if (token.equals("unusedThrown")) { //$NON-NLS-1$ |
3457 |
} else if (token.equals("unusedThrown")) { //$NON-NLS-1$ |
3478 |
this.options.put( |
3458 |
setSeverity(CompilerOptions.OPTION_ReportUnusedDeclaredThrownException, severity, isEnabling); |
3479 |
CompilerOptions.OPTION_ReportUnusedDeclaredThrownException, |
|
|
3480 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
3481 |
return; |
3459 |
return; |
3482 |
} else if (token.equals("unqualifiedField") || token.equals("unqualified-field-access")) { //$NON-NLS-1$ //$NON-NLS-2$ |
3460 |
} else if (token.equals("unqualifiedField") || token.equals("unqualified-field-access")) { //$NON-NLS-1$ //$NON-NLS-2$ |
3483 |
this.options.put( |
3461 |
setSeverity(CompilerOptions.OPTION_ReportUnqualifiedFieldAccess, severity, isEnabling); |
3484 |
CompilerOptions.OPTION_ReportUnqualifiedFieldAccess, |
|
|
3485 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
3486 |
return; |
3462 |
return; |
3487 |
} else if (token.equals("unused")) { //$NON-NLS-1$ |
3463 |
} else if (token.equals("unused")) { //$NON-NLS-1$ |
3488 |
this.options.put( |
3464 |
setSeverity(CompilerOptions.OPTION_ReportUnusedLocal, severity, isEnabling); |
3489 |
CompilerOptions.OPTION_ReportUnusedLocal, |
3465 |
setSeverity(CompilerOptions.OPTION_ReportUnusedParameter, severity, isEnabling); |
3490 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
3466 |
setSeverity(CompilerOptions.OPTION_ReportUnusedImport, severity, isEnabling); |
3491 |
this.options.put( |
3467 |
setSeverity(CompilerOptions.OPTION_ReportUnusedPrivateMember, severity, isEnabling); |
3492 |
CompilerOptions.OPTION_ReportUnusedParameter, |
3468 |
setSeverity(CompilerOptions.OPTION_ReportUnusedDeclaredThrownException, severity, isEnabling); |
3493 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
3469 |
setSeverity(CompilerOptions.OPTION_ReportUnusedLabel, severity, isEnabling); |
3494 |
this.options.put( |
3470 |
setSeverity(CompilerOptions.OPTION_ReportUnusedTypeArgumentsForMethodInvocation, severity, isEnabling); |
3495 |
CompilerOptions.OPTION_ReportUnusedImport, |
|
|
3496 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
3497 |
this.options.put( |
3498 |
CompilerOptions.OPTION_ReportUnusedPrivateMember, |
3499 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
3500 |
this.options.put( |
3501 |
CompilerOptions.OPTION_ReportUnusedDeclaredThrownException, |
3502 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
3503 |
this.options.put( |
3504 |
CompilerOptions.OPTION_ReportUnusedLabel, |
3505 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
3506 |
this.options.put( |
3507 |
CompilerOptions.OPTION_ReportUnusedTypeArgumentsForMethodInvocation, |
3508 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
3509 |
return; |
3471 |
return; |
3510 |
} else if (token.equals("unusedTypeArgs")) { //$NON-NLS-1$ |
3472 |
} else if (token.equals("unusedTypeArgs")) { //$NON-NLS-1$ |
3511 |
this.options.put( |
3473 |
setSeverity(CompilerOptions.OPTION_ReportUnusedTypeArgumentsForMethodInvocation, severity, isEnabling); |
3512 |
CompilerOptions.OPTION_ReportUnusedTypeArgumentsForMethodInvocation, |
|
|
3513 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
3514 |
return; |
3474 |
return; |
3515 |
} |
3475 |
} |
3516 |
break; |
3476 |
break; |
3517 |
case 'v' : |
3477 |
case 'v' : |
3518 |
if (token.equals("varargsCast")) { //$NON-NLS-1$ |
3478 |
if (token.equals("varargsCast")) { //$NON-NLS-1$ |
3519 |
this.options.put( |
3479 |
setSeverity(CompilerOptions.OPTION_ReportVarargsArgumentNeedCast, severity, isEnabling); |
3520 |
CompilerOptions.OPTION_ReportVarargsArgumentNeedCast, |
|
|
3521 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
3522 |
return; |
3480 |
return; |
3523 |
} |
3481 |
} |
3524 |
break; |
3482 |
break; |
3525 |
case 'w' : |
3483 |
case 'w' : |
3526 |
if (token.equals("warningToken")) {//$NON-NLS-1$ |
3484 |
if (token.equals("warningToken")) {//$NON-NLS-1$ |
3527 |
this.options.put( |
3485 |
setSeverity(CompilerOptions.OPTION_ReportUnhandledWarningToken, severity, isEnabling); |
3528 |
CompilerOptions.OPTION_ReportUnhandledWarningToken, |
3486 |
setSeverity(CompilerOptions.OPTION_ReportUnusedWarningToken, severity, isEnabling); |
3529 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
|
|
3530 |
this.options.put( |
3531 |
CompilerOptions.OPTION_ReportUnusedWarningToken, |
3532 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
3533 |
return; |
3487 |
return; |
3534 |
} |
3488 |
} |
3535 |
break; |
3489 |
break; |
3536 |
} |
3490 |
} |
3537 |
addPendingErrors(this.bind("configure.invalidWarning", token)); //$NON-NLS-1$ |
3491 |
String message = null; |
|
|
3492 |
switch(severity) { |
3493 |
case ProblemSeverities.Warning : |
3494 |
message = this.bind("configure.invalidWarning", token); //$NON-NLS-1$ |
3495 |
break; |
3496 |
case ProblemSeverities.Error : |
3497 |
message = this.bind("configure.invalidError", token); //$NON-NLS-1$ |
3498 |
} |
3499 |
addPendingErrors(message); |
3538 |
} |
3500 |
} |
3539 |
/** |
3501 |
/** |
3540 |
* @deprecated - use {@link #initialize(PrintWriter, PrintWriter, boolean, Map, CompilationProgress)} instead |
3502 |
* @deprecated - use {@link #initialize(PrintWriter, PrintWriter, boolean, Map, CompilationProgress)} instead |
Lines 3557-3562
Link Here
|
3557 |
this.err = errWriter; |
3519 |
this.err = errWriter; |
3558 |
this.systemExitWhenFinished = systemExit; |
3520 |
this.systemExitWhenFinished = systemExit; |
3559 |
this.options = new CompilerOptions().getMap(); |
3521 |
this.options = new CompilerOptions().getMap(); |
|
|
3522 |
|
3560 |
this.progress = compilationProgress; |
3523 |
this.progress = compilationProgress; |
3561 |
if (customDefaultOptions != null) { |
3524 |
if (customDefaultOptions != null) { |
3562 |
this.didSpecifySource = customDefaultOptions.get(CompilerOptions.OPTION_Source) != null; |
3525 |
this.didSpecifySource = customDefaultOptions.get(CompilerOptions.OPTION_Source) != null; |