Skip to content
Open
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
9 changes: 9 additions & 0 deletions checker/tests/resourceleak/Issue7217.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import java.util.Collection;

// Test case to show fix for https://github.com/typetools/checker-framework/issues/7217
class Issue7217<E extends Enum<E>> {

void test(boolean b, Collection<E> c1, Collection<E> c2) {
Object x = b ? c1 : c2;
}
}
1 change: 1 addition & 0 deletions docs/manual/contributors.tex
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@
Steph Dietzel,
Stephan Schroevers,
Stuart Pernsteiner,
Suvrat Acharya,
Suzanne Millstein,
Thomas Schweizer,
Thomas Wei\ss schuh,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,9 @@ private final AnnotationMirror lowestQualifier(AnnotationMirror qual1, Annotatio
AnnotatedTypeVariable typeVar,
AnnotationMirror top,
boolean canCombinedSetBeMissingAnnos) {
if (typeVar == null) {
return annotation;
}

AnnotationMirror upperBound = typeVar.getAnnotationInHierarchy(top);
TypeMirror upperBoundTM = typeVar.getUpperBound().getUnderlyingType();
Expand Down Expand Up @@ -590,6 +593,9 @@ public ValueLub(boolean shouldWiden) {
AnnotatedTypeVariable typeVar,
AnnotationMirror top,
boolean canCombinedSetBeMissingAnnos) {
if (typeVar == null) {
return annotation;
}
TypeMirror typeVarTM = typeVar.getUnderlyingType();
if (canCombinedSetBeMissingAnnos) {
// anno is the primary annotation on the use of a type variable. typeVar is a use of
Expand Down Expand Up @@ -695,6 +701,9 @@ protected class ValueGlb extends AnnotationSetCombiner {
AnnotatedTypeVariable typeVar,
AnnotationMirror top,
boolean canCombinedSetBeMissingAnnos) {
if (typeVar == null) {
return annotation;
}
TypeMirror typeVarTM = typeVar.getUnderlyingType();
if (canCombinedSetBeMissingAnnos) {
// anno is the primary annotation on the use of a type variable. typeVar is a use of
Expand Down
Loading