@@ -896,23 +896,27 @@ public void reportSearchMatch(MatchLocator locator, ASTNode node, SearchMatch ma
896896 if (!report )
897897 return ;
898898
899- ASTNode replacementNode = null ;
900- if ( node instanceof QualifiedType qtt ) {
901- replacementNode = findNodeMatchingPatternQualifier (qtt .getQualifier ());
902- } else if ( node instanceof SimpleType st ) {
903- replacementNode = findNodeMatchingPatternQualifier (st );
899+ ASTNode replacementNodeForStartPosition = null ;
900+ ASTNode toCheck = node ;
901+ if ( node instanceof ParameterizedType ptt ) {
902+ toCheck = ptt .getType ();
903+ }
904+ if ( toCheck instanceof QualifiedType qtt ) {
905+ replacementNodeForStartPosition = findNodeMatchingPatternQualifier (qtt .getQualifier ());
906+ } else if ( toCheck instanceof SimpleType st ) {
907+ replacementNodeForStartPosition = findNodeMatchingPatternQualifier (st );
904908 }
905909
906- if ( replacementNode != null ) {
910+ if ( replacementNodeForStartPosition != null ) {
907911 int matchStart = match .getOffset ();
908912 int matchEnd = matchStart + match .getLength ();
909- int newStart = replacementNode .getStartPosition ();
913+ int newStart = replacementNodeForStartPosition .getStartPosition ();
910914 int newLength = matchEnd - newStart ;
911915 match .setOffset (newStart );
912916 match .setLength (newLength );
913917 }
914918
915- ASTNode working = (replacementNode != null ? replacementNode : node );
919+ ASTNode working = (replacementNodeForStartPosition != null ? replacementNodeForStartPosition : node );
916920 int trimQualifierStart = findTrimQualifierStart (working );
917921 if ( trimQualifierStart != -1 ) {
918922 int matchStart = match .getOffset ();
0 commit comments