Thu, 05 Sep 2019 18:58:59 +0800
Merge
1.1 --- a/.hgtags Thu Sep 05 18:40:52 2019 +0800 1.2 +++ b/.hgtags Thu Sep 05 18:58:59 2019 +0800 1.3 @@ -1005,7 +1005,20 @@ 1.4 c0f526208190beea95ec99b06655603537c761f0 jdk8u202-b26 1.5 95f8837bfbdc0da195c6ab9a32b97921cc2dd292 jdk8u202-ga 1.6 075120a8b410485605fffd5bef20ab66ed97bef8 jdk8u212-b00 1.7 +f301c2612d6092ca64b0ba1807a07cf25941bc3b jdk8u222-b00 1.8 f301c2612d6092ca64b0ba1807a07cf25941bc3b jdk8u212-b01 1.9 59ab73ca14e84b4970ac1feb1ddb3f3d9a087d81 jdk8u212-b02 1.10 +4c4c8a86bcb2130dca9581a9aad6a60c01bfeeb0 jdk8u212-b03 1.11 +075e7154cddf75a861c657c6177797fdfbf36d3f jdk8u212-b04 1.12 +4c4c8a86bcb2130dca9581a9aad6a60c01bfeeb0 jdk8u212-ga 1.13 d39b8dd19360fcfdf728da5bbdfb0fe5fa178a3b mips64el-jdk8u212-b04 1.14 dc0fe0710e423100d3a3256be011e451f1367951 mips64el-jdk8u212-b05 1.15 +1f6b4d9449772ea511e1772c3bdd840e0e550e8c jdk8u222-b01 1.16 +d91f70a5eb9d97d2ec52d3d63a512030b151250c jdk8u222-b02 1.17 +12045c5cae334679b31386ddb790c3b7394525ea jdk8u222-b03 1.18 +a5c129168bd3a65209f0b3e53d13b04a5134f07f jdk8u222-b04 1.19 +2ad39b194cc1b7fa1f368b044e86f43a2b6552b1 jdk8u222-b05 1.20 +563e06335c252222c825a1fd67425b99581dbac2 jdk8u222-b06 1.21 +1b641cb01496dfa3d13b7587e76b22d76bfe51c6 jdk8u222-b07 1.22 +e5ee6728508d72b987758116d9b0a23e4f3830c1 jdk8u222-b08 1.23 +6aa4f05982eb70dc746f84a152c4e5e0b4a7261e jdk8u222-b09
2.1 --- a/THIRD_PARTY_README Thu Sep 05 18:40:52 2019 +0800 2.2 +++ b/THIRD_PARTY_README Thu Sep 05 18:58:59 2019 +0800 2.3 @@ -1612,7 +1612,7 @@ 2.4 2.5 ------------------------------------------------------------------------------- 2.6 2.7 -%% This notice is provided with respect to GIFLIB 5.1.1 & libungif 4.1.3, 2.8 +%% This notice is provided with respect to GIFLIB 5.1.8 & libungif 4.1.3, 2.9 which may be included with JRE 8, JDK 8, and OpenJDK 8. 2.10 2.11 --- begin of LICENSE --- 2.12 @@ -1682,7 +1682,7 @@ 2.13 --- begin of LICENSE --- 2.14 2.15 Mesa 3-D graphics library 2.16 - Version: 4.1 2.17 + Version: 5.0 2.18 2.19 Copyright (C) 1999-2002 Brian Paul All Rights Reserved. 2.20 2.21 @@ -2797,61 +2797,8 @@ 2.22 not be used in advertising or otherwise to promote the sale, use or 2.23 other dealings in this Software without prior written authorization 2.24 from the X Consortium. 2.25 -___________________________ 2.26 -The files in motif/lib/Xm/util included this copyright:mkdirhier.man, 2.27 -xmkmf.man, chownxterm.c, makeg.man, mergelib.cpp, lndir.man, makestrs.man, 2.28 -checktree.c, lndir.c, makestrs.c 2.29 -Copyright (c) 1993, 1994 X Consortium 2.30 - 2.31 -Permission is hereby granted, free of charge, to any person obtaining a 2.32 -copy of this software and associated documentation files (the "Software"), 2.33 -to deal in the Software without restriction, including without limitation 2.34 -the rights to use, copy, modify, merge, publish, distribute, sublicense, 2.35 -and/or sell copies of the Software, and to permit persons to whom the 2.36 -Software furnished to do so, subject to the following conditions: 2.37 - 2.38 -The above copyright notice and this permission notice shall be included in 2.39 -all copies or substantial portions of the Software. 2.40 - 2.41 -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 2.42 -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 2.43 -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 2.44 -THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 2.45 -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF 2.46 -OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 2.47 -SOFTWARE. 2.48 - 2.49 -Except as contained in this notice, the name of the X Consortium shall not 2.50 -be used in advertising or otherwise to promote the sale, use or other 2.51 -dealing in this Software without prior written authorization from the 2.52 -X Consortium. 2.53 -_____________________________ 2.54 -Xmos_r.h: 2.55 -/* 2.56 -Copyright (c) 1996 X Consortium 2.57 - 2.58 -Permission is hereby granted, free of charge, to any person obtaining a copy 2.59 -of this software and associated documentation files (the "Software"), to deal 2.60 -in the Software without restriction, including without limitation the rights 2.61 -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 2.62 -copies of the Software, and to permit persons to whom the Software is 2.63 -furnished to do so, subject to the following conditions: 2.64 - 2.65 -The above copyright notice and this permission notice shall be included in 2.66 -all copies or substantial portions of the Software. 2.67 - 2.68 -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 2.69 -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 2.70 -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 2.71 -X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN 2.72 -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 2.73 -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 2.74 - 2.75 -Except as contained in this notice, the name of the X Consortium shall not be 2.76 -used in advertising or otherwise to promote the sale, use or other dealings 2.77 -in this Software without prior written authorization from the X Consortium. 2.78 -*/ 2.79 - 2.80 + 2.81 +--- end of LICENSE --- 2.82 _____________________________ 2.83 Copyright notice for HPkeysym.h: 2.84 /* 2.85 @@ -2906,55 +2853,6 @@ 2.86 performance, or use of this material. 2.87 2.88 */ 2.89 -_____________________________________ 2.90 -Copyright notice in keysym2ucs.h: 2.91 - 2.92 -Copyright 1987, 1994, 1998 The Open Group 2.93 - 2.94 -Permission to use, copy, modify, distribute, and sell this software and its 2.95 -documentation for any purpose is hereby granted without fee, provided that 2.96 -the above copyright notice appear in all copies and that both that 2.97 -copyright notice and this permission notice appear in supporting 2.98 -documentation. 2.99 - 2.100 -The above copyright notice and this permission notice shall be included 2.101 -in all copies or substantial portions of the Software. 2.102 - 2.103 -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 2.104 -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 2.105 -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 2.106 -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR 2.107 -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 2.108 -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 2.109 -OTHER DEALINGS IN THE SOFTWARE. 2.110 - 2.111 -Except as contained in this notice, the name of The Open Group shall 2.112 -not be used in advertising or otherwise to promote the sale, use or 2.113 -other dealings in this Software without prior written authorization 2.114 -from The Open Group. 2.115 - 2.116 - 2.117 -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts 2.118 - 2.119 -All Rights Reserved 2.120 - 2.121 -Permission to use, copy, modify, and distribute this software and its 2.122 -documentation for any purpose and without fee is hereby granted, 2.123 -provided that the above copyright notice appear in all copies and that 2.124 -both that copyright notice and this permission notice appear in 2.125 -supporting documentation, and that the name of Digital not be 2.126 -used in advertising or publicity pertaining to distribution of the 2.127 -software without specific, written prior permission. 2.128 - 2.129 -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING 2.130 -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL 2.131 -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR 2.132 -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, 2.133 -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, 2.134 -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS 2.135 -SOFTWARE. 2.136 - 2.137 -*/ 2.138 2.139 --- end of LICENSE --- 2.140 2.141 @@ -3000,7 +2898,7 @@ 2.142 Apache Jakarta BCEL 5.1 2.143 Apache Jakarta Regexp 1.4 2.144 Apache Santuario XML Security for Java 1.5.4 2.145 - Apache Xalan-Java 2.7.1 2.146 + Apache Xalan-Java 2.7.2 2.147 Apache Xerces Java 2.10.0 2.148 Apache XML Resolver 1.1 2.149
3.1 --- a/src/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java Thu Sep 05 18:40:52 2019 +0800 3.2 +++ b/src/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java Thu Sep 05 18:58:59 2019 +0800 3.3 @@ -1,5 +1,5 @@ 3.4 /* 3.5 - * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. 3.6 + * Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved. 3.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3.8 * 3.9 * This code is free software; you can redistribute it and/or modify it 3.10 @@ -350,6 +350,7 @@ 3.11 log.error("proc.bad.config.file", sce.getLocalizedMessage()); 3.12 throw new Abort(sce); 3.13 } catch (Throwable t) { 3.14 + log.error("proc.bad.config.file", t.getLocalizedMessage()); 3.15 throw new Abort(t); 3.16 } 3.17 } 3.18 @@ -360,7 +361,14 @@ 3.19 } catch (ServiceConfigurationError sce) { 3.20 log.error("proc.bad.config.file", sce.getLocalizedMessage()); 3.21 throw new Abort(sce); 3.22 + } catch (UnsupportedClassVersionError ucve) { 3.23 + log.error("proc.cant.load.class", ucve.getLocalizedMessage()); 3.24 + throw new Abort(ucve); 3.25 + } catch (ClassFormatError cfe) { 3.26 + log.error("proc.cant.load.class", cfe.getLocalizedMessage()); 3.27 + throw new Abort(cfe); 3.28 } catch (Throwable t) { 3.29 + log.error("proc.bad.config.file", t.getLocalizedMessage()); 3.30 throw new Abort(t); 3.31 } 3.32 }
4.1 --- a/src/share/classes/com/sun/tools/javac/resources/compiler.properties Thu Sep 05 18:40:52 2019 +0800 4.2 +++ b/src/share/classes/com/sun/tools/javac/resources/compiler.properties Thu Sep 05 18:58:59 2019 +0800 4.3 @@ -1,5 +1,5 @@ 4.4 # 4.5 -# Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. 4.6 +# Copyright (c) 1999, 2019, Oracle and/or its affiliates. All rights reserved. 4.7 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4.8 # 4.9 # This code is free software; you can redistribute it and/or modify it 4.10 @@ -869,6 +869,9 @@ 4.11 compiler.err.proc.bad.config.file=\ 4.12 Bad service configuration file, or exception thrown while constructing Processor object: {0} 4.13 4.14 +compiler.err.proc.cant.load.class=\ 4.15 + Could not load processor class file due to ''{0}''. 4.16 + 4.17 compiler.err.proc.cant.create.loader=\ 4.18 Could not create class loader for annotation processors: {0} 4.19
5.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 5.2 +++ b/test/tools/javac/annotations/8218152/MalformedAnnotationProcessorTests.java Thu Sep 05 18:58:59 2019 +0800 5.3 @@ -0,0 +1,158 @@ 5.4 +/* 5.5 + * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. 5.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 5.7 + * 5.8 + * This code is free software; you can redistribute it and/or modify it 5.9 + * under the terms of the GNU General Public License version 2 only, as 5.10 + * published by the Free Software Foundation. 5.11 + * 5.12 + * This code is distributed in the hope that it will be useful, but WITHOUT 5.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 5.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 5.15 + * version 2 for more details (a copy is included in the LICENSE file that 5.16 + * accompanied this code). 5.17 + * 5.18 + * You should have received a copy of the GNU General Public License version 5.19 + * 2 along with this work; if not, write to the Free Software Foundation, 5.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 5.21 + * 5.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 5.23 + * or visit www.oracle.com if you need additional information or have any 5.24 + * questions. 5.25 + */ 5.26 + 5.27 +/* 5.28 + * @test 5.29 + * @bug 8218152 5.30 + * @summary A bad annotation processor class file should fail with an error 5.31 + * @author Steven Groeger 5.32 + * 5.33 + * @library /tools/javac/lib 5.34 + * @build ToolBox 5.35 + * @run main MalformedAnnotationProcessorTests 5.36 + */ 5.37 + 5.38 +import java.io.*; 5.39 +import java.util.*; 5.40 +import java.io.RandomAccessFile; 5.41 +import java.nio.ByteBuffer; 5.42 +import java.nio.channels.FileChannel; 5.43 +import java.nio.file.Files; 5.44 +import java.nio.file.Path; 5.45 +import java.nio.file.Paths; 5.46 +import java.util.List; 5.47 +import javax.annotation.processing.Processor; 5.48 + 5.49 +public class MalformedAnnotationProcessorTests { 5.50 + public static void main(String... args) throws Exception { 5.51 + new MalformedAnnotationProcessorTests().run(); 5.52 + } 5.53 + 5.54 + void run() throws Exception { 5.55 + testBadAnnotationProcessor(Paths.get(".")); 5.56 + testMissingAnnotationProcessor(Paths.get(".")); 5.57 + testWrongClassFileVersion(Paths.get(".")); 5.58 + } 5.59 + 5.60 + public void testBadAnnotationProcessor(Path base) throws Exception { 5.61 + Path apDir = base.resolve("annoprocessor"); 5.62 + ToolBox.writeFile(apDir.resolve("META-INF").resolve("services") 5.63 + .resolve(Processor.class.getCanonicalName()), "BadAnnoProcessor"); 5.64 + ToolBox.writeFile(apDir.resolve("BadAnnoProcessor.class"), "badannoprocessor"); 5.65 + 5.66 + Path classes = base.resolve("classes"); 5.67 + Files.createDirectories(classes); 5.68 + 5.69 + List<String> actualErrors = new ArrayList<>(); 5.70 + ToolBox.JavaToolArgs args = new ToolBox.JavaToolArgs(); 5.71 + args.setSources("package test; public class Test {}") 5.72 + .appendArgs("-XDrawDiagnostics", 5.73 + "-d", classes.toString(), 5.74 + "-classpath", "", 5.75 + "-processorpath", apDir.toString()) 5.76 + .set(ToolBox.Expect.FAIL) 5.77 + .setErrOutput(actualErrors); 5.78 + ToolBox.javac(args); 5.79 + 5.80 + System.out.println(actualErrors.get(0)); 5.81 + if (!actualErrors.get(0).contains("- compiler.err.proc.cant.load.class: " + 5.82 + "Incompatible magic value")) { 5.83 + throw new AssertionError("Unexpected errors reported: " + actualErrors); 5.84 + } 5.85 + } 5.86 + 5.87 + public void testMissingAnnotationProcessor(Path base) throws Exception { 5.88 + Path apDir = base.resolve("annoprocessor"); 5.89 + ToolBox.writeFile(apDir.resolve("META-INF").resolve("services").resolve(Processor.class.getCanonicalName()), 5.90 + "MissingAnnoProcessor"); 5.91 + 5.92 + Path classes = base.resolve("classes"); 5.93 + Files.createDirectories(classes); 5.94 + 5.95 + List<String> actualErrors = new ArrayList<>(); 5.96 + ToolBox.JavaToolArgs args = new ToolBox.JavaToolArgs(); 5.97 + args.setSources("package test; public class Test {}") 5.98 + .appendArgs("-XDrawDiagnostics", 5.99 + "-d", classes.toString(), 5.100 + "-classpath", "", 5.101 + "-processorpath", apDir.toString()) 5.102 + .set(ToolBox.Expect.FAIL) 5.103 + .setErrOutput(actualErrors); 5.104 + ToolBox.javac(args); 5.105 + 5.106 + if (!actualErrors.get(0).contains("- compiler.err.proc.bad.config.file: " + 5.107 + "javax.annotation.processing.Processor: Provider MissingAnnoProcessor not found")) { 5.108 + throw new AssertionError("Unexpected errors reported: " + actualErrors); 5.109 + } 5.110 + } 5.111 + 5.112 + public void testWrongClassFileVersion(Path base) throws Exception { 5.113 + Path apDir = base.resolve("annoprocessor"); 5.114 + ToolBox.writeFile(apDir.resolve("META-INF").resolve("services").resolve(Processor.class.getCanonicalName()), 5.115 + "WrongClassFileVersion"); 5.116 + 5.117 + ToolBox.JavaToolArgs args = new ToolBox.JavaToolArgs(); 5.118 + args.setSources("class WrongClassFileVersion {}") 5.119 + .appendArgs("-d", apDir.toString()) 5.120 + .set(ToolBox.Expect.SUCCESS); 5.121 + ToolBox.javac(args); 5.122 + 5.123 + increaseMajor(apDir.resolve("WrongClassFileVersion.class"), 1); 5.124 + 5.125 + Path classes = base.resolve("classes"); 5.126 + Files.createDirectories(classes); 5.127 + 5.128 + List<String> actualErrors = new ArrayList<>(); 5.129 + args = new ToolBox.JavaToolArgs(); 5.130 + args.setSources("package test; public class Test {}") 5.131 + .appendArgs("-XDrawDiagnostics", 5.132 + "-d", classes.toString(), 5.133 + "-classpath", "", 5.134 + "-processorpath", apDir.toString()) 5.135 + .set(ToolBox.Expect.FAIL) 5.136 + .setErrOutput(actualErrors); 5.137 + ToolBox.javac(args); 5.138 + 5.139 + if (!actualErrors.get(0).contains("- compiler.err.proc.cant.load.class: " + 5.140 + "WrongClassFileVersion has been compiled by a more recent version")) { 5.141 + throw new AssertionError("Unexpected errors reported: " + actualErrors); 5.142 + } 5.143 + } 5.144 + 5.145 + // Increase class file cfile's major version by delta 5.146 + // (note: based on test/langtools/tools/javac/6330997/T6330997.java) 5.147 + static void increaseMajor(Path cfile, int delta) { 5.148 + try (RandomAccessFile cls = 5.149 + new RandomAccessFile(cfile.toFile(), "rw"); 5.150 + FileChannel fc = cls.getChannel()) { 5.151 + ByteBuffer rbuf = ByteBuffer.allocate(2); 5.152 + fc.read(rbuf, 6); 5.153 + ByteBuffer wbuf = ByteBuffer.allocate(2); 5.154 + wbuf.putShort(0, (short)(rbuf.getShort(0) + delta)); 5.155 + fc.write(wbuf, 6); 5.156 + fc.force(false); 5.157 + } catch (Exception e){ 5.158 + throw new RuntimeException("Failed: unexpected exception"); 5.159 + } 5.160 + } 5.161 +}
6.1 --- a/test/tools/javac/diags/examples.not-yet.txt Thu Sep 05 18:40:52 2019 +0800 6.2 +++ b/test/tools/javac/diags/examples.not-yet.txt Thu Sep 05 18:58:59 2019 +0800 6.3 @@ -32,6 +32,7 @@ 6.4 compiler.err.proc.no.service # JavacProcessingEnvironment: no service loader available 6.5 compiler.err.proc.processor.bad.option.name # cannot happen? masked by javac.err.invalid.A.key 6.6 compiler.err.proc.service.problem # JavacProcessingEnvironment: catch Throwable from service loader 6.7 +compiler.err.proc.cant.load.class # JavacProcessingEnvironment: cant load the class/jar file 6.8 compiler.err.signature.doesnt.match.intf # UNUSED 6.9 compiler.err.signature.doesnt.match.supertype # UNUSED 6.10 compiler.err.source.cant.overwrite.input.file