private Symbol nameToSymbol(String name, boolean classCache) {
        Symbol s = null;
        Name nameName = env.names.fromString(name);
        if (classCache)
            s = env.symtab.classes.get(nameName);
        else
            s = env.symtab.packages.get(nameName);

        if (s != null && s.exists())
            return s;

        s = javacompiler.resolveIdent(name);
        if (s.kind == Kinds.ERR  )
            return null;

        if (s.kind == Kinds.PCK)
            s.complete();

        return s;
    }