org.checkerframework.checker.interning.InterningChecker Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of checker Show documentation
Show all versions of checker Show documentation
The Checker Framework enhances Java's type system to
make it more powerful and useful. This lets software developers
detect and prevent errors in their Java programs.
The Checker Framework includes compiler plug-ins ("checkers")
that find bugs or verify their absence. It also permits you to
write your own compiler plug-ins.
package org.checkerframework.checker.interning;
import org.checkerframework.checker.interning.qual.Interned;
import org.checkerframework.common.basetype.BaseTypeChecker;
import org.checkerframework.framework.qual.StubFiles;
import org.checkerframework.framework.source.SupportedLintOptions;
import javax.annotation.processing.SupportedOptions;
/**
* A type-checker plug-in for the {@link Interned} qualifier that finds (and verifies the absence
* of) equality-testing and interning errors.
*
* The {@link Interned} annotation indicates that a variable refers to the canonical instance of
* an object, meaning that it is safe to compare that object using the "==" operator. This plugin
* warns whenever "==" is used in cases where one or both operands are not {@link Interned}.
* Optionally, it suggests using "==" instead of ".equals" where possible.
*
* @checker_framework.manual #interning-checker Interning Checker
*/
@StubFiles({"com-sun.astub", "org-jcp.astub", "org-xml.astub", "sun.astub"})
@SupportedLintOptions({"dotequals"})
@SupportedOptions({"checkclass"})
public final class InterningChecker extends BaseTypeChecker {}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy