Class BinaryStubTypeShapesTest

java.lang.Object
org.checkerframework.framework.stub.BinaryStubTypeShapesTest

public class BinaryStubTypeShapesTest extends Object
Checks, shape by shape, that a -Astubs file gives the same types in its text form and in its binary form. Each BinaryStubTypeShapesTest.Row is a library class, a stub that annotates one of its members differently from the class file, and a use whose diagnostics show which annotations took effect. For each row, the use is compiled three times: without the stub, with the stub text-parsed (-AstubWarnIfNotFound disables the binary form), and with the stub's binary form. The text and binary errors must equal the row's expected errors, and, so that a row cannot pass because the stub was ignored, the errors without the stub must differ unless the row says the stub keeps the class file's annotation.

Uses the Subtyping Checker with @Unqualified (top, the default) and @Encrypted (bottom, the default for lower bounds).

  • Field Details

    • tempFolder

      public final org.junit.rules.TemporaryFolder tempFolder
      A fresh directory per test.
  • Constructor Details

    • BinaryStubTypeShapesTest

      public BinaryStubTypeShapesTest()
  • Method Details

    • textAndBinaryAgree

      public void textAndBinaryAgree() throws IOException
      Compiles each row's use without the stub, with its text form, and with its binary form, and checks the errors.
      Throws:
      IOException - if writing or compiling a fixture fails