Package

org.opalj

bytecode

Permalink

package bytecode

Defines functionality commonly useful when processing Java bytecode.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. bytecode
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. case class BytecodeProcessingFailedException(message: String) extends RuntimeException with Product with Serializable

    Permalink

    Indicates that the processing of a class file failed.

    Indicates that the processing of a class file failed. The reason is either a bug in the framework or in the class file.

    Note

    The Scala compiler (at least up to version 2.11.8 sometimes generate invalid type signatures in the combination with parameterized value types.

    ,

    The Eclipse Luna Java compiler does not generate valid class files in a few cases where type annotations are used in combination with try-with-resources statements.

Value Members

  1. lazy val JRELibraryFolder: File

    Permalink

    Returns the most likely position of the JRE's library folder.

    Returns the most likely position of the JRE's library folder. (I.e., the location in which the rt.jar file and the other jar files belonging to the Java runtime environment can be found). If the rt.jar cannot be found an exception is raised.

    Note

    The Java 9 JDK/JRE is structured in a different way. // IMPROVE [JDK9] Add mechanism to locate JDK 9 System class files

  2. lazy val RTJar: File

    Permalink

    Returns the most likely position of the JRE's library folder.

    Returns the most likely position of the JRE's library folder. (I.e., the location in which the rt.jar file and the other jar files belonging to the Java runtime environment can be found).

    Note

    The Java 9 JDK/JRE does not have an rt.jar. // IMPROVE [JDK9] Mechanism to find the primary module.

  3. def abbreviateFQN(definingTypeFQN: String, memberTypeFQN: String, pkgSeparatorChar: Int = '.'): String

    Permalink

    Abbreviates the given memberTypeFQN by abbreviating the common packages (except of the last shared package) of both fully qualified type names using '…'.

    Abbreviates the given memberTypeFQN by abbreviating the common packages (except of the last shared package) of both fully qualified type names using '…'.

    pkgSeparatorChar

    If the given fully qualified type names are using Java notation (i.e., packages are separated using '.') then the parameter should be '.', which is the default, otherwise the parameter should be '/'.

    Example:
    1. scala> org.opalj.abbreviateFQN("a.b.T","a.T") // <= no abbrev.
      res: String = a.T
      scala> org.opalj.abbreviateFQN("a.b.T","a.b.T")
      res: String = …b.T
      scala> org.opalj.abbreviateFQN("a.b.c.T","a.b.c.T.X")
      res: String = …c.T.X
  4. def commonPackage(fqnA: String, fqnB: String, pkgSeparatorChar: Int = '.'): Option[String]

    Permalink

    Returns the package definitions shared by both fully qualified type names.

    Returns the package definitions shared by both fully qualified type names. If both types do not define a common package None is returned.

    pkgSeparatorChar

    If the given fully qualified type names are using Java notation (i.e., packages are separated using '.') then the parameter should be '.', which is the default, otherwise the parameter should be '/'.

    Example:
    1. scala> org.opalj.commonPackage("a.b.T","a.c.T")
      res: Option[String] = Some(a.)
      scala> org.opalj.commonPackage("a.b.T","a.T")
      res: Option[String] = Some(a.)
      scala> org.opalj.commonPackage("a.b.T","a.b.T")
      res: Option[String] = Some(a.b.)
      scala> org.opalj.commonPackage("c.b.T","a.T")
      res: Option[String] = None
      scala> org.opalj.commonPackage("a.b.T","d.c.T")
      res: Option[String] = None

Inherited from AnyRef

Inherited from Any

Ungrouped