Update lint diagnostics to Uast 1.0.8
This commit is contained in:
@@ -973,8 +973,8 @@ public class UElementVisitor {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean visitDeclarationsExpression(UVariableDeclarationsExpression node) {
|
||||
List<VisitingDetector> list = mNodePsiTypeDetectors.get(UVariableDeclarationsExpression.class);
|
||||
public boolean visitDeclarationsExpression(UDeclarationsExpression node) {
|
||||
List<VisitingDetector> list = mNodePsiTypeDetectors.get(UDeclarationsExpression.class);
|
||||
if (list != null) {
|
||||
for (VisitingDetector v : list) {
|
||||
v.getVisitor().visitDeclarationsExpression(node);
|
||||
|
||||
@@ -28,7 +28,7 @@ import com.intellij.psi.*;
|
||||
import org.jetbrains.uast.*;
|
||||
import org.jetbrains.uast.expressions.UReferenceExpression;
|
||||
import org.jetbrains.uast.java.JavaAbstractUExpression;
|
||||
import org.jetbrains.uast.java.JavaUVariableDeclarationsExpression;
|
||||
import org.jetbrains.uast.java.JavaUDeclarationsExpression;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
@@ -301,7 +301,7 @@ public class UastLintUtils {
|
||||
if (element instanceof UExpression) {
|
||||
node = (UExpression) element;
|
||||
} else if (element instanceof UVariable) {
|
||||
node = new JavaUVariableDeclarationsExpression(
|
||||
node = new JavaUDeclarationsExpression(
|
||||
null, Collections.singletonList(((UVariable) element)));
|
||||
} else {
|
||||
throw new IllegalArgumentException("element must be an expression or an UVariable");
|
||||
|
||||
+3
-3
@@ -730,7 +730,7 @@ public class ConstantEvaluator {
|
||||
} else {
|
||||
return left.doubleValue() > right.doubleValue();
|
||||
}
|
||||
} else if (operator == UastBinaryOperator.GREATER_OR_EQUAL) {
|
||||
} else if (operator == UastBinaryOperator.GREATER_OR_EQUALS) {
|
||||
if (isInteger) {
|
||||
return left.longValue() >= right.longValue();
|
||||
} else {
|
||||
@@ -742,7 +742,7 @@ public class ConstantEvaluator {
|
||||
} else {
|
||||
return left.doubleValue() < right.doubleValue();
|
||||
}
|
||||
} else if (operator == UastBinaryOperator.LESS_OR_EQUAL) {
|
||||
} else if (operator == UastBinaryOperator.LESS_OR_EQUALS) {
|
||||
if (isInteger) {
|
||||
return left.longValue() <= right.longValue();
|
||||
} else {
|
||||
@@ -1162,7 +1162,7 @@ public class ConstantEvaluator {
|
||||
|
||||
private static boolean elementHasLevel(UElement node) {
|
||||
return !(node instanceof UBlockExpression
|
||||
|| node instanceof UVariableDeclarationsExpression);
|
||||
|| node instanceof UDeclarationsExpression);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user