Skip to content

Commit 1151f79

Browse files
committed
Kotlin: Apply some review feedback
1 parent 726a005 commit 1151f79

File tree

4 files changed

+4
-10
lines changed

4 files changed

+4
-10
lines changed

java/ql/consistency-queries/cfgDeadEnds.ql

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ import semmle.code.java.ControlFlowGraph
44
predicate shouldBeDeadEnd(ControlFlowNode n) {
55
n instanceof BreakStmt and n.getFile().isKotlinSourceFile() // TODO
66
or
7-
n instanceof ReturnStmt and n.getFile().isKotlinSourceFile() // TODO
8-
or
97
n instanceof Interface // TODO
108
or
119
n instanceof Class // TODO

java/ql/consistency-queries/children.ql

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,7 @@ predicate gapInChildren(Element e, int i) {
4646

4747
predicate lateFirstChild(Element e, int i) {
4848
i > 0 and
49-
exists(nthChildOf(e, i)) and
50-
forex(int j | exists(nthChildOf(e, j)) | j >= i) and
49+
i = min(int j | exists(nthChildOf(e, j))) and
5150
// A wildcard type access can be `?` with no children,
5251
// `? extends T` with only a child 0, or `? super T`
5352
// with only a child 1.

java/ql/lib/semmle/code/java/Expr.qll

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*/
44

55
import java
6-
import semmle.code.java.frameworks.android.Compose
6+
private import semmle.code.java.frameworks.android.Compose
77

88
/** A common super-class that represents all kinds of expressions. */
99
class Expr extends ExprParent, @expr {
@@ -2349,10 +2349,9 @@ class Argument extends Expr {
23492349
*/
23502350
predicate isNthVararg(int arrayindex) {
23512351
not this.isExplicitVarargsArray() and
2352-
exists(Callable tgt, Parameter varargsParam, int varargsParamPos |
2352+
exists(Callable tgt, int varargsParamPos |
23532353
call.getCallee() = tgt and
2354-
tgt.getParameter(varargsParamPos) = varargsParam and
2355-
varargsParam.isVarargs() and
2354+
tgt.getParameter(varargsParamPos).isVarargs() and
23562355
arrayindex = pos - varargsParamPos and
23572356
arrayindex >= 0 and
23582357
arrayindex <= (call.getNumArgument() - tgt.getNumberOfParameters())

java/ql/lib/semmle/code/java/frameworks/android/Compose.qll

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ import java
99
* This always returns a constant expression and can be considered as such.
1010
*/
1111
class LiveLiteral extends MethodAccess {
12-
CompileTimeConstantExpr value;
13-
1412
LiveLiteral() {
1513
this.getMethod() instanceof LiveLiteralMethod and
1614
not this.getEnclosingCallable() instanceof LiveLiteralMethod

0 commit comments

Comments
 (0)