Skip to content

Commit 04e04b3

Browse files
author
Sauyon Lee
committed
Use array allocation syntax
1 parent 97faeb0 commit 04e04b3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

java/ql/src/utils/FlowTestCaseSupportMethods.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -383,12 +383,12 @@ private class ArrayGenMethod extends GenMethod {
383383
ArrayGenMethod() { this = type.getName() + "genmethod" }
384384

385385
override predicate appliesTo(Type t, Content c) {
386-
replaceTypeVariable(t.(Array).getElementType()) = type.getElementType() and
386+
replaceTypeVariable(t.(Array).getComponentType()) = type.getComponentType() and
387387
c instanceof ArrayContent
388388
}
389389

390390
bindingset[arg]
391391
override string getCall(string arg) {
392-
result = "{" + getConvertExprIfNotObject(type.getElementType()) + arg + "}"
392+
result = "new " + getShortNameIfPossible(type) + "{" + getConvertExprIfNotObject(type.getComponentType()) + arg + "}"
393393
}
394394
}

0 commit comments

Comments
 (0)