mirror of
https://github.com/github/codeql.git
synced 2026-04-20 22:44:52 +02:00
Merge pull request #14494 from atorralba/atorralba/remove-library
Java/C/C#: Remove library annotations
This commit is contained in:
@@ -44,7 +44,7 @@ abstract class GeneratedFile extends File { }
|
||||
/**
|
||||
* A file detected as generated based on commonly-used marker comments.
|
||||
*/
|
||||
library class MarkerCommentGeneratedFile extends GeneratedFile {
|
||||
class MarkerCommentGeneratedFile extends GeneratedFile {
|
||||
MarkerCommentGeneratedFile() { any(GeneratedFileMarker t).getFile() = this }
|
||||
}
|
||||
|
||||
|
||||
@@ -86,7 +86,7 @@ class ReflectiveAccessAnnotation extends Annotation {
|
||||
*/
|
||||
abstract class NonReflectiveAnnotation extends Annotation { }
|
||||
|
||||
library class StandardNonReflectiveAnnotation extends NonReflectiveAnnotation {
|
||||
class StandardNonReflectiveAnnotation extends NonReflectiveAnnotation {
|
||||
StandardNonReflectiveAnnotation() {
|
||||
this.getType()
|
||||
.hasQualifiedName("java.lang", ["Override", "Deprecated", "SuppressWarnings", "SafeVarargs"])
|
||||
|
||||
@@ -24,7 +24,7 @@ abstract class DeserializableField extends Field { }
|
||||
* A non-`transient` field in a type that (directly or indirectly) implements the `Serializable` interface
|
||||
* and may be read or written via serialization.
|
||||
*/
|
||||
library class StandardSerializableField extends SerializableField, DeserializableField {
|
||||
class StandardSerializableField extends SerializableField, DeserializableField {
|
||||
StandardSerializableField() {
|
||||
this.getDeclaringType().getAnAncestor() instanceof TypeSerializable and
|
||||
not this.isTransient()
|
||||
|
||||
@@ -140,7 +140,7 @@ class NamespaceClass extends RefType {
|
||||
* This represents the set of classes and interfaces for which we will determine liveness. Each
|
||||
* `SourceClassOrInterfacce` will either be a `LiveClass` or `DeadClass`.
|
||||
*/
|
||||
library class SourceClassOrInterface extends ClassOrInterface {
|
||||
class SourceClassOrInterface extends ClassOrInterface {
|
||||
SourceClassOrInterface() { this.fromSource() }
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import semmle.code.java.frameworks.jackson.JacksonSerializability
|
||||
*
|
||||
* This defines the set of fields for which we will determine liveness.
|
||||
*/
|
||||
library class SourceField extends Field {
|
||||
class SourceField extends Field {
|
||||
SourceField() { this.fromSource() }
|
||||
}
|
||||
|
||||
|
||||
@@ -94,7 +94,7 @@ abstract class ReflectivelyConstructedClass extends EntryPoint, Class {
|
||||
/**
|
||||
* Classes that are deserialized by Jackson are reflectively constructed.
|
||||
*/
|
||||
library class JacksonReflectivelyConstructedClass extends ReflectivelyConstructedClass instanceof JacksonDeserializableType
|
||||
class JacksonReflectivelyConstructedClass extends ReflectivelyConstructedClass instanceof JacksonDeserializableType
|
||||
{
|
||||
override Callable getALiveCallable() {
|
||||
// Constructors may be called by Jackson, if they are a no-arg, they have a suitable annotation,
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import semmle.code.java.Type
|
||||
|
||||
library class JaxbElement extends Class {
|
||||
class JaxbElement extends Class {
|
||||
JaxbElement() {
|
||||
this.getAnAncestor().getQualifiedName() = "javax.xml.bind.JAXBElement" or
|
||||
this.getAnAnnotation().getType().getName() = "XmlRootElement"
|
||||
@@ -12,7 +12,7 @@ library class JaxbElement extends Class {
|
||||
/** DEPRECATED: Alias for JaxbElement */
|
||||
deprecated class JAXBElement = JaxbElement;
|
||||
|
||||
library class JaxbMarshalMethod extends Method {
|
||||
class JaxbMarshalMethod extends Method {
|
||||
JaxbMarshalMethod() {
|
||||
this.getDeclaringType().getQualifiedName() = "javax.xml.bind.Marshaller" and
|
||||
this.getName() = "marshal"
|
||||
@@ -151,7 +151,7 @@ class JaxbBoundField extends Field {
|
||||
/**
|
||||
* A getter or setter method, as defined by whether the method name starts with "set" or "get".
|
||||
*/
|
||||
library class GetterOrSetterMethod extends Method {
|
||||
class GetterOrSetterMethod extends Method {
|
||||
GetterOrSetterMethod() { this.getName().matches("get%") or this.getName().matches("set%") }
|
||||
|
||||
Field getField() {
|
||||
|
||||
@@ -301,7 +301,7 @@ private int mockableParameterCount(Constructor constructor) {
|
||||
/**
|
||||
* A class which is referenced by an `@InjectMocks` field.
|
||||
*/
|
||||
library class MockitoMockInjectedClass extends Class {
|
||||
class MockitoMockInjectedClass extends Class {
|
||||
MockitoMockInjectedClass() {
|
||||
// There must be an `@InjectMock` field that has `this` as the type.
|
||||
exists(MockitoInjectedField injectedField | this = injectedField.getType())
|
||||
|
||||
@@ -19,7 +19,7 @@ import java
|
||||
import semmle.code.java.Reflection
|
||||
import semmle.code.java.frameworks.spring.Spring
|
||||
|
||||
library class CamelAnnotation extends Annotation {
|
||||
class CamelAnnotation extends Annotation {
|
||||
CamelAnnotation() { this.getType().getPackage().hasName("org.apache.camel") }
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ import semmle.code.java.frameworks.spring.Spring
|
||||
/**
|
||||
* A method call to a ProcessorDefinition element.
|
||||
*/
|
||||
library class ProcessorDefinitionElement extends MethodAccess {
|
||||
class ProcessorDefinitionElement extends MethodAccess {
|
||||
ProcessorDefinitionElement() {
|
||||
this.getMethod()
|
||||
.getDeclaringType()
|
||||
|
||||
@@ -7,7 +7,7 @@ import semmle.code.java.frameworks.javaee.jsf.JSFFacesContextXML
|
||||
/**
|
||||
* A method that is visible to faces, if the instance type is visible to faces.
|
||||
*/
|
||||
library class FacesVisibleMethod extends Method {
|
||||
class FacesVisibleMethod extends Method {
|
||||
FacesVisibleMethod() { this.isPublic() and not this.isStatic() }
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import semmle.code.xml.MavenPom
|
||||
/**
|
||||
* A Maven dependency on the Struts 2 convention plugin.
|
||||
*/
|
||||
library class Struts2ConventionDependency extends Dependency {
|
||||
class Struts2ConventionDependency extends Dependency {
|
||||
Struts2ConventionDependency() {
|
||||
this.getGroup().getValue() = "org.apache.struts" and
|
||||
this.getArtifact().getValue() = "struts2-convention-plugin"
|
||||
|
||||
@@ -6,7 +6,7 @@ import semmle.code.java.dataflow.SSA
|
||||
/**
|
||||
* The kind of bound that is known to hold for some variable.
|
||||
*/
|
||||
library class BoundKind extends string {
|
||||
class BoundKind extends string {
|
||||
BoundKind() { this = ["=", "!=", ">=", "<="] }
|
||||
|
||||
predicate isEqual() { this = "=" }
|
||||
|
||||
Reference in New Issue
Block a user