/** * Create a filter based on problem settings. * * @param problemSettings The settings, may not be null. */ public ProblemSettingsFilter(ICompilerProblemSettings problemSettings) { assert problemSettings != null : "Settings may not be null"; this.problemSettings = problemSettings; init(); }
/** * Enable or disable strict semantics mode diagnostics. * @param isStrict - if true, strict semantics mode * diagnostics will appear in the filtered diagnostics. */ private void setShowStrictSemantics(boolean isStrict) { setShowProblemByClass(StrictSemanticsProblem.class, isStrict); }
/** * initialize filter from problem settings. */ private void init() { setShowStrictSemantics(problemSettings.isStrict()); setShowWarnings(problemSettings.showActionScriptWarnings()); setShowDeprecationWarnings(problemSettings.showDeprecationWarnings()); setShowBindingWarnings(problemSettings.showBindingWarnings()); setShowMultipleDefinitionWarnings(problemSettings.showMultipleDefinitionWarnings()); setShowUnusedTypeSelectorWarnings(problemSettings.showUnusedTypeSelectorWarnings()); setAllowSourcePathOverlapWarnings(problemSettings.isSourcePathOverlapAllowed()); setShowActionScriptWarnings(); }
/** * Get an iterator over the set of problems that * are to be reported based on the current settings. * * @param filter - the filter to apply. * * @return an Iterable<ICompilerProblem> over the * subset of problems that are of interest to the client. */ private Iterable<ICompilerProblem> getFilteredProblems(IProblemFilter filter) { if (problemSettings != null) filter = CompositeProblemFilter.and(filter, new ProblemSettingsFilter(problemSettings)); // Sort the problems so that the semantic cascade // filter can find semantic problems that occur // on the same line as parser problems. sortProblems(); return getProblemView(filter); }
private void setShowActionScriptWarnings() { // Associate compiler problems with the compiler -warn-xxx options // that enable/disable them. setShowActionScriptWarning(AssignmentInConditionalProblem.class, ICompilerSettings.WARN_ASSIGNMENT_WITHIN_CONDITIONAL); setShowActionScriptWarning(ArrayCastProblem.class, ICompilerSettings.WARN_BAD_ARRAY_CAST); setShowActionScriptWarning(DateCastProblem.class, ICompilerSettings.WARN_BAD_DATE_CAST); setShowActionScriptWarning(IllogicalComparionWithNaNProblem.class, ICompilerSettings.WARN_BAD_NAN_COMPARISON); setShowActionScriptWarning(NullUsedWhereOtherExpectedProblem.class, ICompilerSettings.WARN_BAD_NULL_ASSIGNMENT); setShowActionScriptWarning(IllogicalComparisonWithUndefinedProblem.class, ICompilerSettings.WARN_BAD_UNDEFINED_COMPARISON); setShowActionScriptWarning(ConstNotInitializedProblem.class, ICompilerSettings.WARN_CONST_NOT_INITIALIZED); setShowActionScriptWarning(DuplicateVariableDefinitionProblem.class, ICompilerSettings.WARN_DUPLICATE_VARIABLE_DEF); setShowActionScriptWarning(InstanceOfProblem.class, ICompilerSettings.WARN_INSTANCEOF_CHANGES); setShowActionScriptWarning(ScopedToDefaultNamespaceProblem.class, ICompilerSettings.WARN_MISSING_NAMESPACE_DECL); setShowActionScriptWarning(VariableHasNoTypeDeclarationProblem.class, ICompilerSettings.WARN_NO_TYPE_DECL); }
/** * initialize filter from problem settings. */ private void init() { setShowStrictSemantics(problemSettings.isStrict()); setShowWarnings(problemSettings.showActionScriptWarnings()); setShowDeprecationWarnings(problemSettings.showDeprecationWarnings()); setShowBindingWarnings(problemSettings.showBindingWarnings()); setShowMultipleDefinitionWarnings(problemSettings.showMultipleDefinitionWarnings()); setShowUnusedTypeSelectorWarnings(problemSettings.showUnusedTypeSelectorWarnings()); setAllowSourcePathOverlapWarnings(problemSettings.isSourcePathOverlapAllowed()); setShowActionScriptWarnings(); }
/** * Get an iterator over the set of problems that * are to be reported based on the current settings. * * @param filter - the filter to apply. * * @return an Iterable<ICompilerProblem> over the * subset of problems that are of interest to the client. */ private Iterable<ICompilerProblem> getFilteredProblems(IProblemFilter filter) { if (problemSettings != null) filter = CompositeProblemFilter.and(filter, new ProblemSettingsFilter(problemSettings)); // Sort the problems so that the semantic cascade // filter can find semantic problems that occur // on the same line as parser problems. sortProblems(); return getProblemView(filter); }
private void setShowActionScriptWarnings() { // Associate compiler problems with the compiler -warn-xxx options // that enable/disable them. setShowActionScriptWarning(AssignmentInConditionalProblem.class, ICompilerSettings.WARN_ASSIGNMENT_WITHIN_CONDITIONAL); setShowActionScriptWarning(ArrayCastProblem.class, ICompilerSettings.WARN_BAD_ARRAY_CAST); setShowActionScriptWarning(DateCastProblem.class, ICompilerSettings.WARN_BAD_DATE_CAST); setShowActionScriptWarning(IllogicalComparionWithNaNProblem.class, ICompilerSettings.WARN_BAD_NAN_COMPARISON); setShowActionScriptWarning(NullUsedWhereOtherExpectedProblem.class, ICompilerSettings.WARN_BAD_NULL_ASSIGNMENT); setShowActionScriptWarning(IllogicalComparisonWithUndefinedProblem.class, ICompilerSettings.WARN_BAD_UNDEFINED_COMPARISON); setShowActionScriptWarning(ConstNotInitializedProblem.class, ICompilerSettings.WARN_CONST_NOT_INITIALIZED); setShowActionScriptWarning(DuplicateVariableDefinitionProblem.class, ICompilerSettings.WARN_DUPLICATE_VARIABLE_DEF); setShowActionScriptWarning(InstanceOfProblem.class, ICompilerSettings.WARN_INSTANCEOF_CHANGES); setShowActionScriptWarning(ScopedToDefaultNamespaceProblem.class, ICompilerSettings.WARN_MISSING_NAMESPACE_DECL); setShowActionScriptWarning(VariableHasNoTypeDeclarationProblem.class, ICompilerSettings.WARN_NO_TYPE_DECL); }
/** * Enable or disable deprecation warnings. * @param showWarnings - if true, deprecation warnings * will appear in the filtered diagnostics. */ private void setShowDeprecationWarnings(boolean showWarnings) { setShowProblemByClass(AbstractDeprecatedAPIProblem.class, showWarnings); setShowProblemByClass(DeprecatedConfigurationOptionProblem.class, showWarnings); }
/** * Create a filter based on problem settings. * * @param problemSettings The settings, may not be null. */ public ProblemSettingsFilter(ICompilerProblemSettings problemSettings) { assert problemSettings != null : "Settings may not be null"; this.problemSettings = problemSettings; init(); }
/** * Enable or disable strict semantics mode diagnostics. * @param isStrict - if true, strict semantics mode * diagnostics will appear in the filtered diagnostics. */ private void setShowStrictSemantics(boolean isStrict) { setShowProblemByClass(StrictSemanticsProblem.class, isStrict); }
/** * Enable or disable semantic warnings. * @param showWarnings - if true, semantic warnings * will appear in the filtered diagnostics. */ private void setShowWarnings(boolean showWarnings) { setShowProblemByClass(SemanticWarningProblem.class, showWarnings); }
/** * Enable or disable deprecation warnings. * @param showWarnings - if true, deprecation warnings * will appear in the filtered diagnostics. */ private void setShowDeprecationWarnings(boolean showWarnings) { setShowProblemByClass(AbstractDeprecatedAPIProblem.class, showWarnings); setShowProblemByClass(DeprecatedConfigurationOptionProblem.class, showWarnings); }
/** * Enable or disable semantic warnings. * @param showWarnings - if true, semantic warnings * will appear in the filtered diagnostics. */ private void setShowWarnings(boolean showWarnings) { setShowProblemByClass(SemanticWarningProblem.class, showWarnings); }
private void setShowMultipleDefinitionWarnings(boolean b) { setShowProblemByClass(DuplicateQNameInSourcePathProblem.class, b); }
private void setAllowSourcePathOverlapWarnings(boolean isSourcePathOverlapAllowed) { setShowProblemByClass(OverlappingSourcePathProblem.class, !isSourcePathOverlapAllowed); }
private void setShowMultipleDefinitionWarnings(boolean b) { setShowProblemByClass(DuplicateQNameInSourcePathProblem.class, b); }
private void setAllowSourcePathOverlapWarnings(boolean isSourcePathOverlapAllowed) { setShowProblemByClass(OverlappingSourcePathProblem.class, !isSourcePathOverlapAllowed); }
/** * Hide/show actionscript warnings based on compiler option settings. * * @param problem * @param warningCode */ private void setShowActionScriptWarning(Class<? extends ICompilerProblem> problem, int warningCode) { setShowProblemByClass(problem, problemSettings.checkActionScriptWarning(warningCode)); }
/** * Hide/show actionscript warnings based on compiler option settings. * * @param problem * @param warningCode */ private void setShowActionScriptWarning(Class<? extends ICompilerProblem> problem, int warningCode) { setShowProblemByClass(problem, problemSettings.checkActionScriptWarning(warningCode)); }