Skip to content

Draft: Remove static state in JClassType

Thomas Lemberger requested to merge remove-static-state-in-jclasstype into trunk

JClassType uses a singleton to represent the Java Object type. This leads to a false positive in this method when a single CPAchecker instance is used for more than one run (as, for example, in tests):

  private void registerSubType(JClassType pChild) {
    checkArgument(!directSubClasses.contains(pChild));
    directSubClasses.add(pChild);
  }

8741f78d tried to fix this by removing the check (with some explanations), but this is not possible because we want to enforce this condition.

So we have to get rid of the static state; this is done by this MR.

Solves #263 (closed)

Edited by Thomas Lemberger

Merge request reports