private void resolveStaticMethodsUsingImports ( Expression expression ) { if ( expression instanceof MethodCallExpr ) { MethodCallExpr methodCall = ( ( MethodCallExpr ) expression ) ; String methodName = methodCall . getName ( ) . getIdentifier ( ) ; if ( ! methodCall . getScope ( ) . isPresent ( ) && context . hasStaticMethod ( methodName ) ) { methodCall . setName ( context . getFullyQualifiedNameForMethodName ( methodName ) ) ; } } // Recurse downward in the expression expression . getChildNodes ( ) . stream ( ) . filter ( Expression . class :: isInstance ) . map ( Expression . class :: cast ) . forEach ( this :: resolveStaticMethodsUsingImports ) ; }
Resolve static method calls using static imports