@@ -213,15 +213,26 @@ public LocatorResponse match(Type node, NodeSetWrapper nodeSet, MatchLocator loc
213213 r1 = matchTypeNodeReturnComponent (node , patternQualifiedString , fqqn , defaultLevel );
214214 if ( r1 != null ) return r1 ;
215215 }
216- // } else {
217- // String[] qualifiedNameFromNodeSegments = qualifiedNameFromNode.split("\\.");
218- // String first = qualifiedNameFromNodeSegments == null ? null : qualifiedNameFromNodeSegments.length == 0 ? null : qualifiedNameFromNodeSegments[0];
219- // String fqqnImport = fqqnFromImport(first);
220- // if( fqqnImport != null ) {
221- // String fqqn = fqqnImport + qualifiedNameFromNode.substring(first.length());
222- // r1 = matchTypeNodeReturnComponent(node, qualifiedNameFromNode, fqqn, defaultLevel);
223- // if( r1 != null ) return r1;
224- // }
216+ } else {
217+ String [] qualifiedNameFromNodeSegments = qualifiedNameFromNode .split ("\\ ." );
218+ String [] qualifiedNamePatternSegments = patternQualifiedString .split ("\\ ." );
219+ String firstNodeSegment = qualifiedNameFromNodeSegments == null ? null : qualifiedNameFromNodeSegments .length == 0 ? null : qualifiedNameFromNodeSegments [0 ];
220+ String firstPatternSegment = qualifiedNamePatternSegments == null ? null : qualifiedNamePatternSegments .length == 0 ? null : qualifiedNamePatternSegments [0 ];
221+ String fqqnImportFromNode = fqqnFromImport (firstNodeSegment );
222+ if ( fqqnImportFromNode != null ) {
223+ String fqqn = fqqnImportFromNode + qualifiedNameFromNode .substring (firstNodeSegment .length ());
224+ r1 = matchTypeNodeReturnComponent (node , qualifiedNameFromNode , fqqn , defaultLevel );
225+ if ( r1 != null )
226+ return r1 ;
227+ }
228+ String fqqnImportFromPattern = fqqnFromImport (firstPatternSegment );
229+ if ( fqqnImportFromPattern != null ) {
230+ String fqqn = fqqnImportFromPattern + patternQualifiedString .substring (firstPatternSegment .length ());
231+ r1 = matchTypeNodeReturnComponent (node , qualifiedNameFromNode , fqqn , defaultLevel );
232+ if ( r1 != null )
233+ return r1 ;
234+ }
235+
225236 }
226237 } else if (simpleNameFromNode != null ) {
227238 if ( this .locator .matchesName (this .locator .pattern .simpleName , simpleNameFromNode .toCharArray ()) ) {
@@ -335,9 +346,11 @@ private int validateTypeParameters(Type node) {
335346 if ( !canContinue ) {
336347 return TYPE_PARAMS_COUNT_MATCH ;
337348 }
338- } else if ( patternSig .startsWith ("Q" )) {
339- String patternSig2 = patternSig .substring (1 );
340- if ( !patternSig2 .equals (domSig .substring (1 )) && !domSig .endsWith ("." + patternSig2 )) {
349+ } else if ( patternSig .startsWith ("Q" ) || patternSig .startsWith ("+Q" ) || patternSig .startsWith ("-Q" )) {
350+ String patternSigWithoutPrefix = patternSig .startsWith ("+" ) || patternSig .startsWith ("-" ) ? patternSig .substring (1 ) : patternSig ;
351+ String domSigWithoutPrefix = domSig .startsWith ("+" ) || domSig .startsWith ("-" ) ? domSig .substring (1 ) : domSig ;
352+ String patternSig2 = patternSigWithoutPrefix .substring (1 );
353+ if ( !patternSig2 .equals (domSigWithoutPrefix .substring (1 )) && !domSig .endsWith ("." + patternSig2 )) {
341354 return TYPE_PARAMS_COUNT_MATCH ;
342355 }
343356 } else if ( !patternSig .equals (domSig )) {
0 commit comments