All Downloads are FREE. Search and download functionalities are using the official Maven repository.

checker.src.org.checkerframework.checker.interning.qual.Interned Maven / Gradle / Ivy

Go to download

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.

There is a newer version: 3.42.0
Show newest version
package org.checkerframework.checker.interning.qual;

import org.checkerframework.checker.interning.InterningChecker;
import org.checkerframework.framework.qual.DefaultFor;
import org.checkerframework.framework.qual.ImplicitFor;
import org.checkerframework.framework.qual.LiteralKind;
import org.checkerframework.framework.qual.SubtypeOf;
import org.checkerframework.framework.qual.TypeUseLocation;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import javax.lang.model.type.TypeKind;

/**
 * Indicates that a variable has been interned, i.e., that the variable refers
 * to the canonical representation of an object.
 * 

* * To specify that all objects of a given type are interned, annotate the class declaration: *

 *   public @Interned class MyInternedClass { ... }
 * 
* This is equivalent to annotating every use of MyInternedClass, in a * declaration or elsewhere. For example, enum classes are implicitly so * annotated. *

* * This annotation is associated with the {@link InterningChecker}. * * @see InterningChecker * @checker_framework.manual #interning-checker Interning Checker */ @SubtypeOf(UnknownInterned.class) @ImplicitFor(literals = { LiteralKind.ALL }, types = { TypeKind.BOOLEAN, TypeKind.BYTE, TypeKind.CHAR, TypeKind.DOUBLE, TypeKind.FLOAT, TypeKind.INT, TypeKind.LONG, TypeKind.SHORT }, typeNames = { Void.class }) @DefaultFor(value={ TypeUseLocation.LOWER_BOUND } ) @Documented @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER}) public @interface Interned {}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy