[visualforce] Remove deprecated classes/methods

This commit is contained in:
Andreas Dangel 2024-02-02 12:42:26 +01:00
parent 7494260ffc
commit 2a59be965a
No known key found for this signature in database
GPG Key ID: 93450DF2DF9A3FA3
7 changed files with 16 additions and 97 deletions

View File

@ -251,6 +251,14 @@ The following previously deprecated classes have been removed:
* Method `getNode()` has been removed. The underlying node is only available in AST nodes, but not in rule implementations.
* {%jdoc !!scala::lang.scala.ast.AbstractScalaNode %} - method `getNode()` has been removed. AST nodes still have access
to the underlying Scala node via the protected property `node`.
* pmd-visualforce
* {%jdoc !!visualforce::lang.vf.ast.VfNode %} - method `jjtAccept()` has been removed.
Use {%jdoc core::lang.ast.Node#acceptVisitor(core::lang.ast.AstVisitor,P) %} instead.
* `net.sourceforge.pmd.lang.vf.ast.VfParserVisitor`
Use {%jdoc visualforce::lang.vf.ast.VfVisitor %} or {%jdoc visualforce::lang.vf.ast.VfVisitorBase %} instead.
* `net.sourceforge.pmd.lang.vf.ast.VfParserVisitorAdapter`
* {%jdoc !!visualforce::lang.vf.DataType %} - method `fromBasicType(BasicType)` has been removed.
Use {%jdoc visualforce::lang.vf.DataType#fromTypeName(java.lang.String) %} instead.
* pmd-vm
* {%jdoc !!vm::lang.vm.ast.VmNode %} - method `jjtAccept()` has been removed.
Use {%jdoc core::lang.ast.Node#acceptVisitor(core::lang.ast.AstVisitor,P) %} instead.

View File

@ -14,8 +14,6 @@ import java.util.Set;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import apex.jorje.semantic.symbol.type.BasicType;
/**
* Represents all data types that can be referenced from a Visualforce page. This enum consolidates the data types
* available to CustomFields and Apex. It uses the naming convention of CustomFields.
@ -106,42 +104,6 @@ public enum DataType {
return dataType;
}
/**
* Map to correct instance, returns {@code Unknown} if the value can't be mapped.
*
* @deprecated Use {@link #fromTypeName(String)} instead.
*/
@Deprecated
public static DataType fromBasicType(BasicType value) {
if (value != null) {
switch (value) {
case BOOLEAN:
return Checkbox;
case CURRENCY:
return Currency;
case DATE:
return Date;
case DATE_TIME:
return DateTime;
case ID:
return Lookup;
case DECIMAL:
case DOUBLE:
case INTEGER:
case LONG:
return Number;
case STRING:
return Text;
case TIME:
return Time;
default:
break;
}
}
LOG.debug("Unable to determine DataType of {}", value);
return Unknown;
}
/**
* Map to correct instance, returns {@code Unknown} if the value can't be mapped.
*/

View File

@ -4,21 +4,7 @@
package net.sourceforge.pmd.lang.vf.ast;
import net.sourceforge.pmd.annotation.DeprecatedUntil700;
import net.sourceforge.pmd.lang.ast.AstVisitor;
import net.sourceforge.pmd.lang.ast.impl.javacc.JjtreeNode;
public interface VfNode extends JjtreeNode<VfNode> {
/**
* Accept the visitor.
*
* @deprecated Use {@link #acceptVisitor(AstVisitor, Object)}
*/
@Deprecated
@DeprecatedUntil700
default Object jjtAccept(VfParserVisitor visitor, Object data) {
return acceptVisitor(visitor, data);
}
}

View File

@ -1,19 +0,0 @@
/*
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
*/
package net.sourceforge.pmd.lang.vf.ast;
import net.sourceforge.pmd.annotation.DeprecatedUntil700;
import net.sourceforge.pmd.lang.ast.Node;
@Deprecated
@DeprecatedUntil700
public interface VfParserVisitor extends VfVisitor<Object, Object> {
@Override
default Object visitNode(Node node, Object param) {
node.children().forEach(it -> it.acceptVisitor(this, param));
return param;
}
}

View File

@ -1,13 +0,0 @@
/*
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
*/
package net.sourceforge.pmd.lang.vf.ast;
import net.sourceforge.pmd.annotation.DeprecatedUntil700;
@Deprecated
@DeprecatedUntil700
public class VfParserVisitorAdapter extends VfVisitorBase<Object, Object> implements VfParserVisitor {
}

View File

@ -7,12 +7,18 @@ package net.sourceforge.pmd.lang.vf.rule;
import net.sourceforge.pmd.RuleContext;
import net.sourceforge.pmd.lang.ast.Node;
import net.sourceforge.pmd.lang.rule.AbstractRule;
import net.sourceforge.pmd.lang.vf.ast.VfParserVisitor;
import net.sourceforge.pmd.lang.vf.ast.VfVisitor;
public abstract class AbstractVfRule extends AbstractRule implements VfParserVisitor {
public abstract class AbstractVfRule extends AbstractRule implements VfVisitor<Object, Object> {
@Override
public void apply(Node target, RuleContext ctx) {
target.acceptVisitor(this, ctx);
}
@Override
public Object visitNode(Node node, Object param) {
node.children().forEach(n -> n.acceptVisitor(this, param));
return param;
}
}

View File

@ -10,8 +10,6 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
import org.junit.jupiter.api.Test;
import apex.jorje.semantic.symbol.type.BasicType;
class DataTypeTest {
@Test
void testFromString() {
@ -33,15 +31,6 @@ class DataTypeTest {
assertEquals(DataType.Unknown, DataType.fromTypeName(null));
}
@Test
void testDeprecatedFromBasicType() {
assertEquals(DataType.Checkbox, DataType.fromBasicType(BasicType.BOOLEAN));
assertEquals(DataType.Number, DataType.fromBasicType(BasicType.DECIMAL));
assertEquals(DataType.Number, DataType.fromBasicType(BasicType.DOUBLE));
assertEquals(DataType.Unknown, DataType.fromBasicType(BasicType.APEX_OBJECT));
assertEquals(DataType.Unknown, DataType.fromBasicType(null));
}
@Test
void testRequiresEncoding() {
assertFalse(DataType.AutoNumber.requiresEscaping);