View | Details | Raw Unified | Return to bug 280784 | Differences between
and this patch

Collapse All | Expand All

(-)batch/org/eclipse/jdt/internal/compiler/batch/Main.java (-257 / +219 lines)
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
(-)batch/org/eclipse/jdt/internal/compiler/batch/messages.properties (-3 / +18 lines)
Lines 52-60 Link Here
52
configure.duplicateExtDirs = duplicate extdirs specification: {0}
52
configure.duplicateExtDirs = duplicate extdirs specification: {0}
53
configure.duplicateSourcepath = duplicate sourcepath specification: {0}
53
configure.duplicateSourcepath = duplicate sourcepath specification: {0}
54
configure.invalidDebugOption = invalid debug option: {0}
54
configure.invalidDebugOption = invalid debug option: {0}
55
configure.invalidWarningConfiguration = invalid warning configuration: {0}
55
configure.invalidWarningConfiguration = invalid warning configuration: ''{0}''
56
configure.invalidWarning = invalid warning: {0}. Ignoring warning and compiling
56
configure.invalidWarning = invalid warning token: ''{0}''. Ignoring warning and compiling
57
configure.invalidWarningOption = invalid warning option: {0}. Must specify a warning token
57
configure.invalidWarningOption = invalid warning option: ''{0}''. Must specify a warning token
58
configure.targetJDK = target level should be comprised in between ''1.1'' and ''1.7'' (or ''5'', ''5.0'', ..., ''7'' or ''7.0'') or cldc1.1: {0}
58
configure.targetJDK = target level should be comprised in between ''1.1'' and ''1.7'' (or ''5'', ''5.0'', ..., ''7'' or ''7.0'') or cldc1.1: {0}
59
configure.incompatibleTargetForSource = Target level ''{0}'' is incompatible with source level ''{1}''. A target level ''{1}'' or better is required
59
configure.incompatibleTargetForSource = Target level ''{0}'' is incompatible with source level ''{1}''. A target level ''{1}'' or better is required
60
configure.incompatibleTargetForGenericSource = Target level ''{0}'' is incompatible with source level ''{1}''. A source level ''1.5'' or better is required
60
configure.incompatibleTargetForGenericSource = Target level ''{0}'' is incompatible with source level ''{1}''. A source level ''1.5'' or better is required
Lines 62-67 Link Here
62
configure.incompatibleComplianceForTarget = Compliance level ''{0}'' is incompatible with target level ''{1}''. A compliance level ''{1}'' or better is required
62
configure.incompatibleComplianceForTarget = Compliance level ''{0}'' is incompatible with target level ''{1}''. A compliance level ''{1}'' or better is required
63
configure.repetition = repetition must be a positive integer: {0}
63
configure.repetition = repetition must be a positive integer: {0}
64
configure.maxProblems = max problems must be a positive integer: {0}
64
configure.maxProblems = max problems must be a positive integer: {0}
65
66
configure.invalidErrorConfiguration = invalid error configuration: ''{0}''
67
configure.invalidError = invalid error token: ''{0}''. Ignoring this error token and compiling
68
configure.invalidErrorOption = invalid error option: ''{0}''. Must specify an error token
69
configure.invalidUsageOfPlusOption=usage of ''+'' for ''{0}'' is illegal there
70
configure.invalidUsageOfMinusOption=usage of ''-'' for ''{0}'' is illegal there
71
65
## configure.directoryNotExist = directory does not exist: {0}
72
## configure.directoryNotExist = directory does not exist: {0}
66
configure.unrecognizedOption = Unrecognized option : {0}
73
configure.unrecognizedOption = Unrecognized option : {0}
67
configure.noClasspath = no classpath defined, using default directory instead
74
configure.noClasspath = no classpath defined, using default directory instead
Lines 167-172 Link Here
167
\    -nowarn -warn:none disable all warnings\n\
174
\    -nowarn -warn:none disable all warnings\n\
168
\    -?:warn -help:warn display advanced warning options\n\
175
\    -?:warn -help:warn display advanced warning options\n\
169
\ \n\
176
\ \n\
177
\ Error options:\n\
178
\    -error:<warnings separated by ,>    convert exactly the listed warnings\n\
179
\                                        to be reported as errors\n\
180
\    -error:+<warnings separated by ,>   enable additional warnings to be\n\
181
\                                        reported as errors\n\
182
\    -error:-<warnings separated by ,>   disable specific warnings to be\n\
183
\                                        reported as errors\n\
184
\ \n\
170
\ Debug options:\n\
185
\ Debug options:\n\
171
\    -g[:lines,vars,source] custom debug info\n\
186
\    -g[:lines,vars,source] custom debug info\n\
172
\    -g:lines,source  + both lines table and source debug info\n\
187
\    -g:lines,source  + both lines table and source debug info\n\
(-)compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java (-8 / +11 lines)
Lines 126-131 Link Here
126
	public static final String OPTION_ReportMissingHashCodeMethod =  "org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod"; //$NON-NLS-1$
126
	public static final String OPTION_ReportMissingHashCodeMethod =  "org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod"; //$NON-NLS-1$
127
	public static final String OPTION_ReportDeadCode =  "org.eclipse.jdt.core.compiler.problem.deadCode"; //$NON-NLS-1$
127
	public static final String OPTION_ReportDeadCode =  "org.eclipse.jdt.core.compiler.problem.deadCode"; //$NON-NLS-1$
128
	public static final String OPTION_ReportDeadCodeInTrivialIfStatement =  "org.eclipse.jdt.core.compiler.problem.deadCodeInTrivialIfStatement"; //$NON-NLS-1$
128
	public static final String OPTION_ReportDeadCodeInTrivialIfStatement =  "org.eclipse.jdt.core.compiler.problem.deadCodeInTrivialIfStatement"; //$NON-NLS-1$
129
	public static final String OPTION_ReportTasks = "org.eclipse.jdt.core.compiler.problem.tasks"; //$NON-NLS-1$
129
130
130
	// Backward compatibility
131
	// Backward compatibility
131
	public static final String OPTION_ReportInvalidAnnotation = "org.eclipse.jdt.core.compiler.problem.invalidAnnotation"; //$NON-NLS-1$
132
	public static final String OPTION_ReportInvalidAnnotation = "org.eclipse.jdt.core.compiler.problem.invalidAnnotation"; //$NON-NLS-1$
Lines 230-235 Link Here
230
	// group 2
231
	// group 2
231
	public static final int ShouldImplementHashcode = IrritantSet.GROUP2 | ASTNode.Bit1;
232
	public static final int ShouldImplementHashcode = IrritantSet.GROUP2 | ASTNode.Bit1;
232
	public static final int DeadCode = IrritantSet.GROUP2 | ASTNode.Bit2;
233
	public static final int DeadCode = IrritantSet.GROUP2 | ASTNode.Bit2;
234
	public static final int Tasks = IrritantSet.GROUP2 | ASTNode.Bit3;
233
235
234
	// Severity level for handlers
236
	// Severity level for handlers
235
	/** 
237
	/** 
Lines 270-276 Link Here
270
	/** Tags used to recognize tasks in comments */
272
	/** Tags used to recognize tasks in comments */
271
	public char[][] taskTags;
273
	public char[][] taskTags;
272
	/** Respective priorities of recognized task tags */
274
	/** Respective priorities of recognized task tags */
273
	public char[][] taskPriorites;
275
	public char[][] taskPriorities;
274
	/** Indicate whether tag detection is case sensitive or not */
276
	/** Indicate whether tag detection is case sensitive or not */
275
	public boolean isTaskCaseSensitive;
277
	public boolean isTaskCaseSensitive;
276
	/** Specify whether deprecation inside deprecated code is to be reported */
278
	/** Specify whether deprecation inside deprecated code is to be reported */
Lines 416-423 Link Here
416
				return OPTION_ReportUnusedImport;
418
				return OPTION_ReportUnusedImport;
417
			case NonStaticAccessToStatic :
419
			case NonStaticAccessToStatic :
418
				return OPTION_ReportNonStaticAccessToStatic;
420
				return OPTION_ReportNonStaticAccessToStatic;
419
			case Task :
420
				return OPTION_TaskTags;
421
			case NoEffectAssignment :
421
			case NoEffectAssignment :
422
				return OPTION_ReportNoEffectAssignment;
422
				return OPTION_ReportNoEffectAssignment;
423
			case IncompatibleNonInheritedInterfaceMethod :
423
			case IncompatibleNonInheritedInterfaceMethod :
Lines 862-868 Link Here
862
			optionsMap.put(OPTION_Encoding, this.defaultEncoding);
862
			optionsMap.put(OPTION_Encoding, this.defaultEncoding);
863
		}
863
		}
864
		optionsMap.put(OPTION_TaskTags, this.taskTags == null ? Util.EMPTY_STRING : new String(CharOperation.concatWith(this.taskTags,',')));
864
		optionsMap.put(OPTION_TaskTags, this.taskTags == null ? Util.EMPTY_STRING : new String(CharOperation.concatWith(this.taskTags,',')));
865
		optionsMap.put(OPTION_TaskPriorities, this.taskPriorites == null ? Util.EMPTY_STRING : new String(CharOperation.concatWith(this.taskPriorites,',')));
865
		optionsMap.put(OPTION_TaskPriorities, this.taskPriorities == null ? Util.EMPTY_STRING : new String(CharOperation.concatWith(this.taskPriorities,',')));
866
		optionsMap.put(OPTION_TaskCaseSensitive, this.isTaskCaseSensitive ? ENABLED : DISABLED);
866
		optionsMap.put(OPTION_TaskCaseSensitive, this.isTaskCaseSensitive ? ENABLED : DISABLED);
867
		optionsMap.put(OPTION_ReportUnusedParameterWhenImplementingAbstract, this.reportUnusedParameterWhenImplementingAbstract ? ENABLED : DISABLED);
867
		optionsMap.put(OPTION_ReportUnusedParameterWhenImplementingAbstract, this.reportUnusedParameterWhenImplementingAbstract ? ENABLED : DISABLED);
868
		optionsMap.put(OPTION_ReportUnusedParameterWhenOverridingConcrete, this.reportUnusedParameterWhenOverridingConcrete ? ENABLED : DISABLED);
868
		optionsMap.put(OPTION_ReportUnusedParameterWhenOverridingConcrete, this.reportUnusedParameterWhenOverridingConcrete ? ENABLED : DISABLED);
Lines 887-892 Link Here
887
		optionsMap.put(OPTION_ReportMissingHashCodeMethod, getSeverityString(ShouldImplementHashcode));
887
		optionsMap.put(OPTION_ReportMissingHashCodeMethod, getSeverityString(ShouldImplementHashcode));
888
		optionsMap.put(OPTION_ReportDeadCode, getSeverityString(DeadCode));
888
		optionsMap.put(OPTION_ReportDeadCode, getSeverityString(DeadCode));
889
		optionsMap.put(OPTION_ReportDeadCodeInTrivialIfStatement, this.reportDeadCodeInTrivialIfStatement ? ENABLED : DISABLED);
889
		optionsMap.put(OPTION_ReportDeadCodeInTrivialIfStatement, this.reportDeadCodeInTrivialIfStatement ? ENABLED : DISABLED);
890
		optionsMap.put(OPTION_ReportTasks, getSeverityString(Tasks));
890
		return optionsMap;
891
		return optionsMap;
891
	}
892
	}
892
893
Lines 958-964 Link Here
958
959
959
		// tags used to recognize tasks in comments
960
		// tags used to recognize tasks in comments
960
		this.taskTags = null;
961
		this.taskTags = null;
961
		this.taskPriorites = null;
962
		this.taskPriorities = null;
962
		this.isTaskCaseSensitive = true;
963
		this.isTaskCaseSensitive = true;
963
964
964
		// deprecation report
965
		// deprecation report
Lines 1182-1190 Link Here
1182
			if (optionValue instanceof String) {
1183
			if (optionValue instanceof String) {
1183
				String stringValue = (String) optionValue;
1184
				String stringValue = (String) optionValue;
1184
				if (stringValue.length() == 0) {
1185
				if (stringValue.length() == 0) {
1185
					this.taskPriorites = null;
1186
					this.taskPriorities = null;
1186
				} else {
1187
				} else {
1187
					this.taskPriorites = CharOperation.splitAndTrimOn(',', stringValue.toCharArray());
1188
					this.taskPriorities = CharOperation.splitAndTrimOn(',', stringValue.toCharArray());
1188
				}
1189
				}
1189
			}
1190
			}
1190
		}
1191
		}
Lines 1280-1285 Link Here
1280
		if ((optionValue = optionsMap.get(OPTION_ReportMissingSynchronizedOnInheritedMethod)) != null) updateSeverity(MissingSynchronizedModifierInInheritedMethod, optionValue);
1281
		if ((optionValue = optionsMap.get(OPTION_ReportMissingSynchronizedOnInheritedMethod)) != null) updateSeverity(MissingSynchronizedModifierInInheritedMethod, optionValue);
1281
		if ((optionValue = optionsMap.get(OPTION_ReportMissingHashCodeMethod)) != null) updateSeverity(ShouldImplementHashcode, optionValue);
1282
		if ((optionValue = optionsMap.get(OPTION_ReportMissingHashCodeMethod)) != null) updateSeverity(ShouldImplementHashcode, optionValue);
1282
		if ((optionValue = optionsMap.get(OPTION_ReportDeadCode)) != null) updateSeverity(DeadCode, optionValue);
1283
		if ((optionValue = optionsMap.get(OPTION_ReportDeadCode)) != null) updateSeverity(DeadCode, optionValue);
1284
		if ((optionValue = optionsMap.get(OPTION_ReportTasks)) != null) updateSeverity(Tasks, optionValue);
1283
1285
1284
		// Javadoc options
1286
		// Javadoc options
1285
		if ((optionValue = optionsMap.get(OPTION_DocCommentSupport)) != null) {
1287
		if ((optionValue = optionsMap.get(OPTION_DocCommentSupport)) != null) {
Lines 1441-1447 Link Here
1441
		buf.append("\n\t- parse literal expressions as constants : ").append(this.parseLiteralExpressionsAsConstants ? "ON" : "OFF"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
1443
		buf.append("\n\t- parse literal expressions as constants : ").append(this.parseLiteralExpressionsAsConstants ? "ON" : "OFF"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
1442
		buf.append("\n\t- encoding : ").append(this.defaultEncoding == null ? "<default>" : this.defaultEncoding); //$NON-NLS-1$ //$NON-NLS-2$
1444
		buf.append("\n\t- encoding : ").append(this.defaultEncoding == null ? "<default>" : this.defaultEncoding); //$NON-NLS-1$ //$NON-NLS-2$
1443
		buf.append("\n\t- task tags: ").append(this.taskTags == null ? Util.EMPTY_STRING : new String(CharOperation.concatWith(this.taskTags,',')));  //$NON-NLS-1$
1445
		buf.append("\n\t- task tags: ").append(this.taskTags == null ? Util.EMPTY_STRING : new String(CharOperation.concatWith(this.taskTags,',')));  //$NON-NLS-1$
1444
		buf.append("\n\t- task priorities : ").append(this.taskPriorites == null ? Util.EMPTY_STRING : new String(CharOperation.concatWith(this.taskPriorites,','))); //$NON-NLS-1$
1446
		buf.append("\n\t- task priorities : ").append(this.taskPriorities == null ? Util.EMPTY_STRING : new String(CharOperation.concatWith(this.taskPriorities,','))); //$NON-NLS-1$
1445
		buf.append("\n\t- report deprecation inside deprecated code : ").append(this.reportDeprecationInsideDeprecatedCode ? ENABLED : DISABLED); //$NON-NLS-1$
1447
		buf.append("\n\t- report deprecation inside deprecated code : ").append(this.reportDeprecationInsideDeprecatedCode ? ENABLED : DISABLED); //$NON-NLS-1$
1446
		buf.append("\n\t- report deprecation when overriding deprecated method : ").append(this.reportDeprecationWhenOverridingDeprecatedMethod ? ENABLED : DISABLED); //$NON-NLS-1$
1448
		buf.append("\n\t- report deprecation when overriding deprecated method : ").append(this.reportDeprecationWhenOverridingDeprecatedMethod ? ENABLED : DISABLED); //$NON-NLS-1$
1447
		buf.append("\n\t- report unused parameter when implementing abstract method : ").append(this.reportUnusedParameterWhenImplementingAbstract ? ENABLED : DISABLED); //$NON-NLS-1$
1449
		buf.append("\n\t- report unused parameter when implementing abstract method : ").append(this.reportUnusedParameterWhenImplementingAbstract ? ENABLED : DISABLED); //$NON-NLS-1$
Lines 1480-1485 Link Here
1480
		buf.append("\n\t- should implement hashCode() method: ").append(getSeverityString(ShouldImplementHashcode)); //$NON-NLS-1$
1482
		buf.append("\n\t- should implement hashCode() method: ").append(getSeverityString(ShouldImplementHashcode)); //$NON-NLS-1$
1481
		buf.append("\n\t- dead code: ").append(getSeverityString(DeadCode)); //$NON-NLS-1$
1483
		buf.append("\n\t- dead code: ").append(getSeverityString(DeadCode)); //$NON-NLS-1$
1482
		buf.append("\n\t- dead code in trivial if statement: ").append(this.reportDeadCodeInTrivialIfStatement ? ENABLED : DISABLED); //$NON-NLS-1$
1484
		buf.append("\n\t- dead code in trivial if statement: ").append(this.reportDeadCodeInTrivialIfStatement ? ENABLED : DISABLED); //$NON-NLS-1$
1485
		buf.append("\n\t- tasks severity: ").append(getSeverityString(Tasks)); //$NON-NLS-1$
1483
		return buf.toString();
1486
		return buf.toString();
1484
	}
1487
	}
1485
	
1488
	
(-)compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java (-1 / +1 lines)
Lines 8966-8972 Link Here
8966
		this.options.sourceLevel /*sourceLevel*/,
8966
		this.options.sourceLevel /*sourceLevel*/,
8967
		this.options.complianceLevel /*complianceLevel*/,
8967
		this.options.complianceLevel /*complianceLevel*/,
8968
		this.options.taskTags/*taskTags*/,
8968
		this.options.taskTags/*taskTags*/,
8969
		this.options.taskPriorites/*taskPriorities*/,
8969
		this.options.taskPriorities/*taskPriorities*/,
8970
		this.options.isTaskCaseSensitive/*taskCaseSensitive*/);
8970
		this.options.isTaskCaseSensitive/*taskCaseSensitive*/);
8971
}
8971
}
8972
public void jumpOverMethodBody() {
8972
public void jumpOverMethodBody() {
(-)compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java (-3 / +4 lines)
Lines 411-416 Link Here
411
			
411
			
412
		case IProblem.DeadCode:
412
		case IProblem.DeadCode:
413
			return CompilerOptions.DeadCode;
413
			return CompilerOptions.DeadCode;
414
			
415
		case IProblem.Task :
416
			return CompilerOptions.Tasks;
414
	}
417
	}
415
	return 0;
418
	return 0;
416
}
419
}
Lines 1203-1211 Link Here
1203
public int computeSeverity(int problemID){
1206
public int computeSeverity(int problemID){
1204
1207
1205
	switch (problemID) {
1208
	switch (problemID) {
1206
		case IProblem.Task :
1209
		case IProblem.VarargsConflict :
1207
			return ProblemSeverities.Warning;
1208
 		case IProblem.VarargsConflict :
1209
			return ProblemSeverities.Warning;
1210
			return ProblemSeverities.Warning;
1210
 		case IProblem.TypeCollidesWithPackage :
1211
 		case IProblem.TypeCollidesWithPackage :
1211
			return ProblemSeverities.Warning;
1212
			return ProblemSeverities.Warning;
(-)model/org/eclipse/jdt/internal/core/util/CommentRecorderParser.java (-1 / +1 lines)
Lines 226-232 Link Here
226
				this.options.getSeverity(CompilerOptions.NonExternalizedString) != ProblemSeverities.Ignore /*nls*/,
226
				this.options.getSeverity(CompilerOptions.NonExternalizedString) != ProblemSeverities.Ignore /*nls*/,
227
				this.options.sourceLevel /*sourceLevel*/,
227
				this.options.sourceLevel /*sourceLevel*/,
228
				this.options.taskTags/*taskTags*/,
228
				this.options.taskTags/*taskTags*/,
229
				this.options.taskPriorites/*taskPriorities*/,
229
				this.options.taskPriorities/*taskPriorities*/,
230
				this.options.isTaskCaseSensitive/*taskCaseSensitive*/);
230
				this.options.isTaskCaseSensitive/*taskCaseSensitive*/);
231
	}
231
	}
232
232
(-)src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java (-6 / +79 lines)
Lines 45-53 Link Here
45
	private static final Main MAIN = new Main(null/*outWriter*/, null/*errWriter*/, false/*systemExit*/, null/*options*/, null/*progress*/);
45
	private static final Main MAIN = new Main(null/*outWriter*/, null/*errWriter*/, false/*systemExit*/, null/*options*/, null/*progress*/);
46
46
47
	static {
47
	static {
48
//	TESTS_NAMES = new String[] { "test292_warn_options" };
48
//		TESTS_NAMES = new String[] { "test292_warn_options" };
49
//	TESTS_NUMBERS = new int[] { 288 };
49
//		TESTS_NUMBERS = new int[] { 295 };
50
//	TESTS_RANGE = new int[] { 107, -1 };
50
//		TESTS_RANGE = new int[] { 107, -1 };
51
	}
51
	}
52
public BatchCompilerTest(String name) {
52
public BatchCompilerTest(String name) {
53
	super(name);
53
	super(name);
Lines 1543-1548 Link Here
1543
        "    -nowarn -warn:none disable all warnings\n" +
1543
        "    -nowarn -warn:none disable all warnings\n" +
1544
        "    -?:warn -help:warn display advanced warning options\n" +
1544
        "    -?:warn -help:warn display advanced warning options\n" +
1545
        " \n" +
1545
        " \n" +
1546
        " Error options:\n" + 
1547
        "    -error:<warnings separated by ,>    convert exactly the listed warnings\n" + 
1548
        "                                        to be reported as errors\n" + 
1549
        "    -error:+<warnings separated by ,>   enable additional warnings to be\n" + 
1550
        "                                        reported as errors\n" + 
1551
        "    -error:-<warnings separated by ,>   disable specific warnings to be\n" + 
1552
        "                                        reported as errors\n" + 
1553
        " \n" + 
1546
        " Debug options:\n" +
1554
        " Debug options:\n" +
1547
        "    -g[:lines,vars,source] custom debug info\n" +
1555
        "    -g[:lines,vars,source] custom debug info\n" +
1548
        "    -g:lines,source  + both lines table and source debug info\n" +
1556
        "    -g:lines,source  + both lines table and source debug info\n" +
Lines 1833-1838 Link Here
1833
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.staticAccessReceiver\" value=\"warning\"/>\n" +
1841
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.staticAccessReceiver\" value=\"warning\"/>\n" +
1834
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.suppressWarnings\" value=\"enabled\"/>\n" +
1842
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.suppressWarnings\" value=\"enabled\"/>\n" +
1835
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation\" value=\"ignore\"/>\n" +
1843
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation\" value=\"ignore\"/>\n" +
1844
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.tasks\" value=\"ignore\"/>\n" + 
1836
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.typeParameterHiding\" value=\"warning\"/>\n" +
1845
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.typeParameterHiding\" value=\"warning\"/>\n" +
1837
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation\" value=\"warning\"/>\n" +
1846
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation\" value=\"warning\"/>\n" +
1838
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock\" value=\"ignore\"/>\n" +
1847
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock\" value=\"ignore\"/>\n" +
Lines 6159-6165 Link Here
6159
		"\"" + OUTPUT_DIR +  File.separator + "X.java\""
6168
		"\"" + OUTPUT_DIR +  File.separator + "X.java\""
6160
		+ " -warn:-nullDereferences -proc:none -d \"" + OUTPUT_DIR + "\"",
6169
		+ " -warn:-nullDereferences -proc:none -d \"" + OUTPUT_DIR + "\"",
6161
		"",
6170
		"",
6162
		"invalid warning: nullDereferences. Ignoring warning and compiling\n" +
6171
		"invalid warning token: 'nullDereferences'. Ignoring warning and compiling\n" +
6163
		"----------\n" +
6172
		"----------\n" +
6164
		"1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 4)\n" +
6173
		"1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 4)\n" +
6165
		"	s.toString();\n" +
6174
		"	s.toString();\n" +
Lines 8488-8494 Link Here
8488
		"\"" + OUTPUT_DIR +  File.separator + "X.java\""
8497
		"\"" + OUTPUT_DIR +  File.separator + "X.java\""
8489
		+ " -warn:null,-unused -proc:none -d \"" + OUTPUT_DIR + "\"",
8498
		+ " -warn:null,-unused -proc:none -d \"" + OUTPUT_DIR + "\"",
8490
		"",
8499
		"",
8491
		"invalid warning option: -warn:null,-unused. Must specify a warning token\n",
8500
		"usage of \'-\' for \'-unused\' is illegal there\n",
8492
		true);
8501
		true);
8493
}
8502
}
8494
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=210518
8503
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=210518
Lines 8509-8515 Link Here
8509
		"\"" + OUTPUT_DIR +  File.separator + "X.java\""
8518
		"\"" + OUTPUT_DIR +  File.separator + "X.java\""
8510
		+ " -warn:null,+unused -proc:none -d \"" + OUTPUT_DIR + "\"",
8519
		+ " -warn:null,+unused -proc:none -d \"" + OUTPUT_DIR + "\"",
8511
		"",
8520
		"",
8512
		"invalid warning option: -warn:null,+unused. Must specify a warning token\n",
8521
		"usage of \'+\' for \'+unused\' is illegal there\n",
8513
		true);
8522
		true);
8514
}
8523
}
8515
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=211588
8524
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=211588
Lines 11096-11099 Link Here
11096
		"3 problems (3 warnings)",
11105
		"3 problems (3 warnings)",
11097
		true);
11106
		true);
11098
}
11107
}
11108
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=280784
11109
public void test293(){
11110
	createCascadedJars();
11111
	this.runNegativeTest(
11112
		new String[] {
11113
			"src/p/X.java",
11114
			"package p;\n" +
11115
			"/** */\n" +
11116
			"public class X {\n" +
11117
			"  A a;\n" +
11118
			"}",
11119
		},
11120
		"\"" + OUTPUT_DIR +  File.separator + "src/p/X.java\""
11121
		+ " -cp \"" + LIB_DIR + File.separator + "lib3.jar[~p/A]\""
11122
		+ " -sourcepath \"" + OUTPUT_DIR +  File.separator + "src\""
11123
		+ " -1.5 -g -preserveAllLocals"
11124
		+ " -proceedOnError -referenceInfo -error:+discouraged"
11125
		+ " -d \"" + OUTPUT_DIR + File.separator + "bin\" ",
11126
		"",
11127
		"----------\n" +
11128
		"1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/p/X.java (at line 4)\n" +
11129
		"	A a;\n" +
11130
		"	^\n" +
11131
		"Discouraged access: The type A is not accessible due to restriction on classpath entry ---LIB_DIR_PLACEHOLDER---/lib3.jar\n" +
11132
		"----------\n" +
11133
		"1 problem (1 error)",
11134
		true);
11135
}
11136
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=280784
11137
public void test294(){
11138
	this.runConformTest(
11139
		new String[] {
11140
			"src/X.java",
11141
			"public class X {\n" +
11142
			"}",
11143
		},
11144
		"\"" + OUTPUT_DIR +  File.separator + "src/X.java\""
11145
		+ " -cp \"" + LIB_DIR + "\""
11146
		+ " -sourcepath \"" + OUTPUT_DIR +  File.separator + "src\""
11147
		+ " -1.5 -g -preserveAllLocals"
11148
		+ " -proceedOnError -referenceInfo -error:+discouraged2"
11149
		+ " -d \"" + OUTPUT_DIR + File.separator + "bin\" ",
11150
		"",
11151
		"invalid error token: \'discouraged2\'. Ignoring this error token and compiling\n",
11152
		true);
11153
}
11154
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=280784
11155
public void test295(){
11156
	this.runNegativeTest(
11157
		new String[] {
11158
			"src/X.java",
11159
			"public class X {\n" +
11160
			"}",
11161
		},
11162
		"\"" + OUTPUT_DIR +  File.separator + "src/X.java\""
11163
		+ " -cp \"" + LIB_DIR + "\""
11164
		+ " -sourcepath \"" + OUTPUT_DIR +  File.separator + "src\""
11165
		+ " -1.5 -g -preserveAllLocals"
11166
		+ " -proceedOnError -referenceInfo -error:raw,+discouraged"
11167
		+ " -d \"" + OUTPUT_DIR + File.separator + "bin\" ",
11168
		"",
11169
		"usage of \'+\' for \'+discouraged\' is illegal there\n",
11170
		true);
11171
}
11099
}
11172
}

Return to bug 280784