Java: Improve getAPrimaryQlClass

Implement it for more types
Fix typos
This commit is contained in:
Joe
2020-09-11 12:33:17 +01:00
parent 908f025888
commit c3320eeb3c
5 changed files with 17 additions and 5 deletions

View File

@@ -764,7 +764,7 @@ class URShiftExpr extends BinaryExpr, @urshiftexpr {
class AndBitwiseExpr extends BinaryExpr, @andbitexpr {
override string getOp() { result = " & " }
override string getAPrimaryQlClass() { result = "AddBitwiseExpr" }
override string getAPrimaryQlClass() { result = "AndBitwiseExpr" }
}
/** A binary expression using the `|` operator. */
@@ -778,7 +778,7 @@ class OrBitwiseExpr extends BinaryExpr, @orbitexpr {
class XorBitwiseExpr extends BinaryExpr, @xorbitexpr {
override string getOp() { result = " ^ " }
override string getAPrimaryQlClass() { result = "?XorBitwiseExpr" }
override string getAPrimaryQlClass() { result = "XorBitwiseExpr" }
}
/** A binary expression using the `&&` operator. */
@@ -1647,7 +1647,7 @@ class ArrayTypeAccess extends Expr, @arraytypeaccess {
/** Gets a printable representation of this expression. */
override string toString() { result = "...[]" }
override string getAPrimaryQlClass() { result = "ArrayTypeAccss" }
override string getAPrimaryQlClass() { result = "ArrayTypeAccess" }
}
/**

View File

@@ -250,6 +250,8 @@ class Wildcard extends BoundedType, @wildcard {
not hasLowerBound() and
wildcards(this, "?", _)
}
override string getAPrimaryQlClass() { result = "Wildcard" }
}
/**

View File

@@ -622,6 +622,8 @@ class Field extends Member, ExprParent, @field, Variable {
/** Cast this field to a class that provides access to metrics information. */
MetricField getMetrics() { result = this }
override string getAPrimaryQlClass() { result = "Field" }
}
/** An instance field. */

View File

@@ -523,7 +523,7 @@ class SynchronizedStmt extends Stmt, @synchronizedstmt {
/** This statement's Halstead ID (used to compute Halstead metrics). */
override string getHalsteadID() { result = "SynchronizedStmt" }
override string getAPrimaryQlClass() { result = "SynchonizedStmt" }
override string getAPrimaryQlClass() { result = "SynchronizedStmt" }
}
/** A `return` statement. */
@@ -683,7 +683,7 @@ class ContinueStmt extends Stmt, @continuestmt {
/** This statement's Halstead ID (used to compute Halstead metrics). */
override string getHalsteadID() { result = "ContinueStmt" }
override string getAPrimaryQlClass() { result = "ContinusStmt" }
override string getAPrimaryQlClass() { result = "ContinueStmt" }
}
/** The empty statement. */

View File

@@ -318,6 +318,8 @@ class Array extends RefType, @array {
* Gets the JVM descriptor for this type, as used in bytecode.
*/
override string getTypeDescriptor() { result = "[" + this.getComponentType().getTypeDescriptor() }
override string getAPrimaryQlClass() { result = "Array" }
}
/**
@@ -877,11 +879,15 @@ class PrimitiveType extends Type, @primitive {
getName().regexpMatch("(float|double|int|short|byte|long)") and
result.getLiteral().regexpMatch("0(\\.0)?+[lLfFdD]?+")
}
override string getAPrimaryQlClass() { result = "PrimitiveType" }
}
/** The type of the `null` literal. */
class NullType extends Type, @primitive {
NullType() { this.hasName("<nulltype>") }
override string getAPrimaryQlClass() { result = "NullType" }
}
/** The `void` type. */
@@ -892,6 +898,8 @@ class VoidType extends Type, @primitive {
* Gets the JVM descriptor for this type, as used in bytecode.
*/
override string getTypeDescriptor() { result = "V" }
override string getAPrimaryQlClass() { result = "VoidType" }
}
/**