Packages

  • package root
    Definition Classes
    root
  • package org
    Definition Classes
    root
  • package opalj

    OPAL is a Scala-based framework for the static analysis, manipulation and creation of Java bytecode.

    OPAL is a Scala-based framework for the static analysis, manipulation and creation of Java bytecode. OPAL is designed with performance, scalability and adaptability in mind.

    Its main components are:

    • a library (Common) which provides generally useful data-structures and algorithms for static analyses.
    • a framework for implementing lattice based static analyses (Static Analysis Infrastructure)
    • a framework for parsing Java bytecode (Bytecode Infrastructure) that can be used to create arbitrary representations.
    • a library to create a one-to-one in-memory representation of Java bytecode (Bytecode Disassembler).
    • a library to create a representation of Java bytecode that facilitates writing simple static analyses (Bytecode Representation - org.opalj.br).
    • a scalable, easily customizable framework for the abstract interpretation of Java bytecode (Abstract Interpretation Framework - org.opalj.ai).
    • a library to extract dependencies between code elements and to facilitate checking architecture definitions.
    • a library for the lightweight manipulation and creation of Java bytecode (Bytecode Assembler).

    General Design Decisions

    Thread Safety

    Unless explicitly noted, OPAL is thread safe. I.e., the classes defined by OPAL can be considered to be thread safe unless otherwise stated. (For example, it is possible to read and process class files concurrently without explicit synchronization on the client side.)

    No null Values

    Unless explicitly noted, OPAL does not null values I.e., fields that are accessible will never contain null values and methods will never return null. If a method accepts null as a value for a parameter or returns a null value it is always explicitly documented. In general, the behavior of methods that are passed null values is undefined unless explicitly documented.

    No Typecasts for Collections

    For efficiency reasons, OPAL sometimes uses mutable data-structures internally. After construction time, these data-structures are generally represented using their generic interfaces (e.g., scala.collection.{Set,Map}). However, a downcast (e.g., to add/remove elements) is always forbidden as it would effectively prevent thread-safety.

    Assertions

    OPAL makes heavy use of Scala's Assertion Facility to facilitate writing correct code. Hence, for production builds (after thorough testing(!)) it is highly recommend to build OPAL again using -Xdisable-assertions.

    Definition Classes
    org
  • package br

    In this representation of Java bytecode references to a Java class file's constant pool and to attributes are replaced by direct references to the corresponding constant pool entries.

    In this representation of Java bytecode references to a Java class file's constant pool and to attributes are replaced by direct references to the corresponding constant pool entries. This facilitates developing analyses and fosters comprehension.

    Based on the fact that indirect references to constant pool entries are resolved and replaced by direct references this representation is called the resolved representation.

    This representation of Java bytecode is considered as OPAL's standard representation for writing Scala based analyses. This representation is engineered such that it facilitates writing analyses that use pattern matching.

    Definition Classes
    opalj
  • package analyses

    Defines commonly useful type aliases.

    Defines commonly useful type aliases.

    Definition Classes
    br
  • package cg
    Definition Classes
    analyses
  • Analysis
  • AnalysisApplication
  • AnalysisException
  • BasicMethodInfo
  • BasicReport
  • DeclaredMethods
  • DeclaredMethodsKey
  • FieldAccessInformation
  • FieldAccessInformationAnalysis
  • FieldAccessInformationKey
  • InconsistentProjectException
  • JavaProject
  • MethodAnalysisApplication
  • MethodDeclarationContext
  • MethodDeclarationContextOrdering
  • MethodInfo
  • ModuleDefinition
  • OneStepAnalysis
  • ProgressEvents
  • ProgressManagement
  • Project
  • ProjectAnalysisApplication
  • ProjectBasedAnalysis
  • ProjectIndex
  • ProjectIndexKey
  • ProjectInformationKey
  • ProjectLike
  • ReportableAnalysisResult
  • StringConstantsInformationKey
  • VirtualFormalParameter
  • VirtualFormalParameters
  • VirtualFormalParametersKey

final class MethodDeclarationContext extends Ordered[MethodDeclarationContext]

Encapsulates the information about a non-abstract, non-static method which is not an initializer (<(cl)init>) and which is required when determining potential call targets.

Source
MethodDeclarationContext.scala
Note

A class may have -- w.r.t. a given package name -- at most one package visible method which has a specific name and descriptor combination. For methods with protected or public visibility a class always has at most one method with a given name and descriptor.

,

Equality is defined based on the name, descriptor and declaring package of a method (the concrete declaring class is not considered!).

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. MethodDeclarationContext
  2. Ordered
  3. Comparable
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new MethodDeclarationContext(method: Method)

Value Members

  1. def <(that: MethodDeclarationContext): Boolean
    Definition Classes
    Ordered
  2. def <=(that: MethodDeclarationContext): Boolean
    Definition Classes
    Ordered
  3. def >(that: MethodDeclarationContext): Boolean
    Definition Classes
    Ordered
  4. def >=(that: MethodDeclarationContext): Boolean
    Definition Classes
    Ordered
  5. def canDirectlyOverride(visibility: Option[VisibilityModifier], packageName: String): Boolean

    Performs the accessibility check required when we need to determine if this method (mc) overrides another method (ma).

    Performs the accessibility check required when we need to determine if this method (mc) overrides another method (ma).

    Note

    This method must be defined by a class which is a subtype of the declaring class of the other method.

  6. def compare(that: MethodDeclarationContext): Int

    Compares this MethodDeclarationContext with the given one.

    Compares this MethodDeclarationContext with the given one. Defines a total order w.r.t. the name, descriptor and declaring package of a method. (The declaring class is not considered and, therefore, two MethodDeclarationContexts may be considered equal even though the underlying method is not the same one.)

    Definition Classes
    MethodDeclarationContext → Ordered
  7. def compareAccessibilityAware(declaringClass: ObjectType, m: Method): Int
  8. def compareAccessibilityAware(packageName: String, name: String, descriptor: MethodDescriptor): Int

    Compares this method (declaration context) with an (implicit) method which has the given name and descriptor and which is defined in the given package unless this method is protected or public.

    Compares this method (declaration context) with an (implicit) method which has the given name and descriptor and which is defined in the given package unless this method is protected or public. In that case the packageName is not compared and "0" (<=> equal) is returned. Hence, this compare method is well suited to make a lookup for a matching method declaration context in a sorted array of method declaration contexts.

  9. def compareTo(that: MethodDeclarationContext): Int
    Definition Classes
    Ordered → Comparable
  10. def compareWithPublicMethod(thatMethod: Method): Int
  11. def declaringClassType: ObjectType
  12. def descriptor: MethodDescriptor
  13. def directlyOverrides(that: MethodDeclarationContext): Boolean

    Returns true if this method directly overrides the given method.

    Returns true if this method directly overrides the given method.

    (Note: indirect overriding can only be determined if all intermediate methods are known; only in that case it is possible to test if, e.g., a public method in package x indirectly overrides a package visible method in a package y.)

    that

    The MethodDeclarationContext object of another method which is defined by the same class as this method or a superclass thereof. If the other method is defined by some other class with which this class is not in a sub-/supertype relation, the result is not defined.

    Note

    The overrides relation is reflexive as defined by the JVM specification (Section: "Overriding").

  14. def equals(other: Any): Boolean
    Definition Classes
    MethodDeclarationContext → AnyRef → Any
  15. def hashCode(): Int

    The hash code is equal to the "hashCode of the descriptor of the underlying method" * 113 + "the hashCode of the package of the declaring class".

    The hash code is equal to the "hashCode of the descriptor of the underlying method" * 113 + "the hashCode of the package of the declaring class".

    Definition Classes
    MethodDeclarationContext → AnyRef → Any
  16. def isDirectlyOverriddenBy(packageName: String): Boolean

    Returns true if a method with the same signature as this method that is defined in the given package directly overrides this encapsultated method.

    Returns true if a method with the same signature as this method that is defined in the given package directly overrides this encapsultated method. This property always holds if this method has public or protected visiblity. If this method has package visibility, the other (implicit) method has to be defined in this method's package.

  17. def isPublic: Boolean
  18. val method: Method
  19. def name: String
  20. def packageName: String
  21. def toString(): String
    Definition Classes
    MethodDeclarationContext → AnyRef → Any