Package com.sun.tools.javac.code.Symbol

Examples of com.sun.tools.javac.code.Symbol.PackageSymbol


                Type t = attr.attribType(ref.qualifierExpression, env);
                if (t.isErroneous()) {
                    if (ref.memberName == null) {
                        // Attr/Resolve assume packages exist and create symbols as needed
                        // so use getPackageElement to restrict search to existing packages
                        PackageSymbol pck = elements.getPackageElement(ref.qualifierExpression.toString());
                        if (pck != null) {
                            return pck;
                        } else if (ref.qualifierExpression.hasTag(JCTree.Tag.IDENT)) {
                            // fixup:  allow "identifier" instead of "#identifier"
                            // for compatibility with javadoc
View Full Code Here


            }else{
                Boolean exists = packageExistence.get(cacheKey);
                if(exists != null)
                    return exists.booleanValue();
            }
            PackageSymbol ceylonPkg = packageName.equals("") ? syms().unnamedPackage : reader.enterPackage(names.fromString(packageName));
            if(loadDeclarations){
                logVerbose("load package "+packageName+" full");
                ceylonPkg.complete();
                /*
                 * Eventually this will go away as we get a hook from the typechecker to load on demand, but
                 * for now the typechecker requires at least ceylon.language to be loaded
                 */
                for(Symbol m : ceylonPkg.members().getElements()){
                    // skip things that are not classes (perhaps package-info?)
                    if(!(m instanceof ClassSymbol))
                        continue;
                    ClassSymbol enclosingClass = getEnclosing((ClassSymbol) m);

                    if(!Util.isLoadedFromSource(enclosingClass)){
                        m.complete();
                        // avoid anonymous and local classes
                        if(isAnonymousOrLocal((ClassSymbol) m))
                            continue;
                        // avoid member classes
                        if(((ClassSymbol)m).getNestingKind() != NestingKind.TOP_LEVEL)
                            continue;
                        // skip module and package descriptors
                        if(isModuleOrPackageDescriptorName(m.name.toString()))
                            continue;
                        convertToDeclaration(module, lookupClassMirror(module, m.getQualifiedName().toString()), DeclarationType.VALUE);
                    }
                }
                if(module.getNameAsString().equals(JAVA_BASE_MODULE_NAME)
                        && packageName.equals("java.lang"))
                    loadJavaBaseArrays();
                // a bit complicated, but couldn't find better. PackageSymbol.exists() seems to be set only by Enter which
                // might be too late
                return ceylonPkg.members().getElements().iterator().hasNext();
            }else{
                logVerbose("load package "+packageName+" light");
                try {
                    // it is cheaper to verify that we have a class file somewhere than to complete the whole package
                    // just to check for its existence
View Full Code Here

                        classSymbol.complete();
                    }catch(CompletionFailure x){
                        // if we can't complete it it doesn't exist, its classfile will remain null
                    }
                    if(classSymbol.classfile == null){
                        PackageSymbol pkg = classSymbol.packge();
                        // do not log an error for missing oracle jdk stuff
                        if(pkg == null || !JDKUtils.isOracleJDKAnyPackage(pkg.getQualifiedName().toString())){
                            // do not log an error because it will be logged elsewhere
                            logVerbose("Unable to find required class file for "+name);
                        }
                        return null;
                    }
View Full Code Here

        return false;
    }

    private void handleCompletionFailure(MethodSymbol method, CompletionFailure x) {
        if(method.owner != null){
            PackageSymbol methodPackage = method.owner.packge();
            if(methodPackage != null){
                String methodPackageName = methodPackage.getQualifiedName().toString();
                if(JDKUtils.isJDKAnyPackage(methodPackageName)){
                    if(x.sym != null && x.sym instanceof ClassSymbol){
                        PackageSymbol pkg = ((ClassSymbol)x.sym).packge();
                        if(pkg != null){
                            String pkgName = pkg.getQualifiedName().toString();
                            if(JDKUtils.isOracleJDKAnyPackage(pkgName)){
                                // the JDK tried to use some Oracle JDK stuff, just log it
                                logMissingOracleType(x.getMessage());
                                return;
                            }
View Full Code Here

       
        // reset all class symbols
        for(ClassSymbol classSymbol : symtab.classes.values()){
            if(Util.isLoadedFromSource(classSymbol)
                    || (classSymbol.sourcefile != null && classSymbol.sourcefile.getKind() == Kind.SOURCE)){
                PackageSymbol pkg = classSymbol.packge();
                String name = pkg.getQualifiedName().toString();
                if(name.startsWith(AbstractModelLoader.CEYLON_LANGUAGE) || name.startsWith("com.redhat.ceylon.compiler.java"))
                    resetClassSymbol(classSymbol);
            }
        }
       
View Full Code Here

TOP

Related Classes of com.sun.tools.javac.code.Symbol.PackageSymbol

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.