Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2546963

Browse files
committed
Java: Autoformat qls.
1 parent 63a4dd0 commit 2546963

10 files changed

Lines changed: 36 additions & 12 deletions

File tree

java/ql/src/Likely Bugs/Arithmetic/CondExprTypes.ql

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212

1313
import java
1414

15-
class CharType extends PrimitiveType { CharType() { this.hasName("char") } }
15+
class CharType extends PrimitiveType {
16+
CharType() { this.hasName("char") }
17+
}
1618

1719
private Type getABranchType(ConditionalExpr ce) {
1820
result = ce.getTrueExpr().getType() or

java/ql/src/Likely Bugs/Concurrency/LazyInitStaticField.ql

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@
1616
import java
1717

1818
/** A comparison (using `==`) with `null`. */
19-
class NullEQExpr extends EQExpr { NullEQExpr() { exists(NullLiteral l | l.getParent() = this) } }
19+
class NullEQExpr extends EQExpr {
20+
NullEQExpr() { exists(NullLiteral l | l.getParent() = this) }
21+
}
2022

2123
/** An assignment to a static field. */
2224
class StaticFieldInit extends AssignExpr {

java/ql/src/Likely Bugs/Likely Typos/ContainerSizeCmpZero.ql

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ import semmle.code.java.Collections
1515
import semmle.code.java.Maps
1616

1717
/** A union of the possible kinds of container size calls. */
18-
abstract class SizeOfContainer extends Expr { abstract string getContainerKind(); }
18+
abstract class SizeOfContainer extends Expr {
19+
abstract string getContainerKind();
20+
}
1921

2022
/** A read access to the `length` field of an array. */
2123
class ArrayLengthRead extends FieldRead, SizeOfContainer {

java/ql/src/Performance/ConcatenationInLoops.ql

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ import semmle.code.java.Statement
1616
import semmle.code.java.JDK
1717

1818
/** A use of `+` that has type `String`. */
19-
class StringCat extends AddExpr { StringCat() { this.getType() instanceof TypeString } }
19+
class StringCat extends AddExpr {
20+
StringCat() { this.getType() instanceof TypeString }
21+
}
2022

2123
/**
2224
* An assignment of the form

java/ql/src/Performance/InefficientToArray.ql

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ predicate emptyArrayLiteral(Expr e) {
3939
)
4040
}
4141

42-
class EmptyArrayLiteral extends Expr { EmptyArrayLiteral() { emptyArrayLiteral(this) } }
42+
class EmptyArrayLiteral extends Expr {
43+
EmptyArrayLiteral() { emptyArrayLiteral(this) }
44+
}
4345

4446
from EmptyArrayLiteral l, MethodAccess ma, Method m, GenericInterface coll
4547
where

java/ql/src/Security/CWE/CWE-190/ArithmeticWithExtremeValues.ql

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,13 @@ abstract class ExtremeValueField extends Field {
2121
ExtremeValueField() { getType() instanceof IntegralType }
2222
}
2323

24-
class MinValueField extends ExtremeValueField { MinValueField() { this.getName() = "MIN_VALUE" } }
24+
class MinValueField extends ExtremeValueField {
25+
MinValueField() { this.getName() = "MIN_VALUE" }
26+
}
2527

26-
class MaxValueField extends ExtremeValueField { MaxValueField() { this.getName() = "MAX_VALUE" } }
28+
class MaxValueField extends ExtremeValueField {
29+
MaxValueField() { this.getName() = "MAX_VALUE" }
30+
}
2731

2832
class ExtremeSource extends VarAccess {
2933
ExtremeSource() { this.getVariable() instanceof ExtremeValueField }

java/ql/src/Security/CWE/CWE-798/HardcodedCredentialsComparison.ql

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212
import java
1313
import HardcodedCredentials
1414

15-
class EqualsAccess extends MethodAccess { EqualsAccess() { getMethod() instanceof EqualsMethod } }
15+
class EqualsAccess extends MethodAccess {
16+
EqualsAccess() { getMethod() instanceof EqualsMethod }
17+
}
1618

1719
from EqualsAccess sink, HardcodedExpr source, PasswordVariable p
1820
where

java/ql/src/Security/CWE/CWE-807/TaintedPermissionsCheck.ql

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ class TypeShiroWCPermission extends RefType {
2525
}
2626
}
2727

28-
abstract class PermissionsConstruction extends Top { abstract Expr getInput(); }
28+
abstract class PermissionsConstruction extends Top {
29+
abstract Expr getInput();
30+
}
2931

3032
class PermissionsCheckMethodAccess extends MethodAccess, PermissionsConstruction {
3133
PermissionsCheckMethodAccess() {

java/ql/src/Violations of Best Practice/Declarations/NoConstantsOnly.ql

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212

1313
import semmle.code.java.Member
1414

15-
class ConstantField extends Field { ConstantField() { this.isStatic() and this.isFinal() } }
15+
class ConstantField extends Field {
16+
ConstantField() { this.isStatic() and this.isFinal() }
17+
}
1618

1719
pragma[noinline]
1820
predicate typeWithConstantField(RefType t) { exists(ConstantField f | f.getDeclaringType() = t) }

java/ql/src/Violations of Best Practice/legacy/AutoBoxing.ql

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,14 @@
1212
import java
1313

1414
/** An expression of primitive type. */
15-
class PrimitiveExpr extends Expr { PrimitiveExpr() { this.getType() instanceof PrimitiveType } }
15+
class PrimitiveExpr extends Expr {
16+
PrimitiveExpr() { this.getType() instanceof PrimitiveType }
17+
}
1618

1719
/** An expression of boxed type. */
18-
class BoxedExpr extends Expr { BoxedExpr() { this.getType() instanceof BoxedType } }
20+
class BoxedExpr extends Expr {
21+
BoxedExpr() { this.getType() instanceof BoxedType }
22+
}
1923

2024
/**
2125
* Relate expressions and the variables they flow into in one step,

0 commit comments

Comments
 (0)