Mercurial > hg > icedtea8-forest > langtools
changeset 3885:517f10ee596b icedtea-3.12.0pre01
Merge jdk8u202-ga
author | andrew |
---|---|
date | Fri, 12 Apr 2019 21:32:14 +0100 |
parents | 26b29f3e117c (current diff) 95f8837bfbdc (diff) |
children | 929383e58d9e |
files | .hgtags |
diffstat | 4 files changed, 124 insertions(+), 32 deletions(-) [+] |
line wrap: on
line diff
--- a/.hgtags Mon Mar 04 16:45:39 2019 +0000 +++ b/.hgtags Fri Apr 12 21:32:14 2019 +0100 @@ -993,6 +993,7 @@ db3c95ad833530ff6454cf47b9063325902bbb64 jdk8u192-b01 b9b11d994f5cab7000f53a2a9cf8a15b2b3f23b1 jdk8u192-b02 df7eda60d98d11b89fae1eb901899dd88d33ae58 jdk8u192-b03 +df7eda60d98d11b89fae1eb901899dd88d33ae58 jdk8u202-b00 7031ed34a60400768d5136df03cbf8f05e6d9a6b jdk8u192-b04 6c91965b2ac226596877ee0259f95f858638536e jdk8u192-b05 9593cfca3186f7481627bda08b24e3a0a3f7bed4 jdk8u192-b06 @@ -1025,3 +1026,10 @@ dd3348cbc2d0651582fa8ede11c58e6bdd365c61 jdk8u201-b77 8c8f74830128f0b244d878920df032e704d35eee jdk8u201-b08 78414f4f0172bf37926faeefe54df0b7f8381d0d icedtea-3.11.0 +29d5186cdb7c5c0a47de00e6487ccaa1dffd85a6 jdk8u202-b01 +6be61de8b2a753b117c525dfefb7f357036e0da2 jdk8u202-b02 +0f0df1c7190a7435d796b268d152883c7b86a821 jdk8u202-b03 +16424331a075b9d4a5f874f5072393cd83c863c5 jdk8u202-b04 +08a36f013df27134878b8ce4af10bf7b4c280de0 jdk8u202-b05 +0bab06166b752fd5dc64e0f087afbb761db7b667 jdk8u202-b06 +d050098ff289bdf42e642fff35a11a15e377624e jdk8u202-b07
--- a/THIRD_PARTY_README Mon Mar 04 16:45:39 2019 +0000 +++ b/THIRD_PARTY_README Fri Apr 12 21:32:14 2019 +0100 @@ -2880,35 +2880,6 @@ */ _____________________________ -Copyright notice for extutil.h: -Copyright 1989, 1998 The Open Group - -All Rights Reserved. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. -* -* Author: Jim Fulton, MIT The Open Group -* -* Xlib Extension-Writing Utilities -* -* This package contains utilities for writing the client API for various -* protocol extensions. THESE INTERFACES ARE NOT PART OF THE X STANDARD AND -* ARE SUBJECT TO CHANGE! -*/ - -_____________________________ Copyright notice for HPkeysym.h: /*
--- a/src/share/classes/com/sun/tools/javac/code/SymbolMetadata.java Mon Mar 04 16:45:39 2019 +0000 +++ b/src/share/classes/com/sun/tools/javac/code/SymbolMetadata.java Fri Apr 12 21:32:14 2019 +0100 @@ -31,10 +31,13 @@ import com.sun.tools.javac.comp.Annotate; import com.sun.tools.javac.comp.AttrContext; +import com.sun.tools.javac.code.Attribute.TypeCompound; +import com.sun.tools.javac.code.Kinds; import com.sun.tools.javac.comp.Env; import com.sun.tools.javac.util.*; import com.sun.tools.javac.util.Assert; import com.sun.tools.javac.util.List; +import com.sun.tools.javac.util.ListBuffer; import com.sun.tools.javac.util.Log; import com.sun.tools.javac.util.Pair; import static com.sun.tools.javac.code.Kinds.PCK; @@ -152,9 +155,22 @@ throw new NullPointerException(); } setDeclarationAttributes(other.getDeclarationAttributes()); - setTypeAttributes(other.getTypeAttributes()); - setInitTypeAttributes(other.getInitTypeAttributes()); - setClassInitTypeAttributes(other.getClassInitTypeAttributes()); + if ((sym.flags() & Flags.BRIDGE) != 0) { + Assert.check(other.sym.kind == Kinds.MTH); + ListBuffer<TypeCompound> typeAttributes = new ListBuffer<>(); + for (TypeCompound tc : other.getTypeAttributes()) { + // Carry over only contractual type annotations: i.e nothing interior to method body. + if (!tc.position.type.isLocal()) + typeAttributes.append(tc); + } + setTypeAttributes(typeAttributes.toList()); + } else { + setTypeAttributes(other.getTypeAttributes()); + } + if (sym.kind == Kinds.TYP) { + setInitTypeAttributes(other.getInitTypeAttributes()); + setClassInitTypeAttributes(other.getClassInitTypeAttributes()); + } } public void setDeclarationAttributesWithCompletion(final Annotate.AnnotateRepeatedContext<Attribute.Compound> ctx) {
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/tools/javac/annotations/typeAnnotations/classfile/BridgeShouldHaveNoInteriorAnnotationsTest.java Fri Apr 12 21:32:14 2019 +0100 @@ -0,0 +1,97 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8160928 + * @summary javac incorrectly copies over interior type annotations to bridge method + * @library /tools/javac/lib + * @build ToolBox + * @run compile -g BridgeShouldHaveNoInteriorAnnotationsTest.java + * @run main BridgeShouldHaveNoInteriorAnnotationsTest + */ + +import java.nio.file.Path; +import java.nio.file.Paths; +import java.lang.annotation.ElementType; +import java.lang.annotation.Target; +import java.io.*; + +class Pair_8160928<T1, T2> { +} + +public class BridgeShouldHaveNoInteriorAnnotationsTest implements java.util.Iterator<Pair_8160928<Object, Object>> { + + @Override + public boolean hasNext() { + throw new RuntimeException(); + } + + @Override + public Pair_8160928<@NonNull Object, Object> next() { + Comparable<@NonNull Object> cble1 = (Comparable<@NonNull Object>) null; + return null; + } + + @Override + public void remove() { + throw new RuntimeException(); + } + + @Target(ElementType.TYPE_USE) + public @interface NonNull { + } + + static class OutputExpectedOnceHolder { + public String[] outputs = { + "0: #55(): CAST, offset=0, type_index=0, location=[TYPE_ARGUMENT(0)]", + "1: #55(): LOCAL_VARIABLE, {start_pc=5, length=2, index=1}, location=[TYPE_ARGUMENT(0)]", + }; + } + + static class OutputExpectedTwiceHolder { + public String[] outputs = { + "0: #55(): METHOD_RETURN, location=[TYPE_ARGUMENT(0)]", + }; + } + + public static void main(String[] args) throws Exception { + Path classPath = Paths.get(System.getProperty("test.classes"), "BridgeShouldHaveNoInteriorAnnotationsTest.class"); + String javapOut = ToolBox.javap(new ToolBox.JavaToolArgs().setAllArgs("-v", "-p", classPath.toString())); + + OutputExpectedOnceHolder holder = new OutputExpectedOnceHolder(); + for (String s : holder.outputs) { + String newOutput = javapOut.replace(s, ""); + if (((javapOut.length() - newOutput.length()) / s.length()) != 1) + throw new AssertionError("Interior annotations carried over to bridge ?"); + } + + OutputExpectedTwiceHolder holder2 = new OutputExpectedTwiceHolder(); + for (String s : holder2.outputs) { + String newOutput = javapOut.replace(s, ""); + if (((javapOut.length() - newOutput.length()) / s.length()) != 2) + throw new AssertionError("Exterior annotations not properly carried over to bridge"); + } + } + +}