1 /* |
1 /* |
2 * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
419 } |
419 } |
420 if (owner.kind == TYP) { |
420 if (owner.kind == TYP) { |
421 // We are seeing a member class. |
421 // We are seeing a member class. |
422 c = syms.enterClass(env.toplevel.modle, tree.name, (TypeSymbol)owner); |
422 c = syms.enterClass(env.toplevel.modle, tree.name, (TypeSymbol)owner); |
423 if (c.owner != owner) { |
423 if (c.owner != owner) { |
|
424 if (c.name != tree.name) { |
|
425 log.error(tree.pos(), Errors.SameBinaryName(c.name, tree.name)); |
|
426 result = types.createErrorType(tree.name, (TypeSymbol)owner, Type.noType); |
|
427 tree.sym = (ClassSymbol)result.tsym; |
|
428 return; |
|
429 } |
424 //anonymous class loaded from a classfile may be recreated from source (see below) |
430 //anonymous class loaded from a classfile may be recreated from source (see below) |
425 //if this class is a member of such an anonymous class, fix the owner: |
431 //if this class is a member of such an anonymous class, fix the owner: |
426 Assert.check(owner.owner.kind != TYP, owner::toString); |
432 Assert.check(owner.owner.kind != TYP, owner::toString); |
427 Assert.check(c.owner.kind == TYP, () -> c.owner.toString()); |
433 Assert.check(c.owner.kind == TYP, () -> c.owner.toString()); |
428 ClassSymbol cowner = (ClassSymbol) c.owner; |
434 ClassSymbol cowner = (ClassSymbol) c.owner; |