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
2 changes: 1 addition & 1 deletion docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Removed method `InitializationParentAnnotatedTypeFactory.createUnderInitializati

**Closed issues:**

eisop#1247, eisop#1263, eisop#1310, eisop#1326, typetools#7096, eisop#1448, eisop#1543.
eisop#792, eisop#1247, eisop#1263, eisop#1310, eisop#1326, typetools#7096, eisop#1448, eisop#1543.


Version 3.49.5 (June 30, 2025)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,16 @@ public Void visitWildcard(AnnotatedWildcardType wildcard, Void aVoid) {
}
visitedNodes.put(wildcard, null);

// Raw wildcard args are already fixed up in visitDeclared.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Raw wildcard" doesn't make sense, does it? You mean "If the wildcard is a type argument to a raw type" or something like that?

// Recursive traversal through scan(wildcard.getExtendsBound(), ...) can
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand what this comment is trying to say. The body of the then-block calls scan on both bounds of the wildcard. Is this intended? What is the problem with re-entering?
Is there any point in scanning these two bounds here? Will they ever propagate anything useful?

// re-enter visitWildcard with a synthesized raw wildcard object that is
// not identity-equal to the parent type argument wildcard.
if (AnnotatedTypes.isTypeArgOfRawType(wildcard)) {
scan(wildcard.getExtendsBound(), null);
scan(wildcard.getSuperBound(), null);
return null;
}

Element typeParamElement = TypesUtils.wildcardToTypeParam(wildcard.getUnderlyingType());
if (typeParamElement == null && !parents.isEmpty()) {
typeParamElement = getTypeParameterElement(wildcard, parents.peekFirst());
Expand Down Expand Up @@ -212,7 +222,8 @@ private void applyAnnosFromBound(
*
* @param typeArg a typeArg of {@code declaredType}
* @param declaredType the type in which {@code typeArg} is a type argument
* @return the type parameter in {@code declaredType} that corresponds to {@code typeArg}
* @return the type parameter in {@code declaredType} that corresponds to {@code typeArg}, or
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change can be undone again?

* null if not found (which can happen with raw types)
*/
private Element getTypeParameterElement(
@FindDistinct AnnotatedTypeMirror typeArg, AnnotatedDeclaredType declaredType) {
Expand Down
4 changes: 4 additions & 0 deletions framework/tests/viewpointtest/RawtypeCrash.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
public class RawtypeCrash<V> {
RawtypeCrash<? extends V> nullObj = null;
Object obj = ((RawtypeCrash) null).nullObj;
}
Loading