Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilipe Mulet2001-08-06 16:12:57 +0000
committerPhilipe Mulet2001-08-06 16:12:57 +0000
commit60adc6e9bd2a19d1f00a26879d59da4db15980bb (patch)
tree8b30b338966fdfae98ce6ce99e1418f63fee7495 /org.eclipse.jdt.core
parent77f822579c514662c97fa5cfdb004c75e9bbd57e (diff)
downloadeclipse.jdt.core-60adc6e9bd2a19d1f00a26879d59da4db15980bb.tar.gz
eclipse.jdt.core-60adc6e9bd2a19d1f00a26879d59da4db15980bb.tar.xz
eclipse.jdt.core-60adc6e9bd2a19d1f00a26879d59da4db15980bb.zip
options rework
Diffstat (limited to 'org.eclipse.jdt.core')
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java651
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/ConfigurableProblems.java1
2 files changed, 362 insertions, 290 deletions
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java
index 22c40aabc5..69a7efda7e 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java
@@ -11,7 +11,10 @@ import org.eclipse.jdt.internal.compiler.problem.*;
import org.eclipse.jdt.internal.compiler.lookup.*;
public class CompilerOptions implements ConfigurableProblems, ProblemIrritants, ProblemReasons, ProblemSeverities {
-
+ private static final int ERROR = 0;
+ private static final int WARNING = 1;
+ private static final int IGNORE = 2;
+
// class file output
// these are the bits used to buld a mask to know which debug
// attributes should be included in the .class file
@@ -24,8 +27,7 @@ public class CompilerOptions implements ConfigurableProblems, ProblemIrritants,
// default severity level for handlers
public int errorThreshold = UnreachableCode | ImportProblem;
- public int warningThreshold =
- ParsingOptionalError |
+ public int warningThreshold =
MethodWithConstructorName | OverriddenPackageDefaultMethod |
UsingDeprecatedAPI | MaskedCatchBlock |
UnusedLocalVariable | AssertUsedAsAnIdentifier |
@@ -63,6 +65,7 @@ public CompilerOptions(){
*/
public CompilerOptions(ConfigurableOption[] settings){
if (settings == null) return;
+
// filter options which are related to the compiler component
String componentName = Compiler.class.getName();
for (int i = 0, max = settings.length; i < max; i++){
@@ -71,209 +74,191 @@ public CompilerOptions(ConfigurableOption[] settings){
}
}
}
-/**
- * Returns all the options of the compiler to be shown by the UI
- *
- * @param locale java.util.Locale
- * @return org.eclipse.jdt.internal.compiler.ConfigurableOption[]
- */
-public ConfigurableOption[] getConfigurableOptions(Locale locale) {
- String componentName = Compiler.class.getName();
- return new ConfigurableOption[] {
- new ConfigurableOption(
- componentName,
- "debug.vars"/*nonNLS*/,
- locale,
- (produceDebugAttributes & Vars) != 0 ? 0 : 1),
- new ConfigurableOption(
- componentName,
- "debug.lines"/*nonNLS*/,
- locale,
- (produceDebugAttributes & Lines) != 0 ? 0 : 1),
- new ConfigurableOption(
- componentName,
- "debug.source"/*nonNLS*/,
- locale,
- (produceDebugAttributes & Source) != 0 ? 0 : 1),
- new ConfigurableOption(
- componentName,
- "debug.preserveAllLocals"/*nonNLS*/,
- locale,
- preserveAllLocalVariables ? 0 : 1),
- new ConfigurableOption(
- componentName,
- "optionalError.unReachableCode"/*nonNLS*/,
- locale,
- (errorThreshold & UnreachableCode) != 0 ? 0 : 1),
- new ConfigurableOption(
- componentName,
- "optionalError.importProblem"/*nonNLS*/,
- locale,
- (errorThreshold & ImportProblem) != 0 ? 0 : 1),
- new ConfigurableOption(
- componentName,
- "optionalWarning.methodWithConstructorName"/*nonNLS*/,
- locale,
- (warningThreshold & MethodWithConstructorName) != 0 ? 0 : 1),
- new ConfigurableOption(
- componentName,
- "optionalWarning.overridingPackageDefaultMethod"/*nonNLS*/,
- locale,
- (warningThreshold & OverriddenPackageDefaultMethod) != 0 ? 0 : 1),
- new ConfigurableOption(
- componentName,
- "optionalWarning.deprecated"/*nonNLS*/,
- locale,
- (warningThreshold & UsingDeprecatedAPI) != 0 ? 0 : 1),
- new ConfigurableOption(
- componentName,
- "optionalWarning.maskedCatchBlock"/*nonNLS*/,
- locale,
- (warningThreshold & MaskedCatchBlock) != 0 ? 0 : 1),
- new ConfigurableOption(
- componentName,
- "optionalWarning.unusedLocalVariable"/*nonNLS*/,
- locale,
- (warningThreshold & UnusedLocalVariable) != 0 ? 0 : 1),
- new ConfigurableOption(
- componentName,
- "optionalWarning.unusedArgument"/*nonNLS*/,
- locale,
- (warningThreshold & UnusedArgument) != 0 ? 0 : 1),
- new ConfigurableOption(
- componentName,
- "binaryCompatibility.targetJDK"/*nonNLS*/,
- locale,
- targetJDK),
- new ConfigurableOption(
- componentName,
- "optionalWarning.accessEmulation"/*nonNLS*/,
- locale,
- (warningThreshold & AccessEmulation) != 0 ? 0 : 1),
- new ConfigurableOption(
- componentName,
- "optionalWarning.nonExternalizedString"/*nonNLS*/,
- locale,
- (warningThreshold & NonExternalizedString) != 0 ? 0 : 1),
- new ConfigurableOption(
- componentName,
- "source"/*nonNLS*/,
- locale,
- assertMode ? 0 : 1),
- new ConfigurableOption(
- componentName,
- "optionalWarning.assertIdentifier"/*nonNLS*/,
- locale,
- (warningThreshold & AssertUsedAsAnIdentifier) != 0 ? 0 : 1)
- };
-}
+
public int getDebugAttributesMask() {
return this.produceDebugAttributes;
}
public int getTargetJDK() {
return this.targetJDK;
}
-
public boolean getAssertMode() {
return this.assertMode;
}
-
-public void handleAccessEmulationAsWarning(boolean flag) {
- if (flag) {
- warningThreshold |= AccessEmulation;
- } else {
- warningThreshold &= ~AccessEmulation;
- }
-}
-public void handleDeprecationUseAsWarning(boolean flag) {
- if (flag) {
- warningThreshold |= UsingDeprecatedAPI;
- } else {
- warningThreshold &= ~UsingDeprecatedAPI;
+public void setAccessEmulationSeverity(int flag) {
+ errorThreshold &= ~AccessEmulation;
+ warningThreshold &= ~AccessEmulation;
+ switch(flag){
+ case ERROR :
+ errorThreshold |= AccessEmulation;
+ break;
+ case WARNING :
+ warningThreshold |= AccessEmulation;
+ break;
}
}
-public void handleImportProblemAsError(boolean flag) {
- if (flag) {
- errorThreshold |= ImportProblem;
- warningThreshold &= ~ImportProblem;
- } else {
- errorThreshold &= ~ImportProblem;
- warningThreshold |= ImportProblem;
+public void setDeprecationUseSeverity(int flag) {
+ errorThreshold &= ~UsingDeprecatedAPI;
+ warningThreshold &= ~UsingDeprecatedAPI;
+ switch(flag){
+ case ERROR :
+ errorThreshold |= UsingDeprecatedAPI;
+ break;
+ case WARNING :
+ warningThreshold |= UsingDeprecatedAPI;
+ break;
}
}
-public void handleMaskedCatchBlockAsWarning(boolean flag) {
- if (flag) {
- warningThreshold |= MaskedCatchBlock;
- } else {
- warningThreshold &= ~MaskedCatchBlock;
+public void setImportProblemSeverity(int flag) {
+ errorThreshold &= ~ImportProblem;
+ warningThreshold &= ~ImportProblem;
+ switch(flag){
+ case ERROR :
+ errorThreshold |= ImportProblem;
+ break;
+ case WARNING :
+ warningThreshold |= ImportProblem;
+ break;
}
}
-public void handleMethodWithConstructorNameAsWarning(boolean flag) {
- if (flag) {
- warningThreshold |= MethodWithConstructorName;
- } else {
- warningThreshold &= ~MethodWithConstructorName;
+public void setMaskedCatchBlockSeverity(int flag) {
+ errorThreshold &= ~MaskedCatchBlock;
+ warningThreshold &= ~MaskedCatchBlock;
+ switch(flag){
+ case ERROR :
+ errorThreshold |= MaskedCatchBlock;
+ break;
+ case WARNING :
+ warningThreshold |= MaskedCatchBlock;
+ break;
}
}
-public void handleObsoleteLiteralAsError(boolean flag) {
- if (flag) {
- errorThreshold |= ParsingOptionalError;
- warningThreshold &= ~ParsingOptionalError;
- } else {
- errorThreshold &= ~ParsingOptionalError;
- warningThreshold |= ParsingOptionalError;
+public void setMethodWithConstructorNameSeverity(int flag) {
+ errorThreshold &= ~MethodWithConstructorName;
+ warningThreshold &= ~MethodWithConstructorName;
+ switch(flag){
+ case ERROR :
+ errorThreshold |= MethodWithConstructorName;
+ break;
+ case WARNING :
+ warningThreshold |= MethodWithConstructorName;
+ break;
}
}
-public void handleOverriddenPackageDefaultMethodAsWarning(boolean flag) {
- if (flag) {
- warningThreshold |= OverriddenPackageDefaultMethod;
- } else {
- warningThreshold &= ~OverriddenPackageDefaultMethod;
+
+public void setOverriddenPackageDefaultMethodSeverity(int flag) {
+ errorThreshold &= ~OverriddenPackageDefaultMethod;
+ warningThreshold &= ~OverriddenPackageDefaultMethod;
+ switch(flag){
+ case ERROR :
+ errorThreshold |= OverriddenPackageDefaultMethod;
+ break;
+ case WARNING :
+ warningThreshold |= OverriddenPackageDefaultMethod;
+ break;
}
}
-public void handleUnreachableCodeAsError(boolean flag) {
- if (flag) {
- errorThreshold |= UnreachableCode;
- warningThreshold &= ~UnreachableCode;
- } else {
- errorThreshold &= ~UnreachableCode;
- warningThreshold |= UnreachableCode;
+public void setUnreachableCodeSeverity(int flag) {
+ errorThreshold &= ~UnreachableCode;
+ warningThreshold &= ~UnreachableCode;
+ switch(flag){
+ case ERROR :
+ errorThreshold |= UnreachableCode;
+ break;
+ case WARNING :
+ warningThreshold |= UnreachableCode;
+ break;
}
}
-public void handleUnusedArgumentAsWarning(boolean flag) {
- if (flag) {
- warningThreshold |= UnusedArgument;
- } else {
- warningThreshold &= ~UnusedArgument;
+public void setUnusedArgumentSeverity(int flag) {
+ errorThreshold &= ~UnusedArgument;
+ warningThreshold &= ~UnusedArgument;
+ switch(flag){
+ case ERROR :
+ errorThreshold |= UnusedArgument;
+ break;
+ case WARNING :
+ warningThreshold |= UnusedArgument;
+ break;
}
}
-public void handleUnusedLocalVariableAsWarning(boolean flag) {
- if (flag) {
- warningThreshold |= UnusedLocalVariable;
- } else {
- warningThreshold &= ~UnusedLocalVariable;
+public void setUnusedLocalVariableSeverity(int flag) {
+ errorThreshold &= ~UnusedLocalVariable;
+ warningThreshold &= ~UnusedLocalVariable;
+ switch(flag){
+ case ERROR :
+ errorThreshold |= UnusedLocalVariable;
+ break;
+ case WARNING :
+ warningThreshold |= UnusedLocalVariable;
+ break;
}
}
-public boolean isAccessEmulationHandledAsWarning() {
- return (warningThreshold & AccessEmulation) != 0;
-}
-public boolean isDeprecationUseHandledAsWarning() {
- return (warningThreshold & UsingDeprecatedAPI) != 0;
-}
-public boolean isImportProblemHandledAsError() {
- return (errorThreshold & ImportProblem) != 0;
-}
-public boolean isMaskedCatchBlockHandledAsWarning() {
- return (warningThreshold & MaskedCatchBlock) != 0;
+public void setNonExternalizedStringLiteralSeverity(int flag) {
+ errorThreshold &= ~NonExternalizedString;
+ warningThreshold &= ~NonExternalizedString;
+ switch(flag){
+ case ERROR :
+ errorThreshold |= NonExternalizedString;
+ break;
+ case WARNING :
+ warningThreshold |= NonExternalizedString;
+ break;
+ }
}
-public boolean isMethodWithConstructorNameHandledAsWarning() {
- return (warningThreshold & MethodWithConstructorName) != 0;
+public void setAssertIdentifierSeverity(int flag) {
+ errorThreshold &= ~AssertUsedAsAnIdentifier;
+ warningThreshold &= ~AssertUsedAsAnIdentifier;
+ switch(flag){
+ case ERROR :
+ errorThreshold |= AssertUsedAsAnIdentifier;
+ break;
+ case WARNING :
+ warningThreshold |= AssertUsedAsAnIdentifier;
+ break;
+ }
}
-public boolean isObsoleteLiteralAsHandledError() {
- return (errorThreshold & ParsingOptionalError) != 0;
+public int getAccessEmulationSeverity() {
+ if((warningThreshold & AccessEmulation) != 0)
+ return WARNING;
+ if((errorThreshold & AccessEmulation) != 0)
+ return ERROR;
+ return IGNORE;
+}
+public int getDeprecationUseSeverity() {
+ if((warningThreshold & UsingDeprecatedAPI) != 0)
+ return WARNING;
+ if((errorThreshold & UsingDeprecatedAPI) != 0)
+ return ERROR;
+ return IGNORE;
+}
+public int getImportProblemSeverity() {
+ if((warningThreshold & ImportProblem) != 0)
+ return WARNING;
+ if((errorThreshold & ImportProblem) != 0)
+ return ERROR;
+ return IGNORE;
+}
+public int getMaskedCatchBlockSeverity() {
+ if((warningThreshold & MaskedCatchBlock) != 0)
+ return WARNING;
+ if((errorThreshold & MaskedCatchBlock) != 0)
+ return ERROR;
+ return IGNORE;
+}
+public int getMethodWithConstructorNameSeverity() {
+ if((warningThreshold & MethodWithConstructorName) != 0)
+ return WARNING;
+ if((errorThreshold & MethodWithConstructorName) != 0)
+ return ERROR;
+ return IGNORE;
}
-public boolean isOverriddenPackageDefaultMethodHandledAsWarning() {
- return (warningThreshold & OverriddenPackageDefaultMethod) != 0;
+
+public int getOverriddenPackageDefaultMethodSeverity() {
+ if((warningThreshold & OverriddenPackageDefaultMethod) != 0)
+ return WARNING;
+ if((errorThreshold & OverriddenPackageDefaultMethod) != 0)
+ return ERROR;
+ return IGNORE;
}
public boolean isPreservingAllLocalVariables() {
return this.preserveAllLocalVariables ;
@@ -281,14 +266,40 @@ public boolean isPreservingAllLocalVariables() {
public boolean isPrivateConstructorAccessChangingVisibility() {
return isPrivateConstructorAccessChangingVisibility;
}
-public boolean isUnreachableCodeHandledAsError() {
- return (errorThreshold & UnreachableCode) != 0;
-}
-public boolean isUnusedArgumentHandledAsWarning() {
- return (warningThreshold & UnusedArgument) != 0;
-}
-public boolean isUnusedLocalVariableHandledAsWarning() {
- return (warningThreshold & UnusedLocalVariable) != 0;
+public int getUnreachableCodeHandledAsError() {
+ if((warningThreshold & UnreachableCode) != 0)
+ return WARNING;
+ if((errorThreshold & UnreachableCode) != 0)
+ return ERROR;
+ return IGNORE;
+}
+public int getUnusedArgumentSeverity() {
+ if((warningThreshold & UnusedArgument) != 0)
+ return WARNING;
+ if((errorThreshold & UnusedArgument) != 0)
+ return ERROR;
+ return IGNORE;
+}
+public int getUnusedLocalVariableSeverity() {
+ if((warningThreshold & UnusedLocalVariable) != 0)
+ return WARNING;
+ if((errorThreshold & UnusedLocalVariable) != 0)
+ return ERROR;
+ return IGNORE;
+}
+public int getNonExternalizedStringLiteralSeverity() {
+ if((warningThreshold & NonExternalizedString) != 0)
+ return WARNING;
+ if((errorThreshold & NonExternalizedString) != 0)
+ return ERROR;
+ return IGNORE;
+}
+public int getAssertIdentifierSeverity() {
+ if((warningThreshold & NonExternalizedString) != 0)
+ return WARNING;
+ if((errorThreshold & NonExternalizedString) != 0)
+ return ERROR;
+ return IGNORE;
}
public void preserveAllLocalVariables(boolean flag) {
this.preserveAllLocalVariables = flag;
@@ -306,98 +317,184 @@ public void setErrorThreshold(int errorMask) {
this.errorThreshold = errorMask;
}
/**
- * Change the value of the option corresponding to the option number
- *
- * @param optionNumber <CODE>int</CODE>
- * @param setting.getCurrentValueIndex() <CODE>int</CODE>
+ * Change the value of the option corresponding to the option ID
*/
void setOption(ConfigurableOption setting) {
+ String componentName = Compiler.class.getName();
- switch (setting.getID()) {
- case 1 : // Local variable table attribute
- if (setting.getCurrentValueIndex() == 0) {
- // set the debug flag with Vars.
- produceDebugAttributes |= Vars;
- } else {
- produceDebugAttributes &= ~Vars;
- }
- break;
- case 2 : // Line number attribute
- if (setting.getCurrentValueIndex() == 0) {
- // set the debug flag with Lines
- produceDebugAttributes |= Lines;
- } else {
- produceDebugAttributes &= ~Lines;
- }
- break;
- case 3 : // source file attribute
- if (setting.getCurrentValueIndex() == 0) {
- // set the debug flag with Source.
- produceDebugAttributes |= Source;
- } else {
- produceDebugAttributes &= ~Source;
- }
- break;
- case 4 : // preserveAllLocals flag
- preserveAllLocalVariables(setting.getCurrentValueIndex() == 0);
- break;
- case 5 : // unreachable code reported as error
- handleUnreachableCodeAsError(setting.getCurrentValueIndex() == 0);
- break;
- case 6 : // invalid import
- handleImportProblemAsError(setting.getCurrentValueIndex() == 0);
- break;
- case 7 : // methods with constructor name
- handleMethodWithConstructorNameAsWarning(setting.getCurrentValueIndex() == 0);
- break;
- case 8 : // overridden package default method
- handleOverriddenPackageDefaultMethodAsWarning(setting.getCurrentValueIndex() == 0);
- break;
- case 9 : // use of deprecated API
- handleDeprecationUseAsWarning(setting.getCurrentValueIndex() == 0);
- break;
- case 10 : // catch block hidden by another one
- handleMaskedCatchBlockAsWarning(setting.getCurrentValueIndex() == 0);
- break;
- case 11 : // local variable not used
- handleUnusedLocalVariableAsWarning(setting.getCurrentValueIndex() == 0);
- break;
- case 12 : // argument not used
- handleUnusedArgumentAsWarning(setting.getCurrentValueIndex() == 0);
- break;
- case 13 : // temporary warning
- if (setting.getCurrentValueIndex() == 0) {
- warningThreshold |= TemporaryWarning;
- }
- break;
- case 14 : // target JDK
- setTargetJDK(setting.getCurrentValueIndex() == 0 ? JDK1_1 : JDK1_2);
- break;
- case 15: // synthetic access emulation
- handleAccessEmulationAsWarning(setting.getCurrentValueIndex() == 0);
- break;
- case 16: // non externalized string literal
- handleNonExternalizedStringLiteralAsWarning(setting.getCurrentValueIndex() == 0);
- break;
- case 17: // assertion mode
- setAssertMode(setting.getCurrentValueIndex() == 0);
- break;
- case 18: // warn on assert identifier
- handleAssertIdentifierAsWarning(setting.getCurrentValueIndex() == 0);
- break;
+ String optionID = setting.getID();
+
+ if(optionID.equals(componentName + ".debugLocalVariable"/*nonNLS*/)){
+ if (setting.getValueIndex() == 0) {
+ // set the debug flag with Vars.
+ produceDebugAttributes |= Vars;
+ } else {
+ produceDebugAttributes &= ~Vars;
+ }
+ } else if(optionID.equals(componentName + ".debugLineNumber"/*nonNLS*/)) {
+ if (setting.getValueIndex() == 0) {
+ // set the debug flag with Lines
+ produceDebugAttributes |= Lines;
+ } else {
+ produceDebugAttributes &= ~Lines;
+ }
+ }else if(optionID.equals(componentName + ".debugSourceFile"/*nonNLS*/)) {
+ if (setting.getValueIndex() == 0) {
+ // set the debug flag with Source.
+ produceDebugAttributes |= Source;
+ } else {
+ produceDebugAttributes &= ~Source;
+ }
+ }else if(optionID.equals(componentName + ".codegenUnusedLocal"/*nonNLS*/)){
+ preserveAllLocalVariables(setting.getValueIndex() == 0);
+ }else if(optionID.equals(componentName + ".problemUnreachableCode"/*nonNLS*/)){
+ switch(setting.getValueIndex()){
+ case 0 :
+ setUnreachableCodeSeverity(ERROR);
+ break;
+ case 1 :
+ setUnreachableCodeSeverity(WARNING);
+ break;
+ case 2 :
+ setUnreachableCodeSeverity(IGNORE);
+ break;
+ }
+ }else if(optionID.equals(componentName + ".problemInvalidImport"/*nonNLS*/)){
+ switch(setting.getValueIndex()){
+ case 0 :
+ setImportProblemSeverity(ERROR);
+ break;
+ case 1 :
+ setImportProblemSeverity(WARNING);
+ break;
+ case 2 :
+ setImportProblemSeverity(IGNORE);
+ break;
+ }
+ }else if(optionID.equals(componentName + ".codegenTargetPlatform"/*nonNLS*/)){
+ setTargetJDK(setting.getValueIndex() == 0 ? JDK1_1 : JDK1_2);
+ }else if(optionID.equals(componentName + ".problemMethodWithConstructorName"/*nonNLS*/)){
+ switch(setting.getValueIndex()){
+ case 0 :
+ setMethodWithConstructorNameSeverity(ERROR);
+ break;
+ case 1 :
+ setMethodWithConstructorNameSeverity(WARNING);
+ break;
+ case 2 :
+ setMethodWithConstructorNameSeverity(IGNORE);
+ break;
+ }
+ }else if(optionID.equals(componentName + ".problemOverridingPackageDefaultMethod"/*nonNLS*/)){
+ switch(setting.getValueIndex()){
+ case 0 :
+ setOverriddenPackageDefaultMethodSeverity(ERROR);
+ break;
+ case 1 :
+ setOverriddenPackageDefaultMethodSeverity(WARNING);
+ break;
+ case 2 :
+ setOverriddenPackageDefaultMethodSeverity(IGNORE);
+ break;
+ }
+ }else if(optionID.equals(componentName + ".problemDeprecation"/*nonNLS*/)){
+ switch(setting.getValueIndex()){
+ case 0 :
+ setDeprecationUseSeverity(ERROR);
+ break;
+ case 1 :
+ setDeprecationUseSeverity(WARNING);
+ break;
+ case 2 :
+ setDeprecationUseSeverity(IGNORE);
+ break;
+ }
+ }else if(optionID.equals(componentName + ".problemHiddenCatchBlock"/*nonNLS*/)){
+ switch(setting.getValueIndex()){
+ case 0 :
+ setMaskedCatchBlockSeverity(ERROR);
+ break;
+ case 1 :
+ setMaskedCatchBlockSeverity(WARNING);
+ break;
+ case 2 :
+ setMaskedCatchBlockSeverity(IGNORE);
+ break;
+ }
+ }else if(optionID.equals(componentName + ".problemUnusedLocal"/*nonNLS*/)){
+ switch(setting.getValueIndex()){
+ case 0 :
+ setUnusedLocalVariableSeverity(ERROR);
+ break;
+ case 1 :
+ setUnusedLocalVariableSeverity(WARNING);
+ break;
+ case 2 :
+ setUnusedLocalVariableSeverity(IGNORE);
+ break;
+ }
+ }else if(optionID.equals(componentName + ".problemUnusedParameter"/*nonNLS*/)){
+ switch(setting.getValueIndex()){
+ case 0 :
+ setUnusedArgumentSeverity(ERROR);
+ break;
+ case 1 :
+ setUnusedArgumentSeverity(WARNING);
+ break;
+ case 2 :
+ setUnusedArgumentSeverity(IGNORE);
+ break;
+ }
+ }else if(optionID.equals(componentName + ".problemSyntheticAccessEmulation"/*nonNLS*/)){
+ switch(setting.getValueIndex()){
+ case 0 :
+ setAccessEmulationSeverity(ERROR);
+ break;
+ case 1 :
+ setAccessEmulationSeverity(WARNING);
+ break;
+ case 2 :
+ setAccessEmulationSeverity(IGNORE);
+ break;
+ }
+ }else if(optionID.equals(componentName + ".problemNonExternalizedStringLiteral"/*nonNLS*/)){
+ switch(setting.getValueIndex()){
+ case 0 :
+ setNonExternalizedStringLiteralSeverity(ERROR);
+ break;
+ case 1 :
+ setNonExternalizedStringLiteralSeverity(WARNING);
+ break;
+ case 2 :
+ setNonExternalizedStringLiteralSeverity(IGNORE);
+ break;
+ }
+ }else if(optionID.equals(componentName + ".problemAssertIdentifier"/*nonNLS*/)){
+ switch(setting.getValueIndex()){
+ case 0 :
+ setAssertIdentifierSeverity(ERROR);
+ break;
+ case 1 :
+ setAssertIdentifierSeverity(WARNING);
+ break;
+ case 2 :
+ setAssertIdentifierSeverity(IGNORE);
+ break;
+ }
+ }else if(optionID.equals(componentName + ".source"/*nonNLS*/)){
+ setAssertMode(setting.getValueIndex() == 1);
}
}
+
public void setTargetJDK(int vmID) {
this.targetJDK = vmID;
}
-
-public void setAssertMode(boolean assertMode) {
- this.assertMode = assertMode;
-}
-
public void setVerboseMode(boolean flag) {
this.verbose = flag;
}
+public void setAssertMode(boolean assertMode) {
+ this.assertMode = assertMode;
+}
public void setWarningThreshold(int warningMask) {
this.warningThreshold = warningMask;
}
@@ -527,28 +624,4 @@ public String toString() {
buf.append("\n-runtime exception name for compile error : "/*nonNLS*/ + runtimeExceptionNameForCompileError);
return buf.toString();
}
-
-public void handleNonExternalizedStringLiteralAsWarning(boolean flag) {
- if (flag) {
- warningThreshold |= NonExternalizedString;
- } else {
- warningThreshold &= ~NonExternalizedString;
- }
-}
-
-public boolean isNonExternalizedStringLiteralHandledAsWarning() {
- return (warningThreshold & NonExternalizedString) != 0;
-}
-
-public void handleAssertIdentifierAsWarning(boolean flag) {
- if (flag) {
- warningThreshold |= AssertUsedAsAnIdentifier;
- } else {
- warningThreshold &= ~AssertUsedAsAnIdentifier;
- }
-}
-
-public boolean isAssertIdentifierHandledAsWarning() {
- return (warningThreshold & AssertUsedAsAnIdentifier) != 0;
-}
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/ConfigurableProblems.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/ConfigurableProblems.java
index ca927af95b..033843d507 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/ConfigurableProblems.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/ConfigurableProblems.java
@@ -9,7 +9,6 @@ import org.eclipse.jdt.internal.compiler.*;
public interface ConfigurableProblems {
final int UnreachableCode = 0x100;
- final int ParsingOptionalError = 0x200;
final int ImportProblem = 0x400;
final int MethodWithConstructorName = 0x1000;
final int OverriddenPackageDefaultMethod = 0x2000;

Back to the top