Merge pull request #14494 from atorralba/atorralba/remove-library

Java/C/C#: Remove library annotations
This commit is contained in:
Tony Torralba
2023-10-16 09:01:40 +02:00
committed by GitHub
22 changed files with 35 additions and 37 deletions

View File

@@ -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 }
}

View File

@@ -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"])

View File

@@ -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()

View File

@@ -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() }
}

View File

@@ -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() }
}

View File

@@ -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,

View File

@@ -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() {

View File

@@ -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())

View File

@@ -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") }
}

View File

@@ -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()

View File

@@ -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() }
}

View File

@@ -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"

View File

@@ -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 = "=" }