@Override protected void initialize(IAcceptor<PreferenceKey> acceptor) { acceptor.accept(create(INVALID_ACTION_USAGE, SeverityConverter.SEVERITY_ERROR)); acceptor.accept(create(EMPTY_ENUM_LITERAL, SeverityConverter.SEVERITY_ERROR)); acceptor.accept(create(EMPTY_KEYWORD, SeverityConverter.SEVERITY_ERROR)); acceptor.accept(create(SPACES_IN_KEYWORD, SeverityConverter.SEVERITY_WARNING)); acceptor.accept(create(INVALID_HIDDEN_TOKEN, SeverityConverter.SEVERITY_ERROR)); acceptor.accept(create(INVALID_HIDDEN_TOKEN_FRAGMENT, SeverityConverter.SEVERITY_ERROR)); acceptor.accept(create(INVALID_PACKAGE_REFERENCE_INHERITED, SeverityConverter.SEVERITY_ERROR)); acceptor.accept(create(CROSS_REFERENCE_IN_ALTERNATIVES, SeverityConverter.SEVERITY_ERROR)); acceptor.accept(create(INVALID_METAMODEL_NAME, SeverityConverter.SEVERITY_WARNING)); acceptor.accept(create(INVALID_PACKAGE_REFERENCE_EXTERNAL, SeverityConverter.SEVERITY_WARNING)); acceptor.accept(create(INVALID_PACKAGE_REFERENCE_NOT_ON_CLASSPATH, SeverityConverter.SEVERITY_WARNING)); acceptor.accept(create(INVALID_TERMINALRULE_NAME, SeverityConverter.SEVERITY_WARNING)); acceptor.accept(create(DUPLICATE_ENUM_LITERAL, SeverityConverter.SEVERITY_WARNING)); acceptor.accept(create(BIDIRECTIONAL_REFERENCE, SeverityConverter.SEVERITY_WARNING)); acceptor.accept(create(DISCOURAGED_RULE_NAME, SeverityConverter.SEVERITY_WARNING)); }
/** * Returns decoded delegation key or <code>null</code> if encodedValue can not be parsed. * @return {@link Pair} where getFirst() is delegationKey and getSecond() is the defaultSeverity. * @see XbaseSeverityConverter#encodeDefaultSeverity(String, String) */ public static Pair<String, String> decodeDelegationKey(String encodedValue) { List<String> split = Strings.split(encodedValue, DEFAULT_SEVERITY_SEPARATOR); if (split.size() == 2) { return Tuples.create(split.get(0), split.get(1)); } else if (split.size() == 1) { return Tuples.create(split.get(0), SeverityConverter.SEVERITY_WARNING); } else { return null; } }
@Override protected void initialize(IAcceptor<PreferenceKey> iAcceptor) { iAcceptor.accept(create(IssueCodes.NULL_SAFE_FEATURE_CALL_OF_PRIMITIVE_VALUED_FEATURE, SeverityConverter.SEVERITY_WARNING)); iAcceptor.accept(createDelegate(IssueCodes.INSTANCE_ACCESS_TO_STATIC_MEMBER, COMPILER_PB_STATIC_ACCESS_RECEIVER)); iAcceptor.accept(create(IssueCodes.UNHANDLED_EXCEPTION, SeverityConverter.SEVERITY_IGNORE)); iAcceptor.accept(create(IssueCodes.EQUALS_WITH_NULL, SeverityConverter.SEVERITY_WARNING)); iAcceptor.accept(createDelegate(IssueCodes.FORBIDDEN_REFERENCE, COMPILER_PB_FORBIDDEN_REFERENCE)); iAcceptor.accept(createDelegate(IssueCodes.DISCOURAGED_REFERENCE, COMPILER_PB_DISCOURAGED_REFERENCE)); iAcceptor.accept(create(IssueCodes.IMPORT_WILDCARD_DEPRECATED, SeverityConverter.SEVERITY_WARNING)); iAcceptor.accept(createDelegate(IssueCodes.OBSOLETE_INSTANCEOF, COMPILER_PB_UNNECESSARY_TYPE_CHECK)); iAcceptor.accept(createDelegate(IssueCodes.OBSOLETE_CAST, COMPILER_PB_UNNECESSARY_TYPE_CHECK)); iAcceptor.accept(createDelegate(IssueCodes.IMPORT_UNUSED, COMPILER_PB_UNUSED_IMPORT)); iAcceptor.accept(createDelegate(IssueCodes.UNUSED_LOCAL_VARIABLE, COMPILER_PB_UNUSED_LOCAL)); iAcceptor.accept(create(IssueCodes.IMPORT_DUPLICATE, SeverityConverter.SEVERITY_WARNING)); iAcceptor.accept(create(IssueCodes.VARIABLE_NAME_DISCOURAGED, SeverityConverter.SEVERITY_WARNING)); iAcceptor.accept(create(IssueCodes.IMPORT_UNRESOLVED, SeverityConverter.SEVERITY_ERROR)); iAcceptor.accept(create(IssueCodes.JAVA_STYLE_TYPE_CAST, SeverityConverter.SEVERITY_ERROR)); iAcceptor.accept(create(IssueCodes.SUSPICIOUSLY_OVERLOADED_FEATURE, SeverityConverter.SEVERITY_WARNING)); iAcceptor.accept(create(IssueCodes.CONSTANT_BOOLEAN_CONDITION, SeverityConverter.SEVERITY_WARNING)); iAcceptor.accept(create(IssueCodes.UNREACHABLE_CASE, SeverityConverter.SEVERITY_ERROR)); iAcceptor.accept(create(IssueCodes.UNREACHABLE_IF_BLOCK, SeverityConverter.SEVERITY_ERROR)); iAcceptor.accept(create(IssueCodes.INCOMPLETE_CASES_ON_ENUM, SeverityConverter.SEVERITY_WARNING)); iAcceptor.accept(create(IssueCodes.OPERATION_WITHOUT_PARENTHESES, SeverityConverter.SEVERITY_IGNORE)); iAcceptor.accept(create(IssueCodes.COPY_JAVA_PROBLEMS, SeverityConverter.SEVERITY_IGNORE)); iAcceptor.accept(createDelegate(IssueCodes.DEPRECATED_MEMBER_REFERENCE, COMPILER_PB_DEPRECATION)); iAcceptor.accept(create(IssueCodes.DUPLICATE_TYPE, SeverityConverter.SEVERITY_ERROR)); iAcceptor.accept(create(IssueCodes.UNQUALIFIED_SUPER_CALL, getUnqualifiedSuperCallSeverity())); iAcceptor.accept(create(IssueCodes.ABSTRACT_METHOD_INVOCATION, getAbstractMethodInvocationSeverity())); }
@SuppressWarnings("javadoc") public N4JSIssueSeverities(IPreferenceValues preferenceValues, Map<String, PreferenceKey> configurableIssueCodes, SeverityConverter converter) { super(preferenceValues, configurableIssueCodes, converter); this.configurableIssueCodes = configurableIssueCodes; }
@SuppressWarnings("javadoc") public N4MFIssueSeverities(IPreferenceValues preferenceValues, Map<String, PreferenceKey> configurableIssueCodes, SeverityConverter converter) { super(preferenceValues, configurableIssueCodes, converter); this.configurableIssueCodes = configurableIssueCodes; }
protected String getUnqualifiedSuperCallSeverity() { return SeverityConverter.SEVERITY_IGNORE; }
protected String getAbstractMethodInvocationSeverity() { return SeverityConverter.SEVERITY_IGNORE; }
protected PreferenceKey createDelegate(String id, String delegationKey) { return createDelegate(id, delegationKey, SeverityConverter.SEVERITY_WARNING); }
public Class<? extends SeverityConverter> bindSeverityConverter() { return XbaseSeverityConverter.class; }
@Override protected void initialize(IAcceptor<PreferenceKey> iAcceptor) { super.initialize(iAcceptor); iAcceptor.accept(create(IssueCodes.SUSPICIOUSLY_OVERLOADED_FEATURE, SeverityConverter.SEVERITY_ERROR)); }