1020 // check that no package exists with same fully qualified name, |
1020 // check that no package exists with same fully qualified name, |
1021 // but admit classes in the unnamed package which have the same |
1021 // but admit classes in the unnamed package which have the same |
1022 // name as a top-level package. |
1022 // name as a top-level package. |
1023 if (checkClash && |
1023 if (checkClash && |
1024 c.owner.kind == PCK && c.owner != syms.unnamedPackage && |
1024 c.owner.kind == PCK && c.owner != syms.unnamedPackage && |
1025 reader.packageExists(c.fullname)) |
1025 reader.packageExists(c.fullname)) { |
1026 { |
1026 log.error(tree.pos, "clash.with.pkg.of.same.name", Kinds.kindName(sym), c); |
1027 log.error(tree.pos, "clash.with.pkg.of.same.name", Kinds.kindName(sym), c); |
1027 } |
1028 } |
1028 if (c.owner.kind == PCK && (c.flags_field & PUBLIC) == 0 && |
1029 |
1029 !env.toplevel.sourcefile.isNameCompatible(c.name.toString(),JavaFileObject.Kind.SOURCE)) { |
|
1030 c.flags_field |= AUXILIARY; |
|
1031 } |
1030 } catch (CompletionFailure ex) { |
1032 } catch (CompletionFailure ex) { |
1031 chk.completionError(tree.pos(), ex); |
1033 chk.completionError(tree.pos(), ex); |
1032 } finally { |
1034 } finally { |
1033 log.useSource(prev); |
1035 log.useSource(prev); |
1034 } |
1036 } |