close

Filter

loading table of contents...

Blueprint Developer Manual / Version 2110

Table Of Contents

4.4.7.3 Annotating Third-Party Libraries

When handing over personal data to third-party dependencies, you will most likely get a compile time error raised by the Checker Framework. You have two options then: Either suppress the check as stated in the Javadoc or add so-called stub classes as described in The Checker Framework Manual.

CoreMedia Personal Data Checker already comes with some predefined stub classes. But they may not be sufficient for your needs. Adding your own stub classes can extend or even override the predefined stub classes as your explicitly mentioned stubs have a higher priority. And more: You may add stub classes for CoreMedia API as well.

To add custom stubs, just extend the annotation processor arguments in the checkPersonalData profile. In the example Example 4.38, “Adding custom stub classes” you see how you may add two directories which will then be scanned for files named *.astub. Using ${path.separator} ensures that your path will work across multiple platforms.

<profile>
  <id>checkPersonalData</id>
  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <executions>
          <execution>
            <id>default-compile</id>
            <!-- ... -->
            <configuration>
              <compilerArgs>
                <!-- ... -->
                <arg>-Astubs=/stubs/a${path.separator}/stubs/b</arg>
              </compilerArgs>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</profile>

Example 4.38. Adding custom stub classes


Search Results

Table Of Contents
warning

Your Internet Explorer is no longer supported.

Please use Mozilla Firefox, Google Chrome, or Microsoft Edge.