Fix node positions of ASTSwitchLabeled* nodes
Note: this is a temporary fix. A more general fix is in branch java-grammar
This commit is contained in:
@ -231,6 +231,8 @@ public abstract class AbstractNode implements Node {
|
||||
|
||||
public void jjtSetFirstToken(final GenericToken token) {
|
||||
this.firstToken = token;
|
||||
this.beginLine = token.getBeginLine();
|
||||
this.beginColumn = token.getBeginColumn();
|
||||
}
|
||||
|
||||
public GenericToken jjtGetLastToken() {
|
||||
|
@ -4,6 +4,8 @@
|
||||
|
||||
package net.sourceforge.pmd.lang.java.ast;
|
||||
|
||||
import net.sourceforge.pmd.lang.ast.AbstractNode;
|
||||
|
||||
public class ASTSwitchLabeledBlock extends AbstractJavaNode implements ASTSwitchLabeledRule {
|
||||
|
||||
ASTSwitchLabeledBlock(int id) {
|
||||
@ -18,4 +20,13 @@ public class ASTSwitchLabeledBlock extends AbstractJavaNode implements ASTSwitch
|
||||
public Object jjtAccept(JavaParserVisitor visitor, Object data) {
|
||||
return visitor.visit(this, data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void jjtClose() {
|
||||
super.jjtClose();
|
||||
if (jjtGetNumChildren() > 0) {
|
||||
AbstractNode firstChild = (AbstractNode) jjtGetChild(0);
|
||||
jjtSetFirstToken(firstChild.jjtGetFirstToken());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4,6 +4,8 @@
|
||||
|
||||
package net.sourceforge.pmd.lang.java.ast;
|
||||
|
||||
import net.sourceforge.pmd.lang.ast.AbstractNode;
|
||||
|
||||
public class ASTSwitchLabeledExpression extends AbstractJavaNode implements ASTSwitchLabeledRule {
|
||||
|
||||
ASTSwitchLabeledExpression(int id) {
|
||||
@ -18,4 +20,13 @@ public class ASTSwitchLabeledExpression extends AbstractJavaNode implements ASTS
|
||||
public Object jjtAccept(JavaParserVisitor visitor, Object data) {
|
||||
return visitor.visit(this, data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void jjtClose() {
|
||||
super.jjtClose();
|
||||
if (jjtGetNumChildren() > 0) {
|
||||
AbstractNode firstChild = (AbstractNode) jjtGetChild(0);
|
||||
jjtSetFirstToken(firstChild.jjtGetFirstToken());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4,6 +4,8 @@
|
||||
|
||||
package net.sourceforge.pmd.lang.java.ast;
|
||||
|
||||
import net.sourceforge.pmd.lang.ast.AbstractNode;
|
||||
|
||||
public class ASTSwitchLabeledThrowStatement extends AbstractJavaNode implements ASTSwitchLabeledRule {
|
||||
|
||||
ASTSwitchLabeledThrowStatement(int id) {
|
||||
@ -18,4 +20,13 @@ public class ASTSwitchLabeledThrowStatement extends AbstractJavaNode implements
|
||||
public Object jjtAccept(JavaParserVisitor visitor, Object data) {
|
||||
return visitor.visit(this, data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void jjtClose() {
|
||||
super.jjtClose();
|
||||
if (jjtGetNumChildren() > 0) {
|
||||
AbstractNode firstChild = (AbstractNode) jjtGetChild(0);
|
||||
jjtSetFirstToken(firstChild.jjtGetFirstToken());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user