mirror of
https://github.com/github/codeql.git
synced 2026-07-15 08:18:18 +02:00
Merge pull request #20328 from michaelnebel/java/ql4ql
Java: Fix some Ql4Ql violations.
This commit is contained in:
@@ -470,7 +470,8 @@ private predicate enhancedForStmtStep(Node node1, Node node2, Type containerType
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if the step from `node1` to `node2` reads a value from an array.
|
||||
* Holds if the step from `node1` to `node2` reads a value from an array, where
|
||||
* the elements are of type `elemType`.
|
||||
* This covers ordinary array reads as well as array iteration through enhanced
|
||||
* `for` statements.
|
||||
*/
|
||||
|
||||
@@ -263,8 +263,8 @@ class Content extends TContent {
|
||||
|
||||
/**
|
||||
* Holds if this element is at the specified location.
|
||||
* The location spans column `startcolumn` of line `startline` to
|
||||
* column `endcolumn` of line `endline` in file `filepath`.
|
||||
* The location spans column `sc` of line `sl` to
|
||||
* column `ec` of line `el` in file `path`.
|
||||
* For more information, see
|
||||
* [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/).
|
||||
*/
|
||||
@@ -362,8 +362,8 @@ class ContentSet instanceof Content {
|
||||
|
||||
/**
|
||||
* Holds if this element is at the specified location.
|
||||
* The location spans column `startcolumn` of line `startline` to
|
||||
* column `endcolumn` of line `endline` in file `filepath`.
|
||||
* The location spans column `sc` of line `sl` to
|
||||
* column `ec` of line `el` in file `path`.
|
||||
* For more information, see
|
||||
* [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/).
|
||||
*/
|
||||
|
||||
@@ -204,7 +204,7 @@ private module Impl {
|
||||
/** Gets the character value of expression `e`. */
|
||||
string getCharValue(Expr e) { result = e.(CharacterLiteral).getValue() }
|
||||
|
||||
/** Gets the constant `float` value of non-`ConstantIntegerExpr` expressions. */
|
||||
/** Gets the constant `float` value of non-`ConstantIntegerExpr` expression `e`. */
|
||||
float getNonIntegerValue(Expr e) {
|
||||
result = e.(LongLiteral).getValue().toFloat() or
|
||||
result = e.(FloatLiteral).getValue().toFloat() or
|
||||
@@ -256,12 +256,12 @@ private module Impl {
|
||||
exists(EnhancedForStmt for | def = for.getVariable())
|
||||
}
|
||||
|
||||
/** Returns the operand of the operation if `def` is a decrement. */
|
||||
/** Returns the operand of the operation if `e` is a decrement. */
|
||||
Expr getDecrementOperand(Element e) {
|
||||
result = e.(PostDecExpr).getExpr() or result = e.(PreDecExpr).getExpr()
|
||||
}
|
||||
|
||||
/** Returns the operand of the operation if `def` is an increment. */
|
||||
/** Returns the operand of the operation if `e` is an increment. */
|
||||
Expr getIncrementOperand(Element e) {
|
||||
result = e.(PostIncExpr).getExpr() or result = e.(PreIncExpr).getExpr()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user