src/share/classes/com/sun/tools/javac/comp/MemberEnter.java

Print this page



1003             // current scope.
1004             if ((c.flags_field & INTERFACE) == 0) {
1005                 VarSymbol thisSym =
1006                     new VarSymbol(FINAL | HASINIT, names._this, c.type, c);
1007                 thisSym.pos = Position.FIRSTPOS;
1008                 env.info.scope.enter(thisSym);
1009                 if (ct.supertype_field.tag == CLASS) {
1010                     VarSymbol superSym =
1011                         new VarSymbol(FINAL | HASINIT, names._super,
1012                                       ct.supertype_field, c);
1013                     superSym.pos = Position.FIRSTPOS;
1014                     env.info.scope.enter(superSym);
1015                 }
1016             }
1017 
1018             // check that no package exists with same fully qualified name,
1019             // but admit classes in the unnamed package which have the same
1020             // name as a top-level package.
1021             if (checkClash &&
1022                 c.owner.kind == PCK && c.owner != syms.unnamedPackage &&
1023                 reader.packageExists(c.fullname))
1024                 {
1025                     log.error(tree.pos, "clash.with.pkg.of.same.name", Kinds.kindName(sym), c);
1026                 }
1027 



1028         } catch (CompletionFailure ex) {
1029             chk.completionError(tree.pos(), ex);
1030         } finally {
1031             log.useSource(prev);
1032         }
1033 
1034         // Enter all member fields and methods of a set of half completed
1035         // classes in a second phase.
1036         if (wasFirst) {
1037             try {
1038                 while (halfcompleted.nonEmpty()) {
1039                     finish(halfcompleted.next());
1040                 }
1041             } finally {
1042                 isFirst = true;
1043             }
1044 
1045             // commit pending annotations
1046             annotate.flush();
1047         }



1003             // current scope.
1004             if ((c.flags_field & INTERFACE) == 0) {
1005                 VarSymbol thisSym =
1006                     new VarSymbol(FINAL | HASINIT, names._this, c.type, c);
1007                 thisSym.pos = Position.FIRSTPOS;
1008                 env.info.scope.enter(thisSym);
1009                 if (ct.supertype_field.tag == CLASS) {
1010                     VarSymbol superSym =
1011                         new VarSymbol(FINAL | HASINIT, names._super,
1012                                       ct.supertype_field, c);
1013                     superSym.pos = Position.FIRSTPOS;
1014                     env.info.scope.enter(superSym);
1015                 }
1016             }
1017 
1018             // check that no package exists with same fully qualified name,
1019             // but admit classes in the unnamed package which have the same
1020             // name as a top-level package.
1021             if (checkClash &&
1022                 c.owner.kind == PCK && c.owner != syms.unnamedPackage &&
1023                 reader.packageExists(c.fullname)) {

1024                 log.error(tree.pos, "clash.with.pkg.of.same.name", Kinds.kindName(sym), c);
1025             }
1026             if (c.owner.kind == PCK && (c.flags_field & PUBLIC) == 0 &&
1027                 !env.toplevel.sourcefile.isNameCompatible(c.name.toString(),JavaFileObject.Kind.SOURCE)) {
1028                 c.flags_field |= AUXILIARY;
1029             }
1030         } catch (CompletionFailure ex) {
1031             chk.completionError(tree.pos(), ex);
1032         } finally {
1033             log.useSource(prev);
1034         }
1035 
1036         // Enter all member fields and methods of a set of half completed
1037         // classes in a second phase.
1038         if (wasFirst) {
1039             try {
1040                 while (halfcompleted.nonEmpty()) {
1041                     finish(halfcompleted.next());
1042                 }
1043             } finally {
1044                 isFirst = true;
1045             }
1046 
1047             // commit pending annotations
1048             annotate.flush();
1049         }