Class SyntheticArrays
java.lang.Object
org.checkerframework.framework.type.SyntheticArrays
SyntheticArrays exists solely to fix AnnotatedTypeMirrors that need to be adapted from Array type
to a specific kind of array. There are no classes for arrays. Instead, for each type of array
(e.g. String[]) the compiler/JVM creates a synthetic type for them.
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
isArrayClone
(AnnotatedTypeMirror type, Element elem) Returns true if this combination of type/elem represents an array.clone.replaceReturnType
(Element methodElem, AnnotatedTypeMirror.AnnotatedArrayType newReturnType) Returns the annotated type of methodElem with its return type replaced by newReturnType.
-
Method Details
-
isArrayClone
Returns true if this combination of type/elem represents an array.clone.- Parameters:
type
- a type with a method/field of elemelem
- an element which is a member of type- Returns:
- true if this combination of type/elem represents an array.clone
-
replaceReturnType
public static AnnotatedTypeMirror.AnnotatedExecutableType replaceReturnType(Element methodElem, AnnotatedTypeMirror.AnnotatedArrayType newReturnType) Returns the annotated type of methodElem with its return type replaced by newReturnType.- Parameters:
methodElem
- identifies a method that should have an AnnotatedArrayType as its return typenewReturnType
- identifies a type that should replace methodElem's return type- Returns:
- the annotated type of methodElem with its return type replaced by newReturnType
-