Skip to content

Commit 0cea3f8

Browse files
committed
Remove library annotations
1 parent 1297acf commit 0cea3f8

File tree

22 files changed

+35
-37
lines changed

22 files changed

+35
-37
lines changed

cpp/ql/lib/semmle/code/cpp/NameQualifiers.qll

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,7 @@ class NameQualifyingElement extends Element, @namequalifyingelement {
158158
/**
159159
* A special name-qualifying element. For example: `__super`.
160160
*/
161-
library class SpecialNameQualifyingElement extends NameQualifyingElement,
162-
@specialnamequalifyingelement
163-
{
161+
class SpecialNameQualifyingElement extends NameQualifyingElement, @specialnamequalifyingelement {
164162
/** Gets the name of this special qualifying element. */
165163
override string getName() { specialnamequalifyingelements(underlyingElement(this), result) }
166164

cpp/ql/lib/semmle/code/cpp/controlflow/DefinitionsAndUses.qll

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ predicate parameterUsePair(Parameter p, VariableAccess va) {
7878
/**
7979
* Utility class: A definition or use of a stack variable.
8080
*/
81-
library class DefOrUse extends ControlFlowNodeBase {
81+
class DefOrUse extends ControlFlowNodeBase {
8282
DefOrUse() {
8383
// Uninstantiated templates are purely syntax, and only on instantiation
8484
// will they be complete with information about types, conversions, call
@@ -140,7 +140,7 @@ library class DefOrUse extends ControlFlowNodeBase {
140140
}
141141

142142
/** A definition of a stack variable. */
143-
library class Def extends DefOrUse {
143+
class Def extends DefOrUse {
144144
Def() { definition(_, this) }
145145

146146
override SemanticStackVariable getVariable(boolean isDef) {
@@ -155,7 +155,7 @@ private predicate parameterIsOverwritten(Function f, Parameter p) {
155155
}
156156

157157
/** A definition of a parameter. */
158-
library class ParameterDef extends DefOrUse {
158+
class ParameterDef extends DefOrUse {
159159
ParameterDef() {
160160
// Optimization: parameters that are not overwritten do not require
161161
// reachability analysis
@@ -169,7 +169,7 @@ library class ParameterDef extends DefOrUse {
169169
}
170170

171171
/** A use of a stack variable. */
172-
library class Use extends DefOrUse {
172+
class Use extends DefOrUse {
173173
Use() { useOfVar(_, this) }
174174

175175
override SemanticStackVariable getVariable(boolean isDef) {

cpp/ql/lib/semmle/code/cpp/controlflow/SSA.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import SSAUtils
1010
* The SSA logic comes in two versions: the standard SSA and range-analysis RangeSSA.
1111
* This class provides the standard SSA logic.
1212
*/
13-
library class StandardSsa extends SsaHelper {
13+
class StandardSsa extends SsaHelper {
1414
StandardSsa() { this = 0 }
1515
}
1616

cpp/ql/lib/semmle/code/cpp/controlflow/SSAUtils.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ private predicate live_at_exit_of_bb(StackVariable v, BasicBlock b) {
114114

115115
/** Common SSA logic for standard SSA and range-analysis SSA. */
116116
cached
117-
library class SsaHelper extends int {
117+
class SsaHelper extends int {
118118
/* 0 = StandardSSA, 1 = RangeSSA */
119119
cached
120120
SsaHelper() { this in [0 .. 1] }

cpp/ql/lib/semmle/code/cpp/controlflow/internal/ConstantExprs.qll

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -366,12 +366,12 @@ class CompileTimeConstantInt extends Expr {
366366
int getIntValue() { result = val }
367367
}
368368

369-
library class CompileTimeVariableExpr extends Expr {
369+
class CompileTimeVariableExpr extends Expr {
370370
CompileTimeVariableExpr() { not this instanceof CompileTimeConstantInt }
371371
}
372372

373373
/** A helper class for evaluation of expressions. */
374-
library class ExprEvaluator extends int {
374+
class ExprEvaluator extends int {
375375
/*
376376
* 0 = ConditionEvaluator,
377377
* 1 = SwitchEvaluator,
@@ -956,7 +956,7 @@ private predicate returnStmt(Function f, Expr value) {
956956
}
957957

958958
/** A helper class for evaluation of conditions. */
959-
library class ConditionEvaluator extends ExprEvaluator {
959+
class ConditionEvaluator extends ExprEvaluator {
960960
ConditionEvaluator() { this = 0 }
961961

962962
override predicate interesting(Expr e) {
@@ -967,7 +967,7 @@ library class ConditionEvaluator extends ExprEvaluator {
967967
}
968968

969969
/** A helper class for evaluation of switch expressions. */
970-
library class SwitchEvaluator extends ExprEvaluator {
970+
class SwitchEvaluator extends ExprEvaluator {
971971
SwitchEvaluator() { this = 1 }
972972

973973
override predicate interesting(Expr e) { e = getASwitchExpr(_, _) }
@@ -976,7 +976,7 @@ library class SwitchEvaluator extends ExprEvaluator {
976976
private int getSwitchValue(Expr e) { exists(SwitchEvaluator x | result = x.getValue(e)) }
977977

978978
/** A helper class for evaluation of loop entry conditions. */
979-
library class LoopEntryConditionEvaluator extends ExprEvaluator {
979+
class LoopEntryConditionEvaluator extends ExprEvaluator {
980980
LoopEntryConditionEvaluator() { this in [2 .. 3] }
981981

982982
abstract override predicate interesting(Expr e);
@@ -1149,7 +1149,7 @@ library class LoopEntryConditionEvaluator extends ExprEvaluator {
11491149
}
11501150

11511151
/** A helper class for evaluation of while-loop entry conditions. */
1152-
library class WhileLoopEntryConditionEvaluator extends LoopEntryConditionEvaluator {
1152+
class WhileLoopEntryConditionEvaluator extends LoopEntryConditionEvaluator {
11531153
WhileLoopEntryConditionEvaluator() { this = 2 }
11541154

11551155
override predicate interesting(Expr e) { exists(WhileStmt while | e = while.getCondition()) }
@@ -1162,7 +1162,7 @@ library class WhileLoopEntryConditionEvaluator extends LoopEntryConditionEvaluat
11621162
}
11631163

11641164
/** A helper class for evaluation of for-loop entry conditions. */
1165-
library class ForLoopEntryConditionEvaluator extends LoopEntryConditionEvaluator {
1165+
class ForLoopEntryConditionEvaluator extends LoopEntryConditionEvaluator {
11661166
ForLoopEntryConditionEvaluator() { this = 3 }
11671167

11681168
override predicate interesting(Expr e) { exists(ForStmt for | e = for.getCondition()) }

cpp/ql/lib/semmle/code/cpp/rangeanalysis/RangeSSA.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ private import RangeAnalysisUtils
2929
* The SSA logic comes in two versions: the standard SSA and range-analysis RangeSSA.
3030
* This class provides the range-analysis SSA logic.
3131
*/
32-
library class RangeSsa extends SsaHelper {
32+
class RangeSsa extends SsaHelper {
3333
RangeSsa() { this = 1 }
3434

3535
/**

cpp/ql/src/Microsoft/SAL.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ private predicate annotatesAtPosition(SalPosition pos, DeclarationEntry d, File
161161
* A SAL element, that is, a SAL annotation or a declaration entry
162162
* that may have SAL annotations.
163163
*/
164-
library class SalElement extends Element {
164+
class SalElement extends Element {
165165
SalElement() {
166166
containsSalAnnotation(this.(DeclarationEntry).getFile()) or
167167
this instanceof SalAnnotation

csharp/ql/lib/semmle/code/csharp/exprs/Access.qll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ class MemberConstantAccess extends FieldAccess {
398398
* An internal helper class to share logic between `PropertyAccess` and
399399
* `PropertyCall`.
400400
*/
401-
library class PropertyAccessExpr extends Expr, @property_access_expr {
401+
class PropertyAccessExpr extends Expr, @property_access_expr {
402402
/** Gets the target of this property access. */
403403
Property getProperty() { expr_access(this, result) }
404404

@@ -540,7 +540,7 @@ class ElementWrite extends ElementAccess, AssignableWrite { }
540540
* An internal helper class to share logic between `IndexerAccess` and
541541
* `IndexerCall`.
542542
*/
543-
library class IndexerAccessExpr extends Expr, @indexer_access_expr {
543+
class IndexerAccessExpr extends Expr, @indexer_access_expr {
544544
/** Gets the target of this indexer access. */
545545
Indexer getIndexer() { expr_access(this, result) }
546546

@@ -628,7 +628,7 @@ class VirtualIndexerAccess extends IndexerAccess {
628628
* An internal helper class to share logic between `EventAccess` and
629629
* `EventCall`.
630630
*/
631-
library class EventAccessExpr extends Expr, @event_access_expr {
631+
class EventAccessExpr extends Expr, @event_access_expr {
632632
/** Gets the target of this event access. */
633633
Event getEvent() { expr_access(this, result) }
634634

csharp/ql/lib/semmle/code/csharp/frameworks/System.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -654,7 +654,7 @@ class DisposeMethod extends Method {
654654
}
655655

656656
/** A method with the signature `void Dispose(bool)`. */
657-
library class DisposeBoolMethod extends Method {
657+
class DisposeBoolMethod extends Method {
658658
DisposeBoolMethod() {
659659
this.hasName("Dispose") and
660660
this.getReturnType() instanceof VoidType and

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ abstract class GeneratedFile extends File { }
4444
/**
4545
* A file detected as generated based on commonly-used marker comments.
4646
*/
47-
library class MarkerCommentGeneratedFile extends GeneratedFile {
47+
class MarkerCommentGeneratedFile extends GeneratedFile {
4848
MarkerCommentGeneratedFile() { any(GeneratedFileMarker t).getFile() = this }
4949
}
5050

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ class ReflectiveAccessAnnotation extends Annotation {
8686
*/
8787
abstract class NonReflectiveAnnotation extends Annotation { }
8888

89-
library class StandardNonReflectiveAnnotation extends NonReflectiveAnnotation {
89+
class StandardNonReflectiveAnnotation extends NonReflectiveAnnotation {
9090
StandardNonReflectiveAnnotation() {
9191
this.getType()
9292
.hasQualifiedName("java.lang", ["Override", "Deprecated", "SuppressWarnings", "SafeVarargs"])

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ abstract class DeserializableField extends Field { }
2424
* A non-`transient` field in a type that (directly or indirectly) implements the `Serializable` interface
2525
* and may be read or written via serialization.
2626
*/
27-
library class StandardSerializableField extends SerializableField, DeserializableField {
27+
class StandardSerializableField extends SerializableField, DeserializableField {
2828
StandardSerializableField() {
2929
this.getDeclaringType().getAnAncestor() instanceof TypeSerializable and
3030
not this.isTransient()

java/ql/lib/semmle/code/java/deadcode/DeadCode.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ class NamespaceClass extends RefType {
140140
* This represents the set of classes and interfaces for which we will determine liveness. Each
141141
* `SourceClassOrInterfacce` will either be a `LiveClass` or `DeadClass`.
142142
*/
143-
library class SourceClassOrInterface extends ClassOrInterface {
143+
class SourceClassOrInterface extends ClassOrInterface {
144144
SourceClassOrInterface() { this.fromSource() }
145145
}
146146

java/ql/lib/semmle/code/java/deadcode/DeadField.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import semmle.code.java.frameworks.jackson.JacksonSerializability
99
*
1010
* This defines the set of fields for which we will determine liveness.
1111
*/
12-
library class SourceField extends Field {
12+
class SourceField extends Field {
1313
SourceField() { this.fromSource() }
1414
}
1515

java/ql/lib/semmle/code/java/deadcode/EntryPoints.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ abstract class ReflectivelyConstructedClass extends EntryPoint, Class {
9494
/**
9595
* Classes that are deserialized by Jackson are reflectively constructed.
9696
*/
97-
library class JacksonReflectivelyConstructedClass extends ReflectivelyConstructedClass instanceof JacksonDeserializableType
97+
class JacksonReflectivelyConstructedClass extends ReflectivelyConstructedClass instanceof JacksonDeserializableType
9898
{
9999
override Callable getALiveCallable() {
100100
// Constructors may be called by Jackson, if they are a no-arg, they have a suitable annotation,

java/ql/lib/semmle/code/java/frameworks/JAXB.qll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import semmle.code.java.Type
44

5-
library class JaxbElement extends Class {
5+
class JaxbElement extends Class {
66
JaxbElement() {
77
this.getAnAncestor().getQualifiedName() = "javax.xml.bind.JAXBElement" or
88
this.getAnAnnotation().getType().getName() = "XmlRootElement"
@@ -12,7 +12,7 @@ library class JaxbElement extends Class {
1212
/** DEPRECATED: Alias for JaxbElement */
1313
deprecated class JAXBElement = JaxbElement;
1414

15-
library class JaxbMarshalMethod extends Method {
15+
class JaxbMarshalMethod extends Method {
1616
JaxbMarshalMethod() {
1717
this.getDeclaringType().getQualifiedName() = "javax.xml.bind.Marshaller" and
1818
this.getName() = "marshal"
@@ -151,7 +151,7 @@ class JaxbBoundField extends Field {
151151
/**
152152
* A getter or setter method, as defined by whether the method name starts with "set" or "get".
153153
*/
154-
library class GetterOrSetterMethod extends Method {
154+
class GetterOrSetterMethod extends Method {
155155
GetterOrSetterMethod() { this.getName().matches("get%") or this.getName().matches("set%") }
156156

157157
Field getField() {

java/ql/lib/semmle/code/java/frameworks/Mockito.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ private int mockableParameterCount(Constructor constructor) {
301301
/**
302302
* A class which is referenced by an `@InjectMocks` field.
303303
*/
304-
library class MockitoMockInjectedClass extends Class {
304+
class MockitoMockInjectedClass extends Class {
305305
MockitoMockInjectedClass() {
306306
// There must be an `@InjectMock` field that has `this` as the type.
307307
exists(MockitoInjectedField injectedField | this = injectedField.getType())

java/ql/lib/semmle/code/java/frameworks/camel/CamelJavaAnnotations.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import java
1919
import semmle.code.java.Reflection
2020
import semmle.code.java.frameworks.spring.Spring
2121

22-
library class CamelAnnotation extends Annotation {
22+
class CamelAnnotation extends Annotation {
2323
CamelAnnotation() { this.getType().getPackage().hasName("org.apache.camel") }
2424
}
2525

java/ql/lib/semmle/code/java/frameworks/camel/CamelJavaDSL.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import semmle.code.java.frameworks.spring.Spring
2121
/**
2222
* A method call to a ProcessorDefinition element.
2323
*/
24-
library class ProcessorDefinitionElement extends MethodAccess {
24+
class ProcessorDefinitionElement extends MethodAccess {
2525
ProcessorDefinitionElement() {
2626
this.getMethod()
2727
.getDeclaringType()

java/ql/lib/semmle/code/java/frameworks/javaee/JavaServerFaces.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import semmle.code.java.frameworks.javaee.jsf.JSFFacesContextXML
77
/**
88
* A method that is visible to faces, if the instance type is visible to faces.
99
*/
10-
library class FacesVisibleMethod extends Method {
10+
class FacesVisibleMethod extends Method {
1111
FacesVisibleMethod() { this.isPublic() and not this.isStatic() }
1212
}
1313

java/ql/lib/semmle/code/java/frameworks/struts/StrutsConventions.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import semmle.code.xml.MavenPom
66
/**
77
* A Maven dependency on the Struts 2 convention plugin.
88
*/
9-
library class Struts2ConventionDependency extends Dependency {
9+
class Struts2ConventionDependency extends Dependency {
1010
Struts2ConventionDependency() {
1111
this.getGroup().getValue() = "org.apache.struts" and
1212
this.getArtifact().getValue() = "struts2-convention-plugin"

java/ql/src/Likely Bugs/Comparison/UselessComparisonTest.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import semmle.code.java.dataflow.SSA
66
/**
77
* The kind of bound that is known to hold for some variable.
88
*/
9-
library class BoundKind extends string {
9+
class BoundKind extends string {
1010
BoundKind() { this = ["=", "!=", ">=", "<="] }
1111

1212
predicate isEqual() { this = "=" }

0 commit comments

Comments
 (0)