Remove usages of EnumeratedProperty

This commit is contained in:
Clément Fournier
2018-12-06 15:17:16 +01:00
parent 159095292c
commit 4962bc2831
6 changed files with 33 additions and 30 deletions

View File

@ -53,6 +53,10 @@ public class EcmascriptParserOptions extends ParserOptions {
// Note: The UI order values are chosen to be larger than those built into
// XPathRule.
// These aren't converted to the new property framework
// Do we need them anyway?
public static final BooleanProperty RECORDING_COMMENTS_DESCRIPTOR = new BooleanProperty("recordingComments",
"Specifies that comments are produced in the AST.", Boolean.TRUE, 3.0f);
public static final BooleanProperty RECORDING_LOCAL_JSDOC_COMMENTS_DESCRIPTOR = new BooleanProperty(

View File

@ -12,6 +12,7 @@ import net.sourceforge.pmd.lang.ParserOptions;
import net.sourceforge.pmd.lang.ast.Node;
import net.sourceforge.pmd.lang.ecmascript.EcmascriptLanguageModule;
import net.sourceforge.pmd.lang.ecmascript.EcmascriptParserOptions;
import net.sourceforge.pmd.lang.ecmascript.EcmascriptParserOptions.Version;
import net.sourceforge.pmd.lang.ecmascript.ast.ASTArrayComprehension;
import net.sourceforge.pmd.lang.ecmascript.ast.ASTArrayComprehensionLoop;
import net.sourceforge.pmd.lang.ecmascript.ast.ASTArrayLiteral;
@ -65,7 +66,6 @@ import net.sourceforge.pmd.lang.ecmascript.ast.EcmascriptNode;
import net.sourceforge.pmd.lang.ecmascript.ast.EcmascriptParserVisitor;
import net.sourceforge.pmd.lang.rule.AbstractRule;
import net.sourceforge.pmd.lang.rule.ImmutableLanguage;
import net.sourceforge.pmd.properties.EnumeratedProperty;
import net.sourceforge.pmd.properties.PropertyDescriptor;
@ -74,10 +74,11 @@ public abstract class AbstractEcmascriptRule extends AbstractRule
private static final PropertyDescriptor<Boolean> RECORDING_COMMENTS_DESCRIPTOR = EcmascriptParserOptions.RECORDING_COMMENTS_DESCRIPTOR;
private static final PropertyDescriptor<Boolean> RECORDING_LOCAL_JSDOC_COMMENTS_DESCRIPTOR = EcmascriptParserOptions.RECORDING_LOCAL_JSDOC_COMMENTS_DESCRIPTOR;
private static final EnumeratedProperty<EcmascriptParserOptions.Version> RHINO_LANGUAGE_VERSION = EcmascriptParserOptions.RHINO_LANGUAGE_VERSION;
private static final PropertyDescriptor<Version> RHINO_LANGUAGE_VERSION = EcmascriptParserOptions.RHINO_LANGUAGE_VERSION;
public AbstractEcmascriptRule() {
super.setLanguage(LanguageRegistry.getLanguage(EcmascriptLanguageModule.NAME));
// Rule-specific parser options are not supported. What do we do?
definePropertyDescriptor(RECORDING_COMMENTS_DESCRIPTOR);
definePropertyDescriptor(RECORDING_LOCAL_JSDOC_COMMENTS_DESCRIPTOR);
definePropertyDescriptor(RHINO_LANGUAGE_VERSION);

View File

@ -8,8 +8,8 @@ import net.sourceforge.pmd.lang.LanguageRegistry;
import net.sourceforge.pmd.lang.ParserOptions;
import net.sourceforge.pmd.lang.ecmascript.EcmascriptLanguageModule;
import net.sourceforge.pmd.lang.ecmascript.EcmascriptParserOptions;
import net.sourceforge.pmd.lang.ecmascript.EcmascriptParserOptions.Version;
import net.sourceforge.pmd.lang.rule.XPathRule;
import net.sourceforge.pmd.properties.EnumeratedProperty;
import net.sourceforge.pmd.properties.PropertyDescriptor;
@ -17,7 +17,7 @@ public class EcmascriptXPathRule extends XPathRule {
private static final PropertyDescriptor<Boolean> RECORDING_COMMENTS_DESCRIPTOR = EcmascriptParserOptions.RECORDING_COMMENTS_DESCRIPTOR;
private static final PropertyDescriptor<Boolean> RECORDING_LOCAL_JSDOC_COMMENTS_DESCRIPTOR = EcmascriptParserOptions.RECORDING_LOCAL_JSDOC_COMMENTS_DESCRIPTOR;
private static final EnumeratedProperty<EcmascriptParserOptions.Version> RHINO_LANGUAGE_VERSION = EcmascriptParserOptions.RHINO_LANGUAGE_VERSION;
private static final PropertyDescriptor<Version> RHINO_LANGUAGE_VERSION = EcmascriptParserOptions.RHINO_LANGUAGE_VERSION;
public EcmascriptXPathRule() {
super.setLanguage(LanguageRegistry.getLanguage(EcmascriptLanguageModule.NAME));