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

changeset 1239
2827076dbf64
parent 1220
38ae13dcd215
child 1269
37dc15c68760
equal deleted inserted replaced
1238:e28a06a3c5d9 1239:2827076dbf64
1 /* 1 /*
2 * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 2003, 2012, 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
779 // Note: @Deprecated has no effect on local variables and parameters 779 // Note: @Deprecated has no effect on local variables and parameters
780 if (!c.type.isErroneous() 780 if (!c.type.isErroneous()
781 && s.owner.kind != MTH 781 && s.owner.kind != MTH
782 && types.isSameType(c.type, syms.deprecatedType)) 782 && types.isSameType(c.type, syms.deprecatedType))
783 s.flags_field |= Flags.DEPRECATED; 783 s.flags_field |= Flags.DEPRECATED;
784 // Internally to java.lang.invoke, a @PolymorphicSignature annotation
785 // acts like a classfile attribute.
786 if (!c.type.isErroneous() &&
787 types.isSameType(c.type, syms.polymorphicSignatureType)) {
788 if (!target.hasMethodHandles()) {
789 // Somebody is compiling JDK7 source code to a JDK6 target.
790 // Make it an error, since it is unlikely but important.
791 log.error(env.tree.pos(),
792 "wrong.target.for.polymorphic.signature.definition",
793 target.name);
794 }
795 // Pull the flag through for better diagnostics, even on a bad target.
796 s.flags_field |= Flags.POLYMORPHIC_SIGNATURE;
797 }
798 if (!annotated.add(a.type.tsym)) 784 if (!annotated.add(a.type.tsym))
799 log.error(a.pos, "duplicate.annotation"); 785 log.error(a.pos, "duplicate.annotation");
800 } 786 }
801 s.attributes_field = buf.toList(); 787 s.attributes_field = buf.toList();
802 } 788 }

mercurial