ASTUtils { @Nullable public static ITypeBinding resolveType(AST ast, String name) { try { BindingResolver bindingResolver = ast.getBindingResolver(); ReferenceBinding referenceBinding = bindingResolver .lookupEnvironment() .getType(CharOperation.splitOn('.', name.toCharArray())); return bindingResolver.getTypeBinding(referenceBinding); } catch (Exception e) { LOG.error(String.format("ECJ Unable to resolve type %s", name), e); return null; } } private  ASTUtils(); static void mayTolerateMissingType(AST ast); @Nullable static ITypeBinding resolveType(AST ast, String name); static IAnnotationBinding[] resolvePackageAnnotations(AST ast, String packageName); static String signature(IMethodBinding methodBinding);  }
@Test void type_resolution_should_recover() { assertNull(ASTUtils.resolveType(null, "Unknown")); }