Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.StringJoiner;
import javax.lang.model.element.AnnotationMirror;
import javax.lang.model.element.Element;
import javax.lang.model.type.TypeKind;
Expand Down Expand Up @@ -618,4 +619,28 @@ public ErrorTypeKindException(String format, Object... args) {
super(String.format(format, args));
}
}

/**
* Returns the formatted representation of a {@link TypeCompound}.
*
* @param tc a TypeCompound
* @return its string representation
*/
public static String toString(TypeCompound tc) {
return tc + "@" + tc.getPosition();
}

/**
* Returns the formatted representation of a collection of {@link TypeCompound}s.
*
* @param tcs a collection of TypeCompounds
* @return its string representation
*/
public static String toString(Iterable<TypeCompound> tcs) {
StringJoiner sj = new StringJoiner(", ", "[", "]");
for (TypeCompound tc : tcs) {
sj.add(toString(tc));
}
return sj.toString();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ protected boolean isAccepted() {
public void extractAndApply() throws UnexpectedAnnotationLocationException {
methodType.setElement(methodSymbol); // Preserves previous behavior

// Add declaration annotations to the return type if
// Add declaration annotations to the return type.
if (methodType.getReturnType() instanceof AnnotatedTypeVariable) {
applyTypeVarUseOnReturnType();
}
Expand All @@ -152,7 +152,7 @@ public void extractAndApply() throws UnexpectedAnnotationLocationException {
methodType.getTypeVariables(), methodSymbol.getTypeParameters(), typeFactory);
}

// NOTE that these are the only locations not handled elsewhere, otherwise we call apply
// NOTE that these are the only locations not handled elsewhere, otherwise we call apply.
@Override
protected void handleTargeted(List<TypeCompound> targeted)
throws UnexpectedAnnotationLocationException {
Expand Down
Loading