From e3c7f43298f9861fb2fce2dd58fef13d347e7c67 Mon Sep 17 00:00:00 2001 From: Thomas Schatzl Date: Wed, 22 Jan 2020 10:00:13 +0100 Subject: [PATCH 01/50] 8235305: Corrupted oops embedded in nmethods due to parallel modification during optional evacuation During optional evacuation it is possible that G1 modifies oops embedded in nmethods in parallel. One source are oop* gathered by a previous evacuation phase in the optional roots, the other the region's strong code roots list. Since these oops may be unaligned on x64, this can result in them being corrupted. The fix is to not gather embedded oops in the optional roots list as the strong code roots list contains them already. Co-authored-by: Erik Osterlund Co-authored-by: Stefan Johansson Co-authored-by: Stefan Karlsson Reviewed-by: sjohanss, stefank --- src/hotspot/share/gc/g1/g1OopClosures.hpp | 3 ++- src/hotspot/share/gc/g1/g1OopClosures.inline.hpp | 2 +- src/hotspot/share/gc/g1/g1SharedClosures.hpp | 11 ++++++++++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/hotspot/share/gc/g1/g1OopClosures.hpp b/src/hotspot/share/gc/g1/g1OopClosures.hpp index b2dd0405ec1..ae967681c18 100644 --- a/src/hotspot/share/gc/g1/g1OopClosures.hpp +++ b/src/hotspot/share/gc/g1/g1OopClosures.hpp @@ -152,7 +152,8 @@ protected: enum G1Barrier { G1BarrierNone, - G1BarrierCLD + G1BarrierCLD, + G1BarrierNoOptRoots // Do not collect optional roots. }; enum G1Mark { diff --git a/src/hotspot/share/gc/g1/g1OopClosures.inline.hpp b/src/hotspot/share/gc/g1/g1OopClosures.inline.hpp index b7162ac117e..2274f907c41 100644 --- a/src/hotspot/share/gc/g1/g1OopClosures.inline.hpp +++ b/src/hotspot/share/gc/g1/g1OopClosures.inline.hpp @@ -246,7 +246,7 @@ void G1ParCopyClosure::do_oop_work(T* p) { } else { if (state.is_humongous()) { _g1h->set_humongous_is_live(obj); - } else if (state.is_optional()) { + } else if ((barrier != G1BarrierNoOptRoots) && state.is_optional()) { _par_scan_state->remember_root_into_optional_region(p); } diff --git a/src/hotspot/share/gc/g1/g1SharedClosures.hpp b/src/hotspot/share/gc/g1/g1SharedClosures.hpp index af77223cfa8..9a705ff2faf 100644 --- a/src/hotspot/share/gc/g1/g1SharedClosures.hpp +++ b/src/hotspot/share/gc/g1/g1SharedClosures.hpp @@ -40,6 +40,14 @@ class G1SharedClosures { public: G1ParCopyClosure _oops; G1ParCopyClosure _oops_in_cld; + // We do not need (and actually should not) collect oops from nmethods into the + // optional collection set as we already automatically collect the corresponding + // nmethods in the region's strong code roots set. So set G1BarrierNoOptRoots in + // this closure. + // If these were present there would be opportunity for multiple threads to try + // to change this oop* at the same time. Since embedded oops are not necessarily + // word-aligned, this could lead to word tearing during update and crashes. + G1ParCopyClosure _oops_in_nmethod; G1CLDScanClosure _clds; G1CodeBlobClosure _codeblobs; @@ -47,6 +55,7 @@ public: G1SharedClosures(G1CollectedHeap* g1h, G1ParScanThreadState* pss, bool process_only_dirty) : _oops(g1h, pss), _oops_in_cld(g1h, pss), + _oops_in_nmethod(g1h, pss), _clds(&_oops_in_cld, process_only_dirty), - _codeblobs(pss->worker_id(), &_oops, needs_strong_processing()) {} + _codeblobs(pss->worker_id(), &_oops_in_nmethod, needs_strong_processing()) {} }; From 9d4f3b2c2c379b58c2227b61d21c9932ec745ab3 Mon Sep 17 00:00:00 2001 From: Zhengyu Gu Date: Wed, 22 Jan 2020 07:40:11 -0500 Subject: [PATCH 02/50] 8237396: JvmtiTagMap::weak_oops_do() should not trigger barriers Reviewed-by: stefank, rkennke --- src/hotspot/share/prims/jvmtiTagMap.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/hotspot/share/prims/jvmtiTagMap.cpp b/src/hotspot/share/prims/jvmtiTagMap.cpp index cc5469857d5..c495a017f74 100644 --- a/src/hotspot/share/prims/jvmtiTagMap.cpp +++ b/src/hotspot/share/prims/jvmtiTagMap.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2020, 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 @@ -97,6 +97,11 @@ class JvmtiTagHashmapEntry : public CHeapObj { inline oop object_peek() { return NativeAccess::oop_load(object_addr()); } + + inline oop object_raw() { + return RawAccess<>::oop_load(object_addr()); + } + inline jlong tag() const { return _tag; } inline void set_tag(jlong tag) { @@ -3352,7 +3357,7 @@ void JvmtiTagMap::do_weak_oops(BoolObjectClosure* is_alive, OopClosure* f) { JvmtiTagHashmapEntry* next = entry->next(); // has object been GC'ed - if (!is_alive->do_object_b(entry->object_peek())) { + if (!is_alive->do_object_b(entry->object_raw())) { // grab the tag jlong tag = entry->tag(); guarantee(tag != 0, "checking"); @@ -3370,7 +3375,7 @@ void JvmtiTagMap::do_weak_oops(BoolObjectClosure* is_alive, OopClosure* f) { ++freed; } else { f->do_oop(entry->object_addr()); - oop new_oop = entry->object_peek(); + oop new_oop = entry->object_raw(); // if the object has moved then re-hash it and move its // entry to its new location. @@ -3404,7 +3409,7 @@ void JvmtiTagMap::do_weak_oops(BoolObjectClosure* is_alive, OopClosure* f) { // Re-add all the entries which were kept aside while (delayed_add != NULL) { JvmtiTagHashmapEntry* next = delayed_add->next(); - unsigned int pos = JvmtiTagHashmap::hash(delayed_add->object_peek(), size); + unsigned int pos = JvmtiTagHashmap::hash(delayed_add->object_raw(), size); delayed_add->set_next(table[pos]); table[pos] = delayed_add; delayed_add = next; From b94b082727704cc3ebefc48484117d3c5134b79c Mon Sep 17 00:00:00 2001 From: Leo Jiang Date: Wed, 22 Jan 2020 22:37:36 +0800 Subject: [PATCH 03/50] 8237465: JDK 14 L10n resource files update - msg drop 10 Reviewed-by: naoto --- .../security/tools/keytool/Resources_ja.java | 2 +- .../tools/keytool/Resources_zh_CN.java | 2 +- .../internal/res/XPATHErrorResources_ja.java | 14 +- .../res/XPATHErrorResources_zh_CN.java | 14 +- .../javac/resources/compiler_ja.properties | 102 ++++++- .../javac/resources/compiler_zh_CN.properties | 102 ++++++- .../resources/LinuxResources_ja.properties | 72 ++--- .../resources/LinuxResources_zh_CN.properties | 72 ++--- .../resources/MacResources_ja.properties | 118 ++++---- .../resources/MacResources_zh_CN.properties | 118 ++++---- .../resources/HelpResources_ja.properties | 261 +----------------- .../resources/HelpResources_zh_CN.properties | 260 +---------------- .../resources/MainResources_ja.properties | 117 ++++---- .../resources/MainResources_zh_CN.properties | 119 ++++---- .../resources/WinResources_ja.properties | 70 ++--- .../resources/WinResources_zh_CN.properties | 70 ++--- .../sun/tools/jar/resources/jar_ja.properties | 2 +- .../tools/jar/resources/jar_zh_CN.properties | 2 +- .../html/resources/standard_ja.properties | 14 +- .../html/resources/standard_zh_CN.properties | 14 +- .../toolkit/resources/doclets_ja.properties | 41 ++- .../resources/doclets_zh_CN.properties | 41 ++- .../tools/jlink/resources/jlink_ja.properties | 6 +- .../jlink/resources/jlink_zh_CN.properties | 6 +- .../jshell/tool/resources/l10n_ja.properties | 4 +- .../tool/resources/l10n_zh_CN.properties | 4 +- 26 files changed, 742 insertions(+), 905 deletions(-) diff --git a/src/java.base/share/classes/sun/security/tools/keytool/Resources_ja.java b/src/java.base/share/classes/sun/security/tools/keytool/Resources_ja.java index dd5d594083c..f60a9b58be0 100644 --- a/src/java.base/share/classes/sun/security/tools/keytool/Resources_ja.java +++ b/src/java.base/share/classes/sun/security/tools/keytool/Resources_ja.java @@ -466,7 +466,7 @@ public class Resources_ja extends java.util.ListResourceBundle { {"migrate.keystore.warning", "\"%1$s\"\u304C%4$s\u306B\u79FB\u884C\u3055\u308C\u307E\u3057\u305F\u3002%2$s\u30AD\u30FC\u30B9\u30C8\u30A2\u306F\"%3$s\"\u3068\u3057\u3066\u30D0\u30C3\u30AF\u30A2\u30C3\u30D7\u3055\u308C\u307E\u3059\u3002"}, {"backup.keystore.warning", "\u5143\u306E\u30AD\u30FC\u30B9\u30C8\u30A2\"%1$s\"\u306F\"%3$s\"\u3068\u3057\u3066\u30D0\u30C3\u30AF\u30A2\u30C3\u30D7\u3055\u308C\u307E\u3059..."}, {"importing.keystore.status", "\u30AD\u30FC\u30B9\u30C8\u30A2%1$s\u3092%2$s\u306B\u30A4\u30F3\u30DD\u30FC\u30C8\u3057\u3066\u3044\u307E\u3059..."}, - {"keyalg.option.1.missing.warning", "-keyalg\u30AA\u30D7\u30B7\u30E7\u30F3\u304C\u3042\u308A\u307E\u305B\u3093\u3002\u30C7\u30D5\u30A9\u30EB\u30C8\u306E\u30AD\u30FC\u30FB\u30A2\u30EB\u30B4\u30EA\u30BA\u30E0(%s)\u306F\u3001\u65E7\u5F0F\u306E\u30A2\u30EB\u30B4\u30EA\u30BA\u30E0\u3067\u3001\u73FE\u5728\u306F\u63A8\u5968\u3055\u308C\u307E\u305B\u3093\u3002JDK\u306E\u5F8C\u7D9A\u306E\u30EA\u30EA\u30FC\u30B9\u3067\u306F\u3001\u30C7\u30D5\u30A9\u30EB\u30C8\u306F\u524A\u9664\u3055\u308C\u308B\u4E88\u5B9A\u3067\u3001-keyalg\u30AA\u30D7\u30B7\u30E7\u30F3\u3092\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002"}, + {"keyalg.option.missing.error", "-keyalg\u30AA\u30D7\u30B7\u30E7\u30F3\u3092\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002"}, {"showinfo.no.option", "-showinfo\u306E\u30AA\u30D7\u30B7\u30E7\u30F3\u304C\u3042\u308A\u307E\u305B\u3093\u3002\"keytool -showinfo -tls\"\u3092\u8A66\u3057\u3066\u304F\u3060\u3055\u3044\u3002"}, }; diff --git a/src/java.base/share/classes/sun/security/tools/keytool/Resources_zh_CN.java b/src/java.base/share/classes/sun/security/tools/keytool/Resources_zh_CN.java index b971b8bcdcf..18f71e3412e 100644 --- a/src/java.base/share/classes/sun/security/tools/keytool/Resources_zh_CN.java +++ b/src/java.base/share/classes/sun/security/tools/keytool/Resources_zh_CN.java @@ -466,7 +466,7 @@ public class Resources_zh_CN extends java.util.ListResourceBundle { {"migrate.keystore.warning", "\u5DF2\u5C06 \"%1$s\" \u8FC1\u79FB\u5230 %4$s\u3002\u5C06 %2$s \u5BC6\u94A5\u5E93\u4F5C\u4E3A \"%3$s\" \u8FDB\u884C\u4E86\u5907\u4EFD\u3002"}, {"backup.keystore.warning", "\u5DF2\u5C06\u539F\u59CB\u5BC6\u94A5\u5E93 \"%1$s\" \u5907\u4EFD\u4E3A \"%3$s\"..."}, {"importing.keystore.status", "\u6B63\u5728\u5C06\u5BC6\u94A5\u5E93 %1$s \u5BFC\u5165\u5230 %2$s..."}, - {"keyalg.option.1.missing.warning", "\u65E0 -keyalg \u9009\u9879\u3002\u9ED8\u8BA4\u5BC6\u94A5\u7B97\u6CD5 (%s) \u662F\u4F20\u7EDF\u7B97\u6CD5\uFF0C\u4E0D\u518D\u63A8\u8350\u3002\u5728 JDK \u7684\u540E\u7EED\u53D1\u884C\u7248\u4E2D\uFF0C\u5C06\u5220\u9664\u9ED8\u8BA4\u503C\uFF0C\u60A8\u5FC5\u987B\u6307\u5B9A -keyalg \u9009\u9879\u3002"}, + {"keyalg.option.missing.error", "\u5FC5\u987B\u6307\u5B9A -keyalg \u9009\u9879\u3002"}, {"showinfo.no.option", "-showinfo \u7F3A\u5C11\u9009\u9879\u3002\u8BF7\u5C1D\u8BD5\u4F7F\u7528 \"keytool -showinfo -tls\"\u3002"}, }; diff --git a/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_ja.java b/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_ja.java index 79a4d301cb1..a8c681aaa37 100644 --- a/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_ja.java +++ b/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_ja.java @@ -1,6 +1,5 @@ /* - * reserved comment block - * DO NOT REMOVE OR ALTER! + * Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved. */ /* * Licensed to the Apache Software Foundation (ASF) under one or more @@ -32,6 +31,7 @@ import java.util.ListResourceBundle; * Also you need to update the count of messages(MAX_CODE)or * the count of warnings(MAX_WARNING) [ Information purpose only] * @xsl.usage advanced + * @LastModified: May 2019 */ public class XPATHErrorResources_ja extends ListResourceBundle { @@ -150,6 +150,10 @@ public class XPATHErrorResources_ja extends ListResourceBundle "ER_FOUND_COMMA_BUT_NO_FOLLOWING_ARG"; public static final String ER_PREDICATE_ILLEGAL_SYNTAX = "ER_PREDICATE_ILLEGAL_SYNTAX"; + public static final String ER_PREDICATE_TOO_MANY_OPEN = + "ER_PREDICATE_TOO_MANY_OPEN"; + public static final String ER_COMPILATION_TOO_MANY_OPERATION = + "ER_COMPILATION_TOO_MANY_OPERATION"; public static final String ER_ILLEGAL_AXIS_NAME = "ER_ILLEGAL_AXIS_NAME"; public static final String ER_UNKNOWN_NODETYPE = "ER_UNKNOWN_NODETYPE"; public static final String ER_PATTERN_LITERAL_NEEDS_BE_QUOTED = @@ -464,6 +468,12 @@ public static final String ER_IGNORABLE_WHITESPACE_NOT_HANDLED = { ER_PREDICATE_ILLEGAL_SYNTAX, "'..[predicate]'\u307E\u305F\u306F'.[predicate]'\u306F\u4E0D\u6B63\u306A\u69CB\u6587\u3067\u3059\u3002\u304B\u308F\u308A\u306B'self::node()[predicate]'\u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044\u3002"}, + { ER_PREDICATE_TOO_MANY_OPEN, + "{1}\u3067{0}\u3092\u89E3\u6790\u4E2D\u306B\u30B9\u30BF\u30C3\u30AF\u30FB\u30AA\u30FC\u30D0\u30FC\u30D5\u30ED\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F\u3002\u30AA\u30FC\u30D7\u30F3\u8FF0\u8A9E\u304C\u591A\u3059\u304E\u307E\u3059({2})\u3002"}, + + { ER_COMPILATION_TOO_MANY_OPERATION, + "\u5F0F\u306E\u30B3\u30F3\u30D1\u30A4\u30EB\u4E2D\u306B\u30B9\u30BF\u30C3\u30AF\u30FB\u30AA\u30FC\u30D0\u30FC\u30D5\u30ED\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F\u3002\u64CD\u4F5C\u304C\u591A\u3059\u304E\u307E\u3059({0})\u3002"}, + { ER_ILLEGAL_AXIS_NAME, "\u4E0D\u6B63\u306A\u8EF8\u540D: {0}"}, diff --git a/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_zh_CN.java b/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_zh_CN.java index 29e45603345..d1e370f0d82 100644 --- a/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_zh_CN.java +++ b/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_zh_CN.java @@ -1,6 +1,5 @@ /* - * reserved comment block - * DO NOT REMOVE OR ALTER! + * Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved. */ /* * Licensed to the Apache Software Foundation (ASF) under one or more @@ -32,6 +31,7 @@ import java.util.ListResourceBundle; * Also you need to update the count of messages(MAX_CODE)or * the count of warnings(MAX_WARNING) [ Information purpose only] * @xsl.usage advanced + * @LastModified: May 2019 */ public class XPATHErrorResources_zh_CN extends ListResourceBundle { @@ -150,6 +150,10 @@ public class XPATHErrorResources_zh_CN extends ListResourceBundle "ER_FOUND_COMMA_BUT_NO_FOLLOWING_ARG"; public static final String ER_PREDICATE_ILLEGAL_SYNTAX = "ER_PREDICATE_ILLEGAL_SYNTAX"; + public static final String ER_PREDICATE_TOO_MANY_OPEN = + "ER_PREDICATE_TOO_MANY_OPEN"; + public static final String ER_COMPILATION_TOO_MANY_OPERATION = + "ER_COMPILATION_TOO_MANY_OPERATION"; public static final String ER_ILLEGAL_AXIS_NAME = "ER_ILLEGAL_AXIS_NAME"; public static final String ER_UNKNOWN_NODETYPE = "ER_UNKNOWN_NODETYPE"; public static final String ER_PATTERN_LITERAL_NEEDS_BE_QUOTED = @@ -464,6 +468,12 @@ public static final String ER_IGNORABLE_WHITESPACE_NOT_HANDLED = { ER_PREDICATE_ILLEGAL_SYNTAX, "'..[predicate]' \u6216 '.[predicate]' \u662F\u975E\u6CD5\u8BED\u6CD5\u3002\u8BF7\u6539\u7528 'self::node()[predicate]'\u3002"}, + { ER_PREDICATE_TOO_MANY_OPEN, + "\u5BF9 {1} \u4E2D\u7684 {0} \u8FDB\u884C\u8BED\u6CD5\u5206\u6790\u65F6\u5806\u6808\u6EA2\u51FA\u3002\u672A\u7ED3\u675F\u7684\u8C13\u8BCD\u592A\u591A ({2})\u3002"}, + + { ER_COMPILATION_TOO_MANY_OPERATION, + "\u7F16\u8BD1\u8868\u8FBE\u5F0F\u65F6\u5806\u6808\u6EA2\u51FA\u3002\u8FD0\u7B97\u592A\u591A ({0})\u3002"}, + { ER_ILLEGAL_AXIS_NAME, "\u975E\u6CD5\u8F74\u540D\u79F0: {0}"}, diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler_ja.properties b/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler_ja.properties index bb0e81c3ff8..64d45ab4933 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler_ja.properties +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler_ja.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 1999, 2019, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1999, 2020, 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 @@ -404,6 +404,9 @@ compiler.err.final.parameter.may.not.be.assigned=final\u30D1\u30E9\u30E1\u30FC\u # 0: symbol compiler.err.try.resource.may.not.be.assigned=\u81EA\u52D5\u30AF\u30ED\u30FC\u30BA\u53EF\u80FD\u306A\u30EA\u30BD\u30FC\u30B9{0}\u306B\u5024\u3092\u4EE3\u5165\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093 +# 0: symbol +compiler.err.pattern.binding.may.not.be.assigned=\u30D1\u30BF\u30FC\u30F3\u30FB\u30D0\u30A4\u30F3\u30C7\u30A3\u30F3\u30B0{0}\u306B\u5024\u3092\u4EE3\u5165\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093 + # 0: symbol compiler.err.multicatch.parameter.may.not.be.assigned=\u8907\u6570catch\u30D1\u30E9\u30E1\u30FC\u30BF{0}\u306B\u5024\u3092\u4EE3\u5165\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093 @@ -681,7 +684,7 @@ compiler.misc.not.def.access.does.not.read.from.unnamed=\u30D1\u30C3\u30B1\u30FC # {0} - package in which the invisible class is declared # {1} - current module # 0: symbol, 1: symbol -compiler.misc.not.def.access.does.not.read.unnamed=\u30D1\u30C3\u30B1\u30FC\u30B8{0}\u306F\u540D\u524D\u306E\u306A\u3044\u30E2\u30B8\u30E5\u30FC\u30EB\u3067\u5BA3\u8A00\u3055\u308C\u3066\u3044\u307E\u3059\u304C\u3001\u30E2\u30B8\u30E5\u30FC\u30EB{0}\u306B\u8AAD\u307F\u8FBC\u307E\u308C\u3066\u3044\u307E\u305B\u3093 +compiler.misc.not.def.access.does.not.read.unnamed=\u30D1\u30C3\u30B1\u30FC\u30B8{0}\u306F\u540D\u524D\u306E\u306A\u3044\u30E2\u30B8\u30E5\u30FC\u30EB\u3067\u5BA3\u8A00\u3055\u308C\u3066\u3044\u307E\u3059\u304C\u3001\u30E2\u30B8\u30E5\u30FC\u30EB{1}\u306B\u8AAD\u307F\u8FBC\u307E\u308C\u3066\u3044\u307E\u305B\u3093 # {0} - package in which the invisible class is declared # {1} - module in which {0} is declared @@ -1008,6 +1011,9 @@ compiler.err.varargs.invalid.trustme.anno={0}\u6CE8\u91C8\u304C\u7121\u52B9\u306 # 0: type compiler.misc.varargs.trustme.on.reifiable.varargs=\u53EF\u5909\u5F15\u6570\u8981\u7D20\u578B{0}\u306Freifiable\u578B\u3067\u3059\u3002 +# 0: type, 1: type +compiler.err.instanceof.reifiable.not.safe={0}\u3092{1}\u306B\u5B89\u5168\u306B\u30AD\u30E3\u30B9\u30C8\u3067\u304D\u307E\u305B\u3093 + # 0: symbol compiler.misc.varargs.trustme.on.non.varargs.meth=\u30E1\u30BD\u30C3\u30C9{0}\u306F\u53EF\u5909\u5F15\u6570\u30E1\u30BD\u30C3\u30C9\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002 @@ -1277,6 +1283,12 @@ compiler.warn.has.been.deprecated={1}\u306E{0}\u306F\u63A8\u5968\u3055\u308C\u30 # 0: symbol, 1: symbol compiler.warn.has.been.deprecated.for.removal={1}\u306E{0}\u306F\u63A8\u5968\u3055\u308C\u3066\u304A\u3089\u305A\u3001\u524A\u9664\u7528\u306B\u30DE\u30FC\u30AF\u3055\u308C\u3066\u3044\u307E\u3059 +# 0: symbol +compiler.warn.is.preview={0}\u306F\u30D7\u30EC\u30D3\u30E5\u30FC\u6A5F\u80FD\u306E\u4E00\u90E8\u3067\u3042\u308BAPI\u3067\u3059 + +# 0: symbol +compiler.err.is.preview={0}\u306F\u30D7\u30EC\u30D3\u30E5\u30FC\u6A5F\u80FD\u306E\u4E00\u90E8\u3067\u3042\u308BAPI\u3067\u3059 + # 0: symbol compiler.warn.has.been.deprecated.module=\u30E2\u30B8\u30E5\u30FC\u30EB{0}\u306F\u63A8\u5968\u3055\u308C\u307E\u305B\u3093 @@ -1341,6 +1353,9 @@ compiler.warn.static.not.qualified.by.type=static {0}\u306F\u5F0F\u3067\u306F\u3 # 0: string compiler.warn.source.no.bootclasspath=\u30D6\u30FC\u30C8\u30B9\u30C8\u30E9\u30C3\u30D7\u30FB\u30AF\u30E9\u30B9\u30D1\u30B9\u304C-source {0}\u3068\u4E00\u7DD2\u306B\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093 +# 0: string +compiler.warn.source.no.system.modules.path=\u30B7\u30B9\u30C6\u30E0\u30FB\u30E2\u30B8\u30E5\u30FC\u30EB\u30FB\u30D1\u30B9\u304C-source {0}\u3068\u4E00\u7DD2\u306B\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093 + # 0: string compiler.warn.option.obsolete.source=\u30BD\u30FC\u30B9\u5024{0}\u306F\u5EC3\u6B62\u3055\u308C\u3066\u3044\u3066\u3001\u4ECA\u5F8C\u306E\u30EA\u30EA\u30FC\u30B9\u3067\u524A\u9664\u3055\u308C\u308B\u4E88\u5B9A\u3067\u3059 @@ -1552,8 +1567,15 @@ compiler.err.expected2={0}\u307E\u305F\u306F{1}\u304C\u3042\u308A\u307E\u305B\u3 # 0: token, 1: token, 2: token compiler.err.expected3={0}\u3001{1}\u307E\u305F\u306F{2}\u304C\u3042\u308A\u307E\u305B\u3093 +# 0: token, 1: token, 2: token, 3: string +compiler.err.expected4={0}, {1}, {2}\u307E\u305F\u306F{3}\u304C\u3042\u308A\u307E\u305B\u3093 + compiler.err.premature.eof=\u69CB\u6587\u89E3\u6790\u4E2D\u306B\u30D5\u30A1\u30A4\u30EB\u306E\u7D42\u308F\u308A\u306B\u79FB\u308A\u307E\u3057\u305F +compiler.err.enum.constant.expected=\u3053\u3053\u306B\u5217\u6319\u578B\u5B9A\u6570\u304C\u5FC5\u8981\u3067\u3059 + +compiler.err.enum.constant.not.expected=\u3053\u3053\u306B\u5217\u6319\u578B\u5B9A\u6570\u306F\u5FC5\u8981\u3042\u308A\u307E\u305B\u3093 + ## The following are related in form, but do not easily fit the above paradigm. compiler.err.expected.module=''\u30E2\u30B8\u30E5\u30FC\u30EB''\u304C\u5FC5\u8981\u3067\u3059 @@ -1634,6 +1656,9 @@ compiler.misc.bad.constant.range={1}\u306E\u5B9A\u6570\u5024''{0}''\u306F{2}\u30 # 0: string (constant value), 1: symbol (constant field), 2: string (expected class) compiler.misc.bad.constant.value={1}\u306E\u5B9A\u6570\u5024''{0}''\u306F\u4E0D\u6B63\u3067\u3059\u3002{2}\u304C\u5FC5\u8981\u3067\u3059 +# 0: type (field type) +compiler.misc.bad.constant.value.type=\u30BF\u30A4\u30D7''{0}''\u306E\u5909\u6570\u306B\u5B9A\u6570\u5024\u306F\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093\u304C\u3001\u5B9A\u6570\u5024\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u3059 + # 0: string (classfile major version), 1: string (classfile minor version) compiler.misc.invalid.default.interface=\u30D0\u30FC\u30B8\u30E7\u30F3{0}.{1}\u306E\u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u306B\u30C7\u30D5\u30A9\u30EB\u30C8\u30FB\u30E1\u30BD\u30C3\u30C9\u304C\u898B\u3064\u304B\u308A\u307E\u3057\u305F @@ -1919,6 +1944,10 @@ compiler.misc.kindname.static.init=static\u521D\u671F\u5316\u5B50 compiler.misc.kindname.instance.init=\u30A4\u30F3\u30B9\u30BF\u30F3\u30B9\u521D\u671F\u5316\u5B50 +compiler.misc.kindname.record.component=\u30EC\u30B3\u30FC\u30C9\u30FB\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8 + +compiler.misc.kindname.record=\u30EC\u30B3\u30FC\u30C9 + ##### compiler.misc.no.args=\u5F15\u6570\u304C\u3042\u308A\u307E\u305B\u3093 @@ -2059,6 +2088,12 @@ compiler.misc.feature.switch.expressions=switch\u5F0F compiler.misc.feature.var.syntax.in.implicit.lambda=\u6697\u9ED9\u30E9\u30E0\u30C0\u306Evar\u69CB\u6587 +compiler.misc.feature.pattern.matching.instanceof=instanceof\u3067\u306E\u30D1\u30BF\u30FC\u30F3\u306E\u4E00\u81F4 + +compiler.misc.feature.reifiable.types.instanceof=instanceof\u3067\u306Ereifiable\u578B + +compiler.misc.feature.records=\u30EC\u30B3\u30FC\u30C9 + compiler.warn.underscore.as.identifier=\u30EA\u30EA\u30FC\u30B99\u304B\u3089''_''\u306F\u30AD\u30FC\u30EF\u30FC\u30C9\u306A\u306E\u3067\u8B58\u5225\u5B50\u3068\u3057\u3066\u4F7F\u7528\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093 compiler.err.underscore.as.identifier=\u30EA\u30EA\u30FC\u30B99\u304B\u3089''_''\u306F\u30AD\u30FC\u30EF\u30FC\u30C9\u306A\u306E\u3067\u8B58\u5225\u5B50\u3068\u3057\u3066\u4F7F\u7528\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093 @@ -2406,14 +2441,75 @@ compiler.warn.leaks.not.accessible.unexported.qualified=\u30E2\u30B8\u30E5\u30FC # 0: string, 1: string compiler.err.illegal.argument.for.option={0}\u306E\u5F15\u6570\u304C\u4E0D\u6B63\u3067\u3059: {1} +compiler.err.match.binding.exists=\u65E2\u5B58\u306E\u4E00\u81F4\u30D0\u30A4\u30F3\u30C7\u30A3\u30F3\u30B0\u3092\u518D\u5B9A\u7FA9\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093 + compiler.err.switch.null.not.allowed=case\u306Enull\u30E9\u30D9\u30EB\u306F\u8A31\u53EF\u3055\u308C\u307E\u305B\u3093 compiler.err.switch.case.unexpected.statement=case\u306E\u4E88\u671F\u3057\u306A\u3044\u6587\u3067\u3059\u3002\u4E88\u671F\u3055\u308C\u308B\u306E\u306F\u3001\u5F0F\u3001\u30D6\u30ED\u30C3\u30AF\u307E\u305F\u306Fthrow\u6587\u3067\u3059 compiler.err.switch.mixing.case.types=switch\u3067case\u306E\u7570\u306A\u308B\u7A2E\u985E\u304C\u4F7F\u7528\u3055\u308C\u3066\u3044\u307E\u3059 +### +# errors related to records + +# record components +compiler.err.record.cant.declare.field.modifiers=\u30EC\u30B3\u30FC\u30C9\u30FB\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u306B\u4FEE\u98FE\u5B50\u3092\u4F7F\u7528\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093 + +# 0: symbol +compiler.err.illegal.record.component.name=\u30EC\u30B3\u30FC\u30C9\u30FB\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u540D{0}\u304C\u7121\u52B9\u3067\u3059 + +# accessor methods +# 0: symbol, 1: fragment +compiler.err.invalid.accessor.method.in.record=\u30EC\u30B3\u30FC\u30C9{0}\u306B\u7121\u52B9\u306A\u30A2\u30AF\u30BB\u30B5\u30FB\u30E1\u30BD\u30C3\u30C9\u304C\u3042\u308A\u307E\u3059\n({1}) + +compiler.misc.method.must.be.public=\u30A2\u30AF\u30BB\u30B5\u30FB\u30E1\u30BD\u30C3\u30C9\u306Fpublic\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059 + +# 0: symbol, 1: symbol +compiler.misc.accessor.return.type.doesnt.match=\u30A2\u30AF\u30BB\u30B5\u30FB\u30E1\u30BD\u30C3\u30C9{0}\u306E\u623B\u308A\u578B\u306F\u30EC\u30B3\u30FC\u30C9\u30FB\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8{1}\u306E\u30BF\u30A4\u30D7\u3068\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059 + +compiler.misc.accessor.method.cant.throw.exception=throws\u53E5\u3092\u30A2\u30AF\u30BB\u30B5\u30FB\u30E1\u30BD\u30C3\u30C9\u3067\u4F7F\u7528\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093 + +compiler.misc.accessor.method.must.not.be.generic=\u30A2\u30AF\u30BB\u30B5\u30FB\u30E1\u30BD\u30C3\u30C9\u306F\u6C4E\u7528\u306B\u3067\u304D\u307E\u305B\u3093 + +compiler.misc.accessor.method.must.not.be.static=\u30A2\u30AF\u30BB\u30B5\u30FB\u30E1\u30BD\u30C3\u30C9\u306F\u9759\u7684\u306B\u3067\u304D\u307E\u305B\u3093 + +# canonical constructors +# 0: fragment, 1: symbol, 2: fragment +compiler.err.invalid.canonical.constructor.in.record=\u30EC\u30B3\u30FC\u30C9{1}\u306B\u7121\u52B9\u306A{0}\u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\u30BF\u304C\u3042\u308A\u307E\u3059\n({2}) + +compiler.misc.canonical=\u6A19\u6E96 + +compiler.misc.compact=\u30B3\u30F3\u30D1\u30AF\u30C8 + +compiler.misc.canonical.constructor.must.be.public=\u6A19\u6E96\u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\u30BF\u306Fpublic\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059 + +compiler.misc.throws.clause.not.allowed.for.canonical.constructor=throws\u53E5\u3092\u6A19\u6E96\u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\u30BF\u3067\u4F7F\u7528\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093 + +compiler.misc.canonical.with.name.mismatch=\u6A19\u6E96\u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\u30BF\u306E\u30D1\u30E9\u30E1\u30FC\u30BF\u540D\u304C\u7121\u52B9\u3067\u3059 + +compiler.misc.canonical.cant.have.return.statement=\u30B3\u30F3\u30D1\u30AF\u30C8\u30FB\u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\u30BF\u306BRETURN\u6587\u3092\u542B\u3081\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093 + +compiler.misc.canonical.must.not.declare.type.variables=\u6A19\u6E96\u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\u30BF\u306F\u578B\u5909\u6570\u3092\u5BA3\u8A00\u3067\u304D\u307E\u305B\u3093 + +compiler.misc.type.must.be.identical.to.corresponding.record.component.type=\u30BF\u30A4\u30D7\u306F\u5BFE\u5FDC\u3059\u308B\u30EC\u30B3\u30FC\u30C9\u30FB\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u306E\u30BF\u30A4\u30D7\u3068\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059 +compiler.misc.canonical.must.not.contain.explicit.constructor.invocation=\u6A19\u6E96\u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\u30BF\u306B\u660E\u793A\u7684\u306A\u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\u30BF\u547C\u51FA\u3057\u3092\u542B\u3081\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093 + +# other +compiler.err.record.cannot.declare.instance.fields=\u30D5\u30A3\u30FC\u30EB\u30C9\u5BA3\u8A00\u306F\u9759\u7684\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\n(\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u30EC\u30B3\u30FC\u30C9\u30FB\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u306B\u7F6E\u63DB\u3059\u308B\u3053\u3068\u3092\u691C\u8A0E) + +# 0: symbol +compiler.err.invalid.supertype.record=\u30AF\u30E9\u30B9\u306F\u76F4\u63A5{0}\u3092\u62E1\u5F35\u3067\u304D\u307E\u305B\u3093 + +compiler.err.first.statement.must.be.call.to.another.constructor=\u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\u30BF\u304C\u6A19\u6E96\u3067\u306A\u3044\u305F\u3081\u3001\u5148\u982D\u6587\u304C\u4ED6\u306E\u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\u30BF\u3092\u547C\u3073\u51FA\u3059\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059 + +compiler.err.instance.initializer.not.allowed.in.records=\u30A4\u30F3\u30B9\u30BF\u30F3\u30B9\u30FB\u30A4\u30CB\u30B7\u30E3\u30E9\u30A4\u30B6\u306F\u30EC\u30B3\u30FC\u30C9\u3067\u306F\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093 + +compiler.err.record.declaration.not.allowed.in.inner.classes=\u30EC\u30B3\u30FC\u30C9\u5BA3\u8A00\u306F\u5185\u90E8\u30AF\u30E9\u30B9\u3067\u306F\u8A31\u53EF\u3055\u308C\u307E\u305B\u3093 + +compiler.err.record.header.expected=\u30EC\u30B3\u30FC\u30C9\u30FB\u30D8\u30C3\u30C0\u30FC\u304C\u5FC5\u8981\u3067\u3059 + ############################################ -# messages previouly at javac.properties +# messages previously at javac.properties compiler.err.empty.A.argument=-A\u306B\u306F\u5F15\u6570\u304C\u5FC5\u8981\u3067\u3059\u3002''-Akey''\u307E\u305F\u306F''-Akey=value''\u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044 diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler_zh_CN.properties b/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler_zh_CN.properties index a97e1df0955..01a453c7002 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler_zh_CN.properties +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler_zh_CN.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 1999, 2019, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1999, 2020, 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 @@ -404,6 +404,9 @@ compiler.err.final.parameter.may.not.be.assigned=\u4E0D\u80FD\u5206\u914D\u6700\ # 0: symbol compiler.err.try.resource.may.not.be.assigned=\u53EF\u80FD\u672A\u5206\u914D\u53EF\u81EA\u52A8\u5173\u95ED\u7684\u8D44\u6E90{0} +# 0: symbol +compiler.err.pattern.binding.may.not.be.assigned=\u4E0D\u80FD\u5206\u914D\u6A21\u5F0F\u7ED1\u5B9A {0} + # 0: symbol compiler.err.multicatch.parameter.may.not.be.assigned=\u53EF\u80FD\u672A\u5206\u914D multi-catch \u53C2\u6570{0} @@ -681,7 +684,7 @@ compiler.misc.not.def.access.does.not.read.from.unnamed=\u7A0B\u5E8F\u5305 {0} \ # {0} - package in which the invisible class is declared # {1} - current module # 0: symbol, 1: symbol -compiler.misc.not.def.access.does.not.read.unnamed=\u7A0B\u5E8F\u5305 {0} \u5DF2\u5728\u672A\u547D\u540D\u6A21\u5757\u4E2D\u58F0\u660E, \u4F46\u6A21\u5757 {0} \u672A\u8BFB\u53D6\u5B83 +compiler.misc.not.def.access.does.not.read.unnamed=\u7A0B\u5E8F\u5305 {0} \u5DF2\u5728\u672A\u547D\u540D\u6A21\u5757\u4E2D\u58F0\u660E\uFF0C\u4F46\u6A21\u5757 {1} \u672A\u8BFB\u53D6\u5B83 # {0} - package in which the invisible class is declared # {1} - module in which {0} is declared @@ -1008,6 +1011,9 @@ compiler.err.varargs.invalid.trustme.anno={0} \u6CE8\u91CA\u65E0\u6548\u3002{1} # 0: type compiler.misc.varargs.trustme.on.reifiable.varargs=Varargs \u5143\u7D20\u7C7B\u578B{0}\u53EF\u5177\u4F53\u5316\u3002 +# 0: type, 1: type +compiler.err.instanceof.reifiable.not.safe={0} \u65E0\u6CD5\u5B89\u5168\u5730\u8F6C\u6362\u4E3A {1} + # 0: symbol compiler.misc.varargs.trustme.on.non.varargs.meth=\u65B9\u6CD5 {0} \u4E0D\u662F varargs \u65B9\u6CD5\u3002 @@ -1277,6 +1283,12 @@ compiler.warn.has.been.deprecated={1}\u4E2D\u7684{0}\u5DF2\u8FC7\u65F6 # 0: symbol, 1: symbol compiler.warn.has.been.deprecated.for.removal={1} \u4E2D\u7684 {0} \u5DF2\u8FC7\u65F6, \u4E14\u6807\u8BB0\u4E3A\u5F85\u5220\u9664 +# 0: symbol +compiler.warn.is.preview={0} \u662F\u67D0\u9884\u89C8\u529F\u80FD\u4E2D\u7684\u4E00\u4E2A API + +# 0: symbol +compiler.err.is.preview={0} \u662F\u67D0\u9884\u89C8\u529F\u80FD\u4E2D\u7684\u4E00\u4E2A API + # 0: symbol compiler.warn.has.been.deprecated.module=\u6A21\u5757 {0} \u5DF2\u8FC7\u65F6 @@ -1341,6 +1353,9 @@ compiler.warn.static.not.qualified.by.type=static {0}\u5E94\u7531\u7C7B\u578B\u5 # 0: string compiler.warn.source.no.bootclasspath=\u672A\u4E0E -source {0} \u4E00\u8D77\u8BBE\u7F6E\u5F15\u5BFC\u7C7B\u8DEF\u5F84 +# 0: string +compiler.warn.source.no.system.modules.path=\u672A\u4E0E -source {0} \u4E00\u8D77\u8BBE\u7F6E\u7CFB\u7EDF\u6A21\u5757\u8DEF\u5F84 + # 0: string compiler.warn.option.obsolete.source=\u6E90\u503C{0}\u5DF2\u8FC7\u65F6, \u5C06\u5728\u672A\u6765\u6240\u6709\u53D1\u884C\u7248\u4E2D\u5220\u9664 @@ -1552,8 +1567,15 @@ compiler.err.expected2=\u9700\u8981{0}\u6216{1} # 0: token, 1: token, 2: token compiler.err.expected3=\u9700\u8981{0}, {1}\u6216{2} +# 0: token, 1: token, 2: token, 3: string +compiler.err.expected4=\u9700\u8981 {0}\u3001{1}\u3001{2} \u6216 {3} + compiler.err.premature.eof=\u8FDB\u884C\u8BED\u6CD5\u5206\u6790\u65F6\u5DF2\u5230\u8FBE\u6587\u4EF6\u7ED3\u5C3E +compiler.err.enum.constant.expected=\u6B64\u5904\u9700\u8981\u679A\u4E3E\u5E38\u91CF + +compiler.err.enum.constant.not.expected=\u6B64\u5904\u4E0D\u9700\u8981\u679A\u4E3E\u5E38\u91CF + ## The following are related in form, but do not easily fit the above paradigm. compiler.err.expected.module=\u9700\u8981 ''module'' @@ -1634,6 +1656,9 @@ compiler.misc.bad.constant.range={1} \u7684\u5E38\u91CF\u503C ''{0}'' \u8D85\u51 # 0: string (constant value), 1: symbol (constant field), 2: string (expected class) compiler.misc.bad.constant.value={1} \u7684\u5E38\u91CF\u503C ''{0}'' \u9519\u8BEF, \u9884\u671F\u4E3A {2} +# 0: type (field type) +compiler.misc.bad.constant.value.type=''{0}'' \u7C7B\u578B\u7684\u53D8\u91CF\u4E0D\u80FD\u5177\u6709\u5E38\u91CF\u503C\uFF0C\u4F46\u662F\u4E3A\u5176\u6307\u5B9A\u4E86\u4E00\u4E2A\u5E38\u91CF\u503C + # 0: string (classfile major version), 1: string (classfile minor version) compiler.misc.invalid.default.interface=\u5728 {0}.{1} \u7248\u7C7B\u6587\u4EF6\u4E2D\u627E\u5230\u9ED8\u8BA4\u65B9\u6CD5 @@ -1919,6 +1944,10 @@ compiler.misc.kindname.static.init=\u9759\u6001\u521D\u59CB\u5316\u7A0B\u5E8F compiler.misc.kindname.instance.init=\u5B9E\u4F8B\u521D\u59CB\u5316\u7A0B\u5E8F +compiler.misc.kindname.record.component=\u8BB0\u5F55\u7EC4\u4EF6 + +compiler.misc.kindname.record=\u8BB0\u5F55 + ##### compiler.misc.no.args=\u6CA1\u6709\u53C2\u6570 @@ -2059,6 +2088,12 @@ compiler.misc.feature.switch.expressions=switch \u8868\u8FBE\u5F0F compiler.misc.feature.var.syntax.in.implicit.lambda=\u9690\u5F0F lambda \u4E2D\u7684 var \u8BED\u6CD5 +compiler.misc.feature.pattern.matching.instanceof=instanceof \u4E2D\u7684\u6A21\u5F0F\u5339\u914D + +compiler.misc.feature.reifiable.types.instanceof=instanceof \u4E2D\u7684\u53EF\u5177\u4F53\u5316\u7C7B\u578B + +compiler.misc.feature.records=\u8BB0\u5F55 + compiler.warn.underscore.as.identifier=\u4ECE\u53D1\u884C\u7248 9 \u5F00\u59CB, ''_'' \u4E3A\u5173\u952E\u5B57, \u4E0D\u80FD\u7528\u4F5C\u6807\u8BC6\u7B26 compiler.err.underscore.as.identifier=\u4ECE\u53D1\u884C\u7248 9 \u5F00\u59CB, ''_'' \u4E3A\u5173\u952E\u5B57, \u4E0D\u80FD\u7528\u4F5C\u6807\u8BC6\u7B26 @@ -2406,14 +2441,75 @@ compiler.warn.leaks.not.accessible.unexported.qualified=\u6A21\u5757 {2} \u4E2D\ # 0: string, 1: string compiler.err.illegal.argument.for.option={0} \u7684\u53C2\u6570\u975E\u6CD5: {1} +compiler.err.match.binding.exists=\u5C1D\u8BD5\u91CD\u65B0\u5B9A\u4E49\u73B0\u6709\u7684\u5339\u914D\u7ED1\u5B9A\uFF0C\u8FD9\u662F\u975E\u6CD5\u7684 + compiler.err.switch.null.not.allowed=case \u4E2D\u4E0D\u5141\u8BB8\u4F7F\u7528\u7A7A\u6807\u7B7E compiler.err.switch.case.unexpected.statement=case \u4E2D\u5B58\u5728\u610F\u5916\u8BED\u53E5\uFF0C\u5E94\u4E3A\u8868\u8FBE\u5F0F\u3001\u5757\u6216\u629B\u51FA\u8BED\u53E5 compiler.err.switch.mixing.case.types=\u5728 switch \u4E2D\u4F7F\u7528\u4E86\u4E0D\u540C case \u7C7B\u578B +### +# errors related to records + +# record components +compiler.err.record.cant.declare.field.modifiers=\u8BB0\u5F55\u7EC4\u4EF6\u4E0D\u80FD\u5177\u6709\u9650\u5B9A\u7B26 + +# 0: symbol +compiler.err.illegal.record.component.name=\u8BB0\u5F55\u7EC4\u4EF6\u540D\u79F0 {0} \u975E\u6CD5 + +# accessor methods +# 0: symbol, 1: fragment +compiler.err.invalid.accessor.method.in.record=\u8BB0\u5F55 {0} \u4E2D\u7684\u5B58\u53D6\u65B9\u6CD5\u65E0\u6548\n({1}) + +compiler.misc.method.must.be.public=\u5B58\u53D6\u65B9\u6CD5\u5FC5\u987B\u662F\u516C\u5171\u7684 + +# 0: symbol, 1: symbol +compiler.misc.accessor.return.type.doesnt.match=\u5B58\u53D6\u65B9\u6CD5 {0} \u7684\u8FD4\u56DE\u7C7B\u578B\u5FC5\u987B\u4E0E\u8BB0\u5F55\u7EC4\u4EF6 {1} \u7684\u7C7B\u578B\u76F8\u5339\u914D + +compiler.misc.accessor.method.cant.throw.exception=\u5BF9\u4E8E\u5B58\u53D6\u65B9\u6CD5\u4E0D\u5141\u8BB8\u4F7F\u7528 throws \u5B50\u53E5 + +compiler.misc.accessor.method.must.not.be.generic=\u5B58\u53D6\u65B9\u6CD5\u4E0D\u80FD\u4E3A\u6CDB\u578B\u65B9\u6CD5 + +compiler.misc.accessor.method.must.not.be.static=\u5B58\u53D6\u65B9\u6CD5\u4E0D\u80FD\u4E3A\u9759\u6001\u65B9\u6CD5 + +# canonical constructors +# 0: fragment, 1: symbol, 2: fragment +compiler.err.invalid.canonical.constructor.in.record=\u8BB0\u5F55 {1} \u4E2D\u7684 {0} \u6784\u9020\u5668\u65E0\u6548\n({2}) + +compiler.misc.canonical=\u89C4\u8303 + +compiler.misc.compact=\u7CBE\u7B80 + +compiler.misc.canonical.constructor.must.be.public=\u89C4\u8303\u6784\u9020\u5668\u5FC5\u987B\u662F\u516C\u5171\u7684 + +compiler.misc.throws.clause.not.allowed.for.canonical.constructor=\u5BF9\u4E8E\u89C4\u8303\u6784\u9020\u5668\u4E0D\u5141\u8BB8\u4F7F\u7528 throws \u5B50\u53E5 + +compiler.misc.canonical.with.name.mismatch=\u89C4\u8303\u6784\u9020\u5668\u4E2D\u7684\u53C2\u6570\u540D\u79F0\u65E0\u6548 + +compiler.misc.canonical.cant.have.return.statement=\u7CBE\u7B80\u6784\u9020\u5668\u4E0D\u5F97\u5305\u542B\u8FD4\u56DE\u8BED\u53E5 + +compiler.misc.canonical.must.not.declare.type.variables=\u89C4\u8303\u6784\u9020\u5668\u4E0D\u5F97\u58F0\u660E\u7C7B\u578B\u53D8\u91CF + +compiler.misc.type.must.be.identical.to.corresponding.record.component.type=\u7C7B\u578B\u5FC5\u987B\u4E0E\u76F8\u5E94\u8BB0\u5F55\u7EC4\u4EF6\u7684\u7C7B\u578B\u76F8\u5339\u914D +compiler.misc.canonical.must.not.contain.explicit.constructor.invocation=\u89C4\u8303\u6784\u9020\u5668\u4E0D\u5F97\u5305\u542B\u663E\u5F0F\u6784\u9020\u5668\u8C03\u7528 + +# other +compiler.err.record.cannot.declare.instance.fields=\u5B57\u6BB5\u58F0\u660E\u5FC5\u987B\u4E3A\u9759\u6001\n\uFF08\u8003\u8651\u5C06\u5B57\u6BB5\u66FF\u6362\u4E3A\u8BB0\u5F55\u7EC4\u4EF6\uFF09 + +# 0: symbol +compiler.err.invalid.supertype.record=\u7C7B\u65E0\u6CD5\u76F4\u63A5\u6269\u5C55 {0} + +compiler.err.first.statement.must.be.call.to.another.constructor=\u6784\u9020\u5668\u4E0D\u662F\u89C4\u8303\u7684\uFF0C\u56E0\u6B64\u5B83\u7684\u7B2C\u4E00\u4E2A\u8BED\u53E5\u5FC5\u987B\u8C03\u7528\u53E6\u4E00\u4E2A\u6784\u9020\u5668 + +compiler.err.instance.initializer.not.allowed.in.records=\u8BB0\u5F55\u4E2D\u4E0D\u5141\u8BB8\u4F7F\u7528\u5B9E\u4F8B\u521D\u59CB\u5316\u7A0B\u5E8F + +compiler.err.record.declaration.not.allowed.in.inner.classes=\u5185\u90E8\u7C7B\u4E2D\u4E0D\u5141\u8BB8\u4F7F\u7528\u8BB0\u5F55\u58F0\u660E + +compiler.err.record.header.expected=\u9700\u8981\u8BB0\u5F55\u6807\u5934 + ############################################ -# messages previouly at javac.properties +# messages previously at javac.properties compiler.err.empty.A.argument=-A \u9700\u8981\u4E00\u4E2A\u53C2\u6570; \u4F7F\u7528 ''-Akey'' \u6216 ''-Akey=value'' diff --git a/src/jdk.incubator.jpackage/linux/classes/jdk/incubator/jpackage/internal/resources/LinuxResources_ja.properties b/src/jdk.incubator.jpackage/linux/classes/jdk/incubator/jpackage/internal/resources/LinuxResources_ja.properties index 875c40f3727..9809606596e 100644 --- a/src/jdk.incubator.jpackage/linux/classes/jdk/incubator/jpackage/internal/resources/LinuxResources_ja.properties +++ b/src/jdk.incubator.jpackage/linux/classes/jdk/incubator/jpackage/internal/resources/LinuxResources_ja.properties @@ -23,47 +23,47 @@ # questions. # # -app.bundler.name=Linux Application Image -deb.bundler.name=DEB Bundle -rpm.bundler.name=RPM Bundle +app.bundler.name=Linux\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u30FB\u30A4\u30E1\u30FC\u30B8 +deb.bundler.name=DEB\u30D0\u30F3\u30C9\u30EB +rpm.bundler.name=RPM\u30D0\u30F3\u30C9\u30EB -param.license-type.default=Unknown -param.menu-group.default=Unknown +param.license-type.default=\u4E0D\u660E +param.menu-group.default=\u4E0D\u660E -resource.deb-control-file=DEB control file -resource.deb-preinstall-script=DEB preinstall script -resource.deb-prerm-script=DEB prerm script -resource.deb-postinstall-script=DEB postinstall script -resource.deb-postrm-script=DEB postrm script -resource.copyright-file=Copyright file -resource.menu-shortcut-descriptor=Menu shortcut descriptor -resource.menu-icon=menu icon -resource.rpm-spec-file=RPM spec file +resource.deb-control-file=DEB\u5236\u5FA1\u30D5\u30A1\u30A4\u30EB +resource.deb-preinstall-script=DEB\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u524D\u30B9\u30AF\u30EA\u30D7\u30C8 +resource.deb-prerm-script=DEB prerm\u30B9\u30AF\u30EA\u30D7\u30C8 +resource.deb-postinstall-script=DEB\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u5F8C\u30B9\u30AF\u30EA\u30D7\u30C8 +resource.deb-postrm-script=DEB postrm\u30B9\u30AF\u30EA\u30D7\u30C8 +resource.copyright-file=\u30B3\u30D4\u30FC\u30E9\u30A4\u30C8\u30FB\u30D5\u30A1\u30A4\u30EB +resource.menu-shortcut-descriptor=\u30E1\u30CB\u30E5\u30FC\u30FB\u30B7\u30E7\u30FC\u30C8\u30AB\u30C3\u30C8\u30FB\u30C7\u30A3\u30B9\u30AF\u30EA\u30D7\u30BF +resource.menu-icon=\u30E1\u30CB\u30E5\u30FC\u30FB\u30A2\u30A4\u30B3\u30F3 +resource.rpm-spec-file=RPM\u4ED5\u69D8\u30D5\u30A1\u30A4\u30EB -error.tool-not-found.advice=Please install required packages -error.tool-old-version.advice=Please install required packages +error.tool-not-found.advice=\u5FC5\u8981\u306A\u30D1\u30C3\u30B1\u30FC\u30B8\u3092\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3057\u3066\u304F\u3060\u3055\u3044 +error.tool-old-version.advice=\u5FC5\u8981\u306A\u30D1\u30C3\u30B1\u30FC\u30B8\u3092\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3057\u3066\u304F\u3060\u3055\u3044 -error.invalid-install-dir=Invalid installation directory "{0}" -error.unsupported-install-dir=Installing to system directory "{0}" is currently unsupported +error.invalid-install-dir=\u7121\u52B9\u306A\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u30FB\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA"{0}" +error.unsupported-install-dir=\u30B7\u30B9\u30C6\u30E0\u30FB\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA"{0}"\u3078\u306E\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u306F\u73FE\u5728\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093 -error.no-content-types-for-file-association=No MIME types were specified for File Association number {0} -error.too-many-content-types-for-file-association=More than one MIME types was specified for File Association number {0}. -error.invalid-value-for-package-name=Invalid value "{0}" for the bundle name. -error.invalid-value-for-package-name.advice=Set the "linux-bundle-name" option to a valid Debian package name. Note that the package names must consist only of lower case letters (a-z), digits (0-9), plus (+) and minus (-) signs, and periods (.). They must be at least two characters long and must start with an alphanumeric character. +error.no-content-types-for-file-association=\u30D5\u30A1\u30A4\u30EB\u30FB\u30A2\u30BD\u30B7\u30A8\u30FC\u30B7\u30E7\u30F3\u756A\u53F7{0}\u306BMIME\u30BF\u30A4\u30D7\u304C\u6307\u5B9A\u3055\u308C\u307E\u305B\u3093\u3067\u3057\u305F +error.too-many-content-types-for-file-association=\u30D5\u30A1\u30A4\u30EB\u30FB\u30A2\u30BD\u30B7\u30A8\u30FC\u30B7\u30E7\u30F3\u756A\u53F7{0}\u306B\u8907\u6570\u306EMIME\u30BF\u30A4\u30D7\u304C\u6307\u5B9A\u3055\u308C\u307E\u3057\u305F\u3002 +error.invalid-value-for-package-name=\u30D0\u30F3\u30C9\u30EB\u540D\u306E\u5024"{0}"\u304C\u7121\u52B9\u3067\u3059\u3002 +error.invalid-value-for-package-name.advice="linux-bundle-name"\u30AA\u30D7\u30B7\u30E7\u30F3\u3092\u6709\u52B9\u306ADebian\u30D1\u30C3\u30B1\u30FC\u30B8\u540D\u306B\u8A2D\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u30D1\u30C3\u30B1\u30FC\u30B8\u540D\u306B\u306F\u3001\u5C0F\u6587\u5B57(a-z)\u3001\u6570\u5B57(0-9)\u3001\u30D7\u30E9\u30B9(+)\u3068\u30DE\u30A4\u30CA\u30B9(-)\u306E\u8A18\u53F7\u304A\u3088\u3073\u30D4\u30EA\u30AA\u30C9(.)\u306E\u307F\u3092\u542B\u3081\u308B\u3088\u3046\u306B\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u9577\u3055\u306F2\u6587\u5B57\u4EE5\u4E0A\u3068\u3057\u3001\u82F1\u6570\u5B57\u3067\u59CB\u3081\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 -message.icon-not-png=The specified icon "{0}" is not a PNG file and will not be used. The default icon will be used in it's place. -message.test-for-tool=Test for [{0}]. Result: {1} -message.outputting-to-location=Generating DEB for installer to: {0}. -message.output-to-location=Package (.deb) saved to: {0}. -message.debs-like-licenses=Debian packages should specify a license. The absence of a license will cause some linux distributions to complain about the quality of the application. -message.outputting-bundle-location=Generating RPM for installer to: {0}. -message.output-bundle-location=Package (.rpm) saved to: {0}. -message.creating-association-with-null-extension=Creating association with null extension. +message.icon-not-png=\u6307\u5B9A\u3057\u305F\u30A2\u30A4\u30B3\u30F3"{0}"\u306FPNG\u30D5\u30A1\u30A4\u30EB\u3067\u306F\u306A\u304F\u3001\u4F7F\u7528\u3055\u308C\u307E\u305B\u3093\u3002\u30C7\u30D5\u30A9\u30EB\u30C8\u30FB\u30A2\u30A4\u30B3\u30F3\u304C\u305D\u306E\u4F4D\u7F6E\u306B\u4F7F\u7528\u3055\u308C\u307E\u3059\u3002 +message.test-for-tool=[{0}]\u306E\u30C6\u30B9\u30C8\u3002\u7D50\u679C: {1} +message.outputting-to-location=\u30A4\u30F3\u30B9\u30C8\u30FC\u30E9\u306EDEB\u3092\u6B21\u306B\u751F\u6210\u3057\u3066\u3044\u307E\u3059: {0} +message.output-to-location=\u30D1\u30C3\u30B1\u30FC\u30B8(.deb)\u306F\u6B21\u306B\u4FDD\u5B58\u3055\u308C\u307E\u3057\u305F: {0} +message.debs-like-licenses=Debian\u30D1\u30C3\u30B1\u30FC\u30B8\u3067\u306F\u30E9\u30A4\u30BB\u30F3\u30B9\u3092\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002\u30E9\u30A4\u30BB\u30F3\u30B9\u304C\u306A\u3044\u5834\u5408\u3001\u4E00\u90E8\u306ELinux\u30C7\u30A3\u30B9\u30C8\u30EA\u30D3\u30E5\u30FC\u30B7\u30E7\u30F3\u3067\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u306E\u54C1\u8CEA\u306B\u554F\u984C\u304C\u767A\u751F\u3059\u308B\u5834\u5408\u304C\u3042\u308A\u307E\u3059\u3002 +message.outputting-bundle-location=\u30A4\u30F3\u30B9\u30C8\u30FC\u30E9\u306ERPM\u3092\u6B21\u306B\u751F\u6210\u3057\u3066\u3044\u307E\u3059: {0} +message.output-bundle-location=\u30D1\u30C3\u30B1\u30FC\u30B8(.rpm)\u306F\u6B21\u306B\u4FDD\u5B58\u3055\u308C\u307E\u3057\u305F: {0} +message.creating-association-with-null-extension=null\u62E1\u5F35\u5B50\u3068\u306E\u95A2\u9023\u4ED8\u3051\u3092\u4F5C\u6210\u3057\u3066\u3044\u307E\u3059\u3002 -message.ldd-not-available=ldd command not found. Package dependencies will not be generated. -message.deb-ldd-not-available.advice=Install "libc-bin" DEB package to get ldd. -message.rpm-ldd-not-available.advice=Install "glibc-common" RPM package to get ldd. +message.ldd-not-available=ldd\u30B3\u30DE\u30F3\u30C9\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u30D1\u30C3\u30B1\u30FC\u30B8\u4F9D\u5B58\u6027\u306F\u751F\u6210\u3055\u308C\u307E\u305B\u3093\u3002 +message.deb-ldd-not-available.advice="libc-bin" DEB\u30D1\u30C3\u30B1\u30FC\u30B8\u3092\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3057\u3066ldd\u3092\u53D6\u5F97\u3057\u307E\u3059\u3002 +message.rpm-ldd-not-available.advice="glibc-common" RPM\u30D1\u30C3\u30B1\u30FC\u30B8\u3092\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3057\u3066ldd\u3092\u53D6\u5F97\u3057\u307E\u3059\u3002 -error.unexpected-package-property=Expected value of "{0}" property is [{1}]. Actual value in output package is [{2}]. Looks like custom "{3}" file from resource directory contained hard coded value of "{0}" property -error.unexpected-package-property.advice=Use [{0}] pattern string instead of hard coded value [{1}] of {2} property in custom "{3}" file -error.unexpected-default-package-property.advice=Don't explicitly set value of {0} property in custom "{1}" file +error.unexpected-package-property="{0}"\u30D7\u30ED\u30D1\u30C6\u30A3\u306B\u5FC5\u8981\u306A\u5024\u306F[{1}]\u3067\u3059\u3002\u51FA\u529B\u30D1\u30C3\u30B1\u30FC\u30B8\u306E\u5B9F\u969B\u306E\u5024\u306F[{2}]\u3067\u3059\u3002\u30EA\u30BD\u30FC\u30B9\u30FB\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306E\u30AB\u30B9\u30BF\u30E0"{3}"\u30D5\u30A1\u30A4\u30EB\u306B\u306F\u3001"{0}"\u30D7\u30ED\u30D1\u30C6\u30A3\u306E\u30CF\u30FC\u30C9\u30B3\u30FC\u30C9\u3055\u308C\u305F\u5024\u304C\u542B\u307E\u308C\u3066\u3044\u308B\u3088\u3046\u3067\u3059 +error.unexpected-package-property.advice=\u30AB\u30B9\u30BF\u30E0"{3}"\u30D5\u30A1\u30A4\u30EB\u3067{2}\u30D7\u30ED\u30D1\u30C6\u30A3\u306E\u30CF\u30FC\u30C9\u30B3\u30FC\u30C9\u3055\u308C\u305F\u5024[{1}]\u3067\u306F\u306A\u304F\u3001[{0}]\u30D1\u30BF\u30FC\u30F3\u6587\u5B57\u5217\u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044 +error.unexpected-default-package-property.advice=\u30AB\u30B9\u30BF\u30E0"{1}"\u30D5\u30A1\u30A4\u30EB\u3067{0}\u30D7\u30ED\u30D1\u30C6\u30A3\u306E\u5024\u3092\u660E\u793A\u7684\u306B\u8A2D\u5B9A\u3057\u306A\u3044\u3067\u304F\u3060\u3055\u3044 diff --git a/src/jdk.incubator.jpackage/linux/classes/jdk/incubator/jpackage/internal/resources/LinuxResources_zh_CN.properties b/src/jdk.incubator.jpackage/linux/classes/jdk/incubator/jpackage/internal/resources/LinuxResources_zh_CN.properties index 875c40f3727..78f33470067 100644 --- a/src/jdk.incubator.jpackage/linux/classes/jdk/incubator/jpackage/internal/resources/LinuxResources_zh_CN.properties +++ b/src/jdk.incubator.jpackage/linux/classes/jdk/incubator/jpackage/internal/resources/LinuxResources_zh_CN.properties @@ -23,47 +23,47 @@ # questions. # # -app.bundler.name=Linux Application Image -deb.bundler.name=DEB Bundle -rpm.bundler.name=RPM Bundle +app.bundler.name=Linux \u5E94\u7528\u7A0B\u5E8F\u6620\u50CF +deb.bundler.name=DEB \u5305 +rpm.bundler.name=RPM \u5305 -param.license-type.default=Unknown -param.menu-group.default=Unknown +param.license-type.default=\u672A\u77E5 +param.menu-group.default=\u672A\u77E5 -resource.deb-control-file=DEB control file -resource.deb-preinstall-script=DEB preinstall script -resource.deb-prerm-script=DEB prerm script -resource.deb-postinstall-script=DEB postinstall script -resource.deb-postrm-script=DEB postrm script -resource.copyright-file=Copyright file -resource.menu-shortcut-descriptor=Menu shortcut descriptor -resource.menu-icon=menu icon -resource.rpm-spec-file=RPM spec file +resource.deb-control-file=DEB \u63A7\u5236\u6587\u4EF6 +resource.deb-preinstall-script=DEB \u5B89\u88C5\u524D\u811A\u672C +resource.deb-prerm-script=DEB \u5220\u9664\u524D\u811A\u672C +resource.deb-postinstall-script=DEB \u5B89\u88C5\u540E\u811A\u672C +resource.deb-postrm-script=DEB \u5220\u9664\u540E\u811A\u672C +resource.copyright-file=\u7248\u6743\u6587\u4EF6 +resource.menu-shortcut-descriptor=\u83DC\u5355\u5FEB\u6377\u65B9\u5F0F\u63CF\u8FF0\u7B26 +resource.menu-icon=\u83DC\u5355\u56FE\u6807 +resource.rpm-spec-file=RPM \u89C4\u8303\u6587\u4EF6 -error.tool-not-found.advice=Please install required packages -error.tool-old-version.advice=Please install required packages +error.tool-not-found.advice=\u8BF7\u5B89\u88C5\u6240\u9700\u7684\u7A0B\u5E8F\u5305 +error.tool-old-version.advice=\u8BF7\u5B89\u88C5\u6240\u9700\u7684\u7A0B\u5E8F\u5305 -error.invalid-install-dir=Invalid installation directory "{0}" -error.unsupported-install-dir=Installing to system directory "{0}" is currently unsupported +error.invalid-install-dir=\u5B89\u88C5\u76EE\u5F55 "{0}" \u65E0\u6548 +error.unsupported-install-dir=\u5F53\u524D\u4E0D\u652F\u6301\u5B89\u88C5\u5230\u7CFB\u7EDF\u76EE\u5F55 "{0}" -error.no-content-types-for-file-association=No MIME types were specified for File Association number {0} -error.too-many-content-types-for-file-association=More than one MIME types was specified for File Association number {0}. -error.invalid-value-for-package-name=Invalid value "{0}" for the bundle name. -error.invalid-value-for-package-name.advice=Set the "linux-bundle-name" option to a valid Debian package name. Note that the package names must consist only of lower case letters (a-z), digits (0-9), plus (+) and minus (-) signs, and periods (.). They must be at least two characters long and must start with an alphanumeric character. +error.no-content-types-for-file-association=\u6CA1\u6709\u4E3A\u6587\u4EF6\u5173\u8054\u53F7{0}\u6307\u5B9A MIME \u7C7B\u578B +error.too-many-content-types-for-file-association=\u4E3A\u6587\u4EF6\u5173\u8054\u53F7{0}\u6307\u5B9A\u4E86\u591A\u4E2A MIME \u7C7B\u578B\u3002 +error.invalid-value-for-package-name=\u5305\u540D\u7684\u503C "{0}" \u65E0\u6548\u3002 +error.invalid-value-for-package-name.advice=\u5C06 "linux-bundle-name" \u9009\u9879\u8BBE\u7F6E\u4E3A\u6709\u6548\u7684 Debian \u7A0B\u5E8F\u5305\u540D\u79F0\u3002\u8BF7\u6CE8\u610F\uFF0C\u7A0B\u5E8F\u5305\u540D\u79F0\u53EA\u80FD\u5305\u542B\u5C0F\u5199\u5B57\u6BCD (a-z)\u3001\u6570\u5B57 (0-9)\u3001\u52A0\u53F7 (+) \u548C\u51CF\u53F7 (-) \u4EE5\u53CA\u53E5\u70B9 (.)\u3002\u540D\u79F0\u957F\u5EA6\u5FC5\u987B\u81F3\u5C11\u4E3A\u4E24\u4E2A\u5B57\u7B26\u5E76\u4E14\u5FC5\u987B\u4EE5\u5B57\u6BCD\u6570\u5B57\u5B57\u7B26\u5F00\u5934\u3002 -message.icon-not-png=The specified icon "{0}" is not a PNG file and will not be used. The default icon will be used in it's place. -message.test-for-tool=Test for [{0}]. Result: {1} -message.outputting-to-location=Generating DEB for installer to: {0}. -message.output-to-location=Package (.deb) saved to: {0}. -message.debs-like-licenses=Debian packages should specify a license. The absence of a license will cause some linux distributions to complain about the quality of the application. -message.outputting-bundle-location=Generating RPM for installer to: {0}. -message.output-bundle-location=Package (.rpm) saved to: {0}. -message.creating-association-with-null-extension=Creating association with null extension. +message.icon-not-png=\u6307\u5B9A\u7684\u56FE\u6807 "{0}" \u4E0D\u662F PNG \u6587\u4EF6, \u4E0D\u4F1A\u4F7F\u7528\u3002\u5C06\u4F7F\u7528\u9ED8\u8BA4\u56FE\u6807\u4EE3\u66FF\u3002 +message.test-for-tool=[{0}] \u7684\u6D4B\u8BD5\u3002\u7ED3\u679C: {1} +message.outputting-to-location=\u6B63\u5728\u4E3A\u5B89\u88C5\u7A0B\u5E8F\u751F\u6210 DEB, \u4F4D\u7F6E: {0}\u3002 +message.output-to-location=\u7A0B\u5E8F\u5305 (.deb) \u5DF2\u4FDD\u5B58\u5230: {0}\u3002 +message.debs-like-licenses=Debian \u7A0B\u5E8F\u5305\u5E94\u6307\u5B9A\u8BB8\u53EF\u8BC1\u3002\u7F3A\u5C11\u8BB8\u53EF\u8BC1\u5C06\u5BFC\u81F4\u67D0\u4E9B Linux \u5206\u53D1\u6295\u8BC9\u5E94\u7528\u7A0B\u5E8F\u8D28\u91CF\u3002 +message.outputting-bundle-location=\u6B63\u5728\u4E3A\u5B89\u88C5\u7A0B\u5E8F\u751F\u6210 RPM, \u4F4D\u7F6E: {0}\u3002 +message.output-bundle-location=\u7A0B\u5E8F\u5305 (.rpm) \u5DF2\u4FDD\u5B58\u5230: {0}\u3002 +message.creating-association-with-null-extension=\u6B63\u5728\u4F7F\u7528\u7A7A\u6269\u5C55\u540D\u521B\u5EFA\u5173\u8054\u3002 -message.ldd-not-available=ldd command not found. Package dependencies will not be generated. -message.deb-ldd-not-available.advice=Install "libc-bin" DEB package to get ldd. -message.rpm-ldd-not-available.advice=Install "glibc-common" RPM package to get ldd. +message.ldd-not-available=\u672A\u627E\u5230 ldd \u547D\u4EE4\u3002\u5C06\u4E0D\u751F\u6210\u7A0B\u5E8F\u5305\u88AB\u4F9D\u8D56\u5BF9\u8C61\u3002 +message.deb-ldd-not-available.advice=\u5B89\u88C5 "libc-bin" DEB \u7A0B\u5E8F\u5305\u4EE5\u83B7\u53D6 ldd\u3002 +message.rpm-ldd-not-available.advice=\u5B89\u88C5 "glibc-common" RPM \u7A0B\u5E8F\u5305\u4EE5\u83B7\u53D6 ldd\u3002 -error.unexpected-package-property=Expected value of "{0}" property is [{1}]. Actual value in output package is [{2}]. Looks like custom "{3}" file from resource directory contained hard coded value of "{0}" property -error.unexpected-package-property.advice=Use [{0}] pattern string instead of hard coded value [{1}] of {2} property in custom "{3}" file -error.unexpected-default-package-property.advice=Don't explicitly set value of {0} property in custom "{1}" file +error.unexpected-package-property="{0}" \u5C5E\u6027\u7684\u9884\u671F\u503C\u4E3A [{1}]\u3002\u8F93\u51FA\u7A0B\u5E8F\u5305\u4E2D\u7684\u5B9E\u9645\u503C\u4E3A [{2}]\u3002\u4E0E\u5B9A\u5236\u7684 "{3}" \u6587\u4EF6\u76F8\u4F3C\uFF0C\u8BE5\u6587\u4EF6\u6240\u5728\u7684\u8D44\u6E90\u76EE\u5F55\u4E2D\u5305\u542B "{0}" \u5C5E\u6027\u7684\u786C\u7F16\u7801\u503C +error.unexpected-package-property.advice=\u5728\u5B9A\u5236\u7684 "{3}" \u6587\u4EF6\u4E2D\u4F7F\u7528 [{0}] \u6A21\u5F0F\u5B57\u7B26\u4E32\uFF0C\u800C\u975E {2} \u5C5E\u6027\u7684\u786C\u7F16\u7801\u503C [{1}] +error.unexpected-default-package-property.advice=\u8BF7\u52FF\u5728\u5B9A\u5236\u7684 "{1}" \u6587\u4EF6\u4E2D\u663E\u5F0F\u8BBE\u7F6E {0} \u5C5E\u6027\u7684\u503C diff --git a/src/jdk.incubator.jpackage/macosx/classes/jdk/incubator/jpackage/internal/resources/MacResources_ja.properties b/src/jdk.incubator.jpackage/macosx/classes/jdk/incubator/jpackage/internal/resources/MacResources_ja.properties index b37302bb31f..34ce00d25f3 100644 --- a/src/jdk.incubator.jpackage/macosx/classes/jdk/incubator/jpackage/internal/resources/MacResources_ja.properties +++ b/src/jdk.incubator.jpackage/macosx/classes/jdk/incubator/jpackage/internal/resources/MacResources_ja.properties @@ -24,66 +24,66 @@ # # -app.bundler.name=Mac Application Image -store.bundler.name=Mac App Store Ready Bundler -dmg.bundler.name=Mac DMG Package -pkg.bundler.name=Mac PKG Package +app.bundler.name=Mac\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u30FB\u30A4\u30E1\u30FC\u30B8 +store.bundler.name=Mac App Store\u306E\u6E96\u5099\u5B8C\u4E86\u30D0\u30F3\u30C9\u30E9 +dmg.bundler.name=Mac DMG\u30D1\u30C3\u30B1\u30FC\u30B8 +pkg.bundler.name=Mac PKG\u30D1\u30C3\u30B1\u30FC\u30B8 -error.invalid-cfbundle-version=Invalid CFBundleVersion: [{0}] -error.invalid-cfbundle-version.advice=Set a compatible 'appVersion' or set a 'mac.CFBundleVersion'. Valid versions are one to three integers separated by dots. -error.explicit-sign-no-cert=Signature explicitly requested but no signing certificate specified -error.explicit-sign-no-cert.advice=Either specify a valid cert in 'mac.signing-key-developer-id-app' or unset 'signBundle' or set 'signBundle' to false. -error.must-sign-app-store=Mac App Store apps must be signed, and signing has been disabled by bundler configuration -error.must-sign-app-store.advice=Either unset 'signBundle' or set 'signBundle' to true -error.no-app-signing-key=No Mac App Store App Signing Key -error.no-app-signing-key.advice=Install your app signing keys into your Mac Keychain using XCode. -error.no-pkg-signing-key=No Mac App Store Installer Signing Key -error.no-pkg-signing-key.advice=Install your app signing keys into your Mac Keychain using XCode. -error.certificate.expired=Error: Certificate expired {0} -error.no.xcode.signing=Xcode with command line developer tools is required for signing -error.no.xcode.signing.advice=Install Xcode with command line developer tools. +error.invalid-cfbundle-version=\u7121\u52B9\u306ACFBundleVersion: [{0}] +error.invalid-cfbundle-version.advice=\u4E92\u63DB\u6027\u306E\u3042\u308B'appVersion'\u3092\u8A2D\u5B9A\u3059\u308B\u304B\u3001'mac.CFBundleVersion'\u3092\u8A2D\u5B9A\u3057\u307E\u3059\u3002\u6709\u52B9\u306A\u30D0\u30FC\u30B8\u30E7\u30F3\u306F\u3001\u30C9\u30C3\u30C8\u3067\u533A\u5207\u3089\u308C\u305F1\u304B\u30893\u3064\u306E\u6574\u6570\u3067\u3059\u3002 +error.explicit-sign-no-cert=\u7F72\u540D\u304C\u660E\u793A\u7684\u306B\u8981\u6C42\u3055\u308C\u307E\u3057\u305F\u304C\u3001\u7F72\u540D\u8A3C\u660E\u66F8\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093 +error.explicit-sign-no-cert.advice=\u6709\u52B9\u306A\u8A3C\u660E\u66F8\u3092'mac.signing-key-developer-id-app'\u3067\u6307\u5B9A\u3059\u308B\u304B\u3001'signBundle'\u3092\u8A2D\u5B9A\u89E3\u9664\u3059\u308B\u304B\u3001\u307E\u305F\u306F'signBundle'\u3092false\u306B\u8A2D\u5B9A\u3057\u307E\u3059\u3002 +error.must-sign-app-store=Mac App Store\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u306F\u7F72\u540D\u3055\u308C\u3066\u3044\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u304C\u3001\u7F72\u540D\u306F\u30D0\u30F3\u30C9\u30E9\u69CB\u6210\u306B\u3088\u3063\u3066\u7121\u52B9\u5316\u3055\u308C\u3066\u3044\u307E\u3059 +error.must-sign-app-store.advice='signBundle'\u3092\u8A2D\u5B9A\u89E3\u9664\u3059\u308B\u304B\u3001'signBundle'\u3092true\u306B\u8A2D\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044 +error.no-app-signing-key=Mac App Store\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u306E\u7F72\u540D\u30AD\u30FC\u304C\u3042\u308A\u307E\u305B\u3093 +error.no-app-signing-key.advice=XCode\u3092\u4F7F\u7528\u3057\u3066\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u306E\u7F72\u540D\u30AD\u30FC\u3092Mac\u30AD\u30FC\u30C1\u30A7\u30FC\u30F3\u306B\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3057\u307E\u3059\u3002 +error.no-pkg-signing-key=Mac App Store\u30A4\u30F3\u30B9\u30C8\u30FC\u30E9\u306E\u7F72\u540D\u30AD\u30FC\u304C\u3042\u308A\u307E\u305B\u3093 +error.no-pkg-signing-key.advice=XCode\u3092\u4F7F\u7528\u3057\u3066\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u306E\u7F72\u540D\u30AD\u30FC\u3092Mac\u30AD\u30FC\u30C1\u30A7\u30FC\u30F3\u306B\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3057\u307E\u3059\u3002 +error.certificate.expired=\u30A8\u30E9\u30FC: \u8A3C\u660E\u66F8\u306F{0}\u306B\u671F\u9650\u304C\u5207\u308C\u307E\u3057\u305F +error.no.xcode.signing=\u7F72\u540D\u306B\u306F\u3001Xcode\u3068\u30B3\u30DE\u30F3\u30C9\u30E9\u30A4\u30F3\u30FB\u30C7\u30D9\u30ED\u30C3\u30D1\u30FB\u30C4\u30FC\u30EB\u304C\u5FC5\u8981\u3067\u3059 +error.no.xcode.signing.advice=Xcode\u3068\u30B3\u30DE\u30F3\u30C9\u30E9\u30A4\u30F3\u30FB\u30C7\u30D9\u30ED\u30C3\u30D1\u30FB\u30C4\u30FC\u30EB\u3092\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3057\u3066\u304F\u3060\u3055\u3044\u3002 -resource.bundle-config-file=Bundle config file -resource.app-info-plist=Application Info.plist -resource.runtime-info-plist=Java Runtime Info.plist -resource.mac-app-store-entitlements=Mac App Store Entitlements -resource.mac-app-store-inherit-entitlements=Mac App Store Inherit Entitlements -resource.dmg-setup-script=DMG setup script -resource.license-setup=License setup -resource.dmg-background=dmg background -resource.volume-icon=volume icon -resource.post-install-script=script to run after application image is populated -resource.pkg-preinstall-script=PKG preinstall script -resource.pkg-postinstall-script=PKG postinstall script -resource.pkg-background-image=pkg background image +resource.bundle-config-file=\u30D0\u30F3\u30C9\u30EB\u69CB\u6210\u30D5\u30A1\u30A4\u30EB +resource.app-info-plist=\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u306EInfo.plist +resource.runtime-info-plist=Java\u30E9\u30F3\u30BF\u30A4\u30E0\u306EInfo.plist +resource.mac-app-store-entitlements=Mac App Store\u6A29\u9650 +resource.mac-app-store-inherit-entitlements=Mac App Store\u7D99\u627F\u6A29\u9650 +resource.dmg-setup-script=DMG\u8A2D\u5B9A\u30B9\u30AF\u30EA\u30D7\u30C8 +resource.license-setup=\u30E9\u30A4\u30BB\u30F3\u30B9\u306E\u8A2D\u5B9A +resource.dmg-background=dmg\u80CC\u666F +resource.volume-icon=\u30DC\u30EA\u30E5\u30FC\u30E0\u30FB\u30A2\u30A4\u30B3\u30F3 +resource.post-install-script=\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u30FB\u30A4\u30E1\u30FC\u30B8\u3092\u79FB\u5165\u3057\u305F\u5F8C\u306B\u5B9F\u884C\u3059\u308B\u30B9\u30AF\u30EA\u30D7\u30C8 +resource.pkg-preinstall-script=PKG\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u524D\u30B9\u30AF\u30EA\u30D7\u30C8 +resource.pkg-postinstall-script=PKG\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u5F8C\u30B9\u30AF\u30EA\u30D7\u30C8 +resource.pkg-background-image=pkg\u80CC\u666F\u30A4\u30E1\u30FC\u30B8 -message.bundle-name-too-long-warning={0} is set to ''{1}'', which is longer than 16 characters. For a better Mac experience consider shortening it. -message.null-classpath=Null app resources? -message.preparing-info-plist=Preparing Info.plist: {0}. -message.icon-not-icns= The specified icon "{0}" is not an ICNS file and will not be used. The default icon will be used in it's place. -message.version-string-too-many-components=Version sting may have between 1 and 3 numbers: 1, 1.2, 1.2.3. -message.version-string-first-number-not-zero=The first number in a CFBundleVersion cannot be zero or negative. -message.version-string-no-negative-numbers=Negative numbers are not allowed in version strings. -message.version-string-numbers-only=Version strings can consist of only numbers and up to two dots. -message.creating-association-with-null-extension=Creating association with null extension. -message.ignoring.symlink=Warning: codesign is skipping the symlink {0}. -message.keychain.error=Error: unable to get keychain list. -message.building-bundle=Building Mac App Store Package for {0}. -message.app-image-dir-does-not-exist=Specified application image directory {0}: {1} does not exists. -message.app-image-dir-does-not-exist.advice=Confirm that the value for {0} exists. -message.app-image-requires-app-name=When using an external app image you must specify the app name. -message.app-image-requires-app-name.advice=Set the app name via the -name CLI flag, the fx:application/@name ANT attribute, or via the 'appName' bundler argument. -message.app-image-requires-identifier=Unable to extract identifier from app image. -message.app-image-requires-identifier.advice=Use "--verbose" for extended error message or specify it via "--mac-package-identifier". -message.building-dmg=Building DMG package for {0}. -message.running-script=Running shell script on application image [{0}]. -message.preparing-dmg-setup=Preparing dmg setup: {0}. -message.creating-dmg-file=Creating DMG file: {0}. -message.dmg-cannot-be-overwritten=Dmg file exists ({0} and can not be removed. -message.output-to-location=Result DMG installer for {0}: {1}. -message.building-pkg=Building PKG package for {0}. -message.preparing-scripts=Preparing package scripts. -message.preparing-distribution-dist=Preparing distribution.dist: {0}. -message.signing.pkg=Warning: For signing PKG, you might need to set "Always Trust" for your certificate using "Keychain Access" tool. -message.setfile.dmg=Setting custom icon on DMG file skipped because 'SetFile' utility was not found. Installing Xcode with Command Line Tools should resolve this issue. +message.bundle-name-too-long-warning={0}\u304C16\u6587\u5B57\u3092\u8D85\u3048\u308B''{1}''\u306B\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u307E\u3059\u3002Mac\u3067\u306E\u64CD\u4F5C\u6027\u3092\u3088\u308A\u826F\u304F\u3059\u308B\u305F\u3081\u306B\u77ED\u304F\u3059\u308B\u3053\u3068\u3092\u691C\u8A0E\u3057\u3066\u304F\u3060\u3055\u3044\u3002 +message.null-classpath=Null\u306E\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u30FB\u30EA\u30BD\u30FC\u30B9\u3067\u3059\u304B\u3002 +message.preparing-info-plist=Info.plist\u3092\u6E96\u5099\u3057\u3066\u3044\u307E\u3059: {0}\u3002 +message.icon-not-icns= \u6307\u5B9A\u3057\u305F\u30A2\u30A4\u30B3\u30F3"{0}"\u306FICNS\u30D5\u30A1\u30A4\u30EB\u3067\u306F\u306A\u304F\u3001\u4F7F\u7528\u3055\u308C\u307E\u305B\u3093\u3002\u30C7\u30D5\u30A9\u30EB\u30C8\u30FB\u30A2\u30A4\u30B3\u30F3\u304C\u305D\u306E\u4F4D\u7F6E\u306B\u4F7F\u7528\u3055\u308C\u307E\u3059\u3002 +message.version-string-too-many-components=\u30D0\u30FC\u30B8\u30E7\u30F3\u6587\u5B57\u5217\u306B\u306F\u30011\u30011.2\u30011.2.3\u306A\u30691\u304B\u30893\u306E\u6570\u5B57\u3092\u4F7F\u7528\u3067\u304D\u307E\u3059\u3002 +message.version-string-first-number-not-zero=CFBundleVersion\u306E\u6700\u521D\u306E\u6570\u5B57\u306F\u3001\u30BC\u30ED\u307E\u305F\u306F\u8CA0\u306E\u5024\u306B\u3067\u304D\u307E\u305B\u3093\u3002 +message.version-string-no-negative-numbers=\u30D0\u30FC\u30B8\u30E7\u30F3\u6587\u5B57\u5217\u306B\u8CA0\u306E\u6570\u306F\u8A31\u53EF\u3055\u308C\u307E\u305B\u3093\u3002 +message.version-string-numbers-only=\u30D0\u30FC\u30B8\u30E7\u30F3\u6587\u5B57\u5217\u306F\u3001\u6570\u5B57\u30682\u3064\u307E\u3067\u306E\u30C9\u30C3\u30C8\u3067\u306E\u307F\u69CB\u6210\u3067\u304D\u307E\u3059\u3002 +message.creating-association-with-null-extension=null\u62E1\u5F35\u5B50\u3068\u306E\u95A2\u9023\u4ED8\u3051\u3092\u4F5C\u6210\u3057\u3066\u3044\u307E\u3059\u3002 +message.ignoring.symlink=\u8B66\u544A: codesign\u304Csymlink {0}\u3092\u30B9\u30AD\u30C3\u30D7\u3057\u3066\u3044\u307E\u3059 +message.keychain.error=\u30A8\u30E9\u30FC: \u30AD\u30FC\u30C1\u30A7\u30FC\u30F3\u30FB\u30EA\u30B9\u30C8\u3092\u53D6\u5F97\u3067\u304D\u307E\u305B\u3093\u3002 +message.building-bundle={0}\u306EMac App Store\u30D1\u30C3\u30B1\u30FC\u30B8\u3092\u4F5C\u6210\u3057\u3066\u3044\u307E\u3059\u3002 +message.app-image-dir-does-not-exist=\u6307\u5B9A\u3055\u308C\u305F\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u30FB\u30A4\u30E1\u30FC\u30B8\u30FB\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA {0}: {1}\u306F\u5B58\u5728\u3057\u307E\u305B\u3093\u3002 +message.app-image-dir-does-not-exist.advice={0}\u306E\u5024\u304C\u5B58\u5728\u3059\u308B\u3053\u3068\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044 +message.app-image-requires-app-name=\u5916\u90E8\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u30FB\u30A4\u30E1\u30FC\u30B8\u3092\u4F7F\u7528\u3059\u308B\u5834\u5408\u3001\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u540D\u3092\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 +message.app-image-requires-app-name.advice=-name CLI\u30D5\u30E9\u30B0\u3001fx:application/@name ANT\u5C5E\u6027\u307E\u305F\u306F'appName'\u30D0\u30F3\u30C9\u30E9\u5F15\u6570\u3067\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u540D\u3092\u8A2D\u5B9A\u3057\u307E\u3059\u3002 +message.app-image-requires-identifier=\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u30FB\u30A4\u30E1\u30FC\u30B8\u304B\u3089\u8B58\u5225\u5B50\u3092\u62BD\u51FA\u3067\u304D\u307E\u305B\u3093\u3002 +message.app-image-requires-identifier.advice=\u62E1\u5F35\u30A8\u30E9\u30FC\u30FB\u30E1\u30C3\u30BB\u30FC\u30B8\u306B"--verbose"\u3092\u4F7F\u7528\u3059\u308B\u304B\u3001"--mac-package-identifier"\u3092\u4F7F\u7528\u3057\u3066\u6307\u5B9A\u3057\u307E\u3059\u3002 +message.building-dmg={0}\u306EDMG\u30D1\u30C3\u30B1\u30FC\u30B8\u3092\u4F5C\u6210\u3057\u3066\u3044\u307E\u3059 +message.running-script=\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u30FB\u30A4\u30E1\u30FC\u30B8[{0}]\u3067\u30B7\u30A7\u30EB\u30FB\u30B9\u30AF\u30EA\u30D7\u30C8\u3092\u5B9F\u884C\u3057\u3066\u3044\u307E\u3059\u3002 +message.preparing-dmg-setup=dmg\u306E\u8A2D\u5B9A\u3092\u6E96\u5099\u3057\u3066\u3044\u307E\u3059: {0} +message.creating-dmg-file=DMG\u30D5\u30A1\u30A4\u30EB\u3092\u4F5C\u6210\u3057\u3066\u3044\u307E\u3059: {0} +message.dmg-cannot-be-overwritten=Dmg\u30D5\u30A1\u30A4\u30EB\u306F\u5B58\u5728\u3057({0}\u3001\u524A\u9664\u3067\u304D\u307E\u305B\u3093\u3002 +message.output-to-location={0}\u306E\u7D50\u679C\u306EDMG\u30A4\u30F3\u30B9\u30C8\u30FC\u30E9: {1} +message.building-pkg={0}\u306EPKG\u30D1\u30C3\u30B1\u30FC\u30B8\u3092\u4F5C\u6210\u3057\u3066\u3044\u307E\u3059 +message.preparing-scripts=\u30D1\u30C3\u30B1\u30FC\u30B8\u30FB\u30B9\u30AF\u30EA\u30D7\u30C8\u3092\u6E96\u5099\u3057\u3066\u3044\u307E\u3059 +message.preparing-distribution-dist=distribution.dist\u3092\u6E96\u5099\u3057\u3066\u3044\u307E\u3059: {0} +message.signing.pkg=\u8B66\u544A: PKG\u3078\u306E\u7F72\u540D\u306E\u5834\u5408\u3001\u300C\u30AD\u30FC\u30C1\u30A7\u30FC\u30F3\u30FB\u30A2\u30AF\u30BB\u30B9\u300D\u30C4\u30FC\u30EB\u3092\u4F7F\u7528\u3057\u3066\u8A3C\u660E\u66F8\u306B\u300C\u5E38\u306B\u4FE1\u983C\u3059\u308B\u300D\u3092\u8A2D\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 +message.setfile.dmg='SetFile'\u30E6\u30FC\u30C6\u30A3\u30EA\u30C6\u30A3\u304C\u898B\u3064\u304B\u3089\u306A\u3044\u305F\u3081\u3001DMG\u30D5\u30A1\u30A4\u30EB\u3067\u306E\u30AB\u30B9\u30BF\u30E0\u30FB\u30A2\u30A4\u30B3\u30F3\u306E\u8A2D\u5B9A\u304C\u30B9\u30AD\u30C3\u30D7\u3055\u308C\u307E\u3057\u305F\u3002Xcode\u3068\u30B3\u30DE\u30F3\u30C9\u30FB\u30E9\u30A4\u30F3\u30FB\u30C4\u30FC\u30EB\u3092\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3059\u308B\u3068\u3001\u3053\u306E\u554F\u984C\u306F\u89E3\u6C7A\u3055\u308C\u307E\u3059\u3002 diff --git a/src/jdk.incubator.jpackage/macosx/classes/jdk/incubator/jpackage/internal/resources/MacResources_zh_CN.properties b/src/jdk.incubator.jpackage/macosx/classes/jdk/incubator/jpackage/internal/resources/MacResources_zh_CN.properties index b37302bb31f..6a0c1fec2e3 100644 --- a/src/jdk.incubator.jpackage/macosx/classes/jdk/incubator/jpackage/internal/resources/MacResources_zh_CN.properties +++ b/src/jdk.incubator.jpackage/macosx/classes/jdk/incubator/jpackage/internal/resources/MacResources_zh_CN.properties @@ -24,66 +24,66 @@ # # -app.bundler.name=Mac Application Image -store.bundler.name=Mac App Store Ready Bundler -dmg.bundler.name=Mac DMG Package -pkg.bundler.name=Mac PKG Package +app.bundler.name=Mac \u5E94\u7528\u7A0B\u5E8F\u6620\u50CF +store.bundler.name=\u652F\u6301 Mac App Store \u7684\u6253\u5305\u7A0B\u5E8F +dmg.bundler.name=Mac DMG \u7A0B\u5E8F\u5305 +pkg.bundler.name=Mac PKG \u7A0B\u5E8F\u5305 -error.invalid-cfbundle-version=Invalid CFBundleVersion: [{0}] -error.invalid-cfbundle-version.advice=Set a compatible 'appVersion' or set a 'mac.CFBundleVersion'. Valid versions are one to three integers separated by dots. -error.explicit-sign-no-cert=Signature explicitly requested but no signing certificate specified -error.explicit-sign-no-cert.advice=Either specify a valid cert in 'mac.signing-key-developer-id-app' or unset 'signBundle' or set 'signBundle' to false. -error.must-sign-app-store=Mac App Store apps must be signed, and signing has been disabled by bundler configuration -error.must-sign-app-store.advice=Either unset 'signBundle' or set 'signBundle' to true -error.no-app-signing-key=No Mac App Store App Signing Key -error.no-app-signing-key.advice=Install your app signing keys into your Mac Keychain using XCode. -error.no-pkg-signing-key=No Mac App Store Installer Signing Key -error.no-pkg-signing-key.advice=Install your app signing keys into your Mac Keychain using XCode. -error.certificate.expired=Error: Certificate expired {0} -error.no.xcode.signing=Xcode with command line developer tools is required for signing -error.no.xcode.signing.advice=Install Xcode with command line developer tools. +error.invalid-cfbundle-version=\u65E0\u6548\u7684 CFBundleVersion\uFF1A[{0}] +error.invalid-cfbundle-version.advice=\u8BBE\u7F6E\u517C\u5BB9\u7684 'appVersion' \u6216\u8005\u8BBE\u7F6E 'mac.CFBundleVersion'\u3002\u6709\u6548\u7248\u672C\u5305\u542B\u4E00\u5230\u4E09\u4E2A\u7528\u70B9\u5206\u9694\u7684\u6574\u6570\u3002 +error.explicit-sign-no-cert=\u5DF2\u660E\u786E\u8BF7\u6C42\u7B7E\u540D, \u4F46\u672A\u6307\u5B9A\u7B7E\u540D\u8BC1\u4E66 +error.explicit-sign-no-cert.advice=\u5728 'mac.signing-key-developer-id-app' \u4E2D\u6307\u5B9A\u6709\u6548\u7684\u8BC1\u4E66, \u6216\u8005\u53D6\u6D88\u8BBE\u7F6E 'signBundle', \u6216\u8005\u5C06 'signBundle' \u8BBE\u7F6E\u4E3A\u201C\u5047\u201D\u3002 +error.must-sign-app-store=Mac App Store \u5E94\u7528\u7A0B\u5E8F\u5FC5\u987B\u7B7E\u540D, \u800C\u6253\u5305\u7A0B\u5E8F\u914D\u7F6E\u5DF2\u7981\u7528\u7B7E\u540D +error.must-sign-app-store.advice=\u53D6\u6D88\u8BBE\u7F6E 'signBundle' \u6216\u8005\u5C06 'signBundle' \u8BBE\u7F6E\u4E3A true +error.no-app-signing-key=\u65E0 Mac App Store \u5E94\u7528\u7A0B\u5E8F\u7B7E\u540D\u5BC6\u94A5 +error.no-app-signing-key.advice=\u4F7F\u7528 XCode \u5C06\u5E94\u7528\u7A0B\u5E8F\u7B7E\u540D\u5BC6\u94A5\u5B89\u88C5\u5230 Mac \u5BC6\u94A5\u94FE\u4E2D\u3002 +error.no-pkg-signing-key=\u65E0 Mac App Store \u5B89\u88C5\u7A0B\u5E8F\u7B7E\u540D\u5BC6\u94A5 +error.no-pkg-signing-key.advice=\u4F7F\u7528 XCode \u5C06\u5E94\u7528\u7A0B\u5E8F\u7B7E\u540D\u5BC6\u94A5\u5B89\u88C5\u5230 Mac \u5BC6\u94A5\u94FE\u4E2D\u3002 +error.certificate.expired=\u9519\u8BEF: \u8BC1\u4E66\u5DF2\u5931\u6548 {0} +error.no.xcode.signing=\u9700\u8981\u4F7F\u7528\u5E26\u547D\u4EE4\u884C\u5F00\u53D1\u4EBA\u5458\u5DE5\u5177\u7684 Xcode \u8FDB\u884C\u7B7E\u540D +error.no.xcode.signing.advice=\u5B89\u88C5\u5E26\u547D\u4EE4\u884C\u5F00\u53D1\u4EBA\u5458\u5DE5\u5177\u7684 Xcode\u3002 -resource.bundle-config-file=Bundle config file -resource.app-info-plist=Application Info.plist -resource.runtime-info-plist=Java Runtime Info.plist -resource.mac-app-store-entitlements=Mac App Store Entitlements -resource.mac-app-store-inherit-entitlements=Mac App Store Inherit Entitlements -resource.dmg-setup-script=DMG setup script -resource.license-setup=License setup -resource.dmg-background=dmg background -resource.volume-icon=volume icon -resource.post-install-script=script to run after application image is populated -resource.pkg-preinstall-script=PKG preinstall script -resource.pkg-postinstall-script=PKG postinstall script -resource.pkg-background-image=pkg background image +resource.bundle-config-file=\u5305\u914D\u7F6E\u6587\u4EF6 +resource.app-info-plist=\u5E94\u7528\u7A0B\u5E8F Info.plist +resource.runtime-info-plist=Java \u8FD0\u884C\u65F6 Info.plist +resource.mac-app-store-entitlements=Mac App Store \u6743\u5229 +resource.mac-app-store-inherit-entitlements=Mac App Store \u7EE7\u627F\u6743\u5229 +resource.dmg-setup-script=DMG \u8BBE\u7F6E\u811A\u672C +resource.license-setup=\u8BB8\u53EF\u8BC1\u8BBE\u7F6E +resource.dmg-background=DMG \u80CC\u666F +resource.volume-icon=\u5377\u56FE\u6807 +resource.post-install-script=\u8981\u5728\u586B\u5145\u5E94\u7528\u7A0B\u5E8F\u6620\u50CF\u4E4B\u540E\u8FD0\u884C\u7684\u811A\u672C +resource.pkg-preinstall-script=PKG \u5B89\u88C5\u524D\u811A\u672C +resource.pkg-postinstall-script=PKG \u5B89\u88C5\u540E\u811A\u672C +resource.pkg-background-image=pkg \u80CC\u666F\u56FE\u50CF -message.bundle-name-too-long-warning={0} is set to ''{1}'', which is longer than 16 characters. For a better Mac experience consider shortening it. -message.null-classpath=Null app resources? -message.preparing-info-plist=Preparing Info.plist: {0}. -message.icon-not-icns= The specified icon "{0}" is not an ICNS file and will not be used. The default icon will be used in it's place. -message.version-string-too-many-components=Version sting may have between 1 and 3 numbers: 1, 1.2, 1.2.3. -message.version-string-first-number-not-zero=The first number in a CFBundleVersion cannot be zero or negative. -message.version-string-no-negative-numbers=Negative numbers are not allowed in version strings. -message.version-string-numbers-only=Version strings can consist of only numbers and up to two dots. -message.creating-association-with-null-extension=Creating association with null extension. -message.ignoring.symlink=Warning: codesign is skipping the symlink {0}. -message.keychain.error=Error: unable to get keychain list. -message.building-bundle=Building Mac App Store Package for {0}. -message.app-image-dir-does-not-exist=Specified application image directory {0}: {1} does not exists. -message.app-image-dir-does-not-exist.advice=Confirm that the value for {0} exists. -message.app-image-requires-app-name=When using an external app image you must specify the app name. -message.app-image-requires-app-name.advice=Set the app name via the -name CLI flag, the fx:application/@name ANT attribute, or via the 'appName' bundler argument. -message.app-image-requires-identifier=Unable to extract identifier from app image. -message.app-image-requires-identifier.advice=Use "--verbose" for extended error message or specify it via "--mac-package-identifier". -message.building-dmg=Building DMG package for {0}. -message.running-script=Running shell script on application image [{0}]. -message.preparing-dmg-setup=Preparing dmg setup: {0}. -message.creating-dmg-file=Creating DMG file: {0}. -message.dmg-cannot-be-overwritten=Dmg file exists ({0} and can not be removed. -message.output-to-location=Result DMG installer for {0}: {1}. -message.building-pkg=Building PKG package for {0}. -message.preparing-scripts=Preparing package scripts. -message.preparing-distribution-dist=Preparing distribution.dist: {0}. -message.signing.pkg=Warning: For signing PKG, you might need to set "Always Trust" for your certificate using "Keychain Access" tool. -message.setfile.dmg=Setting custom icon on DMG file skipped because 'SetFile' utility was not found. Installing Xcode with Command Line Tools should resolve this issue. +message.bundle-name-too-long-warning={0}\u5DF2\u8BBE\u7F6E\u4E3A ''{1}'', \u5176\u957F\u5EA6\u8D85\u8FC7\u4E86 16 \u4E2A\u5B57\u7B26\u3002\u4E3A\u4E86\u83B7\u5F97\u66F4\u597D\u7684 Mac \u4F53\u9A8C, \u8BF7\u8003\u8651\u5C06\u5176\u7F29\u77ED\u3002 +message.null-classpath=\u662F\u5426\u4E3A\u7A7A\u5E94\u7528\u7A0B\u5E8F\u8D44\u6E90? +message.preparing-info-plist=\u6B63\u5728\u51C6\u5907 Info.plist: {0}\u3002 +message.icon-not-icns= \u6307\u5B9A\u7684\u56FE\u6807 "{0}" \u4E0D\u662F ICNS \u6587\u4EF6, \u4E0D\u4F1A\u4F7F\u7528\u3002\u5C06\u4F7F\u7528\u9ED8\u8BA4\u56FE\u6807\u4EE3\u66FF\u3002 +message.version-string-too-many-components=\u7248\u672C\u5B57\u7B26\u4E32\u53EF\u4EE5\u5305\u542B 1 \u5230 3 \u4E2A\u6570\u5B57: 1, 1.2, 1.2.3\u3002 +message.version-string-first-number-not-zero=CFBundleVersion \u4E2D\u7684\u7B2C\u4E00\u4E2A\u6570\u5B57\u4E0D\u80FD\u4E3A\u96F6\u6216\u8D1F\u6570\u3002 +message.version-string-no-negative-numbers=\u7248\u672C\u5B57\u7B26\u4E32\u4E2D\u4E0D\u5141\u8BB8\u4F7F\u7528\u8D1F\u6570\u3002 +message.version-string-numbers-only=\u7248\u672C\u5B57\u7B26\u4E32\u53EA\u80FD\u5305\u542B\u6570\u5B57\u548C\u6700\u591A\u4E24\u4E2A\u70B9\u3002 +message.creating-association-with-null-extension=\u6B63\u5728\u4F7F\u7528\u7A7A\u6269\u5C55\u540D\u521B\u5EFA\u5173\u8054\u3002 +message.ignoring.symlink=\u8B66\u544A: codesign \u6B63\u5728\u8DF3\u8FC7\u7B26\u53F7\u94FE\u63A5 {0}\u3002 +message.keychain.error=\u9519\u8BEF\uFF1A\u65E0\u6CD5\u83B7\u53D6\u5BC6\u94A5\u94FE\u5217\u8868\u3002 +message.building-bundle=\u6B63\u5728\u4E3A {0} \u6784\u5EFA Mac App Store \u7A0B\u5E8F\u5305\u3002 +message.app-image-dir-does-not-exist=\u6307\u5B9A\u7684\u5E94\u7528\u7A0B\u5E8F\u6620\u50CF\u76EE\u5F55 {0}\uFF1A{1} \u4E0D\u5B58\u5728\u3002 +message.app-image-dir-does-not-exist.advice=\u786E\u8BA4 {0} \u7684\u503C\u662F\u5426\u5B58\u5728\u3002 +message.app-image-requires-app-name=\u4F7F\u7528\u5916\u90E8\u5E94\u7528\u7A0B\u5E8F\u6620\u50CF\u65F6, \u5FC5\u987B\u6307\u5B9A\u5E94\u7528\u7A0B\u5E8F\u540D\u79F0\u3002 +message.app-image-requires-app-name.advice=\u901A\u8FC7 -name CLI \u6807\u8BB0, fx:application/@name ANT \u5C5E\u6027\u6216\u901A\u8FC7 'appName' \u6253\u5305\u7A0B\u5E8F\u53C2\u6570\u8BBE\u7F6E\u5E94\u7528\u7A0B\u5E8F\u540D\u79F0\u3002 +message.app-image-requires-identifier=\u65E0\u6CD5\u4ECE\u5E94\u7528\u7A0B\u5E8F\u6620\u50CF\u63D0\u53D6\u6807\u8BC6\u7B26\u3002 +message.app-image-requires-identifier.advice=\u8BF7\u4F7F\u7528 "--verbose" \u83B7\u53D6\u6269\u5C55\u9519\u8BEF\u6D88\u606F\uFF0C\u6216\u8005\u901A\u8FC7 "--mac-package-identifier" \u6307\u5B9A\u5B83\u3002 +message.building-dmg=\u6B63\u5728\u4E3A {0} \u6784\u5EFA DMG \u7A0B\u5E8F\u5305\u3002 +message.running-script=\u6B63\u5728\u5E94\u7528\u7A0B\u5E8F\u6620\u50CF [{0}] \u4E0A\u8FD0\u884C shell \u811A\u672C\u3002 +message.preparing-dmg-setup=\u6B63\u5728\u51C6\u5907 dmg \u8BBE\u7F6E: {0}\u3002 +message.creating-dmg-file=\u6B63\u5728\u521B\u5EFA DMG \u6587\u4EF6: {0}\u3002 +message.dmg-cannot-be-overwritten=Dmg \u6587\u4EF6\u5DF2\u5B58\u5728 ({0}) \u4E14\u65E0\u6CD5\u5220\u9664\u3002 +message.output-to-location=\u4E3A {0} \u751F\u6210\u7684 DMG \u5B89\u88C5\u7A0B\u5E8F: {1}\u3002 +message.building-pkg=\u6B63\u5728\u4E3A {0} \u6784\u5EFA PKG \u7A0B\u5E8F\u5305\u3002 +message.preparing-scripts=\u6B63\u5728\u51C6\u5907\u7A0B\u5E8F\u5305\u811A\u672C\u3002 +message.preparing-distribution-dist=\u6B63\u5728\u51C6\u5907 distribution.dist: {0}\u3002 +message.signing.pkg=\u8B66\u544A\uFF1A\u8981\u5BF9 PKG \u8FDB\u884C\u7B7E\u540D\uFF0C\u53EF\u80FD\u9700\u8981\u4F7F\u7528\u201C\u5BC6\u94A5\u94FE\u8BBF\u95EE\u201D\u5DE5\u5177\u4E3A\u8BC1\u4E66\u8BBE\u7F6E\u201C\u59CB\u7EC8\u4FE1\u4EFB\u201D\u3002 +message.setfile.dmg=\u7531\u4E8E\u672A\u627E\u5230 'SetFile' \u5B9E\u7528\u7A0B\u5E8F\uFF0C\u8DF3\u8FC7\u4E86\u9488\u5BF9 DMG \u6587\u4EF6\u8BBE\u7F6E\u5B9A\u5236\u56FE\u6807\u7684\u64CD\u4F5C\u3002\u5B89\u88C5\u5E26\u547D\u4EE4\u884C\u5DE5\u5177\u7684 Xcode \u5E94\u80FD\u89E3\u51B3\u6B64\u95EE\u9898\u3002 diff --git a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/resources/HelpResources_ja.properties b/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/resources/HelpResources_ja.properties index cad427b54ad..9593ef1f083 100644 --- a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/resources/HelpResources_ja.properties +++ b/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/resources/HelpResources_ja.properties @@ -24,252 +24,17 @@ # # -MSG_Help=Usage: jpackage \n\ -\n\ -Sample usages:\n\ ---------------\n\ -\ Generate an application package suitable for the host system:\n\ -\ For a modular application:\n\ -\ jpackage -n name -p modulePath -m moduleName/className\n\ -\ For a non-modular application:\n\ -\ jpackage -i inputDir -n name \\\n\ -\ --main-class className --main-jar myJar.jar\n\ -\ From a pre-built application image:\n\ -\ jpackage -n name --app-image appImageDir\n\ -\ Generate an application image:\n\ -\ For a modular application:\n\ -\ jpackage --type app-image -n name -p modulePath \\\n\ -\ -m moduleName/className\n\ -\ For a non-modular application:\n\ -\ jpackage --type app-image -i inputDir -n name \\\n\ -\ --main-class className --main-jar myJar.jar\n\ -\ To provide your own options to jlink, run jlink separately:\n\ -\ jlink --output appRuntimeImage -p modulePath -m moduleName \\\n\ -\ --no-header-files [...]\n\ -\ jpackage --type app-image -n name \\\n\ -\ -m moduleName/className --runtime-image appRuntimeImage\n\ -\ Generate a Java runtime package:\n\ -\ jpackage -n name --runtime-image \n\ -\n\ -Generic Options:\n\ -\ @ \n\ -\ Read options and/or mode from a file \n\ -\ This option can be used multiple times.\n\ -\ --type -t \n\ -\ The type of package to create\n\ -\ Valid values are: {1} \n\ -\ If this option is not specified a platform dependent\n\ -\ default type will be created.\n\ -\ --app-version \n\ -\ Version of the application and/or package\n\ -\ --copyright \n\ -\ Copyright for the application\n\ -\ --description \n\ -\ Description of the application\n\ -\ --help -h \n\ -\ Print the usage text with a list and description of each valid\n\ -\ option for the current platform to the output stream, and exit\n\ -\ --name -n \n\ -\ Name of the application and/or package\n\ -\ --dest -d \n\ -\ Path where generated output file is placed\n\ -\ Defaults to the current working directory.\n\ -\ (absolute path or relative to the current directory)\n\ -\ --temp \n\ -\ Path of a new or empty directory used to create temporary files\n\ -\ (absolute path or relative to the current directory)\n\ -\ If specified, the temp dir will not be removed upon the task\n\ -\ completion and must be removed manually\n\ -\ If not specified, a temporary directory will be created and\n\ -\ removed upon the task completion.\n\ -\ --vendor \n\ -\ Vendor of the application\n\ -\ --verbose\n\ -\ Enables verbose output\n\ -\ --version\n\ -\ Print the product version to the output stream and exit\n\ -\n\ -\Options for creating the runtime image:\n\ -\ --add-modules [,...]\n\ -\ A comma (",") separated list of modules to add.\n\ -\ This module list, along with the main module (if specified)\n\ -\ will be passed to jlink as the --add-module argument.\n\ -\ if not specified, either just the main module (if --module is\n\ -\ specified), or the default set of modules (if --main-jar is \n\ -\ specified) are used.\n\ -\ This option can be used multiple times.\n\ -\ --module-path -p ...\n\ -\ A {0} separated list of paths\n\ -\ Each path is either a directory of modules or the path to a\n\ -\ modular jar.\n\ -\ (each path is absolute or relative to the current directory)\n\ -\ This option can be used multiple times.\n\ -\ --bind-services \n\ -\ Pass on --bind-services option to jlink (which will link in \n\ -\ service provider modules and their dependences) \n\ -\ --runtime-image \n\ -\ Path of the predefined runtime image that will be copied into\n\ -\ the application image\n\ -\ (absolute path or relative to the current directory)\n\ -\ If --runtime-image is not specified, jpackage will run jlink to\n\ -\ create the runtime image using options:\n\ -\ --strip-debug, --no-header-files, --no-man-pages, and\n\ -\ --strip-native-commands.\n\ -\n\ -\Options for creating the application image:\n\ -\ --icon \n\ -\ Path of the icon of the application package\n\ -\ (absolute path or relative to the current directory)\n\ -\ --input -i \n\ -\ Path of the input directory that contains the files to be packaged\n\ -\ (absolute path or relative to the current directory)\n\ -\ All files in the input directory will be packaged into the\n\ -\ application image.\n\ -\n\ -\Options for creating the application launcher(s):\n\ -\ --add-launcher =\n\ -\ Name of launcher, and a path to a Properties file that contains\n\ -\ a list of key, value pairs\n\ -\ (absolute path or relative to the current directory)\n\ -\ The keys "module", "main-jar", "main-class",\n\ -\ "arguments", "java-options", "app-version", "icon", and\n\ -\ "win-console" can be used.\n\ -\ These options are added to, or used to overwrite, the original\n\ -\ command line options to build an additional alternative launcher.\n\ -\ The main application launcher will be built from the command line\n\ -\ options. Additional alternative launchers can be built using\n\ -\ this option, and this option can be used multiple times to\n\ -\ build multiple additional launchers. \n\ -\ --arguments
\n\ -\ Command line arguments to pass to the main class if no command\n\ -\ line arguments are given to the launcher\n\ -\ This option can be used multiple times.\n\ -\ --java-options \n\ -\ Options to pass to the Java runtime\n\ -\ This option can be used multiple times.\n\ -\ --main-class \n\ -\ Qualified name of the application main class to execute\n\ -\ This option can only be used if --main-jar is specified.\n\ -\ --main-jar
\n\ -\ The main JAR of the application; containing the main class\n\ -\ (specified as a path relative to the input path)\n\ -\ Either --module or --main-jar option can be specified but not\n\ -\ both.\n\ -\ --module -m [/
]\n\ -\ The main module (and optionally main class) of the application\n\ -\ This module must be located on the module path.\n\ -\ When this option is specified, the main module will be linked\n\ -\ in the Java runtime image. Either --module or --main-jar\n\ -\ option can be specified but not both.\n\ -{2}\n\ -\Options for creating the application package:\n\ -\ --app-image \n\ -\ Location of the predefined application image that is used\n\ -\ to build an installable package\n\ -\ (absolute path or relative to the current directory)\n\ -\ --file-associations \n\ -\ Path to a Properties file that contains list of key, value pairs\n\ -\ (absolute path or relative to the current directory)\n\ -\ The keys "extension", "mime-type", "icon", and "description"\n\ -\ can be used to describe the association.\n\ -\ This option can be used multiple times.\n\ -\ --install-dir \n\ -\ {4}\ -\ --license-file \n\ -\ Path to the license file\n\ -\ (absolute path or relative to the current directory)\n\ -\ --resource-dir \n\ -\ Path to override jpackage resources\n\ -\ Icons, template files, and other resources of jpackage can be\n\ -\ over-ridden by adding replacement resources to this directory.\n\ -\ (absolute path or relative to the current directory)\n\ -\ --runtime-image \n\ -\ Path of the predefined runtime image to install\n\ -\ (absolute path or relative to the current directory)\n\ -\ Option is required when creating a runtime package.\n\ -\n\ -\Platform dependent options for creating the application package:\n\ -{3} - -MSG_Help_win_launcher=\ -\n\ -\Platform dependent option for creating the application launcher:\n\ -\ --win-console\n\ -\ Creates a console launcher for the application, should be\n\ -\ specified for application which requires console interactions\n\ - -MSG_Help_win_install=\ -\ --win-dir-chooser\n\ -\ Adds a dialog to enable the user to choose a directory in which\n\ -\ the product is installed\n\ -\ --win-menu\n\ -\ Adds the application to the system menu\n\ -\ --win-menu-group \n\ -\ Start Menu group this application is placed in\n\ -\ --win-per-user-install\n\ -\ Request to perform an install on a per-user basis\n\ -\ --win-shortcut\n\ -\ Creates a desktop shortcut for the application\n\ -\ --win-upgrade-uuid \n\ -\ UUID associated with upgrades for this package\n\ - -MSG_Help_win_install_dir=\ -\Relative sub-path under the default installation location\n\ - -MSG_Help_mac_launcher=\ -\ --mac-package-identifier \n\ -\ An identifier that uniquely identifies the application for macOS\n\ -\ Defaults to the main class name.\n\ -\ May only use alphanumeric (A-Z,a-z,0-9), hyphen (-),\n\ -\ and period (.) characters.\n\ -\ --mac-package-name \n\ -\ Name of the application as it appears in the Menu Bar\n\ -\ This can be different from the application name.\n\ -\ This name must be less than 16 characters long and be suitable for\n\ -\ displaying in the menu bar and the application Info window.\n\ -\ Defaults to the application name.\n\ -\ --mac-package-signing-prefix \n\ -\ When signing the application package, this value is prefixed\n\ -\ to all components that need to be signed that don't have\n\ -\ an existing package identifier.\n\ -\ --mac-sign\n\ -\ Request that the package be signed\n\ -\ --mac-signing-keychain \n\ -\ Path of the keychain to search for the signing identity\n\ -\ (absolute path or relative to the current directory).\n\ -\ If not specified, the standard keychains are used.\n\ -\ --mac-signing-key-user-name \n\ -\ Team name portion in Apple signing identities' names.\n\ -\ For example "Developer ID Application: "\n\ - -MSG_Help_linux_install=\ -\ --linux-package-name \n\ -\ Name for Linux package, defaults to the application name\n\ -\ --linux-deb-maintainer \n\ -\ Maintainer for .deb package\n\ -\ --linux-menu-group \n\ -\ Menu group this application is placed in\n\ -\ --linux-package-deps\n\ -\ Required packages or capabilities for the application\n\ -\ --linux-rpm-license-type \n\ -\ Type of the license ("License: " of the RPM .spec)\n\ -\ --linux-app-release \n\ -\ Release value of the RPM .spec file or \n\ -\ Debian revision value of the DEB control file.\n\ -\ --linux-app-category \n\ -\ Group value of the RPM .spec file or \n\ -\ Section value of DEB control file.\n\ -\ --linux-shortcut\n\ -\ Creates a shortcut for the application\n\ - -MSG_Help_mac_linux_install_dir=\ -\Absolute path of the installation directory of the application\n\ - -MSG_Help_default_install_dir=\ -\Absolute path of the installation directory of the application on OS X\n\ -\ or Linux. Relative sub-path of the installation location of\n\ -\ the application such as "Program Files" or "AppData" on Windows.\n\ - -MSG_Help_no_args=Usage: jpackage \n\ -\Use jpackage --help (or -h) for a list of possible options\ +MSG_Help=\u4F7F\u7528\u65B9\u6CD5: jpackage \n\n\u4F7F\u7528\u4F8B:\n--------------\n \u30DB\u30B9\u30C8\u30FB\u30B7\u30B9\u30C6\u30E0\u306B\u9069\u3057\u305F\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u30FB\u30D1\u30C3\u30B1\u30FC\u30B8\u3092\u751F\u6210\u3057\u307E\u3059\u3002\n \u30E2\u30B8\u30E5\u30E9\u30FB\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u306E\u5834\u5408:\n jpackage -n name -p modulePath -m moduleName/className\n \u975E\u30E2\u30B8\u30E5\u30E9\u30FB\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u306E\u5834\u5408:\n jpackage -i inputDir -n name \\\n --main-class className --main-jar myJar.jar\n \u4E8B\u524D\u4F5C\u6210\u3055\u308C\u305F\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u30FB\u30A4\u30E1\u30FC\u30B8\u304B\u3089:\n jpackage -n name --app-image appImageDir\n \u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u30FB\u30A4\u30E1\u30FC\u30B8\u306E\u751F\u6210:\n \u30E2\u30B8\u30E5\u30E9\u30FB\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u306E\u5834\u5408:\n jpackage --type app-image -n name -p modulePath \\\n -m moduleName/className\n \u975E\u30E2\u30B8\u30E5\u30E9\u30FB\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u306E\u5834\u5408:\n jpackage --type app-image -i inputDir -n name \\\n --main-class className --main-jar myJar.jar\n jlink\u306B\u72EC\u81EA\u306E\u30AA\u30D7\u30B7\u30E7\u30F3\u3092\u6307\u5B9A\u3059\u308B\u306B\u306F\u3001jlink\u3092\u5225\u500B\u306B\u5B9F\u884C\u3057\u307E\u3059\u3002\n jlink --output appRuntimeImage -p modulePath -m moduleName \\\n --no-header-files [...]\n jpackage --type app-image -n name \\\n -m moduleName/className --runtime-image appRuntimeImage\n Java\u30E9\u30F3\u30BF\u30A4\u30E0\u30FB\u30D1\u30C3\u30B1\u30FC\u30B8\u3092\u751F\u6210\u3057\u307E\u3059\u3002\n jpackage -n name --runtime-image \n\n\u4E00\u822C\u7684\u306A\u30AA\u30D7\u30B7\u30E7\u30F3:\n @ \n \u30D5\u30A1\u30A4\u30EB\u304B\u3089\u306E\u8AAD\u53D6\u308A\u30AA\u30D7\u30B7\u30E7\u30F3\u304A\u3088\u3073\u30E2\u30FC\u30C9 \n \u3053\u306E\u30AA\u30D7\u30B7\u30E7\u30F3\u306F\u8907\u6570\u56DE\u4F7F\u7528\u3067\u304D\u307E\u3059\u3002\n --type -t \n \u4F5C\u6210\u3059\u308B\u30D1\u30C3\u30B1\u30FC\u30B8\u306E\u30BF\u30A4\u30D7\n \u6709\u52B9\u306A\u5024: {1} \n \u3053\u306E\u30AA\u30D7\u30B7\u30E7\u30F3\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u306A\u3044\u5834\u5408\u3001\u30D7\u30E9\u30C3\u30C8\u30D5\u30A9\u30FC\u30E0\u4F9D\u5B58\u306E\n \u30C7\u30D5\u30A9\u30EB\u30C8\u30FB\u30BF\u30A4\u30D7\u304C\u4F5C\u6210\u3055\u308C\u307E\u3059\n --app-version \n \u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u304A\u3088\u3073\u30D1\u30C3\u30B1\u30FC\u30B8\u306E\u30D0\u30FC\u30B8\u30E7\u30F3\n --copyright \n \u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u306E\u30B3\u30D4\u30FC\u30E9\u30A4\u30C8\n --description \n \u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u306E\u8AAC\u660E\n --help -h \n \u4F7F\u7528\u65B9\u6CD5\u30C6\u30AD\u30B9\u30C8\u3068\u73FE\u5728\u306E\u30D7\u30E9\u30C3\u30C8\u30D5\u30A9\u30FC\u30E0\u306E\u6709\u52B9\u306A\u30AA\u30D7\u30B7\u30E7\u30F3\u306E\u30EA\u30B9\u30C8\u3068\u8AAC\u660E\u3092\n \u51FA\u529B\u30B9\u30C8\u30EA\u30FC\u30E0\u306B\u51FA\u529B\u3057\u3066\u3001\u7D42\u4E86\u3057\u307E\u3059\n --name -n \n \u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u304A\u3088\u3073\u30D1\u30C3\u30B1\u30FC\u30B8\u306E\u540D\u524D\n --dest -d \n \u751F\u6210\u3055\u308C\u305F\u51FA\u529B\u30D5\u30A1\u30A4\u30EB\u304C\u914D\u7F6E\u3055\u308C\u308B\u30D1\u30B9\n \ +\u30C7\u30D5\u30A9\u30EB\u30C8\u306F\u73FE\u5728\u306E\u4F5C\u696D\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3067\u3059\u3002\n (\u7D76\u5BFE\u30D1\u30B9\u307E\u305F\u306F\u73FE\u5728\u306E\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u304B\u3089\u306E\u76F8\u5BFE\u30D1\u30B9)\n --temp \n \u4E00\u6642\u30D5\u30A1\u30A4\u30EB\u306E\u4F5C\u6210\u306B\u4F7F\u7528\u3055\u308C\u308B\u65B0\u898F\u307E\u305F\u306F\u7A7A\u306E\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306E\u30D1\u30B9\n (\u7D76\u5BFE\u30D1\u30B9\u307E\u305F\u306F\u73FE\u5728\u306E\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u304B\u3089\u306E\u76F8\u5BFE\u30D1\u30B9)\n \u6307\u5B9A\u3057\u305F\u5834\u5408\u3001\u30BF\u30B9\u30AF\u5B8C\u4E86\u6642\u306B\u4E00\u6642\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306F\u524A\u9664\u3055\u308C\u306A\u3044\u305F\u3081\n \u624B\u52D5\u3067\u524A\u9664\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\n \u6307\u5B9A\u3057\u306A\u304B\u3063\u305F\u5834\u5408\u3001\u4E00\u6642\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u304C\u4F5C\u6210\u3055\u308C\n \u30BF\u30B9\u30AF\u5B8C\u4E86\u6642\u306B\u524A\u9664\u3055\u308C\u307E\u3059\u3002\n --vendor \n \u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u306E\u30D9\u30F3\u30C0\u30FC\n --verbose\n \u8A73\u7D30\u306A\u51FA\u529B\u3092\u6709\u52B9\u306B\u3057\u307E\u3059\n --version\n \u88FD\u54C1\u30D0\u30FC\u30B8\u30E7\u30F3\u3092\u51FA\u529B\u30B9\u30C8\u30EA\u30FC\u30E0\u306B\u51FA\u529B\u3057\u3066\u7D42\u4E86\u3057\u307E\u3059\n\n\u30E9\u30F3\u30BF\u30A4\u30E0\u30FB\u30A4\u30E1\u30FC\u30B8\u3092\u4F5C\u6210\u3059\u308B\u305F\u3081\u306E\u30AA\u30D7\u30B7\u30E7\u30F3:\n --add-modules [,...]\n \u8FFD\u52A0\u3059\u308B\u30E2\u30B8\u30E5\u30FC\u30EB\u306E\u30AB\u30F3\u30DE(",")\u533A\u5207\u308A\u30EA\u30B9\u30C8\u3002\n \u3053\u306E\u30E2\u30B8\u30E5\u30FC\u30EB\u30FB\u30EA\u30B9\u30C8\u3068\u30E1\u30A4\u30F3\u30FB\u30E2\u30B8\u30E5\u30FC\u30EB(\u6307\u5B9A\u3057\u305F\u5834\u5408)\n \u304C--add-module\u5F15\u6570\u3068\u3057\u3066jlink\u306B\u6E21\u3055\u308C\u307E\u3059\u3002\n \u6307\u5B9A\u3057\u306A\u304B\u3063\u305F\u5834\u5408\u3001\u30E1\u30A4\u30F3\u30FB\u30E2\u30B8\u30E5\u30FC\u30EB\u306E\u307F(--module\u304C\n \u6307\u5B9A\u3055\u308C\u305F\u5834\u5408)\u3001\u307E\u305F\u306F\u30C7\u30D5\u30A9\u30EB\u30C8\u306E\u30E2\u30B8\u30E5\u30FC\u30EB\u30FB\u30BB\u30C3\u30C8(--main-jar\u304C \n \u6307\u5B9A\u3055\u308C\u305F\u5834\u5408)\u304C\u4F7F\u7528\u3055\u308C\u307E\u3059\u3002\n \u3053\u306E\u30AA\u30D7\u30B7\u30E7\u30F3\u306F\u8907\u6570\u56DE\u4F7F\u7528\u3067\u304D\u307E\u3059\u3002\n --module-path -p ...\n \u30D1\u30B9\u306E{0}\u533A\u5207\u308A\u30EA\u30B9\u30C8\n \u5404\u30D1\u30B9\u306F\u3001\u30E2\u30B8\u30E5\u30FC\u30EB\u306E\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u307E\u305F\u306F\n \u30E2\u30B8\u30E5\u30E9jar\u3078\u306E\u30D1\u30B9\u3067\u3059\u3002\n (\u5404\u30D1\u30B9\u306F\u3001\u7D76\u5BFE\u30D1\u30B9\u307E\u305F\u306F\u73FE\u5728\u306E\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u304B\u3089\u306E\u76F8\u5BFE\u30D1\u30B9\u3067\u3059)\n \u3053\u306E\u30AA\u30D7\u30B7\u30E7\u30F3\u306F\u8907\u6570\u56DE\u4F7F\u7528\u3067\u304D\u307E\u3059\u3002\n --bind-services \n --bind-services\u30AA\u30D7\u30B7\u30E7\u30F3\u3092jlink ( \n \u30B5\u30FC\u30D3\u30B9\u30FB\u30D7\u30ED\u30D0\u30A4\u30C0\u30FB\u30E2\u30B8\u30E5\u30FC\u30EB\u3068\u305D\u306E\u4F9D\u5B58\u6027\u5185\u3067\u30EA\u30F3\u30AF\u3057\u307E\u3059)\u306B\u6E21\u3057\u307E\u3059 \n --runtime-image \n \u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u30FB\u30A4\u30E1\u30FC\u30B8\u306B\u30B3\u30D4\u30FC\u3055\u308C\u308B\u3001\u4E8B\u524D\u5B9A\u7FA9\u6E08\u307F\u306E\u30E9\u30F3\u30BF\u30A4\u30E0\u30FB\u30A4\u30E1\u30FC\u30B8\n \ +\u306E\u30D1\u30B9\n (\u7D76\u5BFE\u30D1\u30B9\u307E\u305F\u306F\u73FE\u5728\u306E\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u304B\u3089\u306E\u76F8\u5BFE\u30D1\u30B9)\n --runtime-image\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u306A\u3044\u5834\u5408\u3001jpackage\u306Fjlink\u3092\u5B9F\u884C\u3057\u3001\n \u6B21\u306E\u30AA\u30D7\u30B7\u30E7\u30F3\u3092\u4F7F\u7528\u3057\u3066\u30E9\u30F3\u30BF\u30A4\u30E0\u30FB\u30A4\u30E1\u30FC\u30B8\u3092\u4F5C\u6210\u3057\u307E\u3059:\n --strip-debug\u3001--no-header-files\u3001--no-man-pages\u304A\u3088\u3073\n --strip-native-\u30B3\u30DE\u30F3\u30C9\u3002\n\n\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u30FB\u30A4\u30E1\u30FC\u30B8\u3092\u4F5C\u6210\u3059\u308B\u305F\u3081\u306E\u30AA\u30D7\u30B7\u30E7\u30F3:\n --icon \n \u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u30FB\u30D1\u30C3\u30B1\u30FC\u30B8\u306E\u30A2\u30A4\u30B3\u30F3\u306E\u30D1\u30B9\n (\u7D76\u5BFE\u30D1\u30B9\u307E\u305F\u306F\u73FE\u5728\u306E\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u304B\u3089\u306E\u76F8\u5BFE\u30D1\u30B9)\n --input -i \n \u30D1\u30C3\u30B1\u30FC\u30B8\u5316\u3059\u308B\u30D5\u30A1\u30A4\u30EB\u3092\u542B\u3080\u5165\u529B\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3078\u306E\u30D1\u30B9\n (\u7D76\u5BFE\u30D1\u30B9\u307E\u305F\u306F\u73FE\u5728\u306E\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u304B\u3089\u306E\u76F8\u5BFE\u30D1\u30B9)\n \u5165\u529B\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306E\u3059\u3079\u3066\u306E\u30D5\u30A1\u30A4\u30EB\u306F\u3001\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u30FB\u30A4\u30E1\u30FC\u30B8\u306B\n \u30D1\u30C3\u30B1\u30FC\u30B8\u5316\u3055\u308C\u307E\u3059\u3002\n\n\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u30FB\u30E9\u30F3\u30C1\u30E3\u3092\u4F5C\u6210\u3059\u308B\u305F\u3081\u306E\u30AA\u30D7\u30B7\u30E7\u30F3:\n --add-launcher =\n \u30E9\u30F3\u30C1\u30E3\u306E\u540D\u524D\u3001\u304A\u3088\u3073\u30AD\u30FC\u3001\u5024\u306E\u30DA\u30A2\u306E\u30EA\u30B9\u30C8\n \u3092\u542B\u3080\u30D7\u30ED\u30D1\u30C6\u30A3\u30FB\u30D5\u30A1\u30A4\u30EB\u3078\u306E\u30D1\u30B9\n (\u7D76\u5BFE\u30D1\u30B9\u307E\u305F\u306F\u73FE\u5728\u306E\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u304B\u3089\u306E\u76F8\u5BFE\u30D1\u30B9)\n \u30AD\u30FC"module"\u3001"main-jar"\u3001"main-class"\u3001\n "arguments"\u3001"java-options"\u3001"app-version"\u3001"icon"\u3001\n "win-console"\u3092\u4F7F\u7528\u3067\u304D\u307E\u3059\u3002\n \u3053\u308C\u3089\u306E\u30AA\u30D7\u30B7\u30E7\u30F3\u3092\u5143\u306E\u30B3\u30DE\u30F3\u30C9\u30E9\u30A4\u30F3\u30FB\u30AA\u30D7\u30B7\u30E7\u30F3\u306B\u8FFD\u52A0\u3059\u308B\u304B\u3001\u3053\u308C\u3089\u306E\u30AA\u30D7\u30B7\u30E7\u30F3\u3092\n \u4F7F\u7528\u3057\u3066\u5143\u306E\u30B3\u30DE\u30F3\u30C9\u30E9\u30A4\u30F3\u30FB\u30AA\u30D7\u30B7\u30E7\u30F3\u3092\u4E0A\u66F8\u304D\u3057\u3066\u3001\u8FFD\u52A0\u306E\u4EE3\u66FF\u30E9\u30F3\u30C1\u30E3\u3092\u4F5C\u6210\u3057\u307E\u3059\u3002\n \u30E1\u30A4\u30F3\u30FB\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u30FB\u30E9\u30F3\u30C1\u30E3\u306F\u30B3\u30DE\u30F3\u30C9\u30E9\u30A4\u30F3\u30FB\u30AA\u30D7\u30B7\u30E7\u30F3\u304B\u3089\u4F5C\u6210\u3055\u308C\u307E\u3059\u3002\n \u3053\u306E\u30AA\u30D7\u30B7\u30E7\u30F3\u3092\u4F7F\u7528\u3057\u3066\u8FFD\u52A0\u306E\u4EE3\u66FF\u30E9\u30F3\u30C1\u30E3\u3092\u4F5C\u6210\u3067\u304D\u3001\n \u3053\u306E\u30AA\u30D7\u30B7\u30E7\u30F3\u3092\u8907\u6570\u56DE\u4F7F\u7528\u3057\u3066\n \u8907\u6570\u306E\u8FFD\u52A0\u306E\u30E9\u30F3\u30C1\u30E3\u3092\u4F5C\u6210\u3067\u304D\u307E\u3059\u3002 \n --arguments
\n \ +\u30E9\u30F3\u30C1\u30E3\u306B\u30B3\u30DE\u30F3\u30C9\u30FB\u30E9\u30A4\u30F3\u5F15\u6570\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u306A\u3044\u5834\u5408\u306B\u30E1\u30A4\u30F3\u30FB\u30AF\u30E9\u30B9\u306B\u6E21\u3059\n \u30B3\u30DE\u30F3\u30C9\u30FB\u30E9\u30A4\u30F3\u5F15\u6570\n \u3053\u306E\u30AA\u30D7\u30B7\u30E7\u30F3\u306F\u8907\u6570\u56DE\u4F7F\u7528\u3067\u304D\u307E\u3059\u3002\n --java-options \n Java\u30E9\u30F3\u30BF\u30A4\u30E0\u306B\u6E21\u3059\u30AA\u30D7\u30B7\u30E7\u30F3\n \u3053\u306E\u30AA\u30D7\u30B7\u30E7\u30F3\u306F\u8907\u6570\u56DE\u4F7F\u7528\u3067\u304D\u307E\u3059\u3002\n --main-class \n \u5B9F\u884C\u3059\u308B\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u30FB\u30E1\u30A4\u30F3\u30FB\u30AF\u30E9\u30B9\u306E\u4FEE\u98FE\u540D\n \u3053\u306E\u30AA\u30D7\u30B7\u30E7\u30F3\u3092\u4F7F\u7528\u3067\u304D\u308B\u306E\u306F\u3001--main-jar\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u308B\u5834\u5408\u3060\u3051\u3067\u3059\u3002\n --main-jar
\n \u30E1\u30A4\u30F3\u30FB\u30AF\u30E9\u30B9\u3092\u542B\u3080\u3001\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u306E\u30E1\u30A4\u30F3JAR\n (\u5165\u529B\u30D1\u30B9\u304B\u3089\u306E\u76F8\u5BFE\u30D1\u30B9\u3068\u3057\u3066\u6307\u5B9A)\n --module\u307E\u305F\u306F--main-jar\u30AA\u30D7\u30B7\u30E7\u30F3\u3092\u6307\u5B9A\u3067\u304D\u307E\u3059\u304C\u3001\u4E21\u65B9\u306F\n \u6307\u5B9A\u3067\u304D\u307E\u305B\u3093\u3002\n --module -m [/
]\n \u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u306E\u30E1\u30A4\u30F3\u30FB\u30E2\u30B8\u30E5\u30FC\u30EB(\u304A\u3088\u3073\u30AA\u30D7\u30B7\u30E7\u30F3\u3067\u30E1\u30A4\u30F3\u30FB\u30AF\u30E9\u30B9)\n \u3053\u306E\u30E2\u30B8\u30E5\u30FC\u30EB\u306F\u3001\u30E2\u30B8\u30E5\u30FC\u30EB\u30FB\u30D1\u30B9\u306B\u7F6E\u304B\u308C\u3066\u3044\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002\n \u3053\u306E\u30AA\u30D7\u30B7\u30E7\u30F3\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u308B\u5834\u5408\u3001\u30E1\u30A4\u30F3\u30FB\u30E2\u30B8\u30E5\u30FC\u30EB\u306F\n Java\u30E9\u30F3\u30BF\u30A4\u30E0\u30FB\u30A4\u30E1\u30FC\u30B8\u5185\u3067\u30EA\u30F3\u30AF\u3055\u308C\u307E\u3059\u3002--module\u307E\u305F\u306F--main-jar\n \u30AA\u30D7\u30B7\u30E7\u30F3\u3092\u6307\u5B9A\u3067\u304D\u307E\u3059\u304C\u3001\u4E21\u65B9\u306F\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093\u3002\n{2}\n\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u30FB\u30D1\u30C3\u30B1\u30FC\u30B8\u3092\u4F5C\u6210\u3059\u308B\u305F\u3081\u306E\u30AA\u30D7\u30B7\u30E7\u30F3:\n --app-image \n \u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u53EF\u80FD\u306A\u30D1\u30C3\u30B1\u30FC\u30B8\u306E\u4F5C\u6210\u306B\u4F7F\u7528\u3059\u308B\u3001\u4E8B\u524D\u5B9A\u7FA9\u6E08\u307F\n \u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u30FB\u30A4\u30E1\u30FC\u30B8\u306E\u5834\u6240\n (\u7D76\u5BFE\u30D1\u30B9\u307E\u305F\u306F\u73FE\u5728\u306E\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u304B\u3089\u306E\u76F8\u5BFE\u30D1\u30B9)\n --file-associations \n \u30AD\u30FC\u3001\u5024\u306E\u30DA\u30A2\u306E\u30EA\u30B9\u30C8\u3092\u542B\u3080\u30D7\u30ED\u30D1\u30C6\u30A3\u30FB\u30D5\u30A1\u30A4\u30EB\u3078\u306E\u30D1\u30B9\n (\u7D76\u5BFE\u30D1\u30B9\u307E\u305F\u306F\u73FE\u5728\u306E\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u304B\u3089\u306E\u76F8\u5BFE\u30D1\u30B9)\n \u30AD\u30FC"extension"\u3001"mime-type"\u3001"icon"\u3001"description"\n \u3092\u4F7F\u7528\u3057\u3066\u95A2\u9023\u4ED8\u3051\u3092\u8A18\u8FF0\u3067\u304D\u307E\u3059\u3002\n \u3053\u306E\u30AA\u30D7\u30B7\u30E7\u30F3\u306F\u8907\u6570\u56DE\u4F7F\u7528\u3067\u304D\u307E\u3059\u3002\n --install-dir \n {4} --license-file \n \ +\u30E9\u30A4\u30BB\u30F3\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u3078\u306E\u30D1\u30B9\n (\u7D76\u5BFE\u30D1\u30B9\u307E\u305F\u306F\u73FE\u5728\u306E\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u304B\u3089\u306E\u76F8\u5BFE\u30D1\u30B9)\n --resource-dir \n \u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9jpackage\u30EA\u30BD\u30FC\u30B9\u3078\u306E\u30D1\u30B9\n \u30A2\u30A4\u30B3\u30F3\u3001\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u30FB\u30D5\u30A1\u30A4\u30EB\u304A\u3088\u3073jpackage\u306E\u305D\u306E\u4ED6\u306E\u30EA\u30BD\u30FC\u30B9\u306F\u3001\n \u3053\u306E\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306B\u7F6E\u63DB\u30EA\u30BD\u30FC\u30B9\u3092\u8FFD\u52A0\u3059\u308B\u3053\u3068\u3067\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u3067\u304D\u307E\u3059\u3002\n (\u7D76\u5BFE\u30D1\u30B9\u307E\u305F\u306F\u73FE\u5728\u306E\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u304B\u3089\u306E\u76F8\u5BFE\u30D1\u30B9)\n --runtime-image \n \u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3059\u308B\u4E8B\u524D\u5B9A\u7FA9\u6E08\u307F\u306E\u30E9\u30F3\u30BF\u30A4\u30E0\u30FB\u30A4\u30E1\u30FC\u30B8\u306E\u30D1\u30B9\n (\u7D76\u5BFE\u30D1\u30B9\u307E\u305F\u306F\u73FE\u5728\u306E\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u304B\u3089\u306E\u76F8\u5BFE\u30D1\u30B9)\n \u30E9\u30F3\u30BF\u30A4\u30E0\u30FB\u30D1\u30C3\u30B1\u30FC\u30B8\u306E\u4F5C\u6210\u6642\u306B\u306F\u3001\u30AA\u30D7\u30B7\u30E7\u30F3\u304C\u5FC5\u8981\u3067\u3059\u3002\n\n\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u30FB\u30D1\u30C3\u30B1\u30FC\u30B8\u3092\u4F5C\u6210\u3059\u308B\u305F\u3081\u306E\u30D7\u30E9\u30C3\u30C8\u30D5\u30A9\u30FC\u30E0\u4F9D\u5B58\u30AA\u30D7\u30B7\u30E7\u30F3:\n{3} +MSG_Help_win_launcher=\n\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u30FB\u30E9\u30F3\u30C1\u30E3\u3092\u4F5C\u6210\u3059\u308B\u305F\u3081\u306E\u30D7\u30E9\u30C3\u30C8\u30D5\u30A9\u30FC\u30E0\u4F9D\u5B58\u30AA\u30D7\u30B7\u30E7\u30F3:\n --win-console\n \u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u306E\u30B3\u30F3\u30BD\u30FC\u30EB\u30FB\u30E9\u30F3\u30C1\u30E3\u3092\u4F5C\u6210\u3057\u307E\u3059\u3002\u30B3\u30F3\u30BD\u30FC\u30EB\u30FB\n \u30A4\u30F3\u30BF\u30E9\u30AF\u30B7\u30E7\u30F3\u304C\u5FC5\u8981\u306A\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u306B\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\n +MSG_Help_win_install=\ --win-dir-chooser\n \u30E6\u30FC\u30B6\u30FC\u304C\u88FD\u54C1\u3092\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3059\u308B\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3092\u9078\u629E\n \u3059\u308B\u305F\u3081\u306E\u30C0\u30A4\u30A2\u30ED\u30B0\u3092\u8FFD\u52A0\u3057\u307E\u3059\n --win-menu\n \u30B7\u30B9\u30C6\u30E0\u30FB\u30E1\u30CB\u30E5\u30FC\u306B\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u3092\u8FFD\u52A0\u3057\u307E\u3059\n --win-menu-group \n \u3053\u306E\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u3092\u914D\u7F6E\u3059\u308B\u30B9\u30BF\u30FC\u30C8\u30FB\u30E1\u30CB\u30E5\u30FC\u30FB\u30B0\u30EB\u30FC\u30D7\n --win-per-user-install\n \u30E6\u30FC\u30B6\u30FC\u3054\u3068\u306B\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3092\u5B9F\u884C\u3059\u308B\u3088\u3046\u306B\u30EA\u30AF\u30A8\u30B9\u30C8\u3057\u307E\u3059\n --win-shortcut\n \u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u306E\u30C7\u30B9\u30AF\u30C8\u30C3\u30D7\u30FB\u30B7\u30E7\u30FC\u30C8\u30AB\u30C3\u30C8\u3092\u4F5C\u6210\u3057\u307E\u3059\n --win-upgrade-uuid \n \u3053\u306E\u30D1\u30C3\u30B1\u30FC\u30B8\u306E\u30A2\u30C3\u30D7\u30B0\u30EC\u30FC\u30C9\u306B\u95A2\u9023\u4ED8\u3051\u3089\u308C\u3066\u3044\u308BUUID\n +MSG_Help_win_install_dir=\u30C7\u30D5\u30A9\u30EB\u30C8\u306E\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u5834\u6240\u306E\u4E0B\u306E\u76F8\u5BFE\u30B5\u30D6\u30D1\u30B9\n +MSG_Help_mac_launcher=\ --mac-package-identifier \n MacOS\u306E\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u3092\u4E00\u610F\u306B\u8B58\u5225\u3059\u308BID\n \u30E1\u30A4\u30F3\u30FB\u30AF\u30E9\u30B9\u540D\u306B\u30C7\u30D5\u30A9\u30EB\u30C8\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u307E\u3059\u3002\n \u82F1\u6570\u5B57(A-Z\u3001a-z\u30010-9)\u3001\u30CF\u30A4\u30D5\u30F3(-)\n \u304A\u3088\u3073\u30D4\u30EA\u30AA\u30C9(.)\u6587\u5B57\u306E\u307F\u4F7F\u7528\u3067\u304D\u307E\u3059\u3002\n --mac-package-name \n \u30E1\u30CB\u30E5\u30FC\u30FB\u30D0\u30FC\u306B\u8868\u793A\u3055\u308C\u308B\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u306E\u540D\u524D\n \u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u540D\u3068\u306F\u7570\u306A\u308A\u307E\u3059\u3002\n \u3053\u306E\u540D\u524D\u306F16\u6587\u5B57\u672A\u6E80\u306B\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u3001\u30E1\u30CB\u30E5\u30FC\u30FB\u30D0\u30FC\n \u304A\u3088\u3073\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u60C5\u5831\u30A6\u30A3\u30F3\u30C9\u30A6\u306B\u8868\u793A\u3059\u308B\u306E\u306B\u9069\u3057\u3066\u3044\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002\n \u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u540D\u306B\u30C7\u30D5\u30A9\u30EB\u30C8\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u307E\u3059\u3002\n --mac-package-signing-prefix \n \u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u30FB\u30D1\u30C3\u30B1\u30FC\u30B8\u306B\u7F72\u540D\u3059\u308B\u969B\u3001\u65E2\u5B58\u306E\u30D1\u30C3\u30B1\u30FC\u30B8ID\u306E\u306A\u3044\n \u7F72\u540D\u304C\u5FC5\u8981\u306A\u3059\u3079\u3066\u306E\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u306B\u3001\n \u3053\u306E\u5024\u304C\u63A5\u982D\u8F9E\u3068\u3057\u3066\u4ED8\u3051\u3089\u308C\u307E\u3059\u3002\n --mac-sign\n \u30D1\u30C3\u30B1\u30FC\u30B8\u306B\u7F72\u540D\u3059\u308B\u3088\u3046\u30EA\u30AF\u30A8\u30B9\u30C8\u3057\u307E\u3059\n --mac-signing-keychain \n \u7F72\u540D\u30A2\u30A4\u30C7\u30F3\u30C6\u30A3\u30C6\u30A3\u3092\u691C\u7D22\u3059\u308B\u30AD\u30FC\u30C1\u30A7\u30FC\u30F3\u306E\u30D1\u30B9\n (\u7D76\u5BFE\u30D1\u30B9\u307E\u305F\u306F\u73FE\u5728\u306E\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u304B\u3089\u306E\u76F8\u5BFE\u30D1\u30B9)\u3002\n \u6307\u5B9A\u3057\u306A\u304B\u3063\u305F\u5834\u5408\u3001\u6A19\u6E96\u306E\u30AD\u30FC\u30C1\u30A7\u30FC\u30F3\u304C\u4F7F\u7528\u3055\u308C\u307E\u3059\u3002\n --mac-signing-key-user-name \n Apple\u7F72\u540D\u30A2\u30A4\u30C7\u30F3\u30C6\u30A3\u30C6\u30A3\u306E\u540D\u524D\u306E\u30C1\u30FC\u30E0\u540D\u90E8\u5206\u3002\n \u4F8B: "Developer ID Application: "\n +MSG_Help_linux_install=\ --linux-package-name \n Linux\u30D1\u30C3\u30B1\u30FC\u30B8\u306E\u540D\u524D\u3002\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u540D\u306B\u30C7\u30D5\u30A9\u30EB\u30C8\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u307E\u3059\n --linux-deb-maintainer \n .deb\u30D1\u30C3\u30B1\u30FC\u30B8\u306EMaintainer\n --linux-menu-group \n \u3053\u306E\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u304C\u914D\u7F6E\u3055\u308C\u3066\u3044\u308B\u30E1\u30CB\u30E5\u30FC\u30FB\u30B0\u30EB\u30FC\u30D7\n --linux-package-deps\n \u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u306B\u5FC5\u8981\u306A\u30D1\u30C3\u30B1\u30FC\u30B8\u307E\u305F\u306F\u6A5F\u80FD\n --linux-rpm-license-type \n \u30E9\u30A4\u30BB\u30F3\u30B9\u306E\u30BF\u30A4\u30D7(RPM .spec\u306E"License: ")\n --linux-app-release \n RPM .spec\u30D5\u30A1\u30A4\u30EB\u306E\u30EA\u30EA\u30FC\u30B9\u5024\u307E\u305F\u306F \n DEB\u30B3\u30F3\u30C8\u30ED\u30FC\u30EB\u30FB\u30D5\u30A1\u30A4\u30EB\u306EDebian\u30EA\u30D3\u30B8\u30E7\u30F3\u5024\u3002\n --linux-app-category \n RPM .spec\u30D5\u30A1\u30A4\u30EB\u306E\u30B0\u30EB\u30FC\u30D7\u5024\u307E\u305F\u306F \n DEB\u30B3\u30F3\u30C8\u30ED\u30FC\u30EB\u30FB\u30D5\u30A1\u30A4\u30EB\u306E\u30BB\u30AF\u30B7\u30E7\u30F3\u5024\u3002\n --linux-shortcut\n \u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u306E\u30B7\u30E7\u30FC\u30C8\u30AB\u30C3\u30C8\u3092\u4F5C\u6210\u3057\u307E\u3059\n +MSG_Help_mac_linux_install_dir=\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u306E\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u30FB\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306E\u7D76\u5BFE\u30D1\u30B9\n +MSG_Help_default_install_dir=OS X\u307E\u305F\u306FLinux\u4E0A\u306E\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u306E\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u30FB\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306E\u7D76\u5BFE\u30D1\u30B9\u3002\n "\u30D7\u30ED\u30B0\u30E9\u30E0\u30FB\u30D5\u30A1\u30A4\u30EB"\u3084"AppData"\u306A\u3069\u3001Windows\u4E0A\u306E\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u306E\n \u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u5834\u6240\u306E\u76F8\u5BFE\u30B5\u30D6\u30D1\u30B9\u3002\n +MSG_Help_no_args=\u4F7F\u7528\u65B9\u6CD5: jpackage \n\u5229\u7528\u53EF\u80FD\u306A\u30AA\u30D7\u30B7\u30E7\u30F3\u306E\u30EA\u30B9\u30C8\u306B\u3064\u3044\u3066\u306F\u3001jpackage --help (or -h)\u3092\u4F7F\u7528\u3057\u307E\u3059 diff --git a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/resources/HelpResources_zh_CN.properties b/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/resources/HelpResources_zh_CN.properties index cad427b54ad..996170c9e21 100644 --- a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/resources/HelpResources_zh_CN.properties +++ b/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/resources/HelpResources_zh_CN.properties @@ -24,252 +24,16 @@ # # -MSG_Help=Usage: jpackage \n\ -\n\ -Sample usages:\n\ ---------------\n\ -\ Generate an application package suitable for the host system:\n\ -\ For a modular application:\n\ -\ jpackage -n name -p modulePath -m moduleName/className\n\ -\ For a non-modular application:\n\ -\ jpackage -i inputDir -n name \\\n\ -\ --main-class className --main-jar myJar.jar\n\ -\ From a pre-built application image:\n\ -\ jpackage -n name --app-image appImageDir\n\ -\ Generate an application image:\n\ -\ For a modular application:\n\ -\ jpackage --type app-image -n name -p modulePath \\\n\ -\ -m moduleName/className\n\ -\ For a non-modular application:\n\ -\ jpackage --type app-image -i inputDir -n name \\\n\ -\ --main-class className --main-jar myJar.jar\n\ -\ To provide your own options to jlink, run jlink separately:\n\ -\ jlink --output appRuntimeImage -p modulePath -m moduleName \\\n\ -\ --no-header-files [...]\n\ -\ jpackage --type app-image -n name \\\n\ -\ -m moduleName/className --runtime-image appRuntimeImage\n\ -\ Generate a Java runtime package:\n\ -\ jpackage -n name --runtime-image \n\ -\n\ -Generic Options:\n\ -\ @ \n\ -\ Read options and/or mode from a file \n\ -\ This option can be used multiple times.\n\ -\ --type -t \n\ -\ The type of package to create\n\ -\ Valid values are: {1} \n\ -\ If this option is not specified a platform dependent\n\ -\ default type will be created.\n\ -\ --app-version \n\ -\ Version of the application and/or package\n\ -\ --copyright \n\ -\ Copyright for the application\n\ -\ --description \n\ -\ Description of the application\n\ -\ --help -h \n\ -\ Print the usage text with a list and description of each valid\n\ -\ option for the current platform to the output stream, and exit\n\ -\ --name -n \n\ -\ Name of the application and/or package\n\ -\ --dest -d \n\ -\ Path where generated output file is placed\n\ -\ Defaults to the current working directory.\n\ -\ (absolute path or relative to the current directory)\n\ -\ --temp \n\ -\ Path of a new or empty directory used to create temporary files\n\ -\ (absolute path or relative to the current directory)\n\ -\ If specified, the temp dir will not be removed upon the task\n\ -\ completion and must be removed manually\n\ -\ If not specified, a temporary directory will be created and\n\ -\ removed upon the task completion.\n\ -\ --vendor \n\ -\ Vendor of the application\n\ -\ --verbose\n\ -\ Enables verbose output\n\ -\ --version\n\ -\ Print the product version to the output stream and exit\n\ -\n\ -\Options for creating the runtime image:\n\ -\ --add-modules [,...]\n\ -\ A comma (",") separated list of modules to add.\n\ -\ This module list, along with the main module (if specified)\n\ -\ will be passed to jlink as the --add-module argument.\n\ -\ if not specified, either just the main module (if --module is\n\ -\ specified), or the default set of modules (if --main-jar is \n\ -\ specified) are used.\n\ -\ This option can be used multiple times.\n\ -\ --module-path -p ...\n\ -\ A {0} separated list of paths\n\ -\ Each path is either a directory of modules or the path to a\n\ -\ modular jar.\n\ -\ (each path is absolute or relative to the current directory)\n\ -\ This option can be used multiple times.\n\ -\ --bind-services \n\ -\ Pass on --bind-services option to jlink (which will link in \n\ -\ service provider modules and their dependences) \n\ -\ --runtime-image \n\ -\ Path of the predefined runtime image that will be copied into\n\ -\ the application image\n\ -\ (absolute path or relative to the current directory)\n\ -\ If --runtime-image is not specified, jpackage will run jlink to\n\ -\ create the runtime image using options:\n\ -\ --strip-debug, --no-header-files, --no-man-pages, and\n\ -\ --strip-native-commands.\n\ -\n\ -\Options for creating the application image:\n\ -\ --icon \n\ -\ Path of the icon of the application package\n\ -\ (absolute path or relative to the current directory)\n\ -\ --input -i \n\ -\ Path of the input directory that contains the files to be packaged\n\ -\ (absolute path or relative to the current directory)\n\ -\ All files in the input directory will be packaged into the\n\ -\ application image.\n\ -\n\ -\Options for creating the application launcher(s):\n\ -\ --add-launcher =\n\ -\ Name of launcher, and a path to a Properties file that contains\n\ -\ a list of key, value pairs\n\ -\ (absolute path or relative to the current directory)\n\ -\ The keys "module", "main-jar", "main-class",\n\ -\ "arguments", "java-options", "app-version", "icon", and\n\ -\ "win-console" can be used.\n\ -\ These options are added to, or used to overwrite, the original\n\ -\ command line options to build an additional alternative launcher.\n\ -\ The main application launcher will be built from the command line\n\ -\ options. Additional alternative launchers can be built using\n\ -\ this option, and this option can be used multiple times to\n\ -\ build multiple additional launchers. \n\ -\ --arguments
\n\ -\ Command line arguments to pass to the main class if no command\n\ -\ line arguments are given to the launcher\n\ -\ This option can be used multiple times.\n\ -\ --java-options \n\ -\ Options to pass to the Java runtime\n\ -\ This option can be used multiple times.\n\ -\ --main-class \n\ -\ Qualified name of the application main class to execute\n\ -\ This option can only be used if --main-jar is specified.\n\ -\ --main-jar
\n\ -\ The main JAR of the application; containing the main class\n\ -\ (specified as a path relative to the input path)\n\ -\ Either --module or --main-jar option can be specified but not\n\ -\ both.\n\ -\ --module -m [/
]\n\ -\ The main module (and optionally main class) of the application\n\ -\ This module must be located on the module path.\n\ -\ When this option is specified, the main module will be linked\n\ -\ in the Java runtime image. Either --module or --main-jar\n\ -\ option can be specified but not both.\n\ -{2}\n\ -\Options for creating the application package:\n\ -\ --app-image \n\ -\ Location of the predefined application image that is used\n\ -\ to build an installable package\n\ -\ (absolute path or relative to the current directory)\n\ -\ --file-associations \n\ -\ Path to a Properties file that contains list of key, value pairs\n\ -\ (absolute path or relative to the current directory)\n\ -\ The keys "extension", "mime-type", "icon", and "description"\n\ -\ can be used to describe the association.\n\ -\ This option can be used multiple times.\n\ -\ --install-dir \n\ -\ {4}\ -\ --license-file \n\ -\ Path to the license file\n\ -\ (absolute path or relative to the current directory)\n\ -\ --resource-dir \n\ -\ Path to override jpackage resources\n\ -\ Icons, template files, and other resources of jpackage can be\n\ -\ over-ridden by adding replacement resources to this directory.\n\ -\ (absolute path or relative to the current directory)\n\ -\ --runtime-image \n\ -\ Path of the predefined runtime image to install\n\ -\ (absolute path or relative to the current directory)\n\ -\ Option is required when creating a runtime package.\n\ -\n\ -\Platform dependent options for creating the application package:\n\ -{3} - -MSG_Help_win_launcher=\ -\n\ -\Platform dependent option for creating the application launcher:\n\ -\ --win-console\n\ -\ Creates a console launcher for the application, should be\n\ -\ specified for application which requires console interactions\n\ - -MSG_Help_win_install=\ -\ --win-dir-chooser\n\ -\ Adds a dialog to enable the user to choose a directory in which\n\ -\ the product is installed\n\ -\ --win-menu\n\ -\ Adds the application to the system menu\n\ -\ --win-menu-group \n\ -\ Start Menu group this application is placed in\n\ -\ --win-per-user-install\n\ -\ Request to perform an install on a per-user basis\n\ -\ --win-shortcut\n\ -\ Creates a desktop shortcut for the application\n\ -\ --win-upgrade-uuid \n\ -\ UUID associated with upgrades for this package\n\ - -MSG_Help_win_install_dir=\ -\Relative sub-path under the default installation location\n\ - -MSG_Help_mac_launcher=\ -\ --mac-package-identifier \n\ -\ An identifier that uniquely identifies the application for macOS\n\ -\ Defaults to the main class name.\n\ -\ May only use alphanumeric (A-Z,a-z,0-9), hyphen (-),\n\ -\ and period (.) characters.\n\ -\ --mac-package-name \n\ -\ Name of the application as it appears in the Menu Bar\n\ -\ This can be different from the application name.\n\ -\ This name must be less than 16 characters long and be suitable for\n\ -\ displaying in the menu bar and the application Info window.\n\ -\ Defaults to the application name.\n\ -\ --mac-package-signing-prefix \n\ -\ When signing the application package, this value is prefixed\n\ -\ to all components that need to be signed that don't have\n\ -\ an existing package identifier.\n\ -\ --mac-sign\n\ -\ Request that the package be signed\n\ -\ --mac-signing-keychain \n\ -\ Path of the keychain to search for the signing identity\n\ -\ (absolute path or relative to the current directory).\n\ -\ If not specified, the standard keychains are used.\n\ -\ --mac-signing-key-user-name \n\ -\ Team name portion in Apple signing identities' names.\n\ -\ For example "Developer ID Application: "\n\ - -MSG_Help_linux_install=\ -\ --linux-package-name \n\ -\ Name for Linux package, defaults to the application name\n\ -\ --linux-deb-maintainer \n\ -\ Maintainer for .deb package\n\ -\ --linux-menu-group \n\ -\ Menu group this application is placed in\n\ -\ --linux-package-deps\n\ -\ Required packages or capabilities for the application\n\ -\ --linux-rpm-license-type \n\ -\ Type of the license ("License: " of the RPM .spec)\n\ -\ --linux-app-release \n\ -\ Release value of the RPM .spec file or \n\ -\ Debian revision value of the DEB control file.\n\ -\ --linux-app-category \n\ -\ Group value of the RPM .spec file or \n\ -\ Section value of DEB control file.\n\ -\ --linux-shortcut\n\ -\ Creates a shortcut for the application\n\ - -MSG_Help_mac_linux_install_dir=\ -\Absolute path of the installation directory of the application\n\ - -MSG_Help_default_install_dir=\ -\Absolute path of the installation directory of the application on OS X\n\ -\ or Linux. Relative sub-path of the installation location of\n\ -\ the application such as "Program Files" or "AppData" on Windows.\n\ - -MSG_Help_no_args=Usage: jpackage \n\ -\Use jpackage --help (or -h) for a list of possible options\ +MSG_Help=\u7528\u6CD5\uFF1Ajpackage \n\n\u793A\u4F8B\u7528\u6CD5:\n--------------\n \u751F\u6210\u9002\u5408\u4E3B\u673A\u7CFB\u7EDF\u7684\u5E94\u7528\u7A0B\u5E8F\u5305\uFF1A\n \u5BF9\u4E8E\u6A21\u5757\u5316\u5E94\u7528\u7A0B\u5E8F\uFF1A\n jpackage -n name -p modulePath -m moduleName/className\n \u5BF9\u4E8E\u975E\u6A21\u5757\u5316\u5E94\u7528\u7A0B\u5E8F\uFF1A\n jpackage -i inputDir -n name \\\n --main-class className --main-jar myJar.jar\n \u4ECE\u9884\u6784\u5EFA\u7684\u5E94\u7528\u7A0B\u5E8F\u6620\u50CF\uFF1A\n jpackage -n name --app-image appImageDir\n \u751F\u6210\u5E94\u7528\u7A0B\u5E8F\u6620\u50CF\uFF1A\n \u5BF9\u4E8E\u6A21\u5757\u5316\u5E94\u7528\u7A0B\u5E8F\uFF1A\n jpackage --type app-image -n name -p modulePath \\\n -m moduleName/className\n \u5BF9\u4E8E\u975E\u6A21\u5757\u5316\u5E94\u7528\u7A0B\u5E8F\uFF1A\n jpackage --type app-image -i inputDir -n name \\\n --main-class className --main-jar myJar.jar\n \u8981\u4E3A jlink \u63D0\u4F9B\u60A8\u81EA\u5DF1\u7684\u9009\u9879\uFF0C\u8BF7\u5355\u72EC\u8FD0\u884C jlink\uFF1A\n jlink --output appRuntimeImage -p modulePath -m moduleName \\\n --no-header-files [...]\n jpackage --type app-image -n name \\\n -m moduleName/className --runtime-image appRuntimeImage\n \u751F\u6210 Java \u8FD0\u884C\u65F6\u7A0B\u5E8F\u5305\uFF1A\n jpackage -n name --runtime-image \n\n\u4E00\u822C\u9009\u9879\uFF1A\n @ \n \u4ECE\u6587\u4EF6\u8BFB\u53D6\u9009\u9879\u548C/\u6216\u6A21\u5F0F \n \u53EF\u4EE5\u591A\u6B21\u4F7F\u7528\u6B64\u9009\u9879\u3002\n --type -t \n \u8981\u521B\u5EFA\u7684\u7A0B\u5E8F\u5305\u7684\u7C7B\u578B\n \u6709\u6548\u503C\u4E3A\uFF1A{1} \n \u5982\u679C\u672A\u6307\u5B9A\u6B64\u9009\u9879\uFF0C\u5219\u5C06\u521B\u5EFA\u4E0E\u5E73\u53F0\u76F8\u5173\u7684\n \u9ED8\u8BA4\u7C7B\u578B\u3002\n --app-version \n \u5E94\u7528\u7A0B\u5E8F\u548C/\u6216\u7A0B\u5E8F\u5305\u7684\u7248\u672C\n --copyright \n \u5E94\u7528\u7A0B\u5E8F\u7684\u7248\u6743\n --description \n \u5E94\u7528\u7A0B\u5E8F\u7684\u8BF4\u660E\n --help -h \n \u5C06\u7528\u6CD5\u6587\u672C\u8F93\u51FA\u5230\u8F93\u51FA\u6D41\u5E76\u9000\u51FA\uFF0C\u7528\u6CD5\u6587\u672C\u4E2D\u5305\u542B\n \u9002\u7528\u4E8E\u5F53\u524D\u5E73\u53F0\u7684\u6BCF\u4E2A\u6709\u6548\u9009\u9879\u7684\u5217\u8868\u548C\u8BF4\u660E\n --name -n \n \u5E94\u7528\u7A0B\u5E8F\u548C/\u6216\u7A0B\u5E8F\u5305\u7684\u540D\u79F0\n --dest -d \n \u7528\u6765\u653E\u7F6E\u6240\u751F\u6210\u7684\u8F93\u51FA\u6587\u4EF6\u7684\u8DEF\u5F84\n \u9ED8\u8BA4\u4E3A\u5F53\u524D\u7684\u5DE5\u4F5C\u76EE\u5F55\u3002\n \uFF08\u7EDD\u5BF9\u8DEF\u5F84\u6216\u76F8\u5BF9\u4E8E\u5F53\u524D\u76EE\u5F55\u7684\u8DEF\u5F84\uFF09\n --temp \n \u7528\u6765\u521B\u5EFA\u4E34\u65F6\u6587\u4EF6\u7684\u65B0\u76EE\u5F55\u6216\u7A7A\u767D\u76EE\u5F55\u7684\u8DEF\u5F84\n \uFF08\u7EDD\u5BF9\u8DEF\u5F84\u6216\u76F8\u5BF9\u4E8E\u5F53\u524D\u76EE\u5F55\u7684\u8DEF\u5F84\uFF09\n \u5982\u679C\u6307\u5B9A\uFF0C\u5219\u5728\u4EFB\u52A1\u5B8C\u6210\u65F6\u5C06\u4E0D\u5220\u9664\u4E34\u65F6\u76EE\u5F55\uFF0C\n \u5FC5\u987B\u624B\u52A8\u5220\u9664\u4E34\u65F6\u76EE\u5F55\n \u5982\u679C\u672A\u6307\u5B9A\uFF0C\u5219\u5C06\u521B\u5EFA\u4E00\u4E2A\u4E34\u65F6\u76EE\u5F55\uFF0C\n \u5E76\u5728\u4EFB\u52A1\u5B8C\u6210\u65F6\u5220\u9664\u8BE5\u4E34\u65F6\u76EE\u5F55\u3002\n --vendor \n \u5E94\u7528\u7A0B\u5E8F\u7684\u4F9B\u5E94\u5546\n --verbose\n \u542F\u7528\u8BE6\u7EC6\u7684\u8F93\u51FA\n --version\n \ +\u5C06\u4EA7\u54C1\u7248\u672C\u8F93\u51FA\u5230\u8F93\u51FA\u6D41\u5E76\u9000\u51FA\n\n\u7528\u6765\u521B\u5EFA\u8FD0\u884C\u65F6\u6620\u50CF\u7684\u9009\u9879\uFF1A\n --add-modules <\u6A21\u5757\u540D\u79F0>[,<\u6A21\u5757\u540D\u79F0>...]\n \u8981\u6DFB\u52A0\u7684\u6A21\u5757\u7684\u9017\u53F7 (",") \u5206\u9694\u5217\u8868\u3002\n \u6B64\u6A21\u5757\u5217\u8868\u8FDE\u540C\u4E3B\u6A21\u5757\uFF08\u5982\u679C\u6307\u5B9A\uFF09\n \u5C06\u4F5C\u4E3A --add-module \u53C2\u6570\u4F20\u9012\u5230 jlink\u3002\n \u5982\u679C\u672A\u6307\u5B9A\uFF0C\u5219\u4EC5\u4F7F\u7528\u4E3B\u6A21\u5757\uFF08\u5982\u679C\u6307\u5B9A\u4E86 --module\uFF09\uFF0C\n \u6216\u8005\u4F7F\u7528\u9ED8\u8BA4\u7684\u6A21\u5757\u96C6\uFF08\u5982\u679C\u6307\u5B9A\u4E86 \n --main-jar\uFF09\u3002\n \u53EF\u4EE5\u591A\u6B21\u4F7F\u7528\u6B64\u9009\u9879\u3002\n --module-path -p ...\n \u8DEF\u5F84\u7684 {0} \u5206\u9694\u5217\u8868\n \u6BCF\u4E2A\u8DEF\u5F84\u8981\u4E48\u662F\u6A21\u5757\u7684\u76EE\u5F55\uFF0C\u8981\u4E48\u662F\n \u6A21\u5757 jar \u7684\u8DEF\u5F84\u3002\n \uFF08\u6BCF\u4E2A\u8DEF\u5F84\u53EF\u4EE5\u662F\u7EDD\u5BF9\u8DEF\u5F84\uFF0C\u4E5F\u53EF\u4EE5\u662F\u76F8\u5BF9\u4E8E\u5F53\u524D\u76EE\u5F55\u7684\u8DEF\u5F84\uFF09\n \u53EF\u4EE5\u591A\u6B21\u4F7F\u7528\u6B64\u9009\u9879\u3002\n --bind-services \n \u5C06 --bind-services \u9009\u9879\u4F20\u9012\u5230 jlink\uFF08\u5C06\u5728\u670D\u52A1 \n \u63D0\u4F9B\u5546\u6A21\u5757\u53CA\u5176\u88AB\u4F9D\u8D56\u5BF9\u8C61\u4E2D\u8FDB\u884C\u94FE\u63A5\uFF09 \n --runtime-image \n \u5C06\u590D\u5236\u5230\u5E94\u7528\u7A0B\u5E8F\u6620\u50CF\u7684\u9884\u5B9A\u4E49\n \u8FD0\u884C\u65F6\u6620\u50CF\u7684\u8DEF\u5F84\n \uFF08\u7EDD\u5BF9\u8DEF\u5F84\u6216\u76F8\u5BF9\u4E8E\u5F53\u524D\u76EE\u5F55\u7684\u8DEF\u5F84\uFF09\n \u5982\u679C\u672A\u6307\u5B9A --runtime-image\uFF0Cjpackage \u5C06\u8FD0\u884C jlink \u4EE5\n \u4F7F\u7528\u5982\u4E0B\u9009\u9879\u521B\u5EFA\u8FD0\u884C\u65F6\u6620\u50CF\uFF1A\n --strip-debug\u3001--no-header-files\u3001--no-man-pages \u548C \n --strip-native-commands\u3002\n\n\u7528\u6765\u521B\u5EFA\u5E94\u7528\u7A0B\u5E8F\u6620\u50CF\u7684\u9009\u9879\uFF1A\n --icon \n \u5E94\u7528\u7A0B\u5E8F\u5305\u56FE\u6807\u7684\u8DEF\u5F84\n \uFF08\u7EDD\u5BF9\u8DEF\u5F84\u6216\u76F8\u5BF9\u4E8E\u5F53\u524D\u76EE\u5F55\u7684\u8DEF\u5F84\uFF09\n --input -i \n \u5305\u542B\u8981\u6253\u5305\u7684\u6587\u4EF6\u7684\u8F93\u5165\u76EE\u5F55\u7684\u8DEF\u5F84\n \uFF08\u7EDD\u5BF9\u8DEF\u5F84\u6216\u76F8\u5BF9\u4E8E\u5F53\u524D\u76EE\u5F55\u7684\u8DEF\u5F84\uFF09\n \u8F93\u5165\u76EE\u5F55\u4E2D\u7684\u6240\u6709\u6587\u4EF6\u5C06\u6253\u5305\u5230\n \u5E94\u7528\u7A0B\u5E8F\u6620\u50CF\u4E2D\u3002\n\n\u7528\u6765\u521B\u5EFA\u5E94\u7528\u7A0B\u5E8F\u542F\u52A8\u7A0B\u5E8F\u7684\u9009\u9879\uFF1A\n --add-launcher =\n \u542F\u52A8\u7A0B\u5E8F\u7684\u540D\u79F0\u548C\u5305\u542B\u5173\u952E\u5B57-\u503C\u5BF9\u5217\u8868\u7684\n \u5C5E\u6027\u6587\u4EF6\u7684\u8DEF\u5F84\n \uFF08\u7EDD\u5BF9\u8DEF\u5F84\u6216\u76F8\u5BF9\u4E8E\u5F53\u524D\u76EE\u5F55\u7684\u8DEF\u5F84\uFF09\n \u53EF\u4EE5\u4F7F\u7528\u5173\u952E\u5B57 "module"\u3001"main-jar"\u3001"main-class"\u3001\n "arguments"\u3001"java-options"\u3001"app-version"\u3001"icon" \u548C \n "win-console"\u3002\n \u8FD9\u4E9B\u9009\u9879\u5C06\u6DFB\u52A0\u5230\u539F\u59CB\u547D\u4EE4\u884C\u9009\u9879\u4E2D\u6216\u8005\u7528\u6765\u8986\u76D6\n \u539F\u59CB\u547D\u4EE4\u884C\u9009\u9879\uFF0C\u4EE5\u6784\u5EFA\u989D\u5916\u7684\u66FF\u4EE3\u542F\u52A8\u7A0B\u5E8F\u3002\n \ +\u5C06\u4ECE\u547D\u4EE4\u884C\u9009\u9879\u6784\u5EFA\u4E3B\u5E94\u7528\u7A0B\u5E8F\u542F\u52A8\u7A0B\u5E8F\u3002\n \u53EF\u4EE5\u4F7F\u7528\u6B64\u9009\u9879\u6784\u5EFA\u989D\u5916\u7684\u66FF\u4EE3\u542F\u52A8\u7A0B\u5E8F\uFF0C\n \u53EF\u4EE5\u591A\u6B21\u4F7F\u7528\u6B64\u9009\u9879\u6765\u6784\u5EFA\n \u591A\u4E2A\u989D\u5916\u7684\u542F\u52A8\u7A0B\u5E8F\u3002 \n --arguments
\n \u5728\u6CA1\u6709\u4E3A\u542F\u52A8\u7A0B\u5E8F\u63D0\u4F9B\u547D\u4EE4\u884C\u53C2\u6570\u65F6\uFF0C\n \u8981\u4F20\u9012\u5230\u4E3B\u7C7B\u7684\u547D\u4EE4\u884C\u53C2\u6570\n \u53EF\u4EE5\u591A\u6B21\u4F7F\u7528\u6B64\u9009\u9879\u3002\n --java-options \n \u8981\u4F20\u9012\u5230 Java \u8FD0\u884C\u65F6\u7684\u9009\u9879\n \u53EF\u4EE5\u591A\u6B21\u4F7F\u7528\u6B64\u9009\u9879\u3002\n --main-class \n \u8981\u6267\u884C\u7684\u5E94\u7528\u7A0B\u5E8F\u4E3B\u7C7B\u7684\u9650\u5B9A\u540D\u79F0\n \u53EA\u6709\u5728\u6307\u5B9A\u4E86 --main-jar \u65F6\u624D\u80FD\u4F7F\u7528\u6B64\u9009\u9879\u3002\n --main-jar
\n \u5E94\u7528\u7A0B\u5E8F\u7684\u4E3B JAR\uFF1B\u5305\u542B\u4E3B\u7C7B\n \uFF08\u6307\u5B9A\u4E3A\u76F8\u5BF9\u4E8E\u8F93\u5165\u8DEF\u5F84\u7684\u8DEF\u5F84\uFF09\n \u53EF\u4EE5\u6307\u5B9A --module \u6216 --main-jar \u9009\u9879\uFF0C\u4F46\u662F\u4E0D\u80FD\u540C\u65F6\u6307\u5B9A\n \u8FD9\u4E24\u4E2A\u9009\u9879\u3002\n --module -m [/
]\n \u5E94\u7528\u7A0B\u5E8F\u7684\u4E3B\u6A21\u5757\uFF08\u4EE5\u53CA\u53EF\u9009\u7684\u4E3B\u7C7B\uFF09\n \u6B64\u6A21\u5757\u5FC5\u987B\u4F4D\u4E8E\u6A21\u5757\u8DEF\u5F84\u4E2D\u3002\n \u5982\u679C\u6307\u5B9A\u4E86\u6B64\u9009\u9879\uFF0C\u5219\u5C06\u5728 Java \u8FD0\u884C\u65F6\u6620\u50CF\u4E2D\n \u94FE\u63A5\u4E3B\u6A21\u5757\u3002\u53EF\u4EE5\u6307\u5B9A --module \u6216 --main-jar \u9009\u9879\uFF0C\n \u4F46\u662F\u4E0D\u80FD\u540C\u65F6\u6307\u5B9A\u8FD9\u4E24\u4E2A\u9009\u9879\u3002\n{2}\n\u7528\u6765\u521B\u5EFA\u5E94\u7528\u7A0B\u5E8F\u5305\u7684\u9009\u9879\uFF1A\n --app-image \n \u7528\u6765\u6784\u5EFA\u53EF\u5B89\u88C5\u7A0B\u5E8F\u5305\u7684\n \u9884\u5B9A\u4E49\u5E94\u7528\u7A0B\u5E8F\u6620\u50CF\u7684\u4F4D\u7F6E\n \uFF08\u7EDD\u5BF9\u8DEF\u5F84\u6216\u76F8\u5BF9\u4E8E\u5F53\u524D\u76EE\u5F55\u7684\u8DEF\u5F84\uFF09\n --file-associations \n \u5305\u542B\u5173\u952E\u5B57-\u503C\u5BF9\u5217\u8868\u7684\u5C5E\u6027\u6587\u4EF6\u7684\u8DEF\u5F84\n \uFF08\u7EDD\u5BF9\u8DEF\u5F84\u6216\u76F8\u5BF9\u4E8E\u5F53\u524D\u76EE\u5F55\u7684\u8DEF\u5F84\uFF09\n \u53EF\u4EE5\u4F7F\u7528\u5173\u952E\u5B57 "extension"\u3001"mime-type"\u3001"icon" \u548C "description" \n \u6765\u63CF\u8FF0\u6B64\u5173\u8054\u3002\n \u53EF\u4EE5\u591A\u6B21\u4F7F\u7528\u6B64\u9009\u9879\u3002\n --install-dir \n {4} --license-file \n \u8BB8\u53EF\u8BC1\u6587\u4EF6\u7684\u8DEF\u5F84\n \uFF08\u7EDD\u5BF9\u8DEF\u5F84\u6216\u76F8\u5BF9\u4E8E\u5F53\u524D\u76EE\u5F55\u7684\u8DEF\u5F84\uFF09\n --resource-dir \n \u8986\u76D6 jpackage \u8D44\u6E90\u7684\u8DEF\u5F84\n \u53EF\u4EE5\u901A\u8FC7\u5411\u8BE5\u76EE\u5F55\u4E2D\u6DFB\u52A0\u66FF\u4EE3\u8D44\u6E90\u6765\u8986\u76D6 jpackage \u7684\n \u56FE\u6807\u3001\u6A21\u677F\u6587\u4EF6\u548C\u5176\u4ED6\u8D44\u6E90\u3002\n \uFF08\u7EDD\u5BF9\u8DEF\u5F84\u6216\u76F8\u5BF9\u4E8E\u5F53\u524D\u76EE\u5F55\u7684\u8DEF\u5F84\uFF09\n --runtime-image \n \u8981\u5B89\u88C5\u7684\u9884\u5B9A\u4E49\u8FD0\u884C\u65F6\u6620\u50CF\u7684\u8DEF\u5F84\n \uFF08\u7EDD\u5BF9\u8DEF\u5F84\u6216\u76F8\u5BF9\u4E8E\u5F53\u524D\u76EE\u5F55\u7684\u8DEF\u5F84\uFF09\n \ +\u5728\u521B\u5EFA\u8FD0\u884C\u65F6\u7A0B\u5E8F\u5305\u65F6\u9700\u8981\u4F7F\u7528\u9009\u9879\u3002\n\n\u7528\u6765\u521B\u5EFA\u5E94\u7528\u7A0B\u5E8F\u5305\u7684\u4E0E\u5E73\u53F0\u76F8\u5173\u7684\u9009\u9879\uFF1A\n{3} +MSG_Help_win_launcher=\n\u7528\u6765\u521B\u5EFA\u5E94\u7528\u7A0B\u5E8F\u542F\u52A8\u7A0B\u5E8F\u7684\u4E0E\u5E73\u53F0\u76F8\u5173\u7684\u9009\u9879\uFF1A\n --win-console\n \u4E3A\u5E94\u7528\u7A0B\u5E8F\u521B\u5EFA\u63A7\u5236\u53F0\u542F\u52A8\u7A0B\u5E8F\uFF0C\u5E94\u5F53\u4E3A\n \u9700\u8981\u63A7\u5236\u53F0\u4EA4\u4E92\u7684\u5E94\u7528\u7A0B\u5E8F\u6307\u5B9A\n +MSG_Help_win_install=\ --win-dir-chooser\n \u6DFB\u52A0\u4E00\u4E2A\u5BF9\u8BDD\u6846\u4EE5\u5141\u8BB8\u7528\u6237\u9009\u62E9\n \u4EA7\u54C1\u7684\u5B89\u88C5\u76EE\u5F55\n --win-menu\n \u5C06\u8BE5\u5E94\u7528\u7A0B\u5E8F\u6DFB\u52A0\u5230\u7CFB\u7EDF\u83DC\u5355\u4E2D\n --win-menu-group \n \u542F\u52A8\u8BE5\u5E94\u7528\u7A0B\u5E8F\u6240\u5728\u7684\u83DC\u5355\u7EC4\n --win-per-user-install\n \u8BF7\u6C42\u57FA\u4E8E\u6BCF\u4E2A\u7528\u6237\u6267\u884C\u5B89\u88C5\n --win-shortcut\n \u4E3A\u5E94\u7528\u7A0B\u5E8F\u521B\u5EFA\u684C\u9762\u5FEB\u6377\u65B9\u5F0F\n --win-upgrade-uuid \n \u4E0E\u6B64\u7A0B\u5E8F\u5305\u5347\u7EA7\u76F8\u5173\u8054\u7684 UUID\n +MSG_Help_win_install_dir=\u9ED8\u8BA4\u5B89\u88C5\u4F4D\u7F6E\u4E0B\u9762\u7684\u76F8\u5BF9\u5B50\u8DEF\u5F84\n +MSG_Help_mac_launcher=\ --mac-package-identifier \n \u7528\u6765\u552F\u4E00\u5730\u6807\u8BC6 macOS \u5E94\u7528\u7A0B\u5E8F\u7684\u6807\u8BC6\u7B26\n \u9ED8\u8BA4\u4E3A\u4E3B\u7C7B\u540D\u79F0\u3002\n \u53EA\u80FD\u4F7F\u7528\u5B57\u6BCD\u6570\u5B57\uFF08A-Z\u3001a-z\u30010-9\uFF09\u3001\u8FDE\u5B57\u7B26 (-) \u548C\n \u53E5\u70B9 (.) \u5B57\u7B26\u3002\n --mac-package-name \n \u51FA\u73B0\u5728\u83DC\u5355\u680F\u4E2D\u7684\u5E94\u7528\u7A0B\u5E8F\u540D\u79F0\n \u8FD9\u53EF\u4EE5\u4E0E\u5E94\u7528\u7A0B\u5E8F\u540D\u79F0\u4E0D\u540C\u3002\n \u6B64\u540D\u79F0\u7684\u957F\u5EA6\u5FC5\u987B\u5C0F\u4E8E 16 \u4E2A\u5B57\u7B26\uFF0C\u9002\u5408\n \u663E\u793A\u5728\u83DC\u5355\u680F\u4E2D\u548C\u5E94\u7528\u7A0B\u5E8F\u201C\u4FE1\u606F\u201D\u7A97\u53E3\u4E2D\u3002\n \u9ED8\u8BA4\u4E3A\u5E94\u7528\u7A0B\u5E8F\u540D\u79F0\u3002\n --mac-package-signing-prefix \n \u5728\u5BF9\u5E94\u7528\u7A0B\u5E8F\u5305\u7B7E\u540D\u65F6\uFF0C\u4F1A\u5728\u6240\u6709\u9700\u8981\u7B7E\u540D\n \u4F46\u5F53\u524D\u6CA1\u6709\u7A0B\u5E8F\u5305\u6807\u8BC6\u7B26\u7684\u7EC4\u4EF6\u7684\n \u524D\u9762\u52A0\u4E0A\u6B64\u503C\u3002\n --mac-sign\n \u8BF7\u6C42\u5BF9\u7A0B\u5E8F\u5305\u8FDB\u884C\u7B7E\u540D\n --mac-signing-keychain \n \u8981\u7528\u6765\u641C\u7D22\u7B7E\u540D\u8EAB\u4EFD\u7684\u5BC6\u94A5\u94FE\u7684\u8DEF\u5F84\n \uFF08\u7EDD\u5BF9\u8DEF\u5F84\u6216\u76F8\u5BF9\u4E8E\u5F53\u524D\u76EE\u5F55\u7684\u8DEF\u5F84\uFF09\u3002\n \u5982\u679C\u672A\u6307\u5B9A\uFF0C\u5219\u4F7F\u7528\u6807\u51C6\u7684\u5BC6\u94A5\u94FE\u3002\n --mac-signing-key-user-name \n Apple \u7B7E\u540D\u8EAB\u4EFD\u540D\u79F0\u4E2D\u7684\u56E2\u961F\u540D\u79F0\u9009\u9879\u3002\n \u4F8B\u5982\uFF0C"Developer ID Application: "\n +MSG_Help_linux_install=\ --linux-package-name \n Linux \u7A0B\u5E8F\u5305\u7684\u540D\u79F0\uFF0C\u9ED8\u8BA4\u4E3A\u5E94\u7528\u7A0B\u5E8F\u540D\u79F0\n --linux-deb-maintainer \n .deb \u7A0B\u5E8F\u5305\u7684\u7EF4\u62A4\u7A0B\u5E8F\n --linux-menu-group \n \u6B64\u5E94\u7528\u7A0B\u5E8F\u6240\u5728\u7684\u83DC\u5355\u7EC4\n --linux-package-deps\n \u5E94\u7528\u7A0B\u5E8F\u6240\u9700\u7684\u7A0B\u5E8F\u5305\u6216\u529F\u80FD\n --linux-rpm-license-type \n \u8BB8\u53EF\u8BC1\u7684\u7C7B\u578B\uFF08RPM .spec \u7684 "License: "\uFF09\n --linux-app-release \n RPM .spec \u6587\u4EF6\u7684\u53D1\u884C\u7248\u503C\u6216\n DEB \u63A7\u5236\u6587\u4EF6\u7684 Debian \u4FEE\u8BA2\u7248\u503C\u3002\n --linux-app-category \n RPM .spec \u6587\u4EF6\u7684\u7EC4\u503C\u6216\n DEB \u63A7\u5236\u6587\u4EF6\u7684\u533A\u57DF\u503C\u3002\n --linux-shortcut\n \u4E3A\u5E94\u7528\u7A0B\u5E8F\u521B\u5EFA\u5FEB\u6377\u65B9\u5F0F\n +MSG_Help_mac_linux_install_dir=\u5E94\u7528\u7A0B\u5E8F\u5B89\u88C5\u76EE\u5F55\u7684\u7EDD\u5BF9\u8DEF\u5F84\n +MSG_Help_default_install_dir=OS X \u6216 Linux \u4E0A\u5E94\u7528\u7A0B\u5E8F\u5B89\u88C5\u76EE\u5F55\u7684\u7EDD\u5BF9\u8DEF\u5F84\u3002\n Windows \u4E0A\u5E94\u7528\u7A0B\u5E8F\u5B89\u88C5\u4F4D\u7F6E\u7684\u76F8\u5BF9\u5B50\u8DEF\u5F84\n \uFF08\u5982 "Program Files" \u6216 "AppData"\uFF09\u3002\n +MSG_Help_no_args=\u7528\u6CD5\uFF1Ajpackage \n\u4F7F\u7528 jpackage --help\uFF08\u6216 -h\uFF09\u53EF\u83B7\u53D6\u53EF\u80FD\u9009\u9879\u7684\u5217\u8868 diff --git a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/resources/MainResources_ja.properties b/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/resources/MainResources_ja.properties index 2140ca3fe24..248210e61b9 100644 --- a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/resources/MainResources_ja.properties +++ b/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/resources/MainResources_ja.properties @@ -25,69 +25,68 @@ # param.copyright.default=Copyright (C) {0,date,YYYY} -param.description.default=None -param.vendor.default=Unknown +param.description.default=\u306A\u3057 +param.vendor.default=\u4E0D\u660E -message.using-default-resource=Using default package resource {0} {1} (add {2} to the resource-dir to customize). -message.no-default-resource=no default package resource {0} {1} (add {2} to the resource-dir to customize). -message.using-custom-resource-from-file=Using custom package resource {0} (loaded from file {1}). -message.using-custom-resource=Using custom package resource {0} (loaded from {1}). -message.creating-app-bundle=Creating app package: {0} in {1} -message.app-image-dir-does-not-exist=Specified application image directory {0}: {1} does not exists -message.app-image-dir-does-not-exist.advice=Confirm that the value for {0} exists -message.runtime-image-dir-does-not-exist=Specified runtime image directory {0}: {1} does not exists -message.runtime-image-dir-does-not-exist.advice=Confirm that the value for {0} exists -message.debug-working-directory=Kept working directory for debug: {0} -message.bundle-created=Succeeded in building {0} package -message.module-version=Using version "{0}" from module "{1}" as application version -message.module-class=Using class "{0}" from module "{1}" as application main class +message.using-default-resource=\u30C7\u30D5\u30A9\u30EB\u30C8\u306E\u30D1\u30C3\u30B1\u30FC\u30B8\u30FB\u30EA\u30BD\u30FC\u30B9{0} {1}\u306E\u4F7F\u7528({2}\u3092resource-dir\u306B\u8FFD\u52A0\u3057\u3066\u30AB\u30B9\u30BF\u30DE\u30A4\u30BA)\u3002 +message.no-default-resource=\u30C7\u30D5\u30A9\u30EB\u30C8\u306E\u30D1\u30C3\u30B1\u30FC\u30B8\u30FB\u30EA\u30BD\u30FC\u30B9{0} {1}\u306A\u3057({2}\u3092resource-dir\u306B\u8FFD\u52A0\u3057\u3066\u30AB\u30B9\u30BF\u30DE\u30A4\u30BA)\u3002 +message.using-custom-resource-from-file=\u30AB\u30B9\u30BF\u30E0\u30FB\u30D1\u30C3\u30B1\u30FC\u30B8\u30FB\u30EA\u30BD\u30FC\u30B9{0}\u306E\u4F7F\u7528(\u30D5\u30A1\u30A4\u30EB{1}\u304B\u3089\u30ED\u30FC\u30C9\u6E08) +message.using-custom-resource=\u30AB\u30B9\u30BF\u30E0\u30FB\u30D1\u30C3\u30B1\u30FC\u30B8\u30FB\u30EA\u30BD\u30FC\u30B9{0}\u306E\u4F7F\u7528({1}\u304B\u3089\u30ED\u30FC\u30C9\u6E08) +message.creating-app-bundle=\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u30FB\u30D1\u30C3\u30B1\u30FC\u30B8\u3092\u4F5C\u6210\u3057\u3066\u3044\u307E\u3059: {1}\u5185\u306E{0} +message.app-image-dir-does-not-exist=\u6307\u5B9A\u3055\u308C\u305F\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u30FB\u30A4\u30E1\u30FC\u30B8\u30FB\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA {0}: {1}\u306F\u5B58\u5728\u3057\u307E\u305B\u3093 +message.app-image-dir-does-not-exist.advice={0}\u306E\u5024\u304C\u5B58\u5728\u3059\u308B\u3053\u3068\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044 +message.runtime-image-dir-does-not-exist=\u6307\u5B9A\u3055\u308C\u305F\u30E9\u30F3\u30BF\u30A4\u30E0\u30FB\u30A4\u30E1\u30FC\u30B8\u30FB\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA {0}: {1}\u306F\u5B58\u5728\u3057\u307E\u305B\u3093 +message.runtime-image-dir-does-not-exist.advice={0}\u306E\u5024\u304C\u5B58\u5728\u3059\u308B\u3053\u3068\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044 +message.debug-working-directory=\u30C7\u30D0\u30C3\u30B0\u306E\u4F5C\u696D\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u304C\u4FDD\u6301\u3055\u308C\u307E\u3057\u305F: {0} +message.bundle-created={0}\u30D1\u30C3\u30B1\u30FC\u30B8\u306E\u4F5C\u6210\u306B\u6210\u529F\u3057\u307E\u3057\u305F +message.module-version=\u30E2\u30B8\u30E5\u30FC\u30EB"{1}"\u306E\u30D0\u30FC\u30B8\u30E7\u30F3"{0}"\u3092\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u30FB\u30D0\u30FC\u30B8\u30E7\u30F3\u3068\u3057\u3066\u4F7F\u7528 +message.module-class=\u30E2\u30B8\u30E5\u30FC\u30EB"{1}"\u306E\u30AF\u30E9\u30B9"{0}"\u3092\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u30FB\u30E1\u30A4\u30F3\u30FB\u30AF\u30E9\u30B9\u3068\u3057\u3066\u4F7F\u7528 -error.cannot-create-output-dir=Destination directory {0} cannot be created -error.cannot-write-to-output-dir=Destination directory {0} is not writable -error.root-exists=Error: Application destination directory {0} already exists -error.no-main-class-with-main-jar=A main class was not specified nor was one found in the jar {0} -error.no-main-class-with-main-jar.advice=Specify a main class or ensure that the jar {0} specifies one in the manifest -error.no-main-class=A main class was not specified nor was one found in the supplied application resources -error.no-main-class.advice=Please specify a application class or ensure that the appResources has a jar containing one in the manifest -error.main-jar-does-not-exist=The configured main jar does not exist {0} in the input directory -error.main-jar-does-not-exist.advice=The main jar must be specified relative to the input directory (not an absolute path), and must exist within that directory +error.cannot-create-output-dir=\u5B9B\u5148\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA{0}\u3092\u4F5C\u6210\u3067\u304D\u307E\u305B\u3093\u3002 +error.cannot-write-to-output-dir=\u5B9B\u5148\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA{0}\u306F\u66F8\u8FBC\u307F\u4E0D\u53EF\u3067\u3059 +error.root-exists=\u30A8\u30E9\u30FC: \u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u306E\u5B9B\u5148\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA{0}\u306F\u3059\u3067\u306B\u5B58\u5728\u3057\u307E\u3059 +error.no-main-class-with-main-jar=\u30E1\u30A4\u30F3\u30FB\u30AF\u30E9\u30B9\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u306A\u304B\u3063\u305F\u304B\u3001jar {0}\u306B\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3067\u3057\u305F +error.no-main-class-with-main-jar.advice=\u30E1\u30A4\u30F3\u30FB\u30AF\u30E9\u30B9\u3092\u6307\u5B9A\u3059\u308B\u304B\u3001jar {0}\u304C\u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u3067\u6307\u5B9A\u3057\u3066\u3044\u308B\u3053\u3068\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044 +error.no-main-class=\u30E1\u30A4\u30F3\u30FB\u30AF\u30E9\u30B9\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u306A\u304B\u3063\u305F\u304B\u3001\u6307\u5B9A\u3055\u308C\u305F\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u30FB\u30EA\u30BD\u30FC\u30B9\u306B\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3067\u3057\u305F +error.no-main-class.advice=\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u30FB\u30AF\u30E9\u30B9\u3092\u6307\u5B9A\u3059\u308B\u304B\u3001\u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u3067appResources\u306B\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u30FB\u30AF\u30E9\u30B9\u3092\u542B\u3080jar\u304C\u3042\u308B\u3053\u3068\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044 +error.main-jar-does-not-exist=\u5165\u529B\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3067\u3001\u69CB\u6210\u3055\u308C\u305F\u30E1\u30A4\u30F3jar\u304C{0}\u306B\u5B58\u5728\u3057\u307E\u305B\u3093 +error.main-jar-does-not-exist.advice=\u5165\u529B\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306B\u5BFE\u3057\u3066\u76F8\u5BFE\u7684\u306B(\u7D76\u5BFE\u30D1\u30B9\u3067\u306F\u306A\u3044)\u30E1\u30A4\u30F3jar\u3092\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u3001\u305D\u306E\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u5185\u306B\u5B58\u5728\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059 -error.tool-not-found=Can not find {0}. Reason: {1} -error.tool-not-found.advice=Please install {0} -error.tool-old-version=Can not find {0} {1} or newer -error.tool-old-version.advice=Please install {0} {1} or newer -error.jlink.failed=jlink failed with: {0} +error.tool-not-found={0}\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002\u7406\u7531: {1} +error.tool-not-found.advice={0}\u3092\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3057\u3066\u304F\u3060\u3055\u3044 +error.tool-old-version={0} {1}\u4EE5\u964D\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093 +error.tool-old-version.advice={0} {1}\u4EE5\u964D\u3092\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3057\u3066\u304F\u3060\u3055\u3044 +error.jlink.failed=jlink\u304C\u6B21\u3067\u5931\u6557\u3057\u307E\u3057\u305F: {0} -warning.module.does.not.exist=Module [{0}] does not exist -warning.no.jdk.modules.found=Warning: No JDK Modules found +warning.module.does.not.exist=\u30E2\u30B8\u30E5\u30FC\u30EB[{0}]\u306F\u5B58\u5728\u3057\u307E\u305B\u3093 +warning.no.jdk.modules.found=\u8B66\u544A: JDK\u30E2\u30B8\u30E5\u30FC\u30EB\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093 -MSG_BundlerFailed=Error: Bundler "{1}" ({0}) failed to produce a package -MSG_BundlerConfigException=Bundler {0} skipped because of a configuration problem: {1} \n\ -Advice to fix: {2} -MSG_BundlerConfigExceptionNoAdvice=Bundler {0} skipped because of a configuration problem: {1} -MSG_BundlerRuntimeException=Bundler {0} failed because of {1} -MSG_BundlerFailed=Error: Bundler "{1}" ({0}) failed to produce a package +MSG_BundlerFailed=\u30A8\u30E9\u30FC: \u30D0\u30F3\u30C9\u30E9"{1}" ({0})\u304C\u30D1\u30C3\u30B1\u30FC\u30B8\u306E\u751F\u6210\u306B\u5931\u6557\u3057\u307E\u3057\u305F +MSG_BundlerConfigException=\u69CB\u6210\u306E\u554F\u984C\u306E\u305F\u3081\u3001\u30D0\u30F3\u30C9\u30E9{0}\u304C\u30B9\u30AD\u30C3\u30D7\u3055\u308C\u307E\u3057\u305F: {1} \n\u6B21\u306E\u4FEE\u6B63\u3092\u884C\u3063\u3066\u304F\u3060\u3055\u3044: {2} +MSG_BundlerConfigExceptionNoAdvice=\u69CB\u6210\u306E\u554F\u984C\u306E\u305F\u3081\u3001\u30D0\u30F3\u30C9\u30E9{0}\u304C\u30B9\u30AD\u30C3\u30D7\u3055\u308C\u307E\u3057\u305F: {1} +MSG_BundlerRuntimeException={1}\u306E\u305F\u3081\u3001\u30D0\u30F3\u30C9\u30E9{0}\u304C\u5931\u6557\u3057\u307E\u3057\u305F +MSG_BundlerFailed=\u30A8\u30E9\u30FC: \u30D0\u30F3\u30C9\u30E9"{1}" ({0})\u304C\u30D1\u30C3\u30B1\u30FC\u30B8\u306E\u751F\u6210\u306B\u5931\u6557\u3057\u307E\u3057\u305F -ERR_NoMainClass=Error: Main application class is missing -ERR_UnsupportedOption=Error: Option [{0}] is not valid on this platform -ERR_InvalidTypeOption=Error: Option [{0}] is not valid with type [{1}] -ERR_NoInstallerEntryPoint=Error: Option [{0}] is not valid without --module or --main-jar entry point option -ERR_MutuallyExclusiveOptions="Error: Mutually exclusive options [{0}] and [{1}] +ERR_NoMainClass=\u30A8\u30E9\u30FC: \u30E1\u30A4\u30F3\u30FB\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u30FB\u30AF\u30E9\u30B9\u304C\u3042\u308A\u307E\u305B\u3093 +ERR_UnsupportedOption=\u30A8\u30E9\u30FC: \u30AA\u30D7\u30B7\u30E7\u30F3[{0}]\u306F\u3001\u3053\u306E\u30D7\u30E9\u30C3\u30C8\u30D5\u30A9\u30FC\u30E0\u3067\u306F\u7121\u52B9\u3067\u3059 +ERR_InvalidTypeOption=\u30A8\u30E9\u30FC: \u30AA\u30D7\u30B7\u30E7\u30F3[{0}]\u306F\u3001\u30BF\u30A4\u30D7[{1}]\u3067\u306F\u7121\u52B9\u3067\u3059 +ERR_NoInstallerEntryPoint=\u30A8\u30E9\u30FC: \u30AA\u30D7\u30B7\u30E7\u30F3[{0}]\u306F\u3001--module\u307E\u305F\u306F--main-jar\u30A8\u30F3\u30C8\u30EA\u30FB\u30DD\u30A4\u30F3\u30C8\u30FB\u30AA\u30D7\u30B7\u30E7\u30F3\u306A\u3057\u3067\u306F\u7121\u52B9\u3067\u3059 +ERR_MutuallyExclusiveOptions="\u30A8\u30E9\u30FC: \u76F8\u4E92\u6392\u4ED6\u7684\u306A\u30AA\u30D7\u30B7\u30E7\u30F3[{0}]\u3068[{1}] -ERR_MissingArgument=Error: Missing argument: {0} -ERR_MissingAppResources=Error: No application jars found -ERR_AppImageNotExist=Error: App image directory "{0}" does not exist -ERR_NoAddLauncherName=Error: --add-launcher option requires a name and a file path (--add-launcher =) -ERR_NoUniqueName=Error: --add-launcher = requires a unique name -ERR_NoJreInstallerName=Error: Jre Installers require a name parameter -ERR_InvalidAppName=Error: Invalid Application name: {0} -ERR_InvalidSLName=Error: Invalid Add Launcher name: {0} -ERR_LicenseFileNotExit=Error: Specified license file does not exist -ERR_BuildRootInvalid=Error: temp ({0}) must be non-existant or empty directory -ERR_InvalidOption=Error: Invalid Option: [{0}] -ERR_InvalidInstallerType=Error: Invalid or unsupported type: [{0}] -ERR_BothMainJarAndModule=Error: Cannot have both --main-jar and --module Options -ERR_NoEntryPoint=Error: creating application image requires --main-jar or --module Option -ERR_InputNotDirectory=Error: Input directory specified is not a directory: {0} -ERR_CannotReadInputDir=Error: No permission to read from input directory: {0} -ERR_CannotParseOptions=Error: Processing @filename option: {0} +ERR_MissingArgument=\u30A8\u30E9\u30FC: \u5F15\u6570\u304C\u3042\u308A\u307E\u305B\u3093: {0} +ERR_MissingAppResources=\u30A8\u30E9\u30FC: \u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3jar\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3067\u3057\u305F +ERR_AppImageNotExist=\u30A8\u30E9\u30FC: \u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u30FB\u30A4\u30E1\u30FC\u30B8\u30FB\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA"{0}"\u306F\u5B58\u5728\u3057\u307E\u305B\u3093 +ERR_NoAddLauncherName=\u30A8\u30E9\u30FC: --add-launcher\u30AA\u30D7\u30B7\u30E7\u30F3\u306B\u306F\u540D\u524D\u304A\u3088\u3073\u30D5\u30A1\u30A4\u30EB\u30FB\u30D1\u30B9\u304C\u5FC5\u8981\u3067\u3059(--add-launcher =) +ERR_NoUniqueName=\u30A8\u30E9\u30FC: --add-launcher =\u306B\u306F\u4E00\u610F\u306E\u540D\u524D\u304C\u5FC5\u8981\u3067\u3059 +ERR_NoJreInstallerName=\u30A8\u30E9\u30FC: Jre\u30A4\u30F3\u30B9\u30C8\u30FC\u30E9\u306B\u306F\u540D\u524D\u30D1\u30E9\u30E1\u30FC\u30BF\u304C\u5FC5\u8981\u3067\u3059 +ERR_InvalidAppName=\u30A8\u30E9\u30FC: \u7121\u52B9\u306A\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u540D: {0} +ERR_InvalidSLName=\u30A8\u30E9\u30FC: \u7121\u52B9\u306A\u8FFD\u52A0\u30E9\u30F3\u30C1\u30E3\u540D: {0} +ERR_LicenseFileNotExit=\u30A8\u30E9\u30FC: \u6307\u5B9A\u3055\u308C\u305F\u30E9\u30A4\u30BB\u30F3\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u306F\u5B58\u5728\u3057\u307E\u305B\u3093 +ERR_BuildRootInvalid=\u30A8\u30E9\u30FC: \u4E00\u6642({0})\u306F\u5B58\u5728\u3057\u306A\u3044\u304B\u3001\u7A7A\u306E\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059 +ERR_InvalidOption=\u30A8\u30E9\u30FC: \u7121\u52B9\u306A\u30AA\u30D7\u30B7\u30E7\u30F3: [{0}] +ERR_InvalidInstallerType=\u30A8\u30E9\u30FC: \u7121\u52B9\u307E\u305F\u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u306A\u3044\u30BF\u30A4\u30D7: [{0}] +ERR_BothMainJarAndModule=\u30A8\u30E9\u30FC: --main-jar\u30AA\u30D7\u30B7\u30E7\u30F3\u3068--module\u30AA\u30D7\u30B7\u30E7\u30F3\u306E\u4E21\u65B9\u3092\u6307\u5B9A\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093 +ERR_NoEntryPoint=\u30A8\u30E9\u30FC: \u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u30FB\u30A4\u30E1\u30FC\u30B8\u306E\u4F5C\u6210\u306B\u306F--main-jar\u307E\u305F\u306F--module\u30AA\u30D7\u30B7\u30E7\u30F3\u304C\u5FC5\u8981\u3067\u3059 +ERR_InputNotDirectory=\u30A8\u30E9\u30FC: \u6307\u5B9A\u3055\u308C\u305F\u5165\u529B\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306F\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3067\u306F\u3042\u308A\u307E\u305B\u3093: {0} +ERR_CannotReadInputDir=\u30A8\u30E9\u30FC: \u5165\u529B\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u304B\u3089\u8AAD\u307F\u53D6\u308B\u6A29\u9650\u304C\u3042\u308A\u307E\u305B\u3093: {0} +ERR_CannotParseOptions=\u30A8\u30E9\u30FC: @filename\u30AA\u30D7\u30B7\u30E7\u30F3\u306E\u51E6\u7406: {0} diff --git a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/resources/MainResources_zh_CN.properties b/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/resources/MainResources_zh_CN.properties index 2140ca3fe24..f04983725f7 100644 --- a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/resources/MainResources_zh_CN.properties +++ b/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/resources/MainResources_zh_CN.properties @@ -24,70 +24,69 @@ # # -param.copyright.default=Copyright (C) {0,date,YYYY} -param.description.default=None -param.vendor.default=Unknown +param.copyright.default=\u7248\u6743\u6240\u6709 (C) {0,date,YYYY} +param.description.default=\u65E0 +param.vendor.default=\u672A\u77E5 -message.using-default-resource=Using default package resource {0} {1} (add {2} to the resource-dir to customize). -message.no-default-resource=no default package resource {0} {1} (add {2} to the resource-dir to customize). -message.using-custom-resource-from-file=Using custom package resource {0} (loaded from file {1}). -message.using-custom-resource=Using custom package resource {0} (loaded from {1}). -message.creating-app-bundle=Creating app package: {0} in {1} -message.app-image-dir-does-not-exist=Specified application image directory {0}: {1} does not exists -message.app-image-dir-does-not-exist.advice=Confirm that the value for {0} exists -message.runtime-image-dir-does-not-exist=Specified runtime image directory {0}: {1} does not exists -message.runtime-image-dir-does-not-exist.advice=Confirm that the value for {0} exists -message.debug-working-directory=Kept working directory for debug: {0} -message.bundle-created=Succeeded in building {0} package -message.module-version=Using version "{0}" from module "{1}" as application version -message.module-class=Using class "{0}" from module "{1}" as application main class +message.using-default-resource=\u4F7F\u7528\u9ED8\u8BA4\u7A0B\u5E8F\u5305\u8D44\u6E90 {0} {1}\uFF08\u5C06 {2} \u6DFB\u52A0\u5230 resource-dir \u4E2D\u4EE5\u8FDB\u884C\u5B9A\u5236\uFF09\u3002 +message.no-default-resource=\u65E0\u9ED8\u8BA4\u7A0B\u5E8F\u5305\u8D44\u6E90 {0} {1}\uFF08\u5C06 {2} \u6DFB\u52A0\u5230 resource-dir \u4E2D\u4EE5\u8FDB\u884C\u5B9A\u5236\uFF09\u3002 +message.using-custom-resource-from-file=\u4F7F\u7528\u5B9A\u5236\u7A0B\u5E8F\u5305\u8D44\u6E90 {0} (\u4ECE\u6587\u4EF6 {1} \u52A0\u8F7D)\u3002 +message.using-custom-resource=\u4F7F\u7528\u5B9A\u5236\u7A0B\u5E8F\u5305\u8D44\u6E90 {0} (\u4ECE {1} \u52A0\u8F7D)\u3002 +message.creating-app-bundle=\u6B63\u5728 {1} \u4E2D\u521B\u5EFA\u5E94\u7528\u7A0B\u5E8F\u5305 {0} +message.app-image-dir-does-not-exist=\u6307\u5B9A\u7684\u5E94\u7528\u7A0B\u5E8F\u6620\u50CF\u76EE\u5F55 {0}: {1} \u4E0D\u5B58\u5728 +message.app-image-dir-does-not-exist.advice=\u786E\u8BA4 {0} \u7684\u503C\u662F\u5426\u5B58\u5728 +message.runtime-image-dir-does-not-exist=\u6307\u5B9A\u7684\u8FD0\u884C\u65F6\u6620\u50CF\u76EE\u5F55 {0}: {1} \u4E0D\u5B58\u5728 +message.runtime-image-dir-does-not-exist.advice=\u786E\u8BA4 {0} \u7684\u503C\u662F\u5426\u5B58\u5728 +message.debug-working-directory=\u7528\u4E8E\u8C03\u8BD5\u7684\u5DF2\u4FDD\u7559\u5DE5\u4F5C\u76EE\u5F55: {0} +message.bundle-created=\u5DF2\u6210\u529F\u5730\u6784\u5EFA {0} \u7A0B\u5E8F\u5305 +message.module-version=\u6B63\u5728\u5C06\u6A21\u5757 "{1}" \u4E2D\u7684\u7248\u672C "{0}" \u7528\u4F5C\u5E94\u7528\u7A0B\u5E8F\u7248\u672C +message.module-class=\u6B63\u5728\u5C06\u6A21\u5757 "{1}" \u4E2D\u7684\u7C7B "{0}" \u7528\u4F5C\u5E94\u7528\u7A0B\u5E8F\u4E3B\u7C7B -error.cannot-create-output-dir=Destination directory {0} cannot be created -error.cannot-write-to-output-dir=Destination directory {0} is not writable -error.root-exists=Error: Application destination directory {0} already exists -error.no-main-class-with-main-jar=A main class was not specified nor was one found in the jar {0} -error.no-main-class-with-main-jar.advice=Specify a main class or ensure that the jar {0} specifies one in the manifest -error.no-main-class=A main class was not specified nor was one found in the supplied application resources -error.no-main-class.advice=Please specify a application class or ensure that the appResources has a jar containing one in the manifest -error.main-jar-does-not-exist=The configured main jar does not exist {0} in the input directory -error.main-jar-does-not-exist.advice=The main jar must be specified relative to the input directory (not an absolute path), and must exist within that directory +error.cannot-create-output-dir=\u65E0\u6CD5\u521B\u5EFA\u76EE\u6807\u76EE\u5F55 {0} +error.cannot-write-to-output-dir=\u76EE\u6807\u76EE\u5F55 {0} \u4E0D\u53EF\u5199 +error.root-exists=\u9519\u8BEF\uFF1A\u5E94\u7528\u7A0B\u5E8F\u76EE\u6807\u76EE\u5F55 {0} \u5DF2\u5B58\u5728 +error.no-main-class-with-main-jar=\u672A\u6307\u5B9A\u4E3B\u7C7B\uFF0C\u5728 jar {0} \u4E2D\u4E5F\u672A\u627E\u5230\u4E3B\u7C7B +error.no-main-class-with-main-jar.advice=\u8BF7\u6307\u5B9A\u4E3B\u7C7B\u6216\u786E\u4FDD jar {0} \u5728\u6E05\u5355\u4E2D\u6307\u5B9A\u4E00\u4E2A\u4E3B\u7C7B\u3002 +error.no-main-class=\u672A\u6307\u5B9A\u4E3B\u7C7B\uFF0C\u5728\u63D0\u4F9B\u7684\u5E94\u7528\u7A0B\u5E8F\u8D44\u6E90\u4E2D\u4E5F\u672A\u627E\u5230\u4E3B\u7C7B +error.no-main-class.advice=\u8BF7\u6307\u5B9A\u5E94\u7528\u7A0B\u5E8F\u7C7B\uFF0C\u6216\u8005\u786E\u4FDD appResources \u4E2D\u6709\u4E00\u4E2A jar \u5728\u6E05\u5355\u4E2D\u5305\u542B\u5E94\u7528\u7A0B\u5E8F\u7C7B\u3002 +error.main-jar-does-not-exist=\u914D\u7F6E\u7684\u4E3B jar \u5728\u8F93\u5165\u76EE\u5F55\u4E2D\u4E0D\u5B58\u5728 {0} +error.main-jar-does-not-exist.advice=\u5FC5\u987B\u4F7F\u7528\u76F8\u5BF9\u4E8E\u8F93\u5165\u76EE\u5F55\u7684\u8DEF\u5F84\uFF08\u4E0D\u4F7F\u7528\u7EDD\u5BF9\u8DEF\u5F84\uFF09\u6307\u5B9A\u4E3B jar \uFF0C\u5E76\u4E14\u8BE5\u76EE\u5F55\u4E2D\u5B58\u5728\u4E3B jar -error.tool-not-found=Can not find {0}. Reason: {1} -error.tool-not-found.advice=Please install {0} -error.tool-old-version=Can not find {0} {1} or newer -error.tool-old-version.advice=Please install {0} {1} or newer -error.jlink.failed=jlink failed with: {0} +error.tool-not-found=\u627E\u4E0D\u5230 {0}\u3002\u539F\u56E0\uFF1A{1} +error.tool-not-found.advice=\u8BF7\u5B89\u88C5 {0} +error.tool-old-version=\u627E\u4E0D\u5230 {0} {1}\u6216\u66F4\u65B0\u7248\u672C +error.tool-old-version.advice=\u8BF7\u5B89\u88C5 {0} {1}\u6216\u66F4\u65B0\u7248\u672C +error.jlink.failed=jlink \u5931\u8D25\uFF0C\u51FA\u73B0 {0} -warning.module.does.not.exist=Module [{0}] does not exist -warning.no.jdk.modules.found=Warning: No JDK Modules found +warning.module.does.not.exist=\u6A21\u5757 [{0}] \u4E0D\u5B58\u5728 +warning.no.jdk.modules.found=\u8B66\u544A: \u672A\u627E\u5230 JDK \u6A21\u5757 -MSG_BundlerFailed=Error: Bundler "{1}" ({0}) failed to produce a package -MSG_BundlerConfigException=Bundler {0} skipped because of a configuration problem: {1} \n\ -Advice to fix: {2} -MSG_BundlerConfigExceptionNoAdvice=Bundler {0} skipped because of a configuration problem: {1} -MSG_BundlerRuntimeException=Bundler {0} failed because of {1} -MSG_BundlerFailed=Error: Bundler "{1}" ({0}) failed to produce a package +MSG_BundlerFailed=\u9519\u8BEF\uFF1A\u6253\u5305\u7A0B\u5E8F "{1}" ({0}) \u65E0\u6CD5\u751F\u6210\u7A0B\u5E8F\u5305 +MSG_BundlerConfigException=\u7531\u4E8E\u914D\u7F6E\u95EE\u9898, \u8DF3\u8FC7\u4E86\u6253\u5305\u7A0B\u5E8F{0}: {1} \n\u4FEE\u590D\u5EFA\u8BAE: {2} +MSG_BundlerConfigExceptionNoAdvice=\u7531\u4E8E\u914D\u7F6E\u95EE\u9898, \u8DF3\u8FC7\u4E86\u6253\u5305\u7A0B\u5E8F{0}: {1} +MSG_BundlerRuntimeException=\u7531\u4E8E{1}, \u6253\u5305\u7A0B\u5E8F{0}\u5931\u8D25 +MSG_BundlerFailed=\u9519\u8BEF\uFF1A\u6253\u5305\u7A0B\u5E8F "{1}" ({0}) \u65E0\u6CD5\u751F\u6210\u7A0B\u5E8F\u5305 -ERR_NoMainClass=Error: Main application class is missing -ERR_UnsupportedOption=Error: Option [{0}] is not valid on this platform -ERR_InvalidTypeOption=Error: Option [{0}] is not valid with type [{1}] -ERR_NoInstallerEntryPoint=Error: Option [{0}] is not valid without --module or --main-jar entry point option -ERR_MutuallyExclusiveOptions="Error: Mutually exclusive options [{0}] and [{1}] +ERR_NoMainClass=\u9519\u8BEF\uFF1A\u7F3A\u5C11\u4E3B\u5E94\u7528\u7A0B\u5E8F\u7C7B +ERR_UnsupportedOption=\u9519\u8BEF\uFF1A\u9009\u9879 [{0}] \u5728\u6B64\u5E73\u53F0\u4E0A\u65E0\u6548 +ERR_InvalidTypeOption=\u9519\u8BEF\uFF1A\u9009\u9879 [{0}] \u5BF9\u4E8E\u7C7B\u578B [{1}] \u65E0\u6548 +ERR_NoInstallerEntryPoint=\u9519\u8BEF\uFF1A\u5728\u6CA1\u6709 --module \u6216 --main-jar \u5165\u53E3\u70B9\u9009\u9879\u65F6\uFF0C\u9009\u9879 [{0}] \u65E0\u6548 +ERR_MutuallyExclusiveOptions="\u9519\u8BEF\uFF1A\u9009\u9879 [{0}] \u548C [{1}] \u76F8\u4E92\u6392\u65A5 -ERR_MissingArgument=Error: Missing argument: {0} -ERR_MissingAppResources=Error: No application jars found -ERR_AppImageNotExist=Error: App image directory "{0}" does not exist -ERR_NoAddLauncherName=Error: --add-launcher option requires a name and a file path (--add-launcher =) -ERR_NoUniqueName=Error: --add-launcher = requires a unique name -ERR_NoJreInstallerName=Error: Jre Installers require a name parameter -ERR_InvalidAppName=Error: Invalid Application name: {0} -ERR_InvalidSLName=Error: Invalid Add Launcher name: {0} -ERR_LicenseFileNotExit=Error: Specified license file does not exist -ERR_BuildRootInvalid=Error: temp ({0}) must be non-existant or empty directory -ERR_InvalidOption=Error: Invalid Option: [{0}] -ERR_InvalidInstallerType=Error: Invalid or unsupported type: [{0}] -ERR_BothMainJarAndModule=Error: Cannot have both --main-jar and --module Options -ERR_NoEntryPoint=Error: creating application image requires --main-jar or --module Option -ERR_InputNotDirectory=Error: Input directory specified is not a directory: {0} -ERR_CannotReadInputDir=Error: No permission to read from input directory: {0} -ERR_CannotParseOptions=Error: Processing @filename option: {0} +ERR_MissingArgument=\u9519\u8BEF: \u7F3A\u5C11\u53C2\u6570: {0} +ERR_MissingAppResources=\u9519\u8BEF: \u627E\u4E0D\u5230\u5E94\u7528\u7A0B\u5E8F jar +ERR_AppImageNotExist=\u9519\u8BEF\uFF1A\u5E94\u7528\u7A0B\u5E8F\u6620\u50CF\u76EE\u5F55 "{0}" \u4E0D\u5B58\u5728 +ERR_NoAddLauncherName=\u9519\u8BEF\uFF1A--add-launcher \u9009\u9879\u9700\u8981\u4E00\u4E2A\u540D\u79F0\u548C\u4E00\u4E2A\u6587\u4EF6\u8DEF\u5F84 (--add-launcher =) +ERR_NoUniqueName=\u9519\u8BEF\uFF1A--add-launcher = \u9700\u8981\u4E00\u4E2A\u552F\u4E00\u7684\u540D\u79F0 +ERR_NoJreInstallerName=\u9519\u8BEF\uFF1AJre \u5B89\u88C5\u7A0B\u5E8F\u9700\u8981\u4E00\u4E2A\u540D\u79F0\u53C2\u6570 +ERR_InvalidAppName=\u9519\u8BEF\uFF1A\u5E94\u7528\u7A0B\u5E8F\u540D\u79F0 {0} \u65E0\u6548 +ERR_InvalidSLName=\u9519\u8BEF\uFF1A\u6DFB\u52A0\u542F\u52A8\u7A0B\u5E8F\u540D\u79F0 {0} \u65E0\u6548 +ERR_LicenseFileNotExit=\u9519\u8BEF\uFF1A\u6307\u5B9A\u7684\u8BB8\u53EF\u8BC1\u6587\u4EF6\u4E0D\u5B58\u5728 +ERR_BuildRootInvalid=\u9519\u8BEF\uFF1A\u4E34\u65F6\u76EE\u5F55 ({0}) \u5FC5\u987B\u662F\u4E0D\u5B58\u5728\u7684\u76EE\u5F55\u6216\u7A7A\u767D\u76EE\u5F55 +ERR_InvalidOption=\u9519\u8BEF\uFF1A\u9009\u9879 [{0}] \u65E0\u6548 +ERR_InvalidInstallerType=\u9519\u8BEF\uFF1A\u7C7B\u578B [{0}] \u65E0\u6548\u6216\u4E0D\u53D7\u652F\u6301 +ERR_BothMainJarAndModule=\u9519\u8BEF\uFF1A\u4E0D\u80FD\u540C\u65F6\u5305\u542B --main-jar \u548C --module \u9009\u9879 +ERR_NoEntryPoint=\u9519\u8BEF\uFF1A\u521B\u5EFA\u5E94\u7528\u7A0B\u5E8F\u6620\u50CF\u9700\u8981 --main-jar \u6216 --module \u9009\u9879 +ERR_InputNotDirectory=\u9519\u8BEF\uFF1A\u6307\u5B9A\u7684\u8F93\u5165\u76EE\u5F55\u4E0D\u662F\u76EE\u5F55\uFF1A{0} +ERR_CannotReadInputDir=\u9519\u8BEF\uFF1A\u65E0\u6743\u4ECE\u8F93\u5165\u76EE\u5F55\u8BFB\u53D6\uFF1A{0} +ERR_CannotParseOptions=\u9519\u8BEF\uFF1A\u6B63\u5728\u5904\u7406 @filename \u9009\u9879\uFF1A{0} diff --git a/src/jdk.incubator.jpackage/windows/classes/jdk/incubator/jpackage/internal/resources/WinResources_ja.properties b/src/jdk.incubator.jpackage/windows/classes/jdk/incubator/jpackage/internal/resources/WinResources_ja.properties index 97b3cbde801..3cc5ff19e46 100644 --- a/src/jdk.incubator.jpackage/windows/classes/jdk/incubator/jpackage/internal/resources/WinResources_ja.properties +++ b/src/jdk.incubator.jpackage/windows/classes/jdk/incubator/jpackage/internal/resources/WinResources_ja.properties @@ -24,44 +24,44 @@ # # -app.bundler.name=Windows Application Image -exe.bundler.name=EXE Installer Package -msi.bundler.name=MSI Installer Package +app.bundler.name=Windows\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u30FB\u30A4\u30E1\u30FC\u30B8 +exe.bundler.name=EXE\u30A4\u30F3\u30B9\u30C8\u30FC\u30E9\u30FB\u30D1\u30C3\u30B1\u30FC\u30B8 +msi.bundler.name=MSI\u30A4\u30F3\u30B9\u30C8\u30FC\u30E9\u30FB\u30D1\u30C3\u30B1\u30FC\u30B8 -param.menu-group.default=Unknown +param.menu-group.default=\u4E0D\u660E -resource.executable-properties-template=Template for creating executable properties file -resource.setup-icon=setup dialog icon -resource.post-app-image-script=script to run after application image is populated -resource.post-msi-script=script to run after msi file for exe installer is created +resource.executable-properties-template=\u5B9F\u884C\u53EF\u80FD\u306A\u30D7\u30ED\u30D1\u30C6\u30A3\u30FB\u30D5\u30A1\u30A4\u30EB\u4F5C\u6210\u7528\u306E\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8 +resource.setup-icon=\u8A2D\u5B9A\u30C0\u30A4\u30A2\u30ED\u30B0\u30FB\u30A2\u30A4\u30B3\u30F3 +resource.post-app-image-script=\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u30FB\u30A4\u30E1\u30FC\u30B8\u3092\u79FB\u5165\u3057\u305F\u5F8C\u306B\u5B9F\u884C\u3059\u308B\u30B9\u30AF\u30EA\u30D7\u30C8 +resource.post-msi-script=exe\u30A4\u30F3\u30B9\u30C8\u30FC\u30E9\u306Emsi\u30D5\u30A1\u30A4\u30EB\u304C\u4F5C\u6210\u3055\u308C\u305F\u5F8C\u306B\u5B9F\u884C\u3059\u308B\u30B9\u30AF\u30EA\u30D7\u30C8 resource.wxl-file-name=MsiInstallerStrings_en.wxl -resource.main-wix-file=Main WiX project file -resource.overrides-wix-file=Overrides WiX project file +resource.main-wix-file=\u30E1\u30A4\u30F3WiX\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u30FB\u30D5\u30A1\u30A4\u30EB +resource.overrides-wix-file=WiX\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u30FB\u30D5\u30A1\u30A4\u30EB\u306E\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9 -error.no-wix-tools=Can not find WiX tools (light.exe, candle.exe) -error.no-wix-tools.advice=Download WiX 3.0 or later from https://wixtoolset.org and add it to the PATH. -error.version-string-wrong-format=Version string is not compatible with MSI rules [{0}] -error.version-string-wrong-format.advice=Set the bundler argument "{0}" according to these rules: https://msdn.microsoft.com/en-us/library/aa370859%28v\=VS.85%29.aspx . -error.version-string-major-out-of-range=Major version must be in the range [0, 255] -error.version-string-build-out-of-range=Build part of version must be in the range [0, 65535] -error.version-string-minor-out-of-range=Minor version must be in the range [0, 255] -error.version-string-part-not-number=Failed to convert version component to int -error.version-swap=Failed to update version information for {0} -error.invalid-envvar=Invalid value of {0} environment variable +error.no-wix-tools=WiX\u30C4\u30FC\u30EB(light.exe\u3001candle.exe)\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093 +error.no-wix-tools.advice=WiX 3.0\u4EE5\u964D\u3092https://wixtoolset.org\u304B\u3089\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9\u3057\u3001PATH\u306B\u8FFD\u52A0\u3057\u307E\u3059\u3002 +error.version-string-wrong-format=\u30D0\u30FC\u30B8\u30E7\u30F3\u6587\u5B57\u5217\u306FMSI\u898F\u5247[{0}]\u3068\u4E92\u63DB\u6027\u304C\u3042\u308A\u307E\u305B\u3093 +error.version-string-wrong-format.advice=\u30D0\u30F3\u30C9\u30E9\u5F15\u6570"{0}"\u3092\u6B21\u306E\u898F\u5247\u306B\u5F93\u3063\u3066\u8A2D\u5B9A\u3057\u307E\u3059: https://msdn.microsoft.com/en-us/library/aa370859%28v=VS.85%29.aspx\u3002 +error.version-string-major-out-of-range=\u30E1\u30B8\u30E3\u30FC\u30FB\u30D0\u30FC\u30B8\u30E7\u30F3\u306F\u7BC4\u56F2[0, 255]\u5185\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059 +error.version-string-build-out-of-range=\u30D0\u30FC\u30B8\u30E7\u30F3\u306E\u30D3\u30EB\u30C9\u90E8\u5206\u306F\u7BC4\u56F2[0, 65535]\u5185\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059 +error.version-string-minor-out-of-range=\u30DE\u30A4\u30CA\u30FC\u30FB\u30D0\u30FC\u30B8\u30E7\u30F3\u306F\u7BC4\u56F2[0, 255]\u5185\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059 +error.version-string-part-not-number=\u30D0\u30FC\u30B8\u30E7\u30F3\u30FB\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u306Eint\u3078\u306E\u5909\u63DB\u306B\u5931\u6557\u3057\u307E\u3057\u305F +error.version-swap={0}\u306E\u30D0\u30FC\u30B8\u30E7\u30F3\u60C5\u5831\u306E\u66F4\u65B0\u306B\u5931\u6557\u3057\u307E\u3057\u305F +error.invalid-envvar={0}\u74B0\u5883\u5909\u6570\u306E\u5024\u304C\u7121\u52B9\u3067\u3059 -message.result-dir=Result application bundle: {0}. -message.icon-not-ico=The specified icon "{0}" is not an ICO file and will not be used. The default icon will be used in it's place. -message.potential.windows.defender.issue=Warning: Windows Defender may prevent jpackage from functioning. If there is an issue, it can be addressed by either disabling realtime monitoring, or adding an exclusion for the directory "{0}". -message.outputting-to-location=Generating EXE for installer to: {0}. -message.output-location=Installer (.exe) saved to: {0} -message.tool-version=Detected [{0}] version [{1}]. -message.creating-association-with-null-extension=Creating association with null extension. -message.wrong-tool-version=Detected [{0}] version {1} but version {2} is required. -message.version-string-too-many-components=Version sting may have up to 3 components - major.minor.build . -message.use-wix36-features=WiX {0} detected. Enabling advanced cleanup action. -message.product-code=MSI ProductCode: {0}. -message.upgrade-code=MSI UpgradeCode: {0}. -message.preparing-msi-config=Preparing MSI config: {0}. -message.generating-msi=Generating MSI: {0}. -message.invalid.install.dir=Warning: Invalid install directory {0}. Install directory should be a relative sub-path under the default installation location such as "Program Files". Defaulting to application name "{1}". +message.result-dir=\u7D50\u679C\u306E\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u30FB\u30D0\u30F3\u30C9\u30EB: {0} +message.icon-not-ico=\u6307\u5B9A\u3057\u305F\u30A2\u30A4\u30B3\u30F3"{0}"\u306FICO\u30D5\u30A1\u30A4\u30EB\u3067\u306F\u306A\u304F\u3001\u4F7F\u7528\u3055\u308C\u307E\u305B\u3093\u3002\u30C7\u30D5\u30A9\u30EB\u30C8\u30FB\u30A2\u30A4\u30B3\u30F3\u304C\u305D\u306E\u4F4D\u7F6E\u306B\u4F7F\u7528\u3055\u308C\u307E\u3059\u3002 +message.potential.windows.defender.issue=\u8B66\u544A: Windows Defender\u304C\u539F\u56E0\u3067jpackage\u304C\u6A5F\u80FD\u3057\u306A\u3044\u3053\u3068\u304C\u3042\u308A\u307E\u3059\u3002\u554F\u984C\u304C\u767A\u751F\u3057\u305F\u5834\u5408\u306F\u3001\u30EA\u30A2\u30EB\u30BF\u30A4\u30E0\u30FB\u30E2\u30CB\u30BF\u30EA\u30F3\u30B0\u3092\u7121\u52B9\u306B\u3059\u308B\u304B\u3001\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA"{0}"\u306E\u9664\u5916\u3092\u8FFD\u52A0\u3059\u308B\u3053\u3068\u306B\u3088\u308A\u3001\u554F\u984C\u306B\u5BFE\u51E6\u3067\u304D\u307E\u3059\u3002 +message.outputting-to-location=\u30A4\u30F3\u30B9\u30C8\u30FC\u30E9\u306EEXE\u3092\u6B21\u306B\u751F\u6210\u3057\u3066\u3044\u307E\u3059: {0} +message.output-location=\u30A4\u30F3\u30B9\u30C8\u30FC\u30E9(.exe)\u306F\u6B21\u306B\u4FDD\u5B58\u3055\u308C\u307E\u3057\u305F: {0} +message.tool-version=[{0}]\u30D0\u30FC\u30B8\u30E7\u30F3[{1}]\u304C\u691C\u51FA\u3055\u308C\u307E\u3057\u305F\u3002 +message.creating-association-with-null-extension=null\u62E1\u5F35\u5B50\u3068\u306E\u95A2\u9023\u4ED8\u3051\u3092\u4F5C\u6210\u3057\u3066\u3044\u307E\u3059\u3002 +message.wrong-tool-version=[{0}]\u30D0\u30FC\u30B8\u30E7\u30F3{1}\u304C\u691C\u51FA\u3055\u308C\u307E\u3057\u305F\u304C\u3001\u30D0\u30FC\u30B8\u30E7\u30F3{2}\u304C\u5FC5\u8981\u3067\u3059\u3002 +message.version-string-too-many-components=\u30D0\u30FC\u30B8\u30E7\u30F3\u6587\u5B57\u5217\u306B\u306F\u3001\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u30923\u3064(\u30E1\u30B8\u30E3\u30FC.\u30DE\u30A4\u30CA\u30FC.\u30D3\u30EB\u30C9)\u307E\u3067\u542B\u3081\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002 +message.use-wix36-features=WiX {0}\u304C\u691C\u51FA\u3055\u308C\u307E\u3057\u305F\u3002\u62E1\u5F35\u30AF\u30EA\u30FC\u30F3\u30A2\u30C3\u30D7\u30FB\u30A2\u30AF\u30B7\u30E7\u30F3\u3092\u6709\u52B9\u5316\u3057\u3066\u3044\u307E\u3059\u3002 +message.product-code=MSI ProductCode: {0}\u3002 +message.upgrade-code=MSI UpgradeCode: {0}\u3002 +message.preparing-msi-config=MSI\u69CB\u6210\u3092\u6E96\u5099\u3057\u3066\u3044\u307E\u3059: {0} +message.generating-msi=MSI\u3092\u751F\u6210\u3057\u3066\u3044\u307E\u3059: {0}\u3002 +message.invalid.install.dir=\u8B66\u544A: \u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u30FB\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA{0}\u304C\u7121\u52B9\u3067\u3059\u3002\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u30FB\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306F\u30C7\u30D5\u30A9\u30EB\u30C8\u306E\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u5834\u6240("\u30D7\u30ED\u30B0\u30E9\u30E0\u30FB\u30D5\u30A1\u30A4\u30EB"\u306A\u3069)\u306E\u4E0B\u306E\u76F8\u5BFE\u30B5\u30D6\u30D1\u30B9\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u540D"{1}"\u306B\u30C7\u30D5\u30A9\u30EB\u30C8\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u307E\u3059\u3002 diff --git a/src/jdk.incubator.jpackage/windows/classes/jdk/incubator/jpackage/internal/resources/WinResources_zh_CN.properties b/src/jdk.incubator.jpackage/windows/classes/jdk/incubator/jpackage/internal/resources/WinResources_zh_CN.properties index 97b3cbde801..0abb1136a68 100644 --- a/src/jdk.incubator.jpackage/windows/classes/jdk/incubator/jpackage/internal/resources/WinResources_zh_CN.properties +++ b/src/jdk.incubator.jpackage/windows/classes/jdk/incubator/jpackage/internal/resources/WinResources_zh_CN.properties @@ -24,44 +24,44 @@ # # -app.bundler.name=Windows Application Image -exe.bundler.name=EXE Installer Package -msi.bundler.name=MSI Installer Package +app.bundler.name=Windows \u5E94\u7528\u7A0B\u5E8F\u6620\u50CF +exe.bundler.name=EXE \u5B89\u88C5\u7A0B\u5E8F\u5305 +msi.bundler.name=MSI \u5B89\u88C5\u7A0B\u5E8F\u5305 -param.menu-group.default=Unknown +param.menu-group.default=\u672A\u77E5 -resource.executable-properties-template=Template for creating executable properties file -resource.setup-icon=setup dialog icon -resource.post-app-image-script=script to run after application image is populated -resource.post-msi-script=script to run after msi file for exe installer is created +resource.executable-properties-template=\u7528\u4E8E\u521B\u5EFA\u53EF\u6267\u884C\u5C5E\u6027\u6587\u4EF6\u7684\u6A21\u677F +resource.setup-icon=\u8BBE\u7F6E\u5BF9\u8BDD\u6846\u56FE\u6807 +resource.post-app-image-script=\u8981\u5728\u586B\u5145\u5E94\u7528\u7A0B\u5E8F\u6620\u50CF\u4E4B\u540E\u8FD0\u884C\u7684\u811A\u672C +resource.post-msi-script=\u5728\u4E3A exe \u5B89\u88C5\u7A0B\u5E8F\u521B\u5EFA msi \u6587\u4EF6\u4E4B\u540E\u8981\u8FD0\u884C\u7684\u811A\u672C resource.wxl-file-name=MsiInstallerStrings_en.wxl -resource.main-wix-file=Main WiX project file -resource.overrides-wix-file=Overrides WiX project file +resource.main-wix-file=\u4E3B WiX \u9879\u76EE\u6587\u4EF6 +resource.overrides-wix-file=\u8986\u76D6 WiX \u9879\u76EE\u6587\u4EF6 -error.no-wix-tools=Can not find WiX tools (light.exe, candle.exe) -error.no-wix-tools.advice=Download WiX 3.0 or later from https://wixtoolset.org and add it to the PATH. -error.version-string-wrong-format=Version string is not compatible with MSI rules [{0}] -error.version-string-wrong-format.advice=Set the bundler argument "{0}" according to these rules: https://msdn.microsoft.com/en-us/library/aa370859%28v\=VS.85%29.aspx . -error.version-string-major-out-of-range=Major version must be in the range [0, 255] -error.version-string-build-out-of-range=Build part of version must be in the range [0, 65535] -error.version-string-minor-out-of-range=Minor version must be in the range [0, 255] -error.version-string-part-not-number=Failed to convert version component to int -error.version-swap=Failed to update version information for {0} -error.invalid-envvar=Invalid value of {0} environment variable +error.no-wix-tools=\u627E\u4E0D\u5230 WiX \u5DE5\u5177 (light.exe, candle.exe) +error.no-wix-tools.advice=\u4ECE https://wixtoolset.org \u4E0B\u8F7D WiX 3.0 \u6216\u66F4\u9AD8\u7248\u672C\uFF0C\u7136\u540E\u5C06\u5176\u6DFB\u52A0\u5230 PATH\u3002 +error.version-string-wrong-format=\u7248\u672C\u5B57\u7B26\u4E32\u4E0D\u7B26\u5408 MSI \u89C4\u5219 [{0}] +error.version-string-wrong-format.advice=\u6839\u636E\u4EE5\u4E0B\u89C4\u5219\u8BBE\u7F6E\u6253\u5305\u7A0B\u5E8F\u53C2\u6570 "{0}"\uFF1Ahttps://msdn.microsoft.com/en-us/library/aa370859%28v=VS.85%29.aspx\u3002 +error.version-string-major-out-of-range=\u4E3B\u7248\u672C\u5FC5\u987B\u4F4D\u4E8E [0, 255] \u8303\u56F4\u4E2D +error.version-string-build-out-of-range=\u7248\u672C\u7684\u5DE5\u4F5C\u7248\u672C\u90E8\u5206\u5FC5\u987B\u4F4D\u4E8E [0, 65535] \u8303\u56F4\u4E2D +error.version-string-minor-out-of-range=\u6B21\u7248\u672C\u5FC5\u987B\u4F4D\u4E8E [0, 255] \u8303\u56F4\u4E2D +error.version-string-part-not-number=\u65E0\u6CD5\u5C06\u7248\u672C\u7EC4\u6210\u90E8\u5206\u8F6C\u6362\u4E3A\u6574\u6570 +error.version-swap=\u65E0\u6CD5\u66F4\u65B0 {0} \u7684\u7248\u672C\u4FE1\u606F +error.invalid-envvar={0} \u73AF\u5883\u53D8\u91CF\u7684\u503C\u65E0\u6548 -message.result-dir=Result application bundle: {0}. -message.icon-not-ico=The specified icon "{0}" is not an ICO file and will not be used. The default icon will be used in it's place. -message.potential.windows.defender.issue=Warning: Windows Defender may prevent jpackage from functioning. If there is an issue, it can be addressed by either disabling realtime monitoring, or adding an exclusion for the directory "{0}". -message.outputting-to-location=Generating EXE for installer to: {0}. -message.output-location=Installer (.exe) saved to: {0} -message.tool-version=Detected [{0}] version [{1}]. -message.creating-association-with-null-extension=Creating association with null extension. -message.wrong-tool-version=Detected [{0}] version {1} but version {2} is required. -message.version-string-too-many-components=Version sting may have up to 3 components - major.minor.build . -message.use-wix36-features=WiX {0} detected. Enabling advanced cleanup action. -message.product-code=MSI ProductCode: {0}. -message.upgrade-code=MSI UpgradeCode: {0}. -message.preparing-msi-config=Preparing MSI config: {0}. -message.generating-msi=Generating MSI: {0}. -message.invalid.install.dir=Warning: Invalid install directory {0}. Install directory should be a relative sub-path under the default installation location such as "Program Files". Defaulting to application name "{1}". +message.result-dir=\u751F\u6210\u7684\u5E94\u7528\u7A0B\u5E8F\u5305: {0}\u3002 +message.icon-not-ico=\u6307\u5B9A\u7684\u56FE\u6807 "{0}" \u4E0D\u662F ICO \u6587\u4EF6, \u4E0D\u4F1A\u4F7F\u7528\u3002\u5C06\u4F7F\u7528\u9ED8\u8BA4\u56FE\u6807\u4EE3\u66FF\u3002 +message.potential.windows.defender.issue=\u8B66\u544A\uFF1AWindows Defender \u53EF\u80FD\u4F1A\u963B\u6B62 jpackage \u6B63\u5E38\u5DE5\u4F5C\u3002\u5982\u679C\u5B58\u5728\u95EE\u9898\uFF0C\u53EF\u4EE5\u901A\u8FC7\u7981\u7528\u5B9E\u65F6\u76D1\u89C6\u6216\u8005\u4E3A\u76EE\u5F55 "{0}" \u6DFB\u52A0\u6392\u9664\u9879\u6765\u89E3\u51B3\u3002 +message.outputting-to-location=\u6B63\u5728\u4E3A\u5B89\u88C5\u7A0B\u5E8F\u751F\u6210 EXE, \u4F4D\u7F6E: {0}\u3002 +message.output-location=\u5B89\u88C5\u7A0B\u5E8F (.exe) \u5DF2\u4FDD\u5B58\u5230: {0} +message.tool-version=\u68C0\u6D4B\u5230 [{0}] \u7248\u672C [{1}]\u3002 +message.creating-association-with-null-extension=\u6B63\u5728\u4F7F\u7528\u7A7A\u6269\u5C55\u540D\u521B\u5EFA\u5173\u8054\u3002 +message.wrong-tool-version=\u68C0\u6D4B\u5230 [{0}] \u7248\u672C {1}, \u4F46\u9700\u8981\u7248\u672C {2}\u3002 +message.version-string-too-many-components=\u7248\u672C\u5B57\u7B26\u4E32\u6700\u591A\u53EF\u4EE5\u5177\u6709 3 \u4E2A\u7EC4\u6210\u90E8\u5206 - major.minor.build\u3002 +message.use-wix36-features=\u68C0\u6D4B\u5230 WiX {0}\u3002\u6B63\u5728\u542F\u7528\u9AD8\u7EA7\u6E05\u9664\u64CD\u4F5C\u3002 +message.product-code=MSI ProductCode\uFF1A{0}\u3002 +message.upgrade-code=MSI UpgradeCode\uFF1A{0}\u3002 +message.preparing-msi-config=\u6B63\u5728\u51C6\u5907 MSI \u914D\u7F6E: {0}\u3002 +message.generating-msi=\u6B63\u5728\u751F\u6210 MSI: {0}\u3002 +message.invalid.install.dir=\u8B66\u544A\uFF1A\u5B89\u88C5\u76EE\u5F55 {0} \u65E0\u6548\u3002\u5B89\u88C5\u76EE\u5F55\u5E94\u5F53\u662F\u9ED8\u8BA4\u5B89\u88C5\u4F4D\u7F6E\uFF08\u5982 "Program Files"\uFF09\u4E0B\u9762\u7684\u76F8\u5BF9\u5B50\u8DEF\u5F84\u3002\u9ED8\u8BA4\u4E3A\u5E94\u7528\u7A0B\u5E8F\u540D\u79F0 "{1}"\u3002 diff --git a/src/jdk.jartool/share/classes/sun/tools/jar/resources/jar_ja.properties b/src/jdk.jartool/share/classes/sun/tools/jar/resources/jar_ja.properties index b348a21760e..b17d8c1e08d 100644 --- a/src/jdk.jartool/share/classes/sun/tools/jar/resources/jar_ja.properties +++ b/src/jdk.jartool/share/classes/sun/tools/jar/resources/jar_ja.properties @@ -90,7 +90,7 @@ out.extracted={0}\u304C\u62BD\u51FA\u3055\u308C\u307E\u3057\u305F out.inflated=\ {0}\u304C\u5C55\u958B\u3055\u308C\u307E\u3057\u305F out.size=(\u5165={0})(\u51FA={1}) -usage.compat=\u4E92\u63DB\u6027\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9:\n\u4F7F\u7528\u65B9\u6CD5: jar {ctxui}[vfmn0PMe] [jar-file] [manifest-file] [entry-point] [-C dir] files] ...\n\u30AA\u30D7\u30B7\u30E7\u30F3:\n -c \u30A2\u30FC\u30AB\u30A4\u30D6\u3092\u65B0\u898F\u4F5C\u6210\u3059\u308B\n -t \u30A2\u30FC\u30AB\u30A4\u30D6\u306E\u5185\u5BB9\u3092\u4E00\u89A7\u8868\u793A\u3059\u308B\n -x \u6307\u5B9A\u306E(\u307E\u305F\u306F\u3059\u3079\u3066\u306E)\u30D5\u30A1\u30A4\u30EB\u3092\u30A2\u30FC\u30AB\u30A4\u30D6\u304B\u3089\u62BD\u51FA\u3059\u308B\n -u \u65E2\u5B58\u30A2\u30FC\u30AB\u30A4\u30D6\u3092\u66F4\u65B0\u3059\u308B\n -v \u6A19\u6E96\u51FA\u529B\u306B\u8A73\u7D30\u306A\u51FA\u529B\u3092\u751F\u6210\u3059\u308B\n -f \u30A2\u30FC\u30AB\u30A4\u30D6\u30FB\u30D5\u30A1\u30A4\u30EB\u540D\u3092\u6307\u5B9A\u3059\u308B\n -m \u6307\u5B9A\u306E\u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u30FB\u30D5\u30A1\u30A4\u30EB\u304B\u3089\u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u60C5\u5831\u3092\u53D6\u308A\u8FBC\u3080\n -n \u65B0\u898F\u30A2\u30FC\u30AB\u30A4\u30D6\u306E\u4F5C\u6210\u5F8C\u306BPack200\u6B63\u898F\u5316\u3092\u5B9F\u884C\u3059\u308B\n \u3053\u306E\u30AA\u30D7\u30B7\u30E7\u30F3\u306F\u975E\u63A8\u5968\u3067\u3042\u308A\u3001\u4ECA\u5F8C\u306EJDK\u30EA\u30EA\u30FC\u30B9\u3067\u524A\u9664\u3055\u308C\u308B\u4E88\u5B9A\u3067\u3059\n -e \u5B9F\u884C\u53EF\u80FDjar\u30D5\u30A1\u30A4\u30EB\u306B\u30D0\u30F3\u30C9\u30EB\u3055\u308C\u305F\u30B9\u30BF\u30F3\u30C9\u30A2\u30ED\u30F3\u30FB \n \u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u306E\u30A8\u30F3\u30C8\u30EA\u30FB\u30DD\u30A4\u30F3\u30C8\u3092\u6307\u5B9A\u3059\u308B\n -0 \u683C\u7D0D\u306E\u307F\u3002ZIP\u5727\u7E2E\u3092\u4F7F\u7528\u3057\u306A\u3044\n -P \u30D5\u30A1\u30A4\u30EB\u540D\u306E\u5148\u982D\u306E'/' (\u7D76\u5BFE\u30D1\u30B9)\u304A\u3088\u3073\\"..\\" (\u89AA\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA)\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u3092\u4FDD\u6301\u3059\u308B\n -M \u30A8\u30F3\u30C8\u30EA\u306E\u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u4F5C\u6210\u3057\u306A\u3044\n -i \u6307\u5B9A\u306Ejar\u30D5\u30A1\u30A4\u30EB\u306E\u7D22\u5F15\u60C5\u5831\u3092\u751F\u6210\u3059\u308B\n -C \u6307\u5B9A\u306E\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306B\u5909\u66F4\u3057\u3001\u6B21\u306E\u30D5\u30A1\u30A4\u30EB\u3092\u53D6\u308A\u8FBC\u3080\n\u30D5\u30A1\u30A4\u30EB\u304C\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306E\u5834\u5408\u306F\u518D\u5E30\u7684\u306B\u51E6\u7406\u3055\u308C\u307E\u3059\u3002\n\u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u30FB\u30D5\u30A1\u30A4\u30EB\u540D\u3001\u30A2\u30FC\u30AB\u30A4\u30D6\u30FB\u30D5\u30A1\u30A4\u30EB\u540D\u304A\u3088\u3073\u30A8\u30F3\u30C8\u30EA\u30FB\u30DD\u30A4\u30F3\u30C8\u540D\u306F\u3001\n\u30D5\u30E9\u30B0'm'\u3001'f'\u3001'e'\u306E\u6307\u5B9A\u3068\u540C\u3058\u9806\u756A\u3067\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002\n\n\u4F8B1: 2\u3064\u306E\u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u30A2\u30FC\u30AB\u30A4\u30D6classes.jar\u306B\u4FDD\u5B58\u3059\u308B: \n jar cvf classes.jar Foo.class Bar.class \n\u4F8B2: \u65E2\u5B58\u306E\u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u30FB\u30D5\u30A1\u30A4\u30EB'mymanifest'\u3092\u4F7F\u7528\u3057\u3001foo/\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306E\n \u5168\u30D5\u30A1\u30A4\u30EB\u3092'classes.jar'\u306B\u30A2\u30FC\u30AB\u30A4\u30D6\u3059\u308B: \n jar cvfm classes.jar mymanifest -C foo/ .\n +usage.compat=\u4E92\u63DB\u6027\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9: \n\u4F7F\u7528\u65B9\u6CD5: jar {ctxui}[vfmn0PMe] [jar-file] [manifest-file] [entry-point] [-C dir] files] ...\n\u30AA\u30D7\u30B7\u30E7\u30F3:\n -c \u30A2\u30FC\u30AB\u30A4\u30D6\u3092\u65B0\u898F\u4F5C\u6210\u3059\u308B\n -t \u30A2\u30FC\u30AB\u30A4\u30D6\u306E\u5185\u5BB9\u3092\u4E00\u89A7\u8868\u793A\u3059\u308B\n -x \u6307\u5B9A\u306E(\u307E\u305F\u306F\u3059\u3079\u3066\u306E)\u30D5\u30A1\u30A4\u30EB\u3092\u30A2\u30FC\u30AB\u30A4\u30D6\u304B\u3089\u62BD\u51FA\u3059\u308B\n -u \u65E2\u5B58\u30A2\u30FC\u30AB\u30A4\u30D6\u3092\u66F4\u65B0\u3059\u308B\n -v \u6A19\u6E96\u51FA\u529B\u306B\u8A73\u7D30\u306A\u51FA\u529B\u3092\u751F\u6210\u3059\u308B\n -f \u30A2\u30FC\u30AB\u30A4\u30D6\u30FB\u30D5\u30A1\u30A4\u30EB\u540D\u3092\u6307\u5B9A\u3059\u308B\n -m \u6307\u5B9A\u306E\u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u30FB\u30D5\u30A1\u30A4\u30EB\u304B\u3089\u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u60C5\u5831\u3092\u53D6\u308A\u8FBC\u3080\n -e \u5B9F\u884C\u53EF\u80FDjar\u30D5\u30A1\u30A4\u30EB\u306B\u30D0\u30F3\u30C9\u30EB\u3055\u308C\u305F\u30B9\u30BF\u30F3\u30C9\u30A2\u30ED\u30F3\u30FB\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u306E\n \u30A8\u30F3\u30C8\u30EA\u30FB\u30DD\u30A4\u30F3\u30C8\u3092\u6307\u5B9A\u3059\u308B\n -0 \u683C\u7D0D\u306E\u307F\u3002ZIP\u5727\u7E2E\u3092\u4F7F\u7528\u3057\u306A\u3044\n -P \u30D5\u30A1\u30A4\u30EB\u540D\u306E\u5148\u982D\u306E'/' (\u7D76\u5BFE\u30D1\u30B9)\u304A\u3088\u3073".." (\u89AA\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA)\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u3092\u4FDD\u6301\u3059\u308B\n -M \u30A8\u30F3\u30C8\u30EA\u306E\u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u4F5C\u6210\u3057\u306A\u3044\n -i \u6307\u5B9A\u306Ejar\u30D5\u30A1\u30A4\u30EB\u306E\u7D22\u5F15\u60C5\u5831\u3092\u751F\u6210\u3059\u308B\n -C \u6307\u5B9A\u306E\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306B\u5909\u66F4\u3057\u3001\u6B21\u306E\u30D5\u30A1\u30A4\u30EB\u3092\u53D6\u308A\u8FBC\u3080\n\u30D5\u30A1\u30A4\u30EB\u304C\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306E\u5834\u5408\u306F\u518D\u5E30\u7684\u306B\u51E6\u7406\u3055\u308C\u307E\u3059\u3002\n\u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u30FB\u30D5\u30A1\u30A4\u30EB\u540D\u3001\u30A2\u30FC\u30AB\u30A4\u30D6\u30FB\u30D5\u30A1\u30A4\u30EB\u540D\u304A\u3088\u3073\u30A8\u30F3\u30C8\u30EA\u30FB\u30DD\u30A4\u30F3\u30C8\u540D\u306F\u3001\n\u30D5\u30E9\u30B0'm'\u3001'f'\u3001'e'\u306E\u6307\u5B9A\u3068\u540C\u3058\u9806\u756A\u3067\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002\n\n\u4F8B1: 2\u3064\u306E\u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u30A2\u30FC\u30AB\u30A4\u30D6classes.jar\u306B\u4FDD\u5B58\u3059\u308B:\n jar cvf classes.jar Foo.class Bar.class\n\u4F8B2: \u65E2\u5B58\u306E\u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u30FB\u30D5\u30A1\u30A4\u30EB'mymanifest'\u3092\u4F7F\u7528\u3057\u3001foo/\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306E\n \u5168\u30D5\u30A1\u30A4\u30EB\u3092'classes.jar'\u306B\u30A2\u30FC\u30AB\u30A4\u30D6\u3059\u308B:\n jar cvfm classes.jar mymanifest -C foo/ . \n main.usage.summary=\u4F7F\u7528\u65B9\u6CD5: jar [OPTION...] [ [--release VERSION] [-C dir] files] ... main.usage.summary.try=\u8A73\u7D30\u306F\u3001`jar --help'\u3092\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002 diff --git a/src/jdk.jartool/share/classes/sun/tools/jar/resources/jar_zh_CN.properties b/src/jdk.jartool/share/classes/sun/tools/jar/resources/jar_zh_CN.properties index 099682b06b9..36889f522cb 100644 --- a/src/jdk.jartool/share/classes/sun/tools/jar/resources/jar_zh_CN.properties +++ b/src/jdk.jartool/share/classes/sun/tools/jar/resources/jar_zh_CN.properties @@ -90,7 +90,7 @@ out.extracted=\u5DF2\u63D0\u53D6: {0} out.inflated=\ \u5DF2\u89E3\u538B: {0} out.size=(\u8F93\u5165 = {0}) (\u8F93\u51FA = {1}) -usage.compat=\u517C\u5BB9\u6027\u63A5\u53E3\uFF1A\n\u7528\u6CD5\uFF1Ajar {ctxui}[vfmn0PMe] [jar-file] [manifest-file] [entry-point] [-C dir] files] ...\n\u9009\u9879\uFF1A\n -c \u521B\u5EFA\u65B0\u6863\u6848\n -t \u5217\u51FA\u6863\u6848\u76EE\u5F55\n -x \u4ECE\u6863\u6848\u4E2D\u63D0\u53D6\u6307\u5B9A\u7684\uFF08\u6216\u6240\u6709\uFF09\u6587\u4EF6\n -u \u66F4\u65B0\u73B0\u6709\u6863\u6848\n -v \u5728\u6807\u51C6\u8F93\u51FA\u4E2D\u751F\u6210\u8BE6\u7EC6\u8F93\u51FA\n -f \u6307\u5B9A\u6863\u6848\u6587\u4EF6\u540D\n -m \u5305\u542B\u6307\u5B9A\u6E05\u5355\u6587\u4EF6\u4E2D\u7684\u6E05\u5355\u4FE1\u606F\n -n \u521B\u5EFA\u65B0\u6863\u6848\u540E\u6267\u884C Pack200 \u89C4\u8303\u5316\uFF0C\n \u6B64\u9009\u9879\u5DF2\u8FC7\u65F6\uFF0C\u8BA1\u5212\u5728\u672A\u6765\u7684 JDK \u53D1\u884C\u7248\u4E2D\u5220\u9664\n -e \u4E3A\u6346\u7ED1\u5230\u53EF\u6267\u884C jar \u6587\u4EF6\u7684\u72EC\u7ACB\u5E94\u7528\u7A0B\u5E8F\n \u6307\u5B9A\u5E94\u7528\u7A0B\u5E8F\u5165\u53E3\u70B9\n -0 \u4EC5\u5B58\u50A8\uFF1B\u4E0D\u4F7F\u7528 ZIP \u538B\u7F29\n -P \u4FDD\u7559\u6587\u4EF6\u540D\u4E2D\u7684\u524D\u5BFC '/'\uFF08\u7EDD\u5BF9\u8DEF\u5F84\uFF09\u548C ".."\uFF08\u7236\u76EE\u5F55\uFF09\u7EC4\u4EF6\n -M \u4E0D\u521B\u5EFA\u6761\u76EE\u7684\u6E05\u5355\u6587\u4EF6\n -i \u4E3A\u6307\u5B9A\u7684 jar \u6587\u4EF6\u751F\u6210\u7D22\u5F15\u4FE1\u606F\n -C \u66F4\u6539\u4E3A\u6307\u5B9A\u7684\u76EE\u5F55\u5E76\u5305\u542B\u4EE5\u4E0B\u6587\u4EF6\n\u5982\u679C\u4EFB\u4F55\u6587\u4EF6\u4E3A\u76EE\u5F55\uFF0C\u5219\u5BF9\u5176\u8FDB\u884C\u9012\u5F52\u5904\u7406\u3002\n\u6E05\u5355\u6587\u4EF6\u540D\u3001\u6863\u6848\u6587\u4EF6\u540D\u548C\u5165\u53E3\u70B9\u540D\u79F0\u7684\u6307\u5B9A\u987A\u5E8F\n\u4E0E 'm'\u3001'f' \u548C 'e' \u6807\u8BB0\u7684\u6307\u5B9A\u987A\u5E8F\u76F8\u540C\u3002\n\n\u793A\u4F8B 1\uFF1A\u5C06\u4E24\u4E2A\u7C7B\u6587\u4EF6\u5F52\u6863\u5230\u4E00\u4E2A\u540D\u4E3A classes.jar \u7684\u6863\u6848\u4E2D\uFF1A\n jar cvf classes.jar Foo.class Bar.class \n\u793A\u4F8B 2\uFF1A\u4F7F\u7528\u73B0\u6709\u7684\u6E05\u5355\u6587\u4EF6 'mymanifest' \u5E76\n \u5C06 foo/ \u76EE\u5F55\u4E2D\u7684\u6240\u6709\u6587\u4EF6\u5F52\u6863\u5230 'classes.jar' \u4E2D\uFF1A\n jar cvfm classes.jar mymanifest -C foo/ .\n +usage.compat=\u517C\u5BB9\u6027\u63A5\u53E3\uFF1A\n\u7528\u6CD5\uFF1Ajar {ctxui}[vfmn0PMe] [jar-file] [manifest-file] [entry-point] [-C dir] files] ...\n\u9009\u9879\uFF1A\n -c \u521B\u5EFA\u65B0\u6863\u6848\n -t \u5217\u51FA\u6863\u6848\u76EE\u5F55\n -x \u4ECE\u6863\u6848\u4E2D\u63D0\u53D6\u6307\u5B9A\u7684\uFF08\u6216\u6240\u6709\uFF09\u6587\u4EF6\n -u \u66F4\u65B0\u73B0\u6709\u6863\u6848\n -v \u5728\u6807\u51C6\u8F93\u51FA\u4E2D\u751F\u6210\u8BE6\u7EC6\u8F93\u51FA\n -f \u6307\u5B9A\u6863\u6848\u6587\u4EF6\u540D\n -m \u5305\u542B\u6307\u5B9A\u6E05\u5355\u6587\u4EF6\u4E2D\u7684\u6E05\u5355\u4FE1\u606F\n -e \u4E3A\u6346\u7ED1\u5230\u53EF\u6267\u884C jar \u6587\u4EF6\u7684\u72EC\u7ACB\u5E94\u7528\u7A0B\u5E8F\n \u6307\u5B9A\u5E94\u7528\u7A0B\u5E8F\u5165\u53E3\u70B9\n -0 \u4EC5\u5B58\u50A8\uFF1B\u4E0D\u4F7F\u7528\u4EFB\u4F55 ZIP \u538B\u7F29\n -P \u4FDD\u7559\u6587\u4EF6\u540D\u4E2D\u7684\u524D\u5BFC '/'\uFF08\u7EDD\u5BF9\u8DEF\u5F84\uFF09\u548C ".."\uFF08\u7236\u76EE\u5F55\uFF09\u7EC4\u6210\u90E8\u5206\n -M \u4E0D\u521B\u5EFA\u6761\u76EE\u7684\u6E05\u5355\u6587\u4EF6\n -i \u4E3A\u6307\u5B9A\u7684 jar \u6587\u4EF6\u751F\u6210\u7D22\u5F15\u4FE1\u606F\n -C \u66F4\u6539\u4E3A\u6307\u5B9A\u7684\u76EE\u5F55\u5E76\u5305\u542B\u4EE5\u4E0B\u6587\u4EF6\n\u5982\u679C\u4EFB\u4F55\u6587\u4EF6\u4E3A\u76EE\u5F55\uFF0C\u5219\u5BF9\u5176\u8FDB\u884C\u9012\u5F52\u5904\u7406\u3002\n\u6E05\u5355\u6587\u4EF6\u540D\u3001\u6863\u6848\u6587\u4EF6\u540D\u548C\u5165\u53E3\u70B9\u540D\u79F0\u7684\u6307\u5B9A\u987A\u5E8F\n\u4E0E 'm', 'f' \u548C 'e' \u6807\u8BB0\u7684\u6307\u5B9A\u987A\u5E8F\u76F8\u540C\u3002\n\n\u793A\u4F8B 1\uFF1A\u5C06\u4E24\u4E2A\u7C7B\u6587\u4EF6\u5F52\u6863\u5230\u4E00\u4E2A\u540D\u4E3A classes.jar \u7684\u6863\u6848\u4E2D\uFF1A\n jar cvf classes.jar Foo.class Bar.class \n\u793A\u4F8B 2\uFF1A\u4F7F\u7528\u73B0\u6709\u7684\u6E05\u5355\u6587\u4EF6 'mymanifest' \u5E76\n \u5C06 foo/ \u76EE\u5F55\u4E2D\u7684\u6240\u6709\u6587\u4EF6\u5F52\u6863\u5230 'classes.jar' \u4E2D\uFF1A\n jar cvfm classes.jar mymanifest -C foo/\u3002\n main.usage.summary=\u7528\u6CD5: jar [OPTION...] [ [--release VERSION] [-C dir] files] ... main.usage.summary.try=\u5C1D\u8BD5\u4F7F\u7528 `jar --help' \u83B7\u53D6\u8BE6\u7EC6\u4FE1\u606F\u3002 diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/standard_ja.properties b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/standard_ja.properties index 20fbb24b25d..619b46a54ba 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/standard_ja.properties +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/standard_ja.properties @@ -118,7 +118,10 @@ doclet.Interfaces=\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9 doclet.Enclosing_Class=\u542B\u307E\u308C\u3066\u3044\u308B\u30AF\u30E9\u30B9: doclet.Enclosing_Interface=\u542B\u307E\u308C\u3066\u3044\u308B\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9: doclet.Inheritance_Tree=\u7D99\u627F\u30C4\u30EA\u30FC +doclet.ReferencedIn=\u53C2\u7167 doclet.System_Property=\u30B7\u30B9\u30C6\u30E0\u30FB\u30D7\u30ED\u30D1\u30C6\u30A3 +doclet.systemProperties=\u30B7\u30B9\u30C6\u30E0\u30FB\u30D7\u30ED\u30D1\u30C6\u30A3 +doclet.systemPropertiesSummary=\u30B7\u30B9\u30C6\u30E0\u30FB\u30D7\u30ED\u30D1\u30C6\u30A3\u30FB\u30B5\u30DE\u30EA\u30FC doclet.Window_Source_title=\u30BD\u30FC\u30B9\u30FB\u30B3\u30FC\u30C9 doclet.Window_Help_title=API\u30D8\u30EB\u30D7 @@ -156,7 +159,16 @@ doclet.help.annotation_type.intro=\u5404\u6CE8\u91C8\u578B\u306B\u306F\u3001\u30 doclet.help.annotation_type.declaration=\u6CE8\u91C8\u578B\u306E\u5BA3\u8A00 doclet.help.annotation_type.description=\u6CE8\u91C8\u578B\u306E\u8AAC\u660E doclet.help.search.head=\u691C\u7D22 -doclet.help.search.body=\u30E2\u30B8\u30E5\u30FC\u30EB\u3001\u30D1\u30C3\u30B1\u30FC\u30B8\u3001\u30BF\u30A4\u30D7\u3001\u30D5\u30A3\u30FC\u30EB\u30C9\u3001\u30E1\u30BD\u30C3\u30C9\u3001\u304A\u3088\u3073API\u3067\u5B9A\u7FA9\u3055\u308C\u3066\u3044\u308B\u305D\u306E\u4ED6\u306E\u8A9E\u3092\u3001\u540D\u524D\u306E\u4E00\u90E8\u307E\u305F\u306F\u5168\u4F53\u3092\u4F7F\u7528\u3057\u3066\u691C\u7D22\u3067\u304D\u307E\u3059\u3002\u30AD\u30E3\u30E1\u30EB\u30B1\u30FC\u30B9\u306E\u7701\u7565\u5F62\u304C\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u3059: \u305F\u3068\u3048\u3070\u3001"InpStr"\u3068\u6307\u5B9A\u3059\u308B\u3068"InputStream"\u3068"InputStreamReader"\u304C\u691C\u7D22\u3055\u308C\u307E\u3059\u3002 +# Introduction to Javadoc search features, followed by a list of examples +doclet.help.search.intro=\u30E2\u30B8\u30E5\u30FC\u30EB\u3001\u30D1\u30C3\u30B1\u30FC\u30B8\u3001\u30BF\u30A4\u30D7\u3001\u30D5\u30A3\u30FC\u30EB\u30C9\u3001\u30E1\u30BD\u30C3\u30C9\u3001\u30B7\u30B9\u30C6\u30E0\u30FB\u30D7\u30ED\u30D1\u30C6\u30A3\u304A\u3088\u3073API\u3067\u5B9A\u7FA9\u3055\u308C\u3066\u3044\u308B\u305D\u306E\u4ED6\u306E\u8A9E\u3092\u3001\u540D\u524D\u306E\u4E00\u90E8\u307E\u305F\u306F\u5168\u4F53\u3092\u4F7F\u7528\u3057\u3066(\u5FC5\u8981\u306B\u5FDC\u3058\u3066\u30AD\u30E3\u30E1\u30EB\u30B1\u30FC\u30B9\u306E\u7701\u7565\u5F62\u3092\u4F7F\u7528\u3057\u3066)\u691C\u7D22\u3067\u304D\u307E\u3059\u3002\u4F8B: +# Used to list search examples, {0} is a search term and {1} the matching result +doclet.help.search.example={0}\u306F{1}\u3068\u4E00\u81F4\u3057\u307E\u3059 +# {0} contains a link to the current Javadoc Search Specification +doclet.help.search.refer=\u691C\u7D22\u6A5F\u80FD\u306E\u8A73\u7D30\u306A\u8AAC\u660E\u306F\u3001{0}\u3092\u53C2\u7167\u3057\u3066\u304F\u3060\u3055\u3044\u3002 +# The URL for the Javadoc Search Specification. {0} will be replaced by the JDK version number +doclet.help.search.spec.url=https://docs.oracle.com/en/java/javase/{0}/docs/specs/javadoc/javadoc-search-spec.html +# The title for the Javadoc Search Specification +doclet.help.search.spec.title=Javadoc\u691C\u7D22\u4ED5\u69D8 doclet.ClassUse_Packages.that.use.0={0}\u3092\u4F7F\u7528\u3057\u3066\u3044\u308B\u30D1\u30C3\u30B1\u30FC\u30B8 doclet.ClassUse_Uses.of.0.in.1={1}\u3067\u306E{0}\u306E\u4F7F\u7528 diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/standard_zh_CN.properties b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/standard_zh_CN.properties index 5d0a729f74b..e83acaca4b5 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/standard_zh_CN.properties +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/standard_zh_CN.properties @@ -118,7 +118,10 @@ doclet.Interfaces=\u63A5\u53E3 doclet.Enclosing_Class=\u5C01\u95ED\u7C7B: doclet.Enclosing_Interface=\u5C01\u95ED\u63A5\u53E3: doclet.Inheritance_Tree=\u7EE7\u627F\u6811 +doclet.ReferencedIn=\u53C2\u8003\u4F4D\u7F6E doclet.System_Property=\u7CFB\u7EDF\u5C5E\u6027 +doclet.systemProperties=\u7CFB\u7EDF\u5C5E\u6027 +doclet.systemPropertiesSummary=\u7CFB\u7EDF\u5C5E\u6027\u6982\u8981 doclet.Window_Source_title=\u6E90\u4EE3\u7801 doclet.Window_Help_title=API \u5E2E\u52A9 @@ -156,7 +159,16 @@ doclet.help.annotation_type.intro=\u6BCF\u4E2A\u6CE8\u91CA\u7C7B\u578B\u90FD\u67 doclet.help.annotation_type.declaration=\u6CE8\u91CA\u7C7B\u578B\u58F0\u660E doclet.help.annotation_type.description=\u6CE8\u91CA\u7C7B\u578B\u8BF4\u660E doclet.help.search.head=\u641C\u7D22 -doclet.help.search.body=\u53EF\u4EE5\u4F7F\u7528\u90E8\u5206\u6216\u5B8C\u6574\u540D\u79F0\u641C\u7D22\u6A21\u5757\u3001\u7A0B\u5E8F\u5305\u3001\u7C7B\u578B\u3001\u5B57\u6BB5\u3001\u65B9\u6CD5\u4EE5\u53CA\u5728 API \u4E2D\u5B9A\u4E49\u7684\u5176\u4ED6\u672F\u8BED\u7684\u5B9A\u4E49\u3002\u652F\u6301\u201C\u9A7C\u5CF0\u5927\u5C0F\u5199\u5F0F\u201D\u7F29\u5199\uFF1A\u4F8B\u5982\uFF0C"InpStr" \u5C06\u67E5\u627E "InputStream" \u548C "InputStreamReader"\u3002 +# Introduction to Javadoc search features, followed by a list of examples +doclet.help.search.intro=\u53EF\u4EE5\u4F7F\u7528\u90E8\u5206\u6216\u5B8C\u6574\u540D\u79F0\u641C\u7D22\u6A21\u5757\u3001\u7A0B\u5E8F\u5305\u3001\u7C7B\u578B\u3001\u5B57\u6BB5\u3001\u65B9\u6CD5\u3001\u7CFB\u7EDF\u5C5E\u6027\u4EE5\u53CA API \u4E2D\u5B9A\u4E49\u7684\u5176\u4ED6\u672F\u8BED\u7684\u5B9A\u4E49\uFF0C\uFF08\u53EF\u9009\uFF09\u4E5F\u53EF\u4EE5\u4F7F\u7528\u201C\u9A7C\u5CF0\u5927\u5C0F\u5199\u5F0F\u201D\u7F29\u5199\u8FDB\u884C\u641C\u7D22\u3002\u4F8B\u5982\uFF1A +# Used to list search examples, {0} is a search term and {1} the matching result +doclet.help.search.example={0} \u5C06\u4E0E {1} \u76F8\u5339\u914D +# {0} contains a link to the current Javadoc Search Specification +doclet.help.search.refer=\u6709\u5173\u641C\u7D22\u529F\u80FD\u7684\u5B8C\u6574\u8BF4\u660E\uFF0C\u8BF7\u53C2\u9605 {0}\u3002 +# The URL for the Javadoc Search Specification. {0} will be replaced by the JDK version number +doclet.help.search.spec.url=https://docs.oracle.com/en/java/javase/{0}/docs/specs/javadoc/javadoc-search-spec.html +# The title for the Javadoc Search Specification +doclet.help.search.spec.title=Javadoc \u641C\u7D22\u89C4\u8303 doclet.ClassUse_Packages.that.use.0=\u4F7F\u7528{0}\u7684\u7A0B\u5E8F\u5305 doclet.ClassUse_Uses.of.0.in.1={1}\u4E2D{0}\u7684\u4F7F\u7528 diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/doclets_ja.properties b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/doclets_ja.properties index 6b89f32f3a4..b5274383bce 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/doclets_ja.properties +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/doclets_ja.properties @@ -84,10 +84,13 @@ doclet.PropertySetterWithName=\u30D7\u30ED\u30D1\u30C6\u30A3{0}\u306E\u5024\u309 doclet.Default=\u30C7\u30D5\u30A9\u30EB\u30C8: doclet.Parameters=\u30D1\u30E9\u30E1\u30FC\u30BF: doclet.TypeParameters=\u578B\u30D1\u30E9\u30E1\u30FC\u30BF: +doclet.RecordComponents=\u30EC\u30B3\u30FC\u30C9\u30FB\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8: doclet.Parameters_warn=@param argument "{0}"\u306F\u30D1\u30E9\u30E1\u30FC\u30BF\u540D\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002 doclet.Parameters_dup_warn=\u30D1\u30E9\u30E1\u30FC\u30BF"{0}"\u304C2\u56DE\u4EE5\u4E0A\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u5316\u3055\u308C\u3066\u3044\u307E\u3059\u3002 -doclet.Type_Parameters_warn=@param argument "{0}"\u306F\u578B\u30D1\u30E9\u30E1\u30FC\u30BF\u540D\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002 -doclet.Type_Parameters_dup_warn=\u578B\u30D1\u30E9\u30E1\u30FC\u30BF"{0}"\u304C2\u56DE\u4EE5\u4E0A\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u5316\u3055\u308C\u3066\u3044\u307E\u3059\u3002 +doclet.TypeParameters_warn=@param argument "{0}"\u306F\u578B\u30D1\u30E9\u30E1\u30FC\u30BF\u306E\u540D\u524D\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002 +doclet.TypeParameters_dup_warn=\u578B\u30D1\u30E9\u30E1\u30FC\u30BF"{0}"\u304C2\u56DE\u4EE5\u4E0A\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u5316\u3055\u308C\u3066\u3044\u307E\u3059\u3002 +doclet.RecordComponents_warn=@param argument "{0}"\u306F\u30EC\u30B3\u30FC\u30C9\u30FB\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u306E\u540D\u524D\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002 +doclet.RecordComponents_dup_warn=\u30EC\u30B3\u30FC\u30C9\u30FB\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8"{0}"\u304C2\u56DE\u4EE5\u4E0A\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u5316\u3055\u308C\u3066\u3044\u307E\u3059\u3002 doclet.Returns=\u623B\u308A\u5024: doclet.Return_tag_on_void_method=\u623B\u308A\u5024\u306E\u578B\u304Cvoid\u306E\u30E1\u30BD\u30C3\u30C9\u3067\u306F@return\u30BF\u30B0\u3092\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093\u3002 doclet.See_Also=\u95A2\u9023\u9805\u76EE: @@ -128,6 +131,7 @@ doclet.Property_Summary=\u30D7\u30ED\u30D1\u30C6\u30A3\u306E\u6982\u8981 doclet.Enum_Constant_Summary=\u5217\u6319\u578B\u5B9A\u6570\u306E\u6982\u8981 doclet.Constructor_Summary=\u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\u30BF\u306E\u6982\u8981 doclet.Method_Summary=\u30E1\u30BD\u30C3\u30C9\u306E\u6982\u8981 +doclet.Record_Summary=\u30EC\u30B3\u30FC\u30C9\u30FB\u30B5\u30DE\u30EA\u30FC doclet.Interfaces=\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9 doclet.Enums=\u5217\u6319 doclet.AnnotationTypes=\u6CE8\u91C8\u578B @@ -151,6 +155,7 @@ doclet.interface=\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9 doclet.interfaces=\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9 doclet.class=\u30AF\u30E9\u30B9 doclet.classes=\u30AF\u30E9\u30B9 +doclet.Record=\u30EC\u30B3\u30FC\u30C9 doclet.Error=\u30A8\u30E9\u30FC doclet.error=\u30A8\u30E9\u30FC doclet.errors=\u30A8\u30E9\u30FC @@ -246,3 +251,35 @@ doclet.enum_valueof_doc.return=\u6307\u5B9A\u3057\u305F\u540D\u524D\u306E\u5217\ doclet.enum_valueof_doc.throws_ila=\u3053\u306E\u5217\u6319\u578B\u306B\u3001\u6307\u5B9A\u3057\u305F\u540D\u524D\u306E\u5B9A\u6570\u304C\u306A\u3044\u5834\u5408 doclet.enum_valueof_doc.throws_npe=\u5F15\u6570\u304Cnull\u306E\u5834\u5408 + + +#Documentation for records +doclet.record_constructor_doc.fullbody={0}\u30EC\u30B3\u30FC\u30C9\u306E\u30A4\u30F3\u30B9\u30BF\u30F3\u30B9\u3092\u4F5C\u6210\u3057\u307E\u3059\u3002 + +doclet.record_constructor_doc.param_name={0}\u30EC\u30B3\u30FC\u30C9\u30FB\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u306E\u5024 + +doclet.record_equals_doc.fullbody.head=\u4ED6\u306E\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u304C\u3053\u308C\u3068"\u7B49\u3057\u3044"\u304B\u3069\u3046\u304B\u3092\u793A\u3057\u307E\u3059\u3002\u4ED6\u306E\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u304C\u540C\u3058\u30AF\u30E9\u30B9\u3067\u3042\u308A\u3001\u3059\u3079\u3066\u306E\u30EC\u30B3\u30FC\u30C9\u30FB\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u304C\u7B49\u3057\u3044\u5834\u5408\u3001\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u306F\u7B49\u3057\u304F\u306A\u308A\u307E\u3059\u3002 + +doclet.record_equals_doc.fullbody.tail.both=\u53C2\u7167\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u306F{@link java.util.Objects#equals(Object,Object) Objects::equals(Object,Object)}\u3068\u6BD4\u8F03\u3055\u308C\u3001\u30D7\u30EA\u30DF\u30C6\u30A3\u30D6\u30FB\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u306F'=='\u3068\u6BD4\u8F03\u3055\u308C\u307E\u3059\u3002 + +doclet.record_equals_doc.fullbody.tail.primitive=\u3053\u306E\u30EC\u30B3\u30FC\u30C9\u5185\u306E\u3059\u3079\u3066\u306E\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u306F'=='\u3068\u6BD4\u8F03\u3055\u308C\u307E\u3059\u3002 + +doclet.record_equals_doc.fullbody.tail.reference=\u3053\u306E\u30EC\u30B3\u30FC\u30C9\u5185\u306E\u3059\u3079\u3066\u306E\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u306F{@link java.util.Objects#equals(Object,Object) Objects::equals(Object,Object)}\u3068\u6BD4\u8F03\u3055\u308C\u307E\u3059\u3002 + +doclet.record_equals_doc.param_name=\u6BD4\u8F03\u3059\u308B\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8 + +doclet.record_equals_doc.return=\u3053\u306E\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u304C{0}\u5F15\u6570\u3068\u540C\u3058\u3067\u3042\u308B\u5834\u5408\u306Ftrue\u3001\u305D\u308C\u4EE5\u5916\u306E\u5834\u5408\u306Ffalse\u3002 + +doclet.record_hashCode_doc.fullbody=\u3053\u306E\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u306E\u30CF\u30C3\u30B7\u30E5\u30FB\u30B3\u30FC\u30C9\u5024\u3092\u8FD4\u3057\u307E\u3059\u3002\u5024\u306F\u3001\u5404\u30EC\u30B3\u30FC\u30C9\u30FB\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u306E\u30CF\u30C3\u30B7\u30E5\u30FB\u30B3\u30FC\u30C9\u304B\u3089\u5C0E\u51FA\u3055\u308C\u307E\u3059\u3002 + +doclet.record_hashCode_doc.return=\u3053\u306E\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u306E\u30CF\u30C3\u30B7\u30E5\u30FB\u30B3\u30FC\u30C9\u5024 + +doclet.record_toString_doc.fullbody=\u3053\u306E\u30EC\u30B3\u30FC\u30C9\u306E\u6587\u5B57\u5217\u8868\u73FE\u3092\u8FD4\u3057\u307E\u3059\u3002\u8868\u73FE\u306B\u306F\u3001\u578B\u306E\u540D\u524D\u306B\u7D9A\u3051\u3066\u5404\u30EC\u30B3\u30FC\u30C9\u30FB\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u306E\u540D\u524D\u3068\u5024\u304C\u542B\u307E\u308C\u307E\u3059\u3002 + +doclet.record_toString_doc.return=\u3053\u306E\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u306E\u6587\u5B57\u5217\u8868\u73FE + +doclet.record_accessor_doc.fullbody={0}\u30EC\u30B3\u30FC\u30C9\u30FB\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u306E\u5024\u304C\u8FD4\u3055\u308C\u307E\u3059\u3002 + +doclet.record_accessor_doc.return={0}\u30EC\u30B3\u30FC\u30C9\u30FB\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u306E\u5024 + +doclet.record_field_doc.fullbody={0}\u30EC\u30B3\u30FC\u30C9\u30FB\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u306E\u30D5\u30A3\u30FC\u30EB\u30C9\u3067\u3059\u3002 diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/doclets_zh_CN.properties b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/doclets_zh_CN.properties index 33a2a85492e..4c61aad5be9 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/doclets_zh_CN.properties +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/doclets_zh_CN.properties @@ -84,10 +84,13 @@ doclet.PropertySetterWithName=\u8BBE\u7F6E\u5C5E\u6027{0}\u7684\u503C\u3002 doclet.Default=\u9ED8\u8BA4\u503C: doclet.Parameters=\u53C2\u6570: doclet.TypeParameters=\u7C7B\u578B\u53C2\u6570: +doclet.RecordComponents=\u8BB0\u5F55\u7EC4\u4EF6\uFF1A doclet.Parameters_warn=@param argument "{0}" \u4E0D\u662F\u53C2\u6570\u540D\u79F0\u3002 doclet.Parameters_dup_warn=\u591A\u6B21\u5BF9\u53C2\u6570 "{0}" \u8FDB\u884C\u6587\u6863\u5316\u3002 -doclet.Type_Parameters_warn=@param argument "{0}" \u4E0D\u662F\u7C7B\u578B\u53C2\u6570\u540D\u79F0\u3002 -doclet.Type_Parameters_dup_warn=\u591A\u6B21\u5BF9\u7C7B\u578B\u53C2\u6570 "{0}" \u8FDB\u884C\u6587\u6863\u5316\u3002 +doclet.TypeParameters_warn=@param argument "{0}" \u4E0D\u662F\u7C7B\u578B\u53C2\u6570\u540D\u79F0\u3002 +doclet.TypeParameters_dup_warn=\u591A\u6B21\u5BF9\u7C7B\u578B\u53C2\u6570 "{0}" \u8FDB\u884C\u6587\u6863\u5316\u3002 +doclet.RecordComponents_warn=@param argument "{0}" \u4E0D\u662F\u8BB0\u5F55\u7EC4\u4EF6\u540D\u79F0\u3002 +doclet.RecordComponents_dup_warn=\u591A\u6B21\u5BF9\u8BB0\u5F55\u7EC4\u4EF6 "{0}" \u8FDB\u884C\u6587\u6863\u5316\u3002 doclet.Returns=\u8FD4\u56DE: doclet.Return_tag_on_void_method=\u4E0D\u80FD\u5728\u8FD4\u56DE\u7C7B\u578B\u4E3A\u7A7A\u7684\u65B9\u6CD5\u4E2D\u4F7F\u7528 @return \u6807\u8BB0\u3002 doclet.See_Also=\u53E6\u8BF7\u53C2\u9605: @@ -128,6 +131,7 @@ doclet.Property_Summary=\u5C5E\u6027\u6982\u8981 doclet.Enum_Constant_Summary=\u679A\u4E3E\u5E38\u91CF\u6982\u8981 doclet.Constructor_Summary=\u6784\u9020\u5668\u6982\u8981 doclet.Method_Summary=\u65B9\u6CD5\u6982\u8981 +doclet.Record_Summary=\u8BB0\u5F55\u6982\u8981 doclet.Interfaces=\u63A5\u53E3 doclet.Enums=\u679A\u4E3E doclet.AnnotationTypes=\u6CE8\u91CA\u7C7B\u578B @@ -151,6 +155,7 @@ doclet.interface=\u63A5\u53E3 doclet.interfaces=\u63A5\u53E3 doclet.class=\u7C7B doclet.classes=\u7C7B +doclet.Record=\u8BB0\u5F55 doclet.Error=\u9519\u8BEF doclet.error=\u9519\u8BEF doclet.errors=\u9519\u8BEF @@ -246,3 +251,35 @@ doclet.enum_valueof_doc.return=\u8FD4\u56DE\u5E26\u6709\u6307\u5B9A\u540D\u79F0\ doclet.enum_valueof_doc.throws_ila=\u5982\u679C\u8BE5\u679A\u4E3E\u7C7B\u578B\u6CA1\u6709\u5E26\u6709\u6307\u5B9A\u540D\u79F0\u7684\u5E38\u91CF doclet.enum_valueof_doc.throws_npe=\u5982\u679C\u53C2\u6570\u4E3A\u7A7A\u503C + + +#Documentation for records +doclet.record_constructor_doc.fullbody=\u521B\u5EFA {0} \u8BB0\u5F55\u7684\u5B9E\u4F8B\u3002 + +doclet.record_constructor_doc.param_name={0} \u8BB0\u5F55\u7EC4\u4EF6\u7684\u503C + +doclet.record_equals_doc.fullbody.head=\u6307\u793A\u67D0\u4E2A\u5176\u4ED6\u5BF9\u8C61\u662F\u5426\u201C\u7B49\u4E8E\u201D\u6B64\u5BF9\u8C61\u3002\u5982\u679C\u4E24\u4E2A\u5BF9\u8C61\u5C5E\u4E8E\u540C\u4E00\u4E2A\u7C7B\uFF0C\u800C\u4E14\u6240\u6709\u8BB0\u5F55\u7EC4\u4EF6\u90FD\u76F8\u7B49\uFF0C\u5219\u8FD9\u4E24\u4E2A\u5BF9\u8C61\u76F8\u7B49\u3002 + +doclet.record_equals_doc.fullbody.tail.both=\u4F7F\u7528 {@link java.util.Objects#equals(Object,Object) Objects::equals(Object,Object)} \u5BF9\u53C2\u8003\u7EC4\u4EF6\u8FDB\u884C\u6BD4\u8F83\uFF1B\u4F7F\u7528 '==' \u5BF9\u57FA\u5143\u7EC4\u4EF6\u8FDB\u884C\u6BD4\u8F83 + +doclet.record_equals_doc.fullbody.tail.primitive=\u6B64\u8BB0\u5F55\u4E2D\u7684\u6240\u6709\u7EC4\u4EF6\u90FD\u4F7F\u7528 '==' \u8FDB\u884C\u6BD4\u8F83\u3002 + +doclet.record_equals_doc.fullbody.tail.reference=\u6B64\u8BB0\u5F55\u4E2D\u7684\u6240\u6709\u7EC4\u4EF6\u90FD\u4F7F\u7528 {@link java.util.Objects#equals(Object,Object) Objects::equals(Object,Object)} \u8FDB\u884C\u6BD4\u8F83\u3002 + +doclet.record_equals_doc.param_name=\u8981\u4E0E\u4E4B\u8FDB\u884C\u6BD4\u8F83\u7684\u5BF9\u8C61 + +doclet.record_equals_doc.return=\u5982\u679C\u6B64\u5BF9\u8C61\u4E0E {0} \u53C2\u6570\u76F8\u540C\uFF0C\u5219\u4E3A true\uFF1B\u5426\u5219\u4E3A false\u3002 + +doclet.record_hashCode_doc.fullbody=\u8FD4\u56DE\u6B64\u5BF9\u8C61\u7684\u54C8\u5E0C\u4EE3\u7801\u503C\u3002\u6B64\u503C\u6D3E\u751F\u81EA\u6BCF\u4E2A\u8BB0\u5F55\u7EC4\u4EF6\u7684\u54C8\u5E0C\u4EE3\u7801\u3002 + +doclet.record_hashCode_doc.return=\u6B64\u5BF9\u8C61\u7684\u54C8\u5E0C\u4EE3\u7801\u503C + +doclet.record_toString_doc.fullbody=\u8FD4\u56DE\u6B64\u8BB0\u5F55\u7684\u5B57\u7B26\u4E32\u8868\u793A\u5F62\u5F0F\u3002\u6B64\u8868\u793A\u5F62\u5F0F\u5305\u542B\u7C7B\u578B\u7684\u540D\u79F0\uFF0C\u540E\u8DDF\u6BCF\u4E2A\u8BB0\u5F55\u7EC4\u4EF6\u7684\u540D\u79F0\u548C\u503C\u3002 + +doclet.record_toString_doc.return=\u6B64\u5BF9\u8C61\u7684\u5B57\u7B26\u4E32\u8868\u793A\u5F62\u5F0F + +doclet.record_accessor_doc.fullbody=\u8FD4\u56DE {0} \u8BB0\u5F55\u7EC4\u4EF6\u7684\u503C\u3002 + +doclet.record_accessor_doc.return={0} \u8BB0\u5F55\u7EC4\u4EF6\u7684\u503C + +doclet.record_field_doc.fullbody={0} \u8BB0\u5F55\u7EC4\u4EF6\u7684\u5B57\u6BB5\u3002 diff --git a/src/jdk.jlink/share/classes/jdk/tools/jlink/resources/jlink_ja.properties b/src/jdk.jlink/share/classes/jdk/tools/jlink/resources/jlink_ja.properties index f07aea1cccb..bab9737983e 100644 --- a/src/jdk.jlink/share/classes/jdk/tools/jlink/resources/jlink_ja.properties +++ b/src/jdk.jlink/share/classes/jdk/tools/jlink/resources/jlink_ja.properties @@ -31,9 +31,9 @@ main.opt.help=\ -h\u3001--help\u3001-? \u3053\u306E\u30D main.opt.version=\ --version \u30D0\u30FC\u30B8\u30E7\u30F3\u60C5\u5831 -main.opt.module-path=\ -p, --module-path \u30E2\u30B8\u30E5\u30FC\u30EB\u30FB\u30D1\u30B9 +main.opt.module-path=\ -p, --module-path \u30E2\u30B8\u30E5\u30FC\u30EB\u30FB\u30D1\u30B9\u3002\n \u6307\u5B9A\u3055\u308C\u3066\u3044\u306A\u3044\u5834\u5408\u3001JDK\u306Ejmods\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\n \u304C\u4F7F\u7528\u3055\u308C\u307E\u3059(\u5B58\u5728\u3059\u308B\u5834\u5408)\u3002\u6307\u5B9A\u3055\u308C\u3066\n \u3044\u308B\u304Cjava.base\u30E2\u30B8\u30E5\u30FC\u30EB\u3092\u542B\u307E\u306A\u3044\u5834\u5408\u306F\u3001\n JDK\u306Ejmods\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u304C\u8FFD\u52A0\u3055\u308C\u307E\u3059\n (\u5B58\u5728\u3059\u308B\u5834\u5408)\u3002 -main.opt.add-modules=\ --add-modules [,...] \u89E3\u6C7A\u3059\u308B\u30EB\u30FC\u30C8\u30FB\u30E2\u30B8\u30E5\u30FC\u30EB +main.opt.add-modules=\ --add-modules [,...] \u521D\u671F\u30E2\u30B8\u30E5\u30FC\u30EB\u306B\u52A0\u3048\u3066\u89E3\u6C7A\u3059\u308B\u30EB\u30FC\u30C8\u30FB\u30E2\u30B8\u30E5\u30FC\u30EB\u3002\n \u306FALL-MODULE-PATH\u306B\u3059\u308B\u3053\u3068\u3082\u3067\u304D\u307E\u3059\u3002 main.opt.limit-modules=\ --limit-modules [,...] \u53C2\u7167\u53EF\u80FD\u306A\u30E2\u30B8\u30E5\u30FC\u30EB\u306E\u9818\u57DF\u3092\u5236\u9650\u3057\u307E\u3059 @@ -72,7 +72,7 @@ err.launcher.main.class.empty:\u8D77\u52D5\u30C4\u30FC\u30EB\u306E\u30E1\u30A4\u err.launcher.module.name.empty:\u8D77\u52D5\u30C4\u30FC\u30EB\u306E\u30E2\u30B8\u30E5\u30FC\u30EB\u540D\u306F\u7A7A\u306B\u3067\u304D\u307E\u305B\u3093: {0} err.launcher.value.format:\u8D77\u52D5\u30C4\u30FC\u30EB\u306E\u5024\u306F=[/]\u306E\u5F62\u5F0F\u306B\u3057\u3066\u304F\u3060\u3055\u3044: {0} err.output.must.be.specified:--output\u3092\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059 -err.modulepath.must.be.specified:--module-path\u3092\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059 +err.modulepath.must.be.specified:--module-path\u304C\u6307\u5B9A\u3055\u308C\u3066\u304A\u3089\u305A\u3001\u3053\u306E\u30E9\u30F3\u30BF\u30A4\u30E0\u30FB\u30A4\u30E1\u30FC\u30B8\u306Bjmods\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u305B\u3093\u3002 err.mods.must.be.specified:{0}\u306B\u30E2\u30B8\u30E5\u30FC\u30EB\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093 err.path.not.found=\u30D1\u30B9\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093: {0} err.path.not.valid=\u7121\u52B9\u306A\u30D1\u30B9: {0} diff --git a/src/jdk.jlink/share/classes/jdk/tools/jlink/resources/jlink_zh_CN.properties b/src/jdk.jlink/share/classes/jdk/tools/jlink/resources/jlink_zh_CN.properties index 7666581bb4e..a721418187a 100644 --- a/src/jdk.jlink/share/classes/jdk/tools/jlink/resources/jlink_zh_CN.properties +++ b/src/jdk.jlink/share/classes/jdk/tools/jlink/resources/jlink_zh_CN.properties @@ -31,9 +31,9 @@ main.opt.help=\ -h, --help, -? \u8F93\u51FA\u6B64\u5E2E\ main.opt.version=\ --version \u7248\u672C\u4FE1\u606F -main.opt.module-path=\ -p, --module-path <\u8DEF\u5F84> \u6A21\u5757\u8DEF\u5F84 +main.opt.module-path=\ -p, --module-path \u6A21\u5757\u8DEF\u5F84\u3002\n \u5982\u679C\u672A\u6307\u5B9A\uFF0C\u5C06\u4F7F\u7528 JDK \u7684 jmods \n \u76EE\u5F55\uFF08\u5982\u679C\u5B58\u5728\u8BE5\u76EE\u5F55\uFF09\u3002\u5982\u679C\u6307\u5B9A\uFF0C\n \u4F46\u5B83\u4E0D\u5305\u542B java.base \u6A21\u5757\uFF0C\n \u5219\u5C06\u6DFB\u52A0 JDK \u7684 jmods \u76EE\u5F55\n \uFF08\u5982\u679C\u5B58\u5728\u8BE5\u76EE\u5F55\uFF09\u3002 -main.opt.add-modules=\ --add-modules <\u6A21\u5757>[,<\u6A21\u5757>...] \u8981\u89E3\u6790\u7684\u6839\u6A21\u5757 +main.opt.add-modules=\ --add-modules [,...] \u9664\u4E86\u521D\u59CB\u6A21\u5757\u4E4B\u5916\u8981\u89E3\u6790\u7684\n \u6839\u6A21\u5757\u3002 \u8FD8\u53EF\u4EE5\u4E3A ALL-MODULE-PATH\u3002 main.opt.limit-modules=\ --limit-modules <\u6A21\u5757>[,<\u6A21\u5757>...] \u9650\u5236\u53EF\u89C2\u5BDF\u6A21\u5757\u7684\u9886\u57DF @@ -72,7 +72,7 @@ err.launcher.main.class.empty:\u542F\u52A8\u7A0B\u5E8F\u4E3B\u7C7B\u540D\u4E0D\u err.launcher.module.name.empty:\u542F\u52A8\u7A0B\u5E8F\u6A21\u5757\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A: {0} err.launcher.value.format:\u542F\u52A8\u7A0B\u5E8F\u503C\u5E94\u4F7F\u7528\u201C<\u547D\u4EE4>=<\u6A21\u5757>[/<\u4E3B\u7C7B>]\u201D\u683C\u5F0F: {0} err.output.must.be.specified:\u5FC5\u987B\u6307\u5B9A --output -err.modulepath.must.be.specified:\u5FC5\u987B\u6307\u5B9A --module-path +err.modulepath.must.be.specified:\u672A\u6307\u5B9A --module-path\uFF0C\u6B64\u8FD0\u884C\u65F6\u6620\u50CF\u4E0D\u5305\u542B jmods \u76EE\u5F55\u3002 err.mods.must.be.specified:\u6CA1\u6709\u5C06\u4EFB\u4F55\u6A21\u5757\u6307\u5B9A\u5230{0} err.path.not.found=\u627E\u4E0D\u5230\u8DEF\u5F84: {0} err.path.not.valid=\u65E0\u6548\u8DEF\u5F84: {0} diff --git a/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/resources/l10n_ja.properties b/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/resources/l10n_ja.properties index c8693af6f66..6c401bb8e9f 100644 --- a/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/resources/l10n_ja.properties +++ b/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/resources/l10n_ja.properties @@ -243,7 +243,7 @@ help.debug =jshell\u30C4\u30FC\u30EB\u5B9F\u88C5\u306B\u5BFE\u3059\u308B\u30C7\u help.help.summary = jshell\u30C4\u30FC\u30EB\u306E\u4F7F\u7528\u65B9\u6CD5\u306B\u95A2\u3059\u308B\u60C5\u5831\u3092\u53D6\u5F97\u3057\u307E\u3059 help.help.args = [|] -help.help =jshell\u30C4\u30FC\u30EB\u306E\u4F7F\u7528\u65B9\u6CD5\u306B\u95A2\u3059\u308B\u60C5\u5831\u3092\u8868\u793A\u3057\u307E\u3059\u3002\n/help\n\tjshell\u30C4\u30FC\u30EB\u30FB\u30B3\u30DE\u30F3\u30C9\u304A\u3088\u3073\u30D8\u30EB\u30D7\u306E\u30B5\u30D6\u30B8\u30A7\u30AF\u30C8\u3092\u30EA\u30B9\u30C8\u3057\u307E\u3059\n\n/help \n\t\u6307\u5B9A\u3057\u305F\u30B3\u30DE\u30F3\u30C9\u306B\u95A2\u3059\u308B\u60C5\u5831\u3092\u8868\u793A\u3057\u307E\u3059\u3002\u30B9\u30E9\u30C3\u30B7\u30E5\u3092\u542B\u3081\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002\n\t\u5FC5\u8981\u306A\u306E\u306F\u30B3\u30DE\u30F3\u30C9\u306E\u6700\u521D\u306E\u6570\u6587\u5B57\u306E\u307F\u3067\u3059 -- \u8907\u6570\u3042\u308B\u5834\u5408\u306F\n\t\u305D\u308C\u305E\u308C\u8868\u793A\u3055\u308C\u307E\u3059\u3002\u4F8B: /help /li\n\n/help \n\t\u6307\u5B9A\u3057\u305F\u30D8\u30EB\u30D7\u306E\u30B5\u30D6\u30B8\u30A7\u30AF\u30C8\u306B\u95A2\u3059\u308B\u60C5\u5831\u3092\u8868\u793A\u3057\u307E\u3059\u3002\u4F8B: /help intro +help.help =jshell\u30C4\u30FC\u30EB\u306E\u4F7F\u7528\u65B9\u6CD5\u306B\u95A2\u3059\u308B\u60C5\u5831\u3092\u8868\u793A\u3057\u307E\u3059\u3002\n/help\n\tjshell\u30C4\u30FC\u30EB\u30FB\u30B3\u30DE\u30F3\u30C9\u304A\u3088\u3073\u30D8\u30EB\u30D7\u306E\u30B5\u30D6\u30B8\u30A7\u30AF\u30C8\u3092\u30EA\u30B9\u30C8\u3057\u307E\u3059\n\n/help \n\t\u6307\u5B9A\u3057\u305F\u30B3\u30DE\u30F3\u30C9\u306B\u95A2\u3059\u308B\u60C5\u5831\u3092\u8868\u793A\u3057\u307E\u3059\u3002\n\t\u5FC5\u8981\u306A\u306E\u306F\u30B3\u30DE\u30F3\u30C9\u306E\u6700\u521D\u306E\u6570\u6587\u5B57\u306E\u307F\u3067\u3059 -- \u4E00\u81F4\u304C\u8907\u6570\u3042\u308B\u5834\u5408\u306F\n\t\u305D\u308C\u305E\u308C\u8868\u793A\u3055\u308C\u307E\u3059\u3002\u4F8B: /help /li\n\n/help \n\t\u6307\u5B9A\u3057\u305F\u30D8\u30EB\u30D7\u306E\u30B5\u30D6\u30B8\u30A7\u30AF\u30C8\u306B\u95A2\u3059\u308B\u60C5\u5831\u3092\u8868\u793A\u3057\u307E\u3059\u3002\u4F8B: /help intro help.set.summary = \u69CB\u6210\u60C5\u5831\u3092\u8A2D\u5B9A\u3057\u307E\u3059 help.set.args = editor|start|feedback|mode|prompt|truncation|format ... @@ -251,7 +251,7 @@ help.set =\u6B21\u306E\u3088\u3046\u306Ajshell\u30C4\u30FC\u30EB\u69CB\u6210\u60 help.quest.summary = jshell\u30C4\u30FC\u30EB\u306E\u4F7F\u7528\u65B9\u6CD5\u306B\u95A2\u3059\u308B\u60C5\u5831\u3092\u53D6\u5F97\u3057\u307E\u3059 help.quest.args = [|] -help.quest =jshell\u30C4\u30FC\u30EB\u306E\u4F7F\u7528\u65B9\u6CD5\u306B\u95A2\u3059\u308B\u60C5\u5831\u3092\u8868\u793A\u3057\u307E\u3059(/help\u306E\u7701\u7565\u5F62)\u3002\n/?\n\t\u30B3\u30DE\u30F3\u30C9\u304A\u3088\u3073\u30D8\u30EB\u30D7\u306E\u30B5\u30D6\u30B8\u30A7\u30AF\u30C8\u306E\u30EA\u30B9\u30C8\u3092\u8868\u793A\u3057\u307E\u3059\n/? \n\t\u6307\u5B9A\u3057\u305F\u30B3\u30DE\u30F3\u30C9\u306B\u95A2\u3059\u308B\u60C5\u5831\u3092\u8868\u793A\u3057\u307E\u3059\u3002\u30B9\u30E9\u30C3\u30B7\u30E5\u3092\u542B\u3081\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002\n\t\u5FC5\u8981\u306A\u306E\u306F\u30B3\u30DE\u30F3\u30C9\u306E\u6700\u521D\u306E\u6570\u6587\u5B57\u306E\u307F\u3067\u3059 -- \u8907\u6570\u4E00\u81F4\u3059\u308B\u5834\u5408\u306F\n\t\u305D\u308C\u305E\u308C\u8868\u793A\u3055\u308C\u307E\u3059\u3002\u4F8B: /? /li\n/? \n\t\u6307\u5B9A\u3057\u305F\u30D8\u30EB\u30D7\u306E\u30B5\u30D6\u30B8\u30A7\u30AF\u30C8\u306B\u95A2\u3059\u308B\u60C5\u5831\u3092\u8868\u793A\u3057\u307E\u3059\u3002\u4F8B: /? intro +help.quest =jshell\u30C4\u30FC\u30EB\u306E\u4F7F\u7528\u65B9\u6CD5\u306B\u95A2\u3059\u308B\u60C5\u5831\u3092\u8868\u793A\u3057\u307E\u3059(/help\u306E\u7701\u7565\u5F62)\u3002\n/?\n\t\u30B3\u30DE\u30F3\u30C9\u304A\u3088\u3073\u30D8\u30EB\u30D7\u306E\u30B5\u30D6\u30B8\u30A7\u30AF\u30C8\u306E\u30EA\u30B9\u30C8\u3092\u8868\u793A\u3057\u307E\u3059\n/? \n\t\u6307\u5B9A\u3057\u305F\u30B3\u30DE\u30F3\u30C9\u306B\u95A2\u3059\u308B\u60C5\u5831\u3092\u8868\u793A\u3057\u307E\u3059\u3002\n\t\u5FC5\u8981\u306A\u306E\u306F\u30B3\u30DE\u30F3\u30C9\u306E\u6700\u521D\u306E\u6570\u6587\u5B57\u306E\u307F\u3067\u3059 -- \u4E00\u81F4\u304C\u8907\u6570\u3042\u308B\u5834\u5408\u306F\n\t\u305D\u308C\u305E\u308C\u8868\u793A\u3055\u308C\u307E\u3059\u3002\u4F8B: /? /li\n/? \n\t\u6307\u5B9A\u3057\u305F\u30D8\u30EB\u30D7\u306E\u30B5\u30D6\u30B8\u30A7\u30AF\u30C8\u306B\u95A2\u3059\u308B\u60C5\u5831\u3092\u8868\u793A\u3057\u307E\u3059\u3002\u4F8B: /? intro help.bang.summary = \u6700\u5F8C\u306E\u30B9\u30CB\u30DA\u30C3\u30C8\u3092\u518D\u5B9F\u884C\u3057\u307E\u3059 -- /help rerun\u3092\u53C2\u7167\u3057\u3066\u304F\u3060\u3055\u3044 help.bang.args = diff --git a/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/resources/l10n_zh_CN.properties b/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/resources/l10n_zh_CN.properties index 22ec62d5a77..a91d50d4d26 100644 --- a/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/resources/l10n_zh_CN.properties +++ b/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/resources/l10n_zh_CN.properties @@ -242,7 +242,7 @@ help.debug =\u663E\u793A jshell \u5DE5\u5177\u5B9E\u73B0\u7684\u8C03\u8BD5\u4FE1 help.help.summary = \u83B7\u53D6\u6709\u5173\u4F7F\u7528 jshell \u5DE5\u5177\u7684\u4FE1\u606F help.help.args = [|] -help.help =\u663E\u793A\u6709\u5173\u4F7F\u7528 jshell \u5DE5\u5177\u7684\u4FE1\u606F\u3002\n/help\n\t\u5217\u51FA jshell \u5DE5\u5177\u547D\u4EE4\u548C\u5E2E\u52A9\u4E3B\u9898\n\n/help <\u547D\u4EE4>\n\t\u663E\u793A\u6709\u5173\u6307\u5B9A\u547D\u4EE4\u7684\u4FE1\u606F\u3002\u5FC5\u987B\u5305\u542B\u659C\u6760\u3002\n\t\u53EA\u9700\u8981\u547D\u4EE4\u7684\u524D\u51E0\u4E2A\u5B57\u6BCD -- \u5982\u679C\u6709\u591A\u4E2A\u5339\u914D\u9879\uFF0C\n\t\u5219\u5C06\u663E\u793A\u6240\u6709\u5B57\u6BCD\u3002\u793A\u4F8B\uFF1A/help /li\n\n/help <\u4E3B\u9898>\n\t\u663E\u793A\u6709\u5173\u6307\u5B9A\u5E2E\u52A9\u4E3B\u9898\u7684\u4FE1\u606F\u3002\u793A\u4F8B\uFF1A/help intro +help.help =\u663E\u793A\u6709\u5173\u4F7F\u7528 jshell \u5DE5\u5177\u7684\u4FE1\u606F\u3002\n/help\n\t\u5217\u51FA jshell \u5DE5\u5177\u547D\u4EE4\u548C\u5E2E\u52A9\u4E3B\u9898\n\n/help \n\t\u663E\u793A\u6709\u5173\u6307\u5B9A\u547D\u4EE4\u7684\u4FE1\u606F\u3002\n\t\u53EA\u9700\u8F93\u5165\u547D\u4EE4\u7684\u524D\u51E0\u4E2A\u5B57\u6BCD -- \u5982\u679C\u6709\u591A\u4E2A\u5339\u914D\u9879\uFF0C\n\t\u5219\u5C06\u663E\u793A\u9879\u3002\u793A\u4F8B\uFF1A/help /li\n\n/help \n\t\u663E\u793A\u6709\u5173\u6307\u5B9A\u5E2E\u52A9\u4E3B\u9898\u7684\u4FE1\u606F\u3002\u793A\u4F8B\uFF1A/help intro help.set.summary = \u8BBE\u7F6E\u914D\u7F6E\u4FE1\u606F help.set.args = editor|start|feedback|mode|prompt|truncation|format ... @@ -250,7 +250,7 @@ help.set =\u8BBE\u7F6E jshell \u5DE5\u5177\u914D\u7F6E\u4FE1\u606F\uFF0C\u5305\u help.quest.summary = \u83B7\u53D6\u6709\u5173\u4F7F\u7528 jshell \u5DE5\u5177\u7684\u4FE1\u606F help.quest.args = [|] -help.quest =\u663E\u793A\u6709\u5173\u4F7F\u7528 jshell \u5DE5\u5177\u7684\u4FE1\u606F\uFF08\u5BF9 /help \u4F7F\u7528\u7F29\u5199\u5F62\u5F0F\uFF09\u3002\n/?\n\t\u663E\u793A\u547D\u4EE4\u548C\u5E2E\u52A9\u4E3B\u9898\u7684\u5217\u8868\n/? <\u547D\u4EE4>\n\t\u663E\u793A\u6709\u5173\u6307\u5B9A\u547D\u4EE4\u7684\u4FE1\u606F\u3002\u5FC5\u987B\u5305\u542B\u659C\u6760\u3002\n\t\u53EA\u9700\u8981\u547D\u4EE4\u7684\u524D\u51E0\u4E2A\u5B57\u6BCD -- \u5982\u679C\u6709\u591A\u4E2A\n\t\u5339\u914D\u9879\uFF0C\u5219\u5C06\u663E\u793A\u6240\u6709\u5B57\u6BCD\u3002\u793A\u4F8B\uFF1A/? /li\n/? <\u4E3B\u9898>\n\t\u663E\u793A\u6709\u5173\u6307\u5B9A\u5E2E\u52A9\u4E3B\u9898\u7684\u4FE1\u606F\u3002\u793A\u4F8B\uFF1A/? intro +help.quest =\u663E\u793A\u6709\u5173\u4F7F\u7528 jshell \u5DE5\u5177\u7684\u4FE1\u606F\uFF08/help \u7684\u7F29\u5199\u5F62\u5F0F\uFF09\u3002\n/?\n\t\u663E\u793A\u547D\u4EE4\u548C\u5E2E\u52A9\u4E3B\u9898\u7684\u5217\u8868\n/? \n\t\u663E\u793A\u6709\u5173\u6307\u5B9A\u547D\u4EE4\u7684\u4FE1\u606F\u3002\n\t\u53EA\u9700\u8F93\u5165\u547D\u4EE4\u7684\u524D\u51E0\u4E2A\u5B57\u6BCD -- \u5982\u679C\u6709\u591A\u4E2A\n\t\u5339\u914D\u9879\uFF0C\u5219\u5C06\u663E\u793A\u6240\u6709\u9879\u3002\u793A\u4F8B\uFF1A/? /li\n/? \n\t\u663E\u793A\u6709\u5173\u6307\u5B9A\u5E2E\u52A9\u4E3B\u9898\u7684\u4FE1\u606F\u3002\u793A\u4F8B\uFF1A/? intro help.bang.summary = \u91CD\u65B0\u8FD0\u884C\u4E0A\u4E00\u4E2A\u7247\u6BB5 -- \u8BF7\u53C2\u9605 /help rerun help.bang.args = From 4df9b910029a4f1754a24d80be7470ce63196afe Mon Sep 17 00:00:00 2001 From: Jesper Wilhelmsson Date: Thu, 23 Jan 2020 02:36:42 +0100 Subject: [PATCH 04/50] Added tag jdk-14+33 for changeset f728b6c7f491 --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index 29f9479b8f7..24a1ee83ead 100644 --- a/.hgtags +++ b/.hgtags @@ -607,3 +607,4 @@ d54ce919da90dab361995bb4d87be9851f00537a jdk-14+31 d54ce919da90dab361995bb4d87be9851f00537a jdk-14+31 decd3d2953b640f1043ee76953ff89238bff92e8 jdk-14+31 2776da28515e087cc8849acf1e131a65ea7e77b6 jdk-14+32 +f728b6c7f4910d6bd6070cb4dde8393f4ba95113 jdk-14+33 From 2f2594d5d07826dcc100739d366788fe434b3375 Mon Sep 17 00:00:00 2001 From: Tom Rodriguez Date: Thu, 23 Jan 2020 08:43:22 -0800 Subject: [PATCH 05/50] 8231515: [Graal] Crash during exception throwing in InterpreterRuntime::resolve_invoke Reviewed-by: kvn, dlong, iveresov --- src/hotspot/share/aot/aotCodeHeap.cpp | 1 + src/hotspot/share/jvmci/jvmciCompilerToVM.hpp | 1 + .../share/jvmci/jvmciCompilerToVMInit.cpp | 2 + src/hotspot/share/jvmci/jvmciRuntime.cpp | 15 +- src/hotspot/share/jvmci/jvmciRuntime.hpp | 6 +- src/hotspot/share/jvmci/vmStructs_jvmci.cpp | 1 + .../jaotc/binformat/BinaryContainer.java | 10 +- .../compiler/core/test/SubprocessTest.java | 7 + .../compiler/core/gen/DebugInfoBuilder.java | 21 ++- .../compiler/core/gen/NodeLIRBuilder.java | 17 +-- .../aarch64/AArch64HotSpotBackend.java | 2 +- .../AArch64HotSpotDeoptimizeCallerOp.java | 4 +- .../aarch64/AArch64HotSpotDeoptimizeOp.java | 4 +- ...otSpotDeoptimizeWithExceptionCallerOp.java | 68 +++++++++ .../aarch64/AArch64HotSpotEpilogueOp.java | 4 +- .../aarch64/AArch64HotSpotLIRGenerator.java | 6 + .../hotspot/amd64/AMD64DeoptimizeOp.java | 4 +- .../hotspot/amd64/AMD64HotSpotBackend.java | 2 +- .../amd64/AMD64HotSpotDeoptimizeCallerOp.java | 4 +- ...otSpotDeoptimizeWithExceptionCallerOp.java | 75 ++++++++++ .../amd64/AMD64HotSpotLIRGenerator.java | 5 + .../hotspot/sparc/SPARCDeoptimizeOp.java | 4 +- .../hotspot/sparc/SPARCHotSpotBackend.java | 2 +- .../sparc/SPARCHotSpotDeoptimizeCallerOp.java | 4 +- ...otSpotDeoptimizeWithExceptionCallerOp.java | 77 ++++++++++ .../sparc/SPARCHotSpotLIRGenerator.java | 6 + .../test/HotSpotDeoptExplicitExceptions.java | 82 +++++++++++ .../test/HotSpotDeoptPostExceptions.java | 72 ++++++++++ .../hotspot/GraalHotSpotVMConfig.java | 5 +- .../hotspot/HotSpotDebugInfoBuilder.java | 41 +++++- .../compiler/hotspot/HotSpotHostBackend.java | 9 +- .../compiler/hotspot/HotSpotLIRGenerator.java | 12 ++ .../meta/DefaultHotSpotLoweringProvider.java | 8 +- .../meta/HotSpotHostForeignCallsProvider.java | 12 +- .../hotspot/meta/HotSpotNodePlugin.java | 60 +++++--- .../DeoptimizeWithExceptionInCallerNode.java | 63 ++++++++ .../hotspot/replacements/FastNotifyNode.java | 3 +- .../hotspot/stubs/CreateExceptionStub.java | 53 +++++-- .../graalvm/compiler/hotspot/stubs/Stub.java | 4 +- .../graalvm/compiler/java/BytecodeParser.java | 22 ++- .../graalvm/compiler/nodes/FrameState.java | 4 + .../nodes/extended/BytecodeExceptionNode.java | 13 +- .../nodes/extended/ForeignCallNode.java | 2 +- .../nodes/graphbuilderconf/NodePlugin.java | 6 +- .../test/ArrayStoreBytecodeExceptionTest.java | 34 +---- .../test/BytecodeExceptionTest.java | 25 ++-- .../test/ClassCastBytecodeExceptionTest.java | 136 ++++++++++-------- .../test/IndexOobBytecodeExceptionTest.java | 39 +---- .../test/NullBytecodeExceptionTest.java | 32 +---- 49 files changed, 834 insertions(+), 255 deletions(-) create mode 100644 src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotDeoptimizeWithExceptionCallerOp.java create mode 100644 src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotDeoptimizeWithExceptionCallerOp.java create mode 100644 src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotDeoptimizeWithExceptionCallerOp.java create mode 100644 src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotDeoptExplicitExceptions.java create mode 100644 src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotDeoptPostExceptions.java create mode 100644 src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/DeoptimizeWithExceptionInCallerNode.java diff --git a/src/hotspot/share/aot/aotCodeHeap.cpp b/src/hotspot/share/aot/aotCodeHeap.cpp index 0287a42bcf2..91569d2b70d 100644 --- a/src/hotspot/share/aot/aotCodeHeap.cpp +++ b/src/hotspot/share/aot/aotCodeHeap.cpp @@ -465,6 +465,7 @@ void AOTCodeHeap::link_shared_runtime_symbols() { SET_AOT_GLOBAL_SYMBOL_VALUE("_resolve_virtual_entry", address, SharedRuntime::get_resolve_virtual_call_stub()); SET_AOT_GLOBAL_SYMBOL_VALUE("_resolve_opt_virtual_entry", address, SharedRuntime::get_resolve_opt_virtual_call_stub()); SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_deopt_blob_unpack", address, SharedRuntime::deopt_blob()->unpack()); + SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_deopt_blob_unpack_with_exception_in_tls", address, SharedRuntime::deopt_blob()->unpack_with_exception_in_tls()); SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_deopt_blob_uncommon_trap", address, SharedRuntime::deopt_blob()->uncommon_trap()); SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_ic_miss_stub", address, SharedRuntime::get_ic_miss_stub()); SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_handle_wrong_method_stub", address, SharedRuntime::get_handle_wrong_method_stub()); diff --git a/src/hotspot/share/jvmci/jvmciCompilerToVM.hpp b/src/hotspot/share/jvmci/jvmciCompilerToVM.hpp index d85fc61018c..6ddc6cd4854 100644 --- a/src/hotspot/share/jvmci/jvmciCompilerToVM.hpp +++ b/src/hotspot/share/jvmci/jvmciCompilerToVM.hpp @@ -45,6 +45,7 @@ class CompilerToVM { static address SharedRuntime_ic_miss_stub; static address SharedRuntime_handle_wrong_method_stub; static address SharedRuntime_deopt_blob_unpack; + static address SharedRuntime_deopt_blob_unpack_with_exception_in_tls; static address SharedRuntime_deopt_blob_uncommon_trap; static size_t ThreadLocalAllocBuffer_alignment_reserve; diff --git a/src/hotspot/share/jvmci/jvmciCompilerToVMInit.cpp b/src/hotspot/share/jvmci/jvmciCompilerToVMInit.cpp index 3040272b9bc..e508be9f8bb 100644 --- a/src/hotspot/share/jvmci/jvmciCompilerToVMInit.cpp +++ b/src/hotspot/share/jvmci/jvmciCompilerToVMInit.cpp @@ -44,6 +44,7 @@ int CompilerToVM::Data::Method_extra_stack_entries; address CompilerToVM::Data::SharedRuntime_ic_miss_stub; address CompilerToVM::Data::SharedRuntime_handle_wrong_method_stub; address CompilerToVM::Data::SharedRuntime_deopt_blob_unpack; +address CompilerToVM::Data::SharedRuntime_deopt_blob_unpack_with_exception_in_tls; address CompilerToVM::Data::SharedRuntime_deopt_blob_uncommon_trap; size_t CompilerToVM::Data::ThreadLocalAllocBuffer_alignment_reserve; @@ -97,6 +98,7 @@ void CompilerToVM::Data::initialize(JVMCI_TRAPS) { SharedRuntime_ic_miss_stub = SharedRuntime::get_ic_miss_stub(); SharedRuntime_handle_wrong_method_stub = SharedRuntime::get_handle_wrong_method_stub(); SharedRuntime_deopt_blob_unpack = SharedRuntime::deopt_blob()->unpack(); + SharedRuntime_deopt_blob_unpack_with_exception_in_tls = SharedRuntime::deopt_blob()->unpack_with_exception_in_tls(); SharedRuntime_deopt_blob_uncommon_trap = SharedRuntime::deopt_blob()->uncommon_trap(); ThreadLocalAllocBuffer_alignment_reserve = ThreadLocalAllocBuffer::alignment_reserve(); diff --git a/src/hotspot/share/jvmci/jvmciRuntime.cpp b/src/hotspot/share/jvmci/jvmciRuntime.cpp index d4a29f6ee95..1aa470d5103 100644 --- a/src/hotspot/share/jvmci/jvmciRuntime.cpp +++ b/src/hotspot/share/jvmci/jvmciRuntime.cpp @@ -454,22 +454,31 @@ JRT_LEAF(jboolean, JVMCIRuntime::object_notifyAll(JavaThread *thread, oopDesc* o JRT_END -JRT_ENTRY(void, JVMCIRuntime::throw_and_post_jvmti_exception(JavaThread* thread, const char* exception, const char* message)) +JRT_BLOCK_ENTRY(int, JVMCIRuntime::throw_and_post_jvmti_exception(JavaThread* thread, const char* exception, const char* message)) + JRT_BLOCK; TempNewSymbol symbol = SymbolTable::new_symbol(exception); SharedRuntime::throw_and_post_jvmti_exception(thread, symbol, message); + JRT_BLOCK_END; + return caller_is_deopted(); JRT_END -JRT_ENTRY(void, JVMCIRuntime::throw_klass_external_name_exception(JavaThread* thread, const char* exception, Klass* klass)) +JRT_BLOCK_ENTRY(int, JVMCIRuntime::throw_klass_external_name_exception(JavaThread* thread, const char* exception, Klass* klass)) + JRT_BLOCK; ResourceMark rm(thread); TempNewSymbol symbol = SymbolTable::new_symbol(exception); SharedRuntime::throw_and_post_jvmti_exception(thread, symbol, klass->external_name()); + JRT_BLOCK_END; + return caller_is_deopted(); JRT_END -JRT_ENTRY(void, JVMCIRuntime::throw_class_cast_exception(JavaThread* thread, const char* exception, Klass* caster_klass, Klass* target_klass)) +JRT_BLOCK_ENTRY(int, JVMCIRuntime::throw_class_cast_exception(JavaThread* thread, const char* exception, Klass* caster_klass, Klass* target_klass)) + JRT_BLOCK; ResourceMark rm(thread); const char* message = SharedRuntime::generate_class_cast_message(caster_klass, target_klass); TempNewSymbol symbol = SymbolTable::new_symbol(exception); SharedRuntime::throw_and_post_jvmti_exception(thread, symbol, message); + JRT_BLOCK_END; + return caller_is_deopted(); JRT_END JRT_LEAF(void, JVMCIRuntime::log_object(JavaThread* thread, oopDesc* obj, bool as_string, bool newline)) diff --git a/src/hotspot/share/jvmci/jvmciRuntime.hpp b/src/hotspot/share/jvmci/jvmciRuntime.hpp index 155000aa9ab..27e7abb2257 100644 --- a/src/hotspot/share/jvmci/jvmciRuntime.hpp +++ b/src/hotspot/share/jvmci/jvmciRuntime.hpp @@ -332,10 +332,10 @@ class JVMCIRuntime: public CHeapObj { static jboolean validate_object(JavaThread* thread, oopDesc* parent, oopDesc* child); // used to throw exceptions from compiled JVMCI code - static void throw_and_post_jvmti_exception(JavaThread* thread, const char* exception, const char* message); + static int throw_and_post_jvmti_exception(JavaThread* thread, const char* exception, const char* message); // helper methods to throw exception with complex messages - static void throw_klass_external_name_exception(JavaThread* thread, const char* exception, Klass* klass); - static void throw_class_cast_exception(JavaThread* thread, const char* exception, Klass* caster_klass, Klass* target_klass); + static int throw_klass_external_name_exception(JavaThread* thread, const char* exception, Klass* klass); + static int throw_class_cast_exception(JavaThread* thread, const char* exception, Klass* caster_klass, Klass* target_klass); // Test only function static jint test_deoptimize_call_int(JavaThread* thread, int value); diff --git a/src/hotspot/share/jvmci/vmStructs_jvmci.cpp b/src/hotspot/share/jvmci/vmStructs_jvmci.cpp index 6721b800fac..677c7e2833d 100644 --- a/src/hotspot/share/jvmci/vmStructs_jvmci.cpp +++ b/src/hotspot/share/jvmci/vmStructs_jvmci.cpp @@ -48,6 +48,7 @@ static_field(CompilerToVM::Data, SharedRuntime_ic_miss_stub, address) \ static_field(CompilerToVM::Data, SharedRuntime_handle_wrong_method_stub, address) \ static_field(CompilerToVM::Data, SharedRuntime_deopt_blob_unpack, address) \ + static_field(CompilerToVM::Data, SharedRuntime_deopt_blob_unpack_with_exception_in_tls, address) \ static_field(CompilerToVM::Data, SharedRuntime_deopt_blob_uncommon_trap, address) \ \ static_field(CompilerToVM::Data, ThreadLocalAllocBuffer_alignment_reserve, size_t) \ diff --git a/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/BinaryContainer.java b/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/BinaryContainer.java index 0c35a871245..451669efd07 100644 --- a/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/BinaryContainer.java +++ b/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/BinaryContainer.java @@ -36,15 +36,16 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import org.graalvm.compiler.hotspot.GraalHotSpotVMConfig; +import org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration; +import org.graalvm.compiler.options.OptionValues; +import org.graalvm.compiler.serviceprovider.JavaVersionUtil; + import jdk.tools.jaotc.binformat.Symbol.Binding; import jdk.tools.jaotc.binformat.Symbol.Kind; import jdk.tools.jaotc.binformat.elf.JELFRelocObject; import jdk.tools.jaotc.binformat.macho.JMachORelocObject; import jdk.tools.jaotc.binformat.pecoff.JPECoffRelocObject; -import org.graalvm.compiler.hotspot.GraalHotSpotVMConfig; -import org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration; -import org.graalvm.compiler.options.OptionValues; -import org.graalvm.compiler.serviceprovider.JavaVersionUtil; /** * A format-agnostic container class that holds various components of a binary. @@ -145,6 +146,7 @@ public final class BinaryContainer implements SymbolTable { private static final String[][] map = { {"CompilerToVM::Data::SharedRuntime_deopt_blob_unpack", "_aot_deopt_blob_unpack"}, {"CompilerToVM::Data::SharedRuntime_deopt_blob_uncommon_trap", "_aot_deopt_blob_uncommon_trap"}, + {"CompilerToVM::Data::SharedRuntime_deopt_blob_unpack_with_exception_in_tls", "_aot_deopt_blob_unpack_with_exception_in_tls"}, {"CompilerToVM::Data::SharedRuntime_ic_miss_stub", "_aot_ic_miss_stub"}, {"CompilerToVM::Data::SharedRuntime_handle_wrong_method_stub", "_aot_handle_wrong_method_stub"}, {"SharedRuntime::exception_handler_for_return_address", "_aot_exception_handler_for_return_address"}, diff --git a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/SubprocessTest.java b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/SubprocessTest.java index 82e51665147..167b96431b0 100644 --- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/SubprocessTest.java +++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/SubprocessTest.java @@ -51,7 +51,14 @@ public abstract class SubprocessTest extends GraalCompilerTest { vmArgs.add(SubprocessUtil.PACKAGE_OPENING_OPTIONS); vmArgs.add("-D" + recursionPropName + "=true"); configSubprocess(vmArgs); + boolean verbose = Boolean.getBoolean(getClass().getSimpleName() + ".verbose"); + if (verbose) { + System.err.println(String.join(" ", vmArgs)); + } SubprocessUtil.Subprocess proc = java(vmArgs, "com.oracle.mxtool.junit.MxJUnitWrapper", getClass().getName()); + if (verbose) { + System.err.println(proc.output); + } assertTrue(proc.exitCode == 0, proc.toString() + " failed with exit code " + proc.exitCode); } } diff --git a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/gen/DebugInfoBuilder.java b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/gen/DebugInfoBuilder.java index dc1e9d25fbd..21c8f20469d 100644 --- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/gen/DebugInfoBuilder.java +++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/gen/DebugInfoBuilder.java @@ -41,6 +41,7 @@ import org.graalvm.compiler.nodes.ConstantNode; import org.graalvm.compiler.nodes.FrameState; import org.graalvm.compiler.nodes.ValueNode; import org.graalvm.compiler.nodes.spi.NodeValueMap; +import org.graalvm.compiler.nodes.spi.NodeWithState; import org.graalvm.compiler.nodes.util.GraphUtil; import org.graalvm.compiler.nodes.virtual.EscapeObjectState; import org.graalvm.compiler.nodes.virtual.VirtualBoxingNode; @@ -80,7 +81,7 @@ public class DebugInfoBuilder { protected final Queue pendingVirtualObjects = new ArrayDeque<>(); - public LIRFrameState build(FrameState topState, LabelRef exceptionEdge) { + public LIRFrameState build(NodeWithState node, FrameState topState, LabelRef exceptionEdge) { assert virtualObjects.size() == 0; assert objectStates.size() == 0; assert pendingVirtualObjects.size() == 0; @@ -100,7 +101,8 @@ public class DebugInfoBuilder { current = current.outerFrameState(); } while (current != null); - BytecodeFrame frame = computeFrameForState(topState); + assert verifyFrameState(node, topState); + BytecodeFrame frame = computeFrameForState(node, topState); VirtualObject[] virtualObjectsArray = null; if (virtualObjects.size() != 0) { @@ -223,7 +225,18 @@ public class DebugInfoBuilder { return new LIRFrameState(frame, virtualObjectsArray, exceptionEdge); } - protected BytecodeFrame computeFrameForState(FrameState state) { + /** + * Perform platform dependent verification of the FrameState. + * + * @param node the node using the state + * @param topState the state + * @return true if the validation succeeded + */ + protected boolean verifyFrameState(NodeWithState node, FrameState topState) { + return true; + } + + protected BytecodeFrame computeFrameForState(NodeWithState node, FrameState state) { try { assert state.bci != BytecodeFrame.INVALID_FRAMESTATE_BCI; assert state.bci != BytecodeFrame.UNKNOWN_BCI; @@ -249,7 +262,7 @@ public class DebugInfoBuilder { BytecodeFrame caller = null; if (state.outerFrameState() != null) { - caller = computeFrameForState(state.outerFrameState()); + caller = computeFrameForState(node, state.outerFrameState()); } if (!state.canProduceBytecodeFrame()) { diff --git a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/gen/NodeLIRBuilder.java b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/gen/NodeLIRBuilder.java index aa37a2a8140..474799fbe52 100644 --- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/gen/NodeLIRBuilder.java +++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/gen/NodeLIRBuilder.java @@ -104,6 +104,7 @@ import org.graalvm.compiler.nodes.extended.SwitchNode; import org.graalvm.compiler.nodes.spi.LIRLowerable; import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; import org.graalvm.compiler.nodes.spi.NodeValueMap; +import org.graalvm.compiler.nodes.spi.NodeWithState; import org.graalvm.compiler.nodes.virtual.VirtualObjectNode; import org.graalvm.compiler.options.OptionValues; @@ -735,26 +736,26 @@ public abstract class NodeLIRBuilder implements NodeLIRBuilderTool, LIRGeneratio if (!deopt.canDeoptimize()) { return null; } - return stateFor(getFrameState(deopt)); + return stateFor(deopt, getFrameState(deopt)); } public LIRFrameState stateWithExceptionEdge(DeoptimizingNode deopt, LabelRef exceptionEdge) { if (!deopt.canDeoptimize()) { return null; } - return stateForWithExceptionEdge(getFrameState(deopt), exceptionEdge); + return stateForWithExceptionEdge(deopt, getFrameState(deopt), exceptionEdge); } - public LIRFrameState stateFor(FrameState state) { - return stateForWithExceptionEdge(state, null); + public LIRFrameState stateFor(NodeWithState deopt, FrameState state) { + return stateForWithExceptionEdge(deopt, state, null); } - public LIRFrameState stateForWithExceptionEdge(FrameState state, LabelRef exceptionEdge) { + public LIRFrameState stateForWithExceptionEdge(NodeWithState deopt, FrameState state, LabelRef exceptionEdge) { if (gen.needOnlyOopMaps()) { return new LIRFrameState(null, null, null); } - assert state != null; - return getDebugInfoBuilder().build(state, exceptionEdge); + assert state != null : deopt; + return getDebugInfoBuilder().build(deopt, state, exceptionEdge); } @Override @@ -765,7 +766,7 @@ public abstract class NodeLIRBuilder implements NodeLIRBuilderTool, LIRGeneratio @Override public void visitFullInfopointNode(FullInfopointNode i) { - append(new FullInfopointOp(stateFor(i.getState()), i.getReason())); + append(new FullInfopointOp(stateFor(i, i.getState()), i.getReason())); } @Override diff --git a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotBackend.java b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotBackend.java index 5416a641823..8415bc763d0 100644 --- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotBackend.java +++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotBackend.java @@ -390,7 +390,7 @@ public class AArch64HotSpotBackend extends HotSpotHostBackend implements LIRGene AArch64Call.directCall(crb, masm, linkage, helper, null); } crb.recordMark(config.MARKID_DEOPT_HANDLER_ENTRY); - ForeignCallLinkage linkage = foreignCalls.lookupForeignCall(DEOPTIMIZATION_HANDLER); + ForeignCallLinkage linkage = foreignCalls.lookupForeignCall(DEOPT_BLOB_UNPACK); masm.adr(lr, 0); // Warning: the argument is an offset from the instruction! AArch64Call.directJmp(crb, masm, linkage); } else { diff --git a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotDeoptimizeCallerOp.java b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotDeoptimizeCallerOp.java index bb0f9302ed8..a69adfaf7f7 100644 --- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotDeoptimizeCallerOp.java +++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotDeoptimizeCallerOp.java @@ -24,7 +24,7 @@ package org.graalvm.compiler.hotspot.aarch64; -import static org.graalvm.compiler.hotspot.HotSpotHostBackend.UNCOMMON_TRAP_HANDLER; +import static org.graalvm.compiler.hotspot.HotSpotHostBackend.DEOPT_BLOB_UNCOMMON_TRAP; import org.graalvm.compiler.asm.aarch64.AArch64MacroAssembler; import org.graalvm.compiler.hotspot.GraalHotSpotVMConfig; @@ -47,6 +47,6 @@ public class AArch64HotSpotDeoptimizeCallerOp extends AArch64HotSpotEpilogueOp { @Override public void emitCode(CompilationResultBuilder crb, AArch64MacroAssembler masm) { leaveFrame(crb, masm, /* emitSafepoint */false, false); - AArch64Call.directJmp(crb, masm, crb.foreignCalls.lookupForeignCall(UNCOMMON_TRAP_HANDLER)); + AArch64Call.directJmp(crb, masm, crb.foreignCalls.lookupForeignCall(DEOPT_BLOB_UNCOMMON_TRAP)); } } diff --git a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotDeoptimizeOp.java b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotDeoptimizeOp.java index c754fc3460b..896021927aa 100644 --- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotDeoptimizeOp.java +++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotDeoptimizeOp.java @@ -24,7 +24,7 @@ package org.graalvm.compiler.hotspot.aarch64; -import static org.graalvm.compiler.hotspot.HotSpotHostBackend.UNCOMMON_TRAP_HANDLER; +import static org.graalvm.compiler.hotspot.HotSpotHostBackend.DEOPT_BLOB_UNCOMMON_TRAP; import org.graalvm.compiler.asm.aarch64.AArch64MacroAssembler; import org.graalvm.compiler.lir.LIRFrameState; @@ -49,7 +49,7 @@ public class AArch64HotSpotDeoptimizeOp extends AArch64BlockEndOp implements Blo @Override public void emitCode(CompilationResultBuilder crb, AArch64MacroAssembler masm) { try (AArch64MacroAssembler.ScratchRegister scratch = masm.getScratchRegister()) { - AArch64Call.directCall(crb, masm, crb.foreignCalls.lookupForeignCall(UNCOMMON_TRAP_HANDLER), scratch.getRegister(), info, null); + AArch64Call.directCall(crb, masm, crb.foreignCalls.lookupForeignCall(DEOPT_BLOB_UNCOMMON_TRAP), scratch.getRegister(), info, null); } } diff --git a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotDeoptimizeWithExceptionCallerOp.java b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotDeoptimizeWithExceptionCallerOp.java new file mode 100644 index 00000000000..0dba0e47f2b --- /dev/null +++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotDeoptimizeWithExceptionCallerOp.java @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2013, 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. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * 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. + */ +package org.graalvm.compiler.hotspot.aarch64; + +import static jdk.vm.ci.aarch64.AArch64.lr; +import static jdk.vm.ci.code.ValueUtil.asRegister; +import static org.graalvm.compiler.hotspot.HotSpotHostBackend.DEOPT_BLOB_UNPACK_WITH_EXCEPTION_IN_TLS; + +import org.graalvm.compiler.asm.aarch64.AArch64MacroAssembler; +import org.graalvm.compiler.hotspot.GraalHotSpotVMConfig; +import org.graalvm.compiler.lir.LIRInstructionClass; +import org.graalvm.compiler.lir.Opcode; +import org.graalvm.compiler.lir.aarch64.AArch64Call; +import org.graalvm.compiler.lir.asm.CompilationResultBuilder; + +import jdk.vm.ci.code.Register; +import jdk.vm.ci.meta.Value; + +/** + * Removes the current frame and tail calls the uncommon trap routine. + */ +@Opcode("DEOPT_WITH_EXCEPTION_IN_CALLER") +public class AArch64HotSpotDeoptimizeWithExceptionCallerOp extends AArch64HotSpotEpilogueOp { + public static final LIRInstructionClass TYPE = LIRInstructionClass.create(AArch64HotSpotDeoptimizeWithExceptionCallerOp.class); + + @Use(OperandFlag.REG) private Value exception; + + public AArch64HotSpotDeoptimizeWithExceptionCallerOp(GraalHotSpotVMConfig config, Value exception, Register thread) { + super(TYPE, config, thread); + this.exception = exception; + } + + @Override + public void emitCode(CompilationResultBuilder crb, AArch64MacroAssembler masm) { + Register exc = asRegister(exception); + + leaveFrame(crb, masm, /* emitSafepoint */false, false); + + // Save exception oop in TLS + masm.str(64, exc, masm.makeAddress(thread, config.threadExceptionOopOffset, 8)); + // Store original return address in TLS + masm.str(64, lr, masm.makeAddress(thread, config.threadExceptionPcOffset, 8)); + + AArch64Call.directJmp(crb, masm, crb.foreignCalls.lookupForeignCall(DEOPT_BLOB_UNPACK_WITH_EXCEPTION_IN_TLS)); + } +} diff --git a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotEpilogueOp.java b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotEpilogueOp.java index 5a9f913b906..71957b74deb 100644 --- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotEpilogueOp.java +++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotEpilogueOp.java @@ -53,8 +53,8 @@ import jdk.vm.ci.code.RegisterValue; */ abstract class AArch64HotSpotEpilogueOp extends AArch64BlockEndOp { - private final GraalHotSpotVMConfig config; - private final Register thread; + protected final GraalHotSpotVMConfig config; + protected final Register thread; protected AArch64HotSpotEpilogueOp(LIRInstructionClass c, GraalHotSpotVMConfig config, Register thread) { super(c); diff --git a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotLIRGenerator.java b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotLIRGenerator.java index 5fd5081ef41..e12eb72b71d 100644 --- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotLIRGenerator.java +++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotLIRGenerator.java @@ -399,6 +399,12 @@ public class AArch64HotSpotLIRGenerator extends AArch64LIRGenerator implements H append(new AArch64HotSpotDeoptimizeCallerOp(config)); } + @Override + public void emitDeoptimizeWithExceptionInCaller(Value exception) { + Register thread = getProviders().getRegisters().getThreadRegister(); + append(new AArch64HotSpotDeoptimizeWithExceptionCallerOp(config, exception, thread)); + } + @Override public void emitDeoptimize(Value actionAndReason, Value failedSpeculation, LIRFrameState state) { moveDeoptValuesToThread(actionAndReason, failedSpeculation); diff --git a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64DeoptimizeOp.java b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64DeoptimizeOp.java index b371ac890e3..4871d96e0c9 100644 --- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64DeoptimizeOp.java +++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64DeoptimizeOp.java @@ -24,7 +24,7 @@ package org.graalvm.compiler.hotspot.amd64; -import static org.graalvm.compiler.hotspot.HotSpotHostBackend.UNCOMMON_TRAP_HANDLER; +import static org.graalvm.compiler.hotspot.HotSpotHostBackend.DEOPT_BLOB_UNCOMMON_TRAP; import org.graalvm.compiler.asm.amd64.AMD64MacroAssembler; import org.graalvm.compiler.lir.LIRFrameState; @@ -48,6 +48,6 @@ final class AMD64DeoptimizeOp extends AMD64BlockEndOp implements BlockEndOp { @Override public void emitCode(CompilationResultBuilder crb, AMD64MacroAssembler masm) { - AMD64Call.directCall(crb, masm, crb.foreignCalls.lookupForeignCall(UNCOMMON_TRAP_HANDLER), null, false, info); + AMD64Call.directCall(crb, masm, crb.foreignCalls.lookupForeignCall(DEOPT_BLOB_UNCOMMON_TRAP), null, false, info); } } diff --git a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotBackend.java b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotBackend.java index 33cac04a512..b5e0f5f1b1b 100644 --- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotBackend.java +++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotBackend.java @@ -328,7 +328,7 @@ public class AMD64HotSpotBackend extends HotSpotHostBackend implements LIRGenera crb.recordMark(config.MARKID_EXCEPTION_HANDLER_ENTRY); AMD64Call.directCall(crb, asm, foreignCalls.lookupForeignCall(EXCEPTION_HANDLER), null, false, null); crb.recordMark(config.MARKID_DEOPT_HANDLER_ENTRY); - AMD64Call.directCall(crb, asm, foreignCalls.lookupForeignCall(DEOPTIMIZATION_HANDLER), null, false, null); + AMD64Call.directCall(crb, asm, foreignCalls.lookupForeignCall(DEOPT_BLOB_UNPACK), null, false, null); } else { // No need to emit the stubs for entries back into the method since // it has no calls that can cause such "return" entries diff --git a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotDeoptimizeCallerOp.java b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotDeoptimizeCallerOp.java index 76885c36dee..2a30fee2de5 100644 --- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotDeoptimizeCallerOp.java +++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotDeoptimizeCallerOp.java @@ -24,7 +24,7 @@ package org.graalvm.compiler.hotspot.amd64; -import static org.graalvm.compiler.hotspot.HotSpotHostBackend.UNCOMMON_TRAP_HANDLER; +import static org.graalvm.compiler.hotspot.HotSpotHostBackend.DEOPT_BLOB_UNCOMMON_TRAP; import org.graalvm.compiler.asm.amd64.AMD64MacroAssembler; import org.graalvm.compiler.lir.LIRInstructionClass; @@ -47,6 +47,6 @@ final class AMD64HotSpotDeoptimizeCallerOp extends AMD64HotSpotEpilogueBlockEndO @Override public void emitCode(CompilationResultBuilder crb, AMD64MacroAssembler masm) { leaveFrameAndRestoreRbp(crb, masm); - AMD64Call.directJmp(crb, masm, crb.foreignCalls.lookupForeignCall(UNCOMMON_TRAP_HANDLER)); + AMD64Call.directJmp(crb, masm, crb.foreignCalls.lookupForeignCall(DEOPT_BLOB_UNCOMMON_TRAP)); } } diff --git a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotDeoptimizeWithExceptionCallerOp.java b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotDeoptimizeWithExceptionCallerOp.java new file mode 100644 index 00000000000..3ed7d957e05 --- /dev/null +++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotDeoptimizeWithExceptionCallerOp.java @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2012, 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. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * 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. + */ +package org.graalvm.compiler.hotspot.amd64; + +import static jdk.vm.ci.code.ValueUtil.asRegister; +import static org.graalvm.compiler.hotspot.HotSpotHostBackend.DEOPT_BLOB_UNPACK_WITH_EXCEPTION_IN_TLS; + +import org.graalvm.compiler.asm.amd64.AMD64Address; +import org.graalvm.compiler.asm.amd64.AMD64MacroAssembler; +import org.graalvm.compiler.hotspot.GraalHotSpotVMConfig; +import org.graalvm.compiler.lir.LIRInstructionClass; +import org.graalvm.compiler.lir.Opcode; +import org.graalvm.compiler.lir.amd64.AMD64Call; +import org.graalvm.compiler.lir.asm.CompilationResultBuilder; + +import jdk.vm.ci.amd64.AMD64; +import jdk.vm.ci.code.Register; +import jdk.vm.ci.meta.Value; + +/** + * Removes the current frame and tail calls the uncommon trap routine. + */ +@Opcode("DEOPT_WITH_EXCEPTION_IN_CALLER") +final class AMD64HotSpotDeoptimizeWithExceptionCallerOp extends AMD64HotSpotEpilogueBlockEndOp { + + public static final LIRInstructionClass TYPE = LIRInstructionClass.create(AMD64HotSpotDeoptimizeWithExceptionCallerOp.class); + private final GraalHotSpotVMConfig config; + @Use(OperandFlag.REG) private Value exception; + + protected AMD64HotSpotDeoptimizeWithExceptionCallerOp(GraalHotSpotVMConfig config, Value exception) { + super(TYPE); + this.config = config; + this.exception = exception; + } + + @Override + public void emitCode(CompilationResultBuilder crb, AMD64MacroAssembler masm) { + Register stackPointer = crb.frameMap.getRegisterConfig().getFrameRegister(); + Register exc = asRegister(exception); + + leaveFrameAndRestoreRbp(crb, masm); + + // Save exception oop in TLS + masm.movq(new AMD64Address(AMD64.r15, config.threadExceptionOopOffset), exc); + // Get return address and store it into TLS + masm.movq(exc, new AMD64Address(stackPointer, 0)); + masm.movq(new AMD64Address(AMD64.r15, config.threadExceptionPcOffset), exc); + + // Remove return address. + masm.addq(stackPointer, crb.target.arch.getReturnAddressSize()); + AMD64Call.directJmp(crb, masm, crb.foreignCalls.lookupForeignCall(DEOPT_BLOB_UNPACK_WITH_EXCEPTION_IN_TLS)); + } +} diff --git a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLIRGenerator.java b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLIRGenerator.java index 938f0c30cbf..ef8d42f2c30 100644 --- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLIRGenerator.java +++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLIRGenerator.java @@ -544,6 +544,11 @@ public class AMD64HotSpotLIRGenerator extends AMD64LIRGenerator implements HotSp append(new AMD64HotSpotDeoptimizeCallerOp()); } + @Override + public void emitDeoptimizeWithExceptionInCaller(Value exception) { + append(new AMD64HotSpotDeoptimizeWithExceptionCallerOp(config, exception)); + } + @Override public void beforeRegisterAllocation() { super.beforeRegisterAllocation(); diff --git a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCDeoptimizeOp.java b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCDeoptimizeOp.java index a5568409371..ee2edd88b27 100644 --- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCDeoptimizeOp.java +++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCDeoptimizeOp.java @@ -24,7 +24,7 @@ package org.graalvm.compiler.hotspot.sparc; -import static org.graalvm.compiler.hotspot.HotSpotHostBackend.UNCOMMON_TRAP_HANDLER; +import static org.graalvm.compiler.hotspot.HotSpotHostBackend.DEOPT_BLOB_UNCOMMON_TRAP; import org.graalvm.compiler.asm.sparc.SPARCMacroAssembler; import org.graalvm.compiler.core.common.LIRKind; @@ -62,6 +62,6 @@ final class SPARCDeoptimizeOp extends SPARCBlockEndOp { // [Deopt Handler Code] // 0xffffffff749bb60c: call 0xffffffff748da540 ; {runtime_call} // 0xffffffff749bb610: nop - SPARCCall.directCall(crb, masm, crb.foreignCalls.lookupForeignCall(UNCOMMON_TRAP_HANDLER), null, info); + SPARCCall.directCall(crb, masm, crb.foreignCalls.lookupForeignCall(DEOPT_BLOB_UNCOMMON_TRAP), null, info); } } diff --git a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotBackend.java b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotBackend.java index 0c45c57a5b5..feb7b125b30 100644 --- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotBackend.java +++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotBackend.java @@ -349,7 +349,7 @@ public class SPARCHotSpotBackend extends HotSpotHostBackend implements LIRGenera crb.recordMark(config.MARKID_EXCEPTION_HANDLER_ENTRY); SPARCCall.directCall(crb, masm, foreignCalls.lookupForeignCall(EXCEPTION_HANDLER), null, null); crb.recordMark(config.MARKID_DEOPT_HANDLER_ENTRY); - SPARCCall.directCall(crb, masm, foreignCalls.lookupForeignCall(DEOPTIMIZATION_HANDLER), null, null); + SPARCCall.directCall(crb, masm, foreignCalls.lookupForeignCall(DEOPT_BLOB_UNPACK), null, null); } else { // No need to emit the stubs for entries back into the method since // it has no calls that can cause such "return" entries diff --git a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotDeoptimizeCallerOp.java b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotDeoptimizeCallerOp.java index bbb5f0c3a3f..19464a529d0 100644 --- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotDeoptimizeCallerOp.java +++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotDeoptimizeCallerOp.java @@ -24,7 +24,7 @@ package org.graalvm.compiler.hotspot.sparc; -import static org.graalvm.compiler.hotspot.HotSpotHostBackend.UNCOMMON_TRAP_HANDLER; +import static org.graalvm.compiler.hotspot.HotSpotHostBackend.DEOPT_BLOB_UNCOMMON_TRAP; import org.graalvm.compiler.asm.sparc.SPARCMacroAssembler; import org.graalvm.compiler.asm.sparc.SPARCMacroAssembler.ScratchRegister; @@ -59,7 +59,7 @@ final class SPARCHotSpotDeoptimizeCallerOp extends SPARCHotSpotEpilogueOp { try (ScratchRegister sc = masm.getScratchRegister()) { Register scratch = sc.getRegister(); - SPARCCall.indirectJmp(crb, masm, scratch, crb.foreignCalls.lookupForeignCall(UNCOMMON_TRAP_HANDLER)); + SPARCCall.indirectJmp(crb, masm, scratch, crb.foreignCalls.lookupForeignCall(DEOPT_BLOB_UNCOMMON_TRAP)); } // frameContext.leave(crb); diff --git a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotDeoptimizeWithExceptionCallerOp.java b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotDeoptimizeWithExceptionCallerOp.java new file mode 100644 index 00000000000..a250f2f6533 --- /dev/null +++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotDeoptimizeWithExceptionCallerOp.java @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2020, 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. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * 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. + */ +package org.graalvm.compiler.hotspot.sparc; + +import static jdk.vm.ci.code.ValueUtil.asRegister; +import static org.graalvm.compiler.hotspot.HotSpotHostBackend.DEOPT_BLOB_UNPACK_WITH_EXCEPTION_IN_TLS; + +import org.graalvm.compiler.asm.sparc.SPARCAddress; +import org.graalvm.compiler.asm.sparc.SPARCMacroAssembler; +import org.graalvm.compiler.hotspot.GraalHotSpotVMConfig; +import org.graalvm.compiler.lir.LIRInstructionClass; +import org.graalvm.compiler.lir.Opcode; +import org.graalvm.compiler.lir.asm.CompilationResultBuilder; +import org.graalvm.compiler.lir.sparc.SPARCCall; + +import jdk.vm.ci.code.Register; +import jdk.vm.ci.meta.Value; +import jdk.vm.ci.sparc.SPARC; + +/** + * Removes the current frame and tail calls the uncommon trap routine. + */ +@Opcode("DEOPT_WITH_EXCEPTION_IN_CALLER") +final class SPARCHotSpotDeoptimizeWithExceptionCallerOp extends SPARCHotSpotEpilogueOp { + public static final LIRInstructionClass TYPE = LIRInstructionClass.create(SPARCHotSpotDeoptimizeWithExceptionCallerOp.class); + public static final SizeEstimate SIZE = SizeEstimate.create(32); + + private final GraalHotSpotVMConfig config; + private final Register thread; + @Use(OperandFlag.REG) private Value exception; + + protected SPARCHotSpotDeoptimizeWithExceptionCallerOp(GraalHotSpotVMConfig config, Value exception, Register thread) { + super(TYPE, SIZE); + this.config = config; + this.exception = exception; + this.thread = thread; + } + + @Override + public void emitCode(CompilationResultBuilder crb, SPARCMacroAssembler masm) { + Register exc = asRegister(exception); + + // Save exception oop in TLS + masm.stx(exc, new SPARCAddress(thread, config.threadExceptionOopOffset)); + // Store original return address in TLS + masm.stx(SPARC.i7, new SPARCAddress(thread, config.threadExceptionPcOffset)); + + leaveFrame(crb); + + try (SPARCMacroAssembler.ScratchRegister sc = masm.getScratchRegister()) { + Register scratch = sc.getRegister(); + SPARCCall.indirectJmp(crb, masm, scratch, crb.foreignCalls.lookupForeignCall(DEOPT_BLOB_UNPACK_WITH_EXCEPTION_IN_TLS)); + } + } +} diff --git a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotLIRGenerator.java b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotLIRGenerator.java index ae48f464643..30e1c9bac19 100644 --- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotLIRGenerator.java +++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotLIRGenerator.java @@ -238,6 +238,12 @@ public class SPARCHotSpotLIRGenerator extends SPARCLIRGenerator implements HotSp append(new SPARCHotSpotDeoptimizeCallerOp()); } + @Override + public void emitDeoptimizeWithExceptionInCaller(Value exception) { + Register thread = getProviders().getRegisters().getThreadRegister(); + append(new SPARCHotSpotDeoptimizeWithExceptionCallerOp(config, exception, thread)); + } + @Override public Variable emitLogicCompareAndSwap(LIRKind accessKind, Value address, Value expectedValue, Value newValue, Value trueValue, Value falseValue) { ValueKind kind = newValue.getValueKind(); diff --git a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotDeoptExplicitExceptions.java b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotDeoptExplicitExceptions.java new file mode 100644 index 00000000000..1a0457825ea --- /dev/null +++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotDeoptExplicitExceptions.java @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2019, 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. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * 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. + */ +package org.graalvm.compiler.hotspot.test; + +import static org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration.BytecodeExceptionMode.CheckAll; + +import java.io.IOException; +import java.util.List; + +import org.graalvm.compiler.core.test.SubprocessTest; +import org.graalvm.compiler.hotspot.HotSpotBackend; +import org.graalvm.compiler.hotspot.stubs.CreateExceptionStub; +import org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration; +import org.junit.Assume; +import org.junit.Test; + +/** + * This test exercises the deoptimization in the BytecodeExceptioNode foreign call path. + */ +public class HotSpotDeoptExplicitExceptions extends SubprocessTest { + + @Override + protected GraphBuilderConfiguration editGraphBuilderConfiguration(GraphBuilderConfiguration conf) { + return super.editGraphBuilderConfiguration(conf).withBytecodeExceptionMode(CheckAll); + } + + static String nullCheckSnippet(Object o) { + return o.toString(); + } + + static int divByZeroSnippet(int x, int y) { + return x / y; + } + + static String classCastSnippet(Object o) { + return (String) o; + } + + void testBody() { + test("nullCheckSnippet", (Object) null); + test("divByZeroSnippet", 1, 0); + test("classCastSnippet", Boolean.TRUE); + } + + @Override + public void configSubprocess(List vmArgs) { + vmArgs.add("-Dgraal.HotSpotDeoptExplicitExceptions=true"); + } + + @Test + public void explicitExceptions() throws IOException, InterruptedException { + Assume.assumeTrue("required entry point is missing", ((HotSpotBackend) getBackend()).getRuntime().getVMConfig().deoptBlobUnpackWithExceptionInTLS != 0); + if (!CreateExceptionStub.Options.HotSpotDeoptExplicitExceptions.getValue(getInitialOptions())) { + launchSubprocess(this::testBody); + } else { + testBody(); + } + } + +} diff --git a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotDeoptPostExceptions.java b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotDeoptPostExceptions.java new file mode 100644 index 00000000000..e5092bcefac --- /dev/null +++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotDeoptPostExceptions.java @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2019, 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. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * 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. + */ +package org.graalvm.compiler.hotspot.test; + +import static org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration.BytecodeExceptionMode.CheckAll; + +import org.graalvm.compiler.core.phases.HighTier; +import org.graalvm.compiler.core.test.GraalCompilerTest; +import org.graalvm.compiler.hotspot.meta.HotSpotNodePlugin; +import org.graalvm.compiler.nodes.ValueNode; +import org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration; +import org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderContext; +import org.graalvm.compiler.nodes.graphbuilderconf.InlineInvokePlugin; +import org.graalvm.compiler.options.OptionValues; +import org.graalvm.compiler.phases.tiers.Suites; +import org.junit.Test; + +import jdk.vm.ci.meta.ResolvedJavaMethod; + +/** + * This test exercises the FrameState used for deoptimization in the JVMTI post_on_exceptions path. + */ +public class HotSpotDeoptPostExceptions extends GraalCompilerTest { + + @Override + @SuppressWarnings("try") + protected Suites createSuites(OptionValues options) { + return super.createSuites(new OptionValues(options, HighTier.Options.Inline, false)); + } + + @Override + protected InlineInvokePlugin.InlineInfo bytecodeParserShouldInlineInvoke(GraphBuilderContext b, ResolvedJavaMethod method, ValueNode[] args) { + return InlineInvokePlugin.InlineInfo.DO_NOT_INLINE_NO_EXCEPTION; + } + + @Override + protected GraphBuilderConfiguration editGraphBuilderConfiguration(GraphBuilderConfiguration conf) { + return super.editGraphBuilderConfiguration(conf).withBytecodeExceptionMode(CheckAll); + } + + static String snippet(Object o) { + return o.toString(); + } + + @Test + public void testPost() { + OptionValues options = new OptionValues(getInitialOptions(), HotSpotNodePlugin.Options.HotSpotPostOnExceptions, true); + test(options, "snippet", (Object) null); + } +} diff --git a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/GraalHotSpotVMConfig.java b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/GraalHotSpotVMConfig.java index ec8ceb3c2f5..b6e7dc37f41 100644 --- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/GraalHotSpotVMConfig.java +++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/GraalHotSpotVMConfig.java @@ -620,8 +620,9 @@ public class GraalHotSpotVMConfig extends GraalHotSpotVMConfigBase { public final long inlineCacheMissStub = getFieldValue("CompilerToVM::Data::SharedRuntime_ic_miss_stub", Long.class, "address"); public final long handleWrongMethodStub = getFieldValue("CompilerToVM::Data::SharedRuntime_handle_wrong_method_stub", Long.class, "address"); - public final long handleDeoptStub = getFieldValue("CompilerToVM::Data::SharedRuntime_deopt_blob_unpack", Long.class, "address"); - public final long uncommonTrapStub = getFieldValue("CompilerToVM::Data::SharedRuntime_deopt_blob_uncommon_trap", Long.class, "address"); + public final long deoptBlobUnpack = getFieldValue("CompilerToVM::Data::SharedRuntime_deopt_blob_unpack", Long.class, "address"); + public final long deoptBlobUnpackWithExceptionInTLS = getFieldValue("CompilerToVM::Data::SharedRuntime_deopt_blob_unpack_with_exception_in_tls", Long.class, "address", 0L); + public final long deoptBlobUncommonTrap = getFieldValue("CompilerToVM::Data::SharedRuntime_deopt_blob_uncommon_trap", Long.class, "address"); public final long codeCacheLowBound = versioned.codeCacheLowBound; public final long codeCacheHighBound = versioned.codeCacheHighBound; diff --git a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotDebugInfoBuilder.java b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotDebugInfoBuilder.java index 66384cebf30..8ff4f69ca18 100644 --- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotDebugInfoBuilder.java +++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotDebugInfoBuilder.java @@ -31,13 +31,19 @@ import java.util.List; import org.graalvm.compiler.api.replacements.MethodSubstitution; import org.graalvm.compiler.api.replacements.Snippet; +import org.graalvm.compiler.bytecode.Bytecodes; +import org.graalvm.compiler.core.common.spi.ForeignCallDescriptor; import org.graalvm.compiler.core.gen.DebugInfoBuilder; import org.graalvm.compiler.graph.GraalGraphError; import org.graalvm.compiler.graph.NodeSourcePosition; +import org.graalvm.compiler.hotspot.meta.DefaultHotSpotLoweringProvider; import org.graalvm.compiler.lir.VirtualStackSlot; import org.graalvm.compiler.nodes.FrameState; +import org.graalvm.compiler.nodes.FullInfopointNode; import org.graalvm.compiler.nodes.ValueNode; +import org.graalvm.compiler.nodes.extended.ForeignCallNode; import org.graalvm.compiler.nodes.spi.NodeValueMap; +import org.graalvm.compiler.nodes.spi.NodeWithState; import jdk.vm.ci.code.BytecodeFrame; import jdk.vm.ci.code.StackLockValue; @@ -87,11 +93,42 @@ public class HotSpotDebugInfoBuilder extends DebugInfoBuilder { } @Override - protected BytecodeFrame computeFrameForState(FrameState state) { + protected boolean verifyFrameState(NodeWithState node, FrameState topState) { + if (node instanceof FullInfopointNode) { + return true; + } + if (node instanceof ForeignCallNode) { + ForeignCallNode call = (ForeignCallNode) node; + ForeignCallDescriptor descriptor = call.getDescriptor(); + if (DefaultHotSpotLoweringProvider.RuntimeCalls.runtimeCalls.containsValue(descriptor)) { + return true; + } + } + // There are many properties of FrameStates which could be validated though it's complicated + // by some of the idiomatic ways that they are used. This check specifically tries to catch + // cases where a FrameState that's constructed for reexecution has an incorrect stack depth + // at invokes. + if (topState.bci >= 0 && !topState.duringCall() && !topState.rethrowException()) { + ResolvedJavaMethod m = topState.getMethod(); + int opcode = m.getCode()[topState.bci] & 0xff; + if (opcode == Bytecodes.INVOKEVIRTUAL || opcode == Bytecodes.INVOKEINTERFACE) { + assert topState.stackSize() > 0 : "expected non-empty stack: " + topState; + } else { + int stackEffect = Bytecodes.stackEffectOf(opcode); + if (stackEffect < 0) { + assert topState.stackSize() >= -stackEffect : "expected at least " + (-stackEffect) + " stack depth : " + topState; + } + } + } + return true; + } + + @Override + protected BytecodeFrame computeFrameForState(NodeWithState node, FrameState state) { if (isPlaceholderBci(state.bci) && state.bci != BytecodeFrame.BEFORE_BCI) { raiseInvalidFrameStateError(state); } - BytecodeFrame result = super.computeFrameForState(state); + BytecodeFrame result = super.computeFrameForState(node, state); maxInterpreterFrameSize = Math.max(maxInterpreterFrameSize, codeCacheProvider.interpreterFrameSize(result)); return result; } diff --git a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotHostBackend.java b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotHostBackend.java index d0e5cea68ef..019e3df9557 100644 --- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotHostBackend.java +++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotHostBackend.java @@ -67,12 +67,17 @@ public abstract class HotSpotHostBackend extends HotSpotBackend implements LIRGe /** * Descriptor for {@code SharedRuntime::deopt_blob()->unpack()}. */ - public static final ForeignCallDescriptor DEOPTIMIZATION_HANDLER = new ForeignCallDescriptor("deoptHandler", void.class); + public static final ForeignCallDescriptor DEOPT_BLOB_UNPACK = new ForeignCallDescriptor("deopt_blob()->unpack()", void.class); + + /** + * Descriptor for {@code SharedRuntime::deopt_blob()->unpack_with_exception_in_tls()}. + */ + public static final ForeignCallDescriptor DEOPT_BLOB_UNPACK_WITH_EXCEPTION_IN_TLS = new ForeignCallDescriptor("deopt_blob()->unpack_with_exception_in_tls()", void.class); /** * Descriptor for {@code SharedRuntime::deopt_blob()->uncommon_trap()}. */ - public static final ForeignCallDescriptor UNCOMMON_TRAP_HANDLER = new ForeignCallDescriptor("uncommonTrapHandler", void.class); + public static final ForeignCallDescriptor DEOPT_BLOB_UNCOMMON_TRAP = new ForeignCallDescriptor("deopt_blob()->uncommon_trap()", void.class); public static final ForeignCallDescriptor ENABLE_STACK_RESERVED_ZONE = new ForeignCallDescriptor("enableStackReservedZoneEntry", void.class, Word.class); diff --git a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotLIRGenerator.java b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotLIRGenerator.java index c716464fce9..c93300622c2 100644 --- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotLIRGenerator.java +++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotLIRGenerator.java @@ -61,8 +61,20 @@ public interface HotSpotLIRGenerator extends LIRGeneratorTool { */ void emitTailcall(Value[] args, Value address); + /** + * Emits code that jumps to the deopt blob uncommon_trap entry point with {@code action} and + * {@code reason}. + */ void emitDeoptimizeCaller(DeoptimizationAction action, DeoptimizationReason reason); + /** + * Emits code that jumps to the deopt blob unpack_with_exception entry point with + * {@code exception}. + * + * @param exception + */ + void emitDeoptimizeWithExceptionInCaller(Value exception); + /** * Emits code for a {@link LoadConstantIndirectlyNode}. * diff --git a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/DefaultHotSpotLoweringProvider.java b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/DefaultHotSpotLoweringProvider.java index cddc6d85528..e3e048d610a 100644 --- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/DefaultHotSpotLoweringProvider.java +++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/DefaultHotSpotLoweringProvider.java @@ -722,7 +722,13 @@ public abstract class DefaultHotSpotLoweringProvider extends DefaultJavaLowering StructuredGraph graph = node.graph(); ForeignCallNode foreignCallNode = graph.add(new ForeignCallNode(foreignCalls, descriptor, node.stamp(NodeView.DEFAULT), node.getArguments())); - foreignCallNode.setStateAfter(node.stateAfter()); + /* + * The original BytecodeExceptionNode has a rethrowException FrameState which isn't suitable + * for deopt because the exception to be thrown come from this call so it's not available in + * the debug info. The foreign call needs a stateDuring instead so it can deopt with a + * pending exception. + */ + foreignCallNode.setStateAfter(node.createStateDuring()); graph.replaceFixedWithFixed(node, foreignCallNode); } diff --git a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotHostForeignCallsProvider.java b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotHostForeignCallsProvider.java index 1c562038703..d996e04b5f3 100644 --- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotHostForeignCallsProvider.java +++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotHostForeignCallsProvider.java @@ -74,10 +74,11 @@ import static org.graalvm.compiler.hotspot.HotSpotForeignCallLinkage.Transition. import static org.graalvm.compiler.hotspot.HotSpotForeignCallLinkage.Transition.LEAF_NO_VZERO; import static org.graalvm.compiler.hotspot.HotSpotForeignCallLinkage.Transition.SAFEPOINT; import static org.graalvm.compiler.hotspot.HotSpotForeignCallLinkage.Transition.STACK_INSPECTABLE_LEAF; -import static org.graalvm.compiler.hotspot.HotSpotHostBackend.DEOPTIMIZATION_HANDLER; +import static org.graalvm.compiler.hotspot.HotSpotHostBackend.DEOPT_BLOB_UNCOMMON_TRAP; +import static org.graalvm.compiler.hotspot.HotSpotHostBackend.DEOPT_BLOB_UNPACK; +import static org.graalvm.compiler.hotspot.HotSpotHostBackend.DEOPT_BLOB_UNPACK_WITH_EXCEPTION_IN_TLS; import static org.graalvm.compiler.hotspot.HotSpotHostBackend.ENABLE_STACK_RESERVED_ZONE; import static org.graalvm.compiler.hotspot.HotSpotHostBackend.THROW_DELAYED_STACKOVERFLOW_ERROR; -import static org.graalvm.compiler.hotspot.HotSpotHostBackend.UNCOMMON_TRAP_HANDLER; import static org.graalvm.compiler.hotspot.replacements.AssertionSnippets.ASSERTION_VM_MESSAGE_C; import static org.graalvm.compiler.hotspot.replacements.HotSpotG1WriteBarrierSnippets.G1WBPOSTCALL; import static org.graalvm.compiler.hotspot.replacements.HotSpotG1WriteBarrierSnippets.G1WBPRECALL; @@ -270,8 +271,11 @@ public abstract class HotSpotHostForeignCallsProvider extends HotSpotForeignCall public void initialize(HotSpotProviders providers, OptionValues options) { GraalHotSpotVMConfig c = runtime.getVMConfig(); - registerForeignCall(DEOPTIMIZATION_HANDLER, c.handleDeoptStub, NativeCall, LEAF_NO_VZERO, REEXECUTABLE, NO_LOCATIONS); - registerForeignCall(UNCOMMON_TRAP_HANDLER, c.uncommonTrapStub, NativeCall, LEAF_NO_VZERO, REEXECUTABLE, NO_LOCATIONS); + registerForeignCall(DEOPT_BLOB_UNPACK, c.deoptBlobUnpack, NativeCall, LEAF_NO_VZERO, REEXECUTABLE, NO_LOCATIONS); + if (c.deoptBlobUnpackWithExceptionInTLS != 0) { + registerForeignCall(DEOPT_BLOB_UNPACK_WITH_EXCEPTION_IN_TLS, c.deoptBlobUnpackWithExceptionInTLS, NativeCall, LEAF_NO_VZERO, REEXECUTABLE, NO_LOCATIONS); + } + registerForeignCall(DEOPT_BLOB_UNCOMMON_TRAP, c.deoptBlobUncommonTrap, NativeCall, LEAF_NO_VZERO, REEXECUTABLE, NO_LOCATIONS); registerForeignCall(IC_MISS_HANDLER, c.inlineCacheMissStub, NativeCall, LEAF_NO_VZERO, REEXECUTABLE, NO_LOCATIONS); if (c.enableStackReservedZoneAddress != 0) { diff --git a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotNodePlugin.java b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotNodePlugin.java index 460dd41e7ef..2f79af1d168 100644 --- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotNodePlugin.java +++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotNodePlugin.java @@ -27,6 +27,9 @@ package org.graalvm.compiler.hotspot.meta; import static jdk.vm.ci.meta.DeoptimizationAction.None; import static jdk.vm.ci.meta.DeoptimizationReason.TransferToInterpreter; import static org.graalvm.compiler.core.common.GraalOptions.ImmutableCode; +import static org.graalvm.compiler.hotspot.meta.HotSpotNodePlugin.Options.HotSpotPostOnExceptions; + +import java.util.function.Supplier; import org.graalvm.compiler.core.common.CompilationIdentifier; import org.graalvm.compiler.core.common.type.StampFactory; @@ -38,6 +41,7 @@ import org.graalvm.compiler.hotspot.word.HotSpotWordTypes; import org.graalvm.compiler.nodes.ConstantNode; import org.graalvm.compiler.nodes.FixedGuardNode; import org.graalvm.compiler.nodes.FixedWithNextNode; +import org.graalvm.compiler.nodes.FrameState; import org.graalvm.compiler.nodes.LogicNode; import org.graalvm.compiler.nodes.NamedLocationIdentity; import org.graalvm.compiler.nodes.StructuredGraph; @@ -54,6 +58,9 @@ import org.graalvm.compiler.nodes.memory.ReadNode; import org.graalvm.compiler.nodes.memory.address.AddressNode; import org.graalvm.compiler.nodes.memory.address.OffsetAddressNode; import org.graalvm.compiler.nodes.util.ConstantFoldUtil; +import org.graalvm.compiler.options.Option; +import org.graalvm.compiler.options.OptionKey; +import org.graalvm.compiler.options.OptionType; import org.graalvm.compiler.serviceprovider.GraalUnsafeAccess; import org.graalvm.compiler.word.Word; import org.graalvm.compiler.word.WordOperationPlugin; @@ -82,6 +89,11 @@ import sun.misc.Unsafe; * */ public final class HotSpotNodePlugin implements NodePlugin, TypePlugin { + public static class Options { + @Option(help = "Testing only option that forces deopts for exception throws", type = OptionType.Expert)// + public static final OptionKey HotSpotPostOnExceptions = new OptionKey<>(false); + } + private static final Unsafe UNSAFE = GraalUnsafeAccess.getUnsafe(); protected final WordOperationPlugin wordOperationPlugin; private final GraalHotSpotVMConfig config; @@ -209,35 +221,39 @@ public final class HotSpotNodePlugin implements NodePlugin, TypePlugin { } @Override - public FixedWithNextNode instrumentExceptionDispatch(StructuredGraph graph, FixedWithNextNode afterExceptionLoaded) { + public FixedWithNextNode instrumentExceptionDispatch(StructuredGraph graph, FixedWithNextNode afterExceptionLoaded, Supplier frameStateFunction) { CompilationIdentifier id = graph.compilationId(); - if (id instanceof HotSpotCompilationIdentifier) { + if (id instanceof HotSpotCompilationIdentifier && + config.jvmciCompileStateCanPostOnExceptionsOffset != Integer.MIN_VALUE && + config.javaThreadShouldPostOnExceptionsFlagOffset != Integer.MIN_VALUE) { + boolean canPostOnExceptions = HotSpotPostOnExceptions.getValue(graph.getOptions()); HotSpotCompilationRequest request = ((HotSpotCompilationIdentifier) id).getRequest(); if (request != null) { long compileState = request.getJvmciEnv(); - if (compileState != 0 && - config.jvmciCompileStateCanPostOnExceptionsOffset != Integer.MIN_VALUE && - config.javaThreadShouldPostOnExceptionsFlagOffset != Integer.MIN_VALUE) { + if (compileState != 0) { long canPostOnExceptionsOffset = compileState + config.jvmciCompileStateCanPostOnExceptionsOffset; - boolean canPostOnExceptions = UNSAFE.getByte(canPostOnExceptionsOffset) != 0; - if (canPostOnExceptions) { - // If the exception capability is set, then generate code - // to check the JavaThread.should_post_on_exceptions flag to see - // if we actually need to report exception events for the current - // thread. If not, take the fast path otherwise deoptimize. - CurrentJavaThreadNode thread = graph.unique(new CurrentJavaThreadNode(wordTypes.getWordKind())); - ValueNode offset = graph.unique(ConstantNode.forLong(config.javaThreadShouldPostOnExceptionsFlagOffset)); - AddressNode address = graph.unique(new OffsetAddressNode(thread, offset)); - ReadNode shouldPostException = graph.add(new ReadNode(address, JAVA_THREAD_SHOULD_POST_ON_EXCEPTIONS_FLAG_LOCATION, StampFactory.intValue(), BarrierType.NONE)); - afterExceptionLoaded.setNext(shouldPostException); - ValueNode zero = graph.unique(ConstantNode.forInt(0)); - LogicNode cond = graph.unique(new IntegerEqualsNode(shouldPostException, zero)); - FixedGuardNode check = graph.add(new FixedGuardNode(cond, TransferToInterpreter, None, false)); - shouldPostException.setNext(check); - return check; - } + canPostOnExceptions = UNSAFE.getByte(canPostOnExceptionsOffset) != 0; } } + if (canPostOnExceptions) { + // If the exception capability is set, then generate code + // to check the JavaThread.should_post_on_exceptions flag to see + // if we actually need to report exception events for the current + // thread. If not, take the fast path otherwise deoptimize. + CurrentJavaThreadNode thread = graph.unique(new CurrentJavaThreadNode(wordTypes.getWordKind())); + ValueNode offset = graph.unique(ConstantNode.forLong(config.javaThreadShouldPostOnExceptionsFlagOffset)); + AddressNode address = graph.unique(new OffsetAddressNode(thread, offset)); + ReadNode shouldPostException = graph.add(new ReadNode(address, JAVA_THREAD_SHOULD_POST_ON_EXCEPTIONS_FLAG_LOCATION, StampFactory.intValue(), BarrierType.NONE)); + afterExceptionLoaded.setNext(shouldPostException); + ValueNode zero = graph.unique(ConstantNode.forInt(0)); + LogicNode cond = graph.unique(new IntegerEqualsNode(shouldPostException, zero)); + FixedGuardNode check = graph.add(new FixedGuardNode(cond, TransferToInterpreter, None, false)); + FrameState fs = frameStateFunction.get(); + assert fs.stackSize() == 1 && fs.rethrowException() : "expected rethrow exception FrameState"; + check.setStateBefore(fs); + shouldPostException.setNext(check); + return check; + } } return afterExceptionLoaded; } diff --git a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/DeoptimizeWithExceptionInCallerNode.java b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/DeoptimizeWithExceptionInCallerNode.java new file mode 100644 index 00000000000..1d5c0af577c --- /dev/null +++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/DeoptimizeWithExceptionInCallerNode.java @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2009, 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. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * 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. + */ +package org.graalvm.compiler.hotspot.nodes; + +import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_8; +import static org.graalvm.compiler.nodeinfo.NodeSize.SIZE_8; + +import org.graalvm.compiler.core.common.type.StampFactory; +import org.graalvm.compiler.graph.NodeClass; +import org.graalvm.compiler.hotspot.HotSpotLIRGenerator; +import org.graalvm.compiler.nodeinfo.NodeInfo; +import org.graalvm.compiler.nodes.ControlSinkNode; +import org.graalvm.compiler.nodes.ValueNode; +import org.graalvm.compiler.nodes.spi.LIRLowerable; +import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; + +import jdk.vm.ci.meta.Value; + +/** + * Removes the current frame and tail calls the uncommon trap routine. + */ +@NodeInfo(cycles = CYCLES_8, size = SIZE_8) +public final class DeoptimizeWithExceptionInCallerNode extends ControlSinkNode implements LIRLowerable { + public static final NodeClass TYPE = NodeClass.create(DeoptimizeWithExceptionInCallerNode.class); + + @Input protected ValueNode exception; + + public DeoptimizeWithExceptionInCallerNode(ValueNode exception) { + super(TYPE, StampFactory.forVoid()); + this.exception = exception; + } + + @Override + public void generate(NodeLIRBuilderTool gen) { + Value e = gen.operand(exception); + ((HotSpotLIRGenerator) gen.getLIRGeneratorTool()).emitDeoptimizeWithExceptionInCaller(e); + } + + @NodeIntrinsic + public static native void deopt(Object exception); +} diff --git a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/FastNotifyNode.java b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/FastNotifyNode.java index db9b4545726..ae301c92252 100644 --- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/FastNotifyNode.java +++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/FastNotifyNode.java @@ -24,6 +24,7 @@ package org.graalvm.compiler.hotspot.replacements; +import static org.graalvm.compiler.nodeinfo.InputType.Memory; import static org.graalvm.compiler.nodeinfo.InputType.State; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_2; import static org.graalvm.compiler.nodeinfo.NodeSize.SIZE_0; @@ -40,7 +41,7 @@ import org.graalvm.compiler.nodes.spi.Lowerable; import org.graalvm.compiler.nodes.spi.LoweringTool; import jdk.internal.vm.compiler.word.LocationIdentity; -@NodeInfo(cycles = CYCLES_2, size = SIZE_0) +@NodeInfo(cycles = CYCLES_2, size = SIZE_0, allowedUsageTypes = Memory) public class FastNotifyNode extends AbstractMemoryCheckpoint implements Lowerable, MemoryCheckpoint.Single, DeoptimizingNode.DeoptDuring { public static final NodeClass TYPE = NodeClass.create(FastNotifyNode.class); diff --git a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/CreateExceptionStub.java b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/CreateExceptionStub.java index 366eaba00f2..7bfe1ba366e 100644 --- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/CreateExceptionStub.java +++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/CreateExceptionStub.java @@ -25,6 +25,7 @@ package org.graalvm.compiler.hotspot.stubs; import static jdk.vm.ci.hotspot.HotSpotCallingConventionType.NativeCall; +import static org.graalvm.compiler.hotspot.GraalHotSpotVMConfigBase.INJECTED_OPTIONVALUES; import static org.graalvm.compiler.hotspot.HotSpotForeignCallLinkage.Reexecutability.REEXECUTABLE; import static org.graalvm.compiler.hotspot.HotSpotForeignCallLinkage.Transition.SAFEPOINT; import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.clearPendingException; @@ -36,11 +37,16 @@ import org.graalvm.compiler.core.common.spi.ForeignCallDescriptor; import org.graalvm.compiler.graph.Node.ConstantNodeParameter; import org.graalvm.compiler.graph.Node.NodeIntrinsic; import org.graalvm.compiler.hotspot.GraalHotSpotVMConfig; +import org.graalvm.compiler.hotspot.GraalHotSpotVMConfigBase; import org.graalvm.compiler.hotspot.HotSpotForeignCallLinkage; import org.graalvm.compiler.hotspot.meta.HotSpotForeignCallsProviderImpl; import org.graalvm.compiler.hotspot.meta.HotSpotProviders; +import org.graalvm.compiler.hotspot.nodes.DeoptimizeWithExceptionInCallerNode; import org.graalvm.compiler.hotspot.nodes.StubForeignCallNode; import org.graalvm.compiler.hotspot.word.KlassPointer; +import org.graalvm.compiler.options.Option; +import org.graalvm.compiler.options.OptionKey; +import org.graalvm.compiler.options.OptionType; import org.graalvm.compiler.options.OptionValues; import org.graalvm.compiler.replacements.nodes.CStringConstant; import org.graalvm.compiler.word.Word; @@ -53,10 +59,25 @@ import jdk.vm.ci.code.Register; */ public class CreateExceptionStub extends SnippetStub { + public static class Options { + @Option(help = "Testing only option that forces deopts for exception throws", type = OptionType.Expert)// + public static final OptionKey HotSpotDeoptExplicitExceptions = new OptionKey<>(false); + } + protected CreateExceptionStub(String snippetMethodName, OptionValues options, HotSpotProviders providers, HotSpotForeignCallLinkage linkage) { super(snippetMethodName, options, providers, linkage); } + @Fold + static boolean reportsDeoptimization(@Fold.InjectedParameter GraalHotSpotVMConfig config) { + return config.deoptBlobUnpackWithExceptionInTLS != 0; + } + + @Fold + static boolean alwayDeoptimize(@Fold.InjectedParameter OptionValues options) { + return Options.HotSpotDeoptExplicitExceptions.getValue(options); + } + @Fold static String getInternalClassName(Class cls) { return cls.getName().replace('.', '/'); @@ -73,36 +94,44 @@ public class CreateExceptionStub extends SnippetStub { protected static Object createException(Register threadRegister, Class exception, Word message) { Word thread = registerAsWord(threadRegister); - throwAndPostJvmtiException(THROW_AND_POST_JVMTI_EXCEPTION, thread, classAsCString(exception), message); - return clearPendingException(thread); + int deoptimized = throwAndPostJvmtiException(THROW_AND_POST_JVMTI_EXCEPTION, thread, classAsCString(exception), message); + return handleExceptionReturn(thread, deoptimized); } protected static Object createException(Register threadRegister, Class exception, KlassPointer klass) { Word thread = registerAsWord(threadRegister); - throwKlassExternalNameException(THROW_KLASS_EXTERNAL_NAME_EXCEPTION, thread, classAsCString(exception), klass); - return clearPendingException(thread); + int deoptimized = throwKlassExternalNameException(THROW_KLASS_EXTERNAL_NAME_EXCEPTION, thread, classAsCString(exception), klass); + return handleExceptionReturn(thread, deoptimized); } protected static Object createException(Register threadRegister, Class exception, KlassPointer objKlass, KlassPointer targetKlass) { Word thread = registerAsWord(threadRegister); - throwClassCastException(THROW_CLASS_CAST_EXCEPTION, thread, classAsCString(exception), objKlass, targetKlass); - return clearPendingException(thread); + int deoptimized = throwClassCastException(THROW_CLASS_CAST_EXCEPTION, thread, classAsCString(exception), objKlass, targetKlass); + return handleExceptionReturn(thread, deoptimized); } - private static final ForeignCallDescriptor THROW_AND_POST_JVMTI_EXCEPTION = new ForeignCallDescriptor("throw_and_post_jvmti_exception", void.class, Word.class, Word.class, Word.class); - private static final ForeignCallDescriptor THROW_KLASS_EXTERNAL_NAME_EXCEPTION = new ForeignCallDescriptor("throw_klass_external_name_exception", void.class, Word.class, Word.class, + private static Object handleExceptionReturn(Word thread, int deoptimized) { + Object clearPendingException = clearPendingException(thread); + if (alwayDeoptimize(INJECTED_OPTIONVALUES) || (reportsDeoptimization(GraalHotSpotVMConfigBase.INJECTED_VMCONFIG) && deoptimized != 0)) { + DeoptimizeWithExceptionInCallerNode.deopt(clearPendingException); + } + return clearPendingException; + } + + private static final ForeignCallDescriptor THROW_AND_POST_JVMTI_EXCEPTION = new ForeignCallDescriptor("throw_and_post_jvmti_exception", int.class, Word.class, Word.class, Word.class); + private static final ForeignCallDescriptor THROW_KLASS_EXTERNAL_NAME_EXCEPTION = new ForeignCallDescriptor("throw_klass_external_name_exception", int.class, Word.class, Word.class, KlassPointer.class); - private static final ForeignCallDescriptor THROW_CLASS_CAST_EXCEPTION = new ForeignCallDescriptor("throw_class_cast_exception", void.class, Word.class, Word.class, KlassPointer.class, + private static final ForeignCallDescriptor THROW_CLASS_CAST_EXCEPTION = new ForeignCallDescriptor("throw_class_cast_exception", int.class, Word.class, Word.class, KlassPointer.class, KlassPointer.class); @NodeIntrinsic(StubForeignCallNode.class) - private static native void throwAndPostJvmtiException(@ConstantNodeParameter ForeignCallDescriptor d, Word thread, Word type, Word message); + private static native int throwAndPostJvmtiException(@ConstantNodeParameter ForeignCallDescriptor d, Word thread, Word type, Word message); @NodeIntrinsic(StubForeignCallNode.class) - private static native void throwKlassExternalNameException(@ConstantNodeParameter ForeignCallDescriptor d, Word thread, Word type, KlassPointer klass); + private static native int throwKlassExternalNameException(@ConstantNodeParameter ForeignCallDescriptor d, Word thread, Word type, KlassPointer klass); @NodeIntrinsic(StubForeignCallNode.class) - private static native void throwClassCastException(@ConstantNodeParameter ForeignCallDescriptor d, Word thread, Word type, KlassPointer objKlass, KlassPointer targetKlass); + private static native int throwClassCastException(@ConstantNodeParameter ForeignCallDescriptor d, Word thread, Word type, KlassPointer objKlass, KlassPointer targetKlass); public static void registerForeignCalls(GraalHotSpotVMConfig c, HotSpotForeignCallsProviderImpl foreignCalls) { foreignCalls.registerForeignCall(THROW_AND_POST_JVMTI_EXCEPTION, c.throwAndPostJvmtiExceptionAddress, NativeCall, SAFEPOINT, REEXECUTABLE, any()); diff --git a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/Stub.java b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/Stub.java index 6c421b3c4a9..73bf27398ff 100644 --- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/Stub.java +++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/Stub.java @@ -30,7 +30,7 @@ import static org.graalvm.compiler.core.common.GraalOptions.GeneratePIC; import static org.graalvm.compiler.core.common.GraalOptions.RegisterPressure; import static org.graalvm.compiler.debug.DebugContext.DEFAULT_LOG_STREAM; import static org.graalvm.compiler.debug.DebugOptions.DebugStubsAndSnippets; -import static org.graalvm.compiler.hotspot.HotSpotHostBackend.UNCOMMON_TRAP_HANDLER; +import static org.graalvm.compiler.hotspot.HotSpotHostBackend.DEOPT_BLOB_UNCOMMON_TRAP; import static org.graalvm.util.CollectionsUtil.allMatch; import java.util.ListIterator; @@ -288,7 +288,7 @@ public abstract class Stub { Call call = (Call) infopoint; assert call.target instanceof HotSpotForeignCallLinkage : this + " cannot have non runtime call: " + call.target; HotSpotForeignCallLinkage callLinkage = (HotSpotForeignCallLinkage) call.target; - assert !callLinkage.isCompiledStub() || callLinkage.getDescriptor().equals(UNCOMMON_TRAP_HANDLER) : this + " cannot call compiled stub " + callLinkage; + assert !callLinkage.isCompiledStub() || callLinkage.getDescriptor().equals(DEOPT_BLOB_UNCOMMON_TRAP) : this + " cannot call compiled stub " + callLinkage; } return true; } diff --git a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/BytecodeParser.java b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/BytecodeParser.java index 40643c70b86..f5768c9f842 100644 --- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/BytecodeParser.java +++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/BytecodeParser.java @@ -1321,10 +1321,10 @@ public class BytecodeParser implements GraphBuilderContext { AbstractBeginNode dispatchBegin; if (exceptionObject == null) { ExceptionObjectNode newExceptionObject = graph.add(new ExceptionObjectNode(getMetaAccess())); - dispatchBegin = newExceptionObject; - dispatchState.push(JavaKind.Object, dispatchBegin); + dispatchState.push(JavaKind.Object, newExceptionObject); dispatchState.setRethrowException(true); newExceptionObject.setStateAfter(dispatchState.create(bci, newExceptionObject)); + dispatchBegin = newExceptionObject; } else { dispatchBegin = graph.add(new BeginNode()); dispatchState.push(JavaKind.Object, exceptionObject); @@ -1346,7 +1346,7 @@ public class BytecodeParser implements GraphBuilderContext { protected void createHandleExceptionTarget(FixedWithNextNode afterExceptionLoaded, int bci, FrameStateBuilder dispatchState) { FixedWithNextNode afterInstrumentation = afterExceptionLoaded; for (NodePlugin plugin : graphBuilderConfig.getPlugins().getNodePlugins()) { - afterInstrumentation = plugin.instrumentExceptionDispatch(graph, afterInstrumentation); + afterInstrumentation = plugin.instrumentExceptionDispatch(graph, afterInstrumentation, () -> dispatchState.create(bci, getNonIntrinsicAncestor(), false, null, null)); assert afterInstrumentation.next() == null : "exception dispatch instrumentation will be linked to dispatch block"; } @@ -1611,7 +1611,7 @@ public class BytecodeParser implements GraphBuilderContext { append(new IfNode(condition, trueSuccessor, falseSuccessor, passingOnTrue ? LUDICROUSLY_FAST_PATH_PROBABILITY : LUDICROUSLY_SLOW_PATH_PROBABILITY)); lastInstr = passingSuccessor; - exception.setStateAfter(createFrameState(bci(), exception)); + exception.setStateAfter(createBytecodeExceptionFrameState(bci(), exception)); exception.setNext(handleException(exception, bci(), false)); EXPLICIT_EXCEPTIONS.increment(debug); @@ -3909,12 +3909,24 @@ public class BytecodeParser implements GraphBuilderContext { } private FrameState createFrameState(int bci, StateSplit forStateSplit) { + assert !(forStateSplit instanceof BytecodeExceptionNode); if (currentBlock != null && bci > currentBlock.endBci) { frameState.clearNonLiveLocals(currentBlock, liveness, false); } return frameState.create(bci, forStateSplit); } + private FrameState createBytecodeExceptionFrameState(int bci, BytecodeExceptionNode bytecodeException) { + FrameStateBuilder copy = frameState.copy(); + copy.clearStack(); + if (currentBlock != null) { + copy.clearNonLiveLocals(currentBlock, liveness, false); + } + copy.setRethrowException(true); + copy.push(JavaKind.Object, bytecodeException); + return copy.create(bci, bytecodeException); + } + @Override public void setStateAfter(StateSplit sideEffect) { assert sideEffect.hasSideEffect() || sideEffect instanceof AbstractMergeNode; @@ -4747,7 +4759,7 @@ public class BytecodeParser implements GraphBuilderContext { @Override public AbstractBeginNode genExplicitExceptionEdge(BytecodeExceptionKind exceptionKind) { BytecodeExceptionNode exceptionNode = graph.add(new BytecodeExceptionNode(getMetaAccess(), exceptionKind)); - exceptionNode.setStateAfter(createFrameState(bci(), exceptionNode)); + exceptionNode.setStateAfter(createBytecodeExceptionFrameState(bci(), exceptionNode)); AbstractBeginNode exceptionDispatch = handleException(exceptionNode, bci(), false); exceptionNode.setNext(exceptionDispatch); return BeginNode.begin(exceptionNode); diff --git a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FrameState.java b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FrameState.java index 0a907cfb509..3b2e8d22d8a 100644 --- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FrameState.java +++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FrameState.java @@ -351,6 +351,10 @@ public final class FrameState extends VirtualState implements IterableNodeType { return duplicateModified(graph(), bci, rethrowException, duringCall, popKind, new JavaKind[]{pushedSlotKind}, new ValueNode[]{pushedValue}); } + public FrameState duplicateRethrow(ValueNode exceptionObject) { + return duplicateModified(graph(), bci, true, duringCall, JavaKind.Void, new JavaKind[]{JavaKind.Object}, new ValueNode[]{exceptionObject}); + } + /** * Creates a copy of this frame state with one stack element of type popKind popped from the * stack and the values in pushedValues pushed on the stack. The pushedValues will be formatted diff --git a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/BytecodeExceptionNode.java b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/BytecodeExceptionNode.java index 1d71cb5f156..c3697820d92 100644 --- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/BytecodeExceptionNode.java +++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/BytecodeExceptionNode.java @@ -38,6 +38,7 @@ import org.graalvm.compiler.graph.spi.Canonicalizable; import org.graalvm.compiler.graph.spi.CanonicalizerTool; import org.graalvm.compiler.nodeinfo.NodeInfo; import org.graalvm.compiler.nodeinfo.Verbosity; +import org.graalvm.compiler.nodes.FrameState; import org.graalvm.compiler.nodes.ValueNode; import org.graalvm.compiler.nodes.memory.AbstractMemoryCheckpoint; import org.graalvm.compiler.nodes.memory.MemoryCheckpoint; @@ -45,6 +46,7 @@ import org.graalvm.compiler.nodes.spi.Lowerable; import org.graalvm.compiler.nodes.spi.LoweringTool; import jdk.internal.vm.compiler.word.LocationIdentity; +import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.MetaAccessProvider; /** @@ -106,7 +108,7 @@ public final class BytecodeExceptionNode extends AbstractMemoryCheckpoint implem @Override public Node canonical(CanonicalizerTool tool) { - if (tool.allUsagesAvailable() && getUsageCount() == 0) { + if (tool.allUsagesAvailable() && (hasNoUsages() || (hasExactlyOneUsage() && usages().first() == stateAfter))) { return null; } return this; @@ -120,4 +122,13 @@ public final class BytecodeExceptionNode extends AbstractMemoryCheckpoint implem public NodeInputList getArguments() { return arguments; } + + /** + * Create a new stateDuring for use by a foreign call. + */ + public FrameState createStateDuring() { + return stateAfter.duplicateModified(graph(), stateAfter.bci, /* rethrowException */ false, /* duringCall */ true, + JavaKind.Object, null, null); + } + } diff --git a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/ForeignCallNode.java b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/ForeignCallNode.java index 6705dfbae51..2edf82e386c 100644 --- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/ForeignCallNode.java +++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/ForeignCallNode.java @@ -218,7 +218,7 @@ public class ForeignCallNode extends AbstractMemoryCheckpoint implements LIRLowe (currentStateAfter.stackSize() > 1 && currentStateAfter.stackAt(currentStateAfter.stackSize() - 2) == this)) { // The result of this call is on the top of stack, so roll back to the previous bci. assert bci != BytecodeFrame.UNKNOWN_BCI : this; - newStateDuring = currentStateAfter.duplicateModifiedDuringCall(bci, this.getStackKind()); + newStateDuring = currentStateAfter.duplicateModified(currentStateAfter.graph(), bci, false, true, this.getStackKind(), null, null); } else { newStateDuring = currentStateAfter; } diff --git a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/NodePlugin.java b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/NodePlugin.java index 46f532d9d2e..bfeae84ebe1 100644 --- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/NodePlugin.java +++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/NodePlugin.java @@ -24,8 +24,11 @@ package org.graalvm.compiler.nodes.graphbuilderconf; +import java.util.function.Supplier; + import org.graalvm.compiler.graph.Node.ValueNumberable; import org.graalvm.compiler.nodes.FixedWithNextNode; +import org.graalvm.compiler.nodes.FrameState; import org.graalvm.compiler.nodes.StructuredGraph; import org.graalvm.compiler.nodes.ValueNode; import org.graalvm.compiler.nodes.extended.GuardingNode; @@ -226,9 +229,10 @@ public interface NodePlugin extends GraphBuilderPlugin { * * @param graph the graph being parsed * @param afterExceptionLoaded the last fixed node after loading the exception + * @param frameStateFunction a helper that produces a FrameState suitable for deopt * @return the last fixed node after instrumentation */ - default FixedWithNextNode instrumentExceptionDispatch(StructuredGraph graph, FixedWithNextNode afterExceptionLoaded) { + default FixedWithNextNode instrumentExceptionDispatch(StructuredGraph graph, FixedWithNextNode afterExceptionLoaded, Supplier frameStateFunction) { return afterExceptionLoaded; } diff --git a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/ArrayStoreBytecodeExceptionTest.java b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/ArrayStoreBytecodeExceptionTest.java index 47a9b3b9346..6fc5eb510c9 100644 --- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/ArrayStoreBytecodeExceptionTest.java +++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/ArrayStoreBytecodeExceptionTest.java @@ -33,39 +33,11 @@ import org.junit.runners.Parameterized; import org.junit.runners.Parameterized.Parameter; import org.junit.runners.Parameterized.Parameters; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.extended.BytecodeExceptionNode.BytecodeExceptionKind; -import org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderContext; -import org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugin; -import org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugins; - -import jdk.vm.ci.meta.ResolvedJavaMethod; - @RunWith(Parameterized.class) public class ArrayStoreBytecodeExceptionTest extends BytecodeExceptionTest { - private static class Exceptions { - - private static Object[] array = new Exceptions[1]; - - public static void throwArrayStore(Object obj) { - array[0] = obj; - } - } - - @Override - protected void registerInvocationPlugins(InvocationPlugins invocationPlugins) { - invocationPlugins.register(new InvocationPlugin() { - @Override - public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver, ValueNode obj) { - return throwBytecodeException(b, BytecodeExceptionKind.ARRAY_STORE, obj); - } - }, Exceptions.class, "throwArrayStore", Object.class); - super.registerInvocationPlugins(invocationPlugins); - } - - public static void arrayStoreSnippet(Object obj) { - Exceptions.throwArrayStore(obj); + public static void arrayStoreSnippet(Object[] array, Object obj) { + array[0] = obj; } @Parameter(0) public Object object; @@ -84,6 +56,6 @@ public class ArrayStoreBytecodeExceptionTest extends BytecodeExceptionTest { @Test public void testArrayStoreException() { - test("arrayStoreSnippet", object); + test("arrayStoreSnippet", new ArrayStoreBytecodeExceptionTest[1], object); } } diff --git a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/BytecodeExceptionTest.java b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/BytecodeExceptionTest.java index 6f3070dca00..3934762b51f 100644 --- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/BytecodeExceptionTest.java +++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/BytecodeExceptionTest.java @@ -24,18 +24,27 @@ package org.graalvm.compiler.replacements.test; +import static org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration.BytecodeExceptionMode.CheckAll; + import org.graalvm.compiler.core.test.GraalCompilerTest; -import org.graalvm.compiler.nodes.UnwindNode; -import org.graalvm.compiler.nodes.ValueNode; +import org.graalvm.compiler.nodes.StructuredGraph; import org.graalvm.compiler.nodes.extended.BytecodeExceptionNode; -import org.graalvm.compiler.nodes.extended.BytecodeExceptionNode.BytecodeExceptionKind; -import org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderContext; +import org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration; +import org.graalvm.compiler.options.OptionValues; + +import jdk.vm.ci.meta.ResolvedJavaMethod; public abstract class BytecodeExceptionTest extends GraalCompilerTest { - protected boolean throwBytecodeException(GraphBuilderContext b, BytecodeExceptionKind exception, ValueNode... arguments) { - BytecodeExceptionNode exceptionNode = b.add(new BytecodeExceptionNode(b.getMetaAccess(), exception, arguments)); - b.add(new UnwindNode(exceptionNode)); - return true; + @Override + protected GraphBuilderConfiguration editGraphBuilderConfiguration(GraphBuilderConfiguration conf) { + return super.editGraphBuilderConfiguration(conf).withBytecodeExceptionMode(CheckAll); + } + + @Override + protected Result test(OptionValues options, ResolvedJavaMethod method, Object receiver, Object... args) { + StructuredGraph graph = parseEager(method, StructuredGraph.AllowAssumptions.NO); + assertTrue("no BytecodeExceptionNode generated", graph.getNodes().filter(BytecodeExceptionNode.class).isNotEmpty()); + return super.test(options, method, receiver, args); } } diff --git a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/ClassCastBytecodeExceptionTest.java b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/ClassCastBytecodeExceptionTest.java index e3a0712e4b8..611fea7fba9 100644 --- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/ClassCastBytecodeExceptionTest.java +++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/ClassCastBytecodeExceptionTest.java @@ -27,6 +27,7 @@ package org.graalvm.compiler.replacements.test; import java.util.ArrayList; import java.util.Collection; +import org.graalvm.compiler.api.directives.GraalDirectives; import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; @@ -34,64 +35,9 @@ import org.junit.runners.Parameterized; import org.junit.runners.Parameterized.Parameter; import org.junit.runners.Parameterized.Parameters; -import org.graalvm.compiler.api.directives.GraalDirectives; -import org.graalvm.compiler.core.common.type.Stamp; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.core.common.type.TypeReference; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.extended.BytecodeExceptionNode.BytecodeExceptionKind; -import org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderContext; -import org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugin; -import org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugins; - -import jdk.vm.ci.meta.Constant; -import jdk.vm.ci.meta.ResolvedJavaMethod; -import jdk.vm.ci.meta.ResolvedJavaType; - @RunWith(Parameterized.class) public class ClassCastBytecodeExceptionTest extends BytecodeExceptionTest { - private static class Exceptions { - - public static void throwClassCast(Object obj, Class cls) { - /* - * We don't use cls.cast(obj) here because that gives a different exception message than - * the checkcast bytecode. - */ - if (cls == Double.class) { - Double cast = (Double) obj; - GraalDirectives.blackhole(cast); - } else if (cls == byte[].class) { - byte[] cast = (byte[]) obj; - GraalDirectives.blackhole(cast); - } else if (cls == String[].class) { - String[] cast = (String[]) obj; - GraalDirectives.blackhole(cast); - } else if (cls == Object[][].class) { - Object[][] cast = (Object[][]) obj; - GraalDirectives.blackhole(cast); - } else { - Assert.fail("unexpected class argument"); - } - } - } - - @Override - protected void registerInvocationPlugins(InvocationPlugins invocationPlugins) { - invocationPlugins.register(new InvocationPlugin() { - @Override - public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver, ValueNode obj, ValueNode classNode) { - ResolvedJavaType type = b.getConstantReflection().asJavaType(classNode.asConstant()); - Constant hub = b.getConstantReflection().asObjectHub(type); - Stamp hubStamp = b.getStampProvider().createHubStamp(StampFactory.object(TypeReference.createExactTrusted(type))); - ConstantNode hubConst = b.add(ConstantNode.forConstant(hubStamp, hub, b.getMetaAccess())); - return throwBytecodeException(b, BytecodeExceptionKind.CLASS_CAST, obj, hubConst); - } - }, Exceptions.class, "throwClassCast", Object.class, Class.class); - super.registerInvocationPlugins(invocationPlugins); - } - @Parameter(0) public Object object; @Parameter(1) public Class cls; @@ -107,7 +53,25 @@ public class ClassCastBytecodeExceptionTest extends BytecodeExceptionTest { } public static void castToDouble(Object obj) { - Exceptions.throwClassCast(obj, Double.class); + /* + * We don't use cls.cast(obj) here because that gives a different exception message than the + * checkcast bytecode. + */ + if (Double.class == Double.class) { + Double cast = (Double) obj; + GraalDirectives.blackhole(cast); + } else if ((Class) Double.class == byte[].class) { + byte[] cast = (byte[]) obj; + GraalDirectives.blackhole(cast); + } else if ((Class) Double.class == String[].class) { + String[] cast = (String[]) obj; + GraalDirectives.blackhole(cast); + } else if ((Class) Double.class == Object[][].class) { + Object[][] cast = (Object[][]) obj; + GraalDirectives.blackhole(cast); + } else { + Assert.fail("unexpected class argument"); + } } @Test @@ -116,7 +80,25 @@ public class ClassCastBytecodeExceptionTest extends BytecodeExceptionTest { } public static void castToByteArray(Object obj) { - Exceptions.throwClassCast(obj, byte[].class); + /* + * We don't use cls.cast(obj) here because that gives a different exception message than the + * checkcast bytecode. + */ + if ((Class) byte[].class == Double.class) { + Double cast = (Double) obj; + GraalDirectives.blackhole(cast); + } else if (byte[].class == byte[].class) { + byte[] cast = (byte[]) obj; + GraalDirectives.blackhole(cast); + } else if ((Class) byte[].class == String[].class) { + String[] cast = (String[]) obj; + GraalDirectives.blackhole(cast); + } else if ((Class) byte[].class == Object[][].class) { + Object[][] cast = (Object[][]) obj; + GraalDirectives.blackhole(cast); + } else { + Assert.fail("unexpected class argument"); + } } @Test @@ -125,7 +107,25 @@ public class ClassCastBytecodeExceptionTest extends BytecodeExceptionTest { } public static void castToStringArray(Object obj) { - Exceptions.throwClassCast(obj, String[].class); + /* + * We don't use cls.cast(obj) here because that gives a different exception message than the + * checkcast bytecode. + */ + if ((Class) String[].class == Double.class) { + Double cast = (Double) obj; + GraalDirectives.blackhole(cast); + } else if ((Class) String[].class == byte[].class) { + byte[] cast = (byte[]) obj; + GraalDirectives.blackhole(cast); + } else if (String[].class == String[].class) { + String[] cast = (String[]) obj; + GraalDirectives.blackhole(cast); + } else if ((Class) String[].class == Object[][].class) { + Object[][] cast = (Object[][]) obj; + GraalDirectives.blackhole(cast); + } else { + Assert.fail("unexpected class argument"); + } } @Test @@ -134,7 +134,25 @@ public class ClassCastBytecodeExceptionTest extends BytecodeExceptionTest { } public static void castToArrayArray(Object obj) { - Exceptions.throwClassCast(obj, Object[][].class); + /* + * We don't use cls.cast(obj) here because that gives a different exception message than the + * checkcast bytecode. + */ + if ((Class) Object[][].class == Double.class) { + Double cast = (Double) obj; + GraalDirectives.blackhole(cast); + } else if ((Class) Object[][].class == byte[].class) { + byte[] cast = (byte[]) obj; + GraalDirectives.blackhole(cast); + } else if ((Class) Object[][].class == String[].class) { + String[] cast = (String[]) obj; + GraalDirectives.blackhole(cast); + } else if (Object[][].class == Object[][].class) { + Object[][] cast = (Object[][]) obj; + GraalDirectives.blackhole(cast); + } else { + Assert.fail("unexpected class argument"); + } } @Test diff --git a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/IndexOobBytecodeExceptionTest.java b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/IndexOobBytecodeExceptionTest.java index 37ad0a291ef..6a117620051 100644 --- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/IndexOobBytecodeExceptionTest.java +++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/IndexOobBytecodeExceptionTest.java @@ -27,47 +27,19 @@ package org.graalvm.compiler.replacements.test; import java.util.ArrayList; import java.util.Collection; +import org.graalvm.compiler.api.directives.GraalDirectives; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import org.junit.runners.Parameterized.Parameter; import org.junit.runners.Parameterized.Parameters; -import org.graalvm.compiler.api.directives.GraalDirectives; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.extended.BytecodeExceptionNode.BytecodeExceptionKind; -import org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderContext; -import org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugin; -import org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugins; - -import jdk.vm.ci.meta.ResolvedJavaMethod; - @RunWith(Parameterized.class) public class IndexOobBytecodeExceptionTest extends BytecodeExceptionTest { - private static class Exceptions { - - private static Object[] empty = new Object[0]; - - public static void throwOutOfBounds(int idx, int length) { - GraalDirectives.blackhole(empty[idx]); - GraalDirectives.blackhole(length); - } - } - - @Override - protected void registerInvocationPlugins(InvocationPlugins invocationPlugins) { - invocationPlugins.register(new InvocationPlugin() { - @Override - public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver, ValueNode idx, ValueNode length) { - return throwBytecodeException(b, BytecodeExceptionKind.OUT_OF_BOUNDS, idx, length); - } - }, Exceptions.class, "throwOutOfBounds", int.class, int.class); - super.registerInvocationPlugins(invocationPlugins); - } - - public static void oobSnippet(int idx, int length) { - Exceptions.throwOutOfBounds(idx, length); + public static void oobSnippet(Object[] empty, int idx, int length) { + GraalDirectives.blackhole(empty[idx]); + GraalDirectives.blackhole(length); } @Parameter public int index; @@ -85,6 +57,7 @@ public class IndexOobBytecodeExceptionTest extends BytecodeExceptionTest { @Test public void testOutOfBoundsException() { - test("oobSnippet", index, Exceptions.empty.length); + Object[] empty = new Object[0]; + test("oobSnippet", empty, index, empty.length); } } diff --git a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/NullBytecodeExceptionTest.java b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/NullBytecodeExceptionTest.java index a5da10e35cf..1ffce991217 100644 --- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/NullBytecodeExceptionTest.java +++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/NullBytecodeExceptionTest.java @@ -25,41 +25,15 @@ package org.graalvm.compiler.replacements.test; import org.junit.Test; -import org.graalvm.compiler.nodes.extended.BytecodeExceptionNode.BytecodeExceptionKind; -import org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderContext; -import org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugin; -import org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugins; - -import jdk.vm.ci.meta.ResolvedJavaMethod; public class NullBytecodeExceptionTest extends BytecodeExceptionTest { - private static class Exceptions { - - private static Object obj = null; - - public static void throwNull() { - obj.toString(); - } - } - - @Override - protected void registerInvocationPlugins(InvocationPlugins invocationPlugins) { - invocationPlugins.register(new InvocationPlugin() { - @Override - public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver) { - return throwBytecodeException(b, BytecodeExceptionKind.NULL_POINTER); - } - }, Exceptions.class, "throwNull"); - super.registerInvocationPlugins(invocationPlugins); - } - - public static void nullSnippet() { - Exceptions.throwNull(); + public static void nullSnippet(Object obj) { + obj.toString(); } @Test public void testNullPointerException() { - test("nullSnippet"); + test("nullSnippet", (Object) null); } } From f4f7dbd54cf9d309039122e46ab8577bc3fd950a Mon Sep 17 00:00:00 2001 From: Brian Burkhalter Date: Thu, 23 Jan 2020 10:19:32 -0800 Subject: [PATCH 06/50] 8225471: Test utility jdk.test.lib.util.FileUtils.areAllMountPointsAccessible needs to tolerate duplicates Reviewed-by: alanb --- test/jdk/java/nio/file/FileStore/Basic.java | 4 +- test/lib/jdk/test/lib/util/FileUtils.java | 134 ++++++++++---------- 2 files changed, 68 insertions(+), 70 deletions(-) diff --git a/test/jdk/java/nio/file/FileStore/Basic.java b/test/jdk/java/nio/file/FileStore/Basic.java index 1344b1ccb59..20f9db06886 100644 --- a/test/jdk/java/nio/file/FileStore/Basic.java +++ b/test/jdk/java/nio/file/FileStore/Basic.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2020, 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 @@ -115,7 +115,7 @@ public class Basic { /** * Test: Enumerate all FileStores */ - if (FileUtils.areAllMountPointsAccessible()) { + if (FileUtils.areMountPointsAccessibleAndUnique()) { FileStore prev = null; for (FileStore store: FileSystems.getDefault().getFileStores()) { System.out.format("%s (name=%s type=%s)\n", store, store.name(), diff --git a/test/lib/jdk/test/lib/util/FileUtils.java b/test/lib/jdk/test/lib/util/FileUtils.java index 5b69fcb2f95..3b10bb26392 100644 --- a/test/lib/jdk/test/lib/util/FileUtils.java +++ b/test/lib/jdk/test/lib/util/FileUtils.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2020, 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 @@ -47,6 +47,7 @@ import java.util.ArrayDeque; import java.util.HashSet; import java.util.List; import java.util.Optional; +import java.util.Set; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicReference; import java.util.concurrent.TimeUnit; @@ -242,87 +243,84 @@ public final class FileUtils { } /** - * Checks whether all file systems are accessible. This is performed - * by checking free disk space on all mounted file systems via a - * separate, spawned process. File systems are considered to be - * accessible if this process completes successfully before a given - * fixed duration has elapsed. + * Checks whether all file systems are accessible and there are no + * duplicate mount points. This is performed by checking free disk + * space on all mounted file systems via a separate, spawned process. + * File systems are considered to be accessible if this process completes + * successfully before a given fixed duration has elapsed. * * @implNote On Unix this executes the {@code df} command in a separate * process and on Windows always returns {@code true}. * - * @return whether file systems appear to be accessible - * - * @throws RuntimeException if there are duplicate mount points or some - * other execution problem occurs + * @return whether file systems appear to be accessible and duplicate-free */ - public static boolean areAllMountPointsAccessible() { - final AtomicBoolean areMountPointsOK = new AtomicBoolean(true); - if (!IS_WINDOWS) { - Thread thr = new Thread(() -> { - try { - Process proc = new ProcessBuilder("df").start(); - BufferedReader reader = new BufferedReader - (new InputStreamReader(proc.getInputStream())); - // Skip the first line as it is the "df" output header. - if (reader.readLine() != null ) { - String prevMountPoint = null, mountPoint = null; - while ((mountPoint = reader.readLine()) != null) { - if (prevMountPoint != null && - mountPoint.equals(prevMountPoint)) { - throw new RuntimeException - ("System configuration error: " + - "duplicate mount point " + mountPoint + - " detected"); - } - prevMountPoint = mountPoint; - } - } + public static boolean areMountPointsAccessibleAndUnique() { + if (IS_WINDOWS) return true; - try { - proc.waitFor(90, TimeUnit.SECONDS); - } catch (InterruptedException ignored) { - } - try { - int exitValue = proc.exitValue(); - if (exitValue != 0) { - System.err.printf("df process exited with %d != 0%n", - exitValue); + final AtomicBoolean areMountPointsOK = new AtomicBoolean(true); + Thread thr = new Thread(() -> { + try { + Process proc = new ProcessBuilder("df").start(); + BufferedReader reader = new BufferedReader + (new InputStreamReader(proc.getInputStream())); + // Skip the first line as it is the "df" output header. + if (reader.readLine() != null ) { + Set mountPoints = new HashSet(); + String mountPoint = null; + while ((mountPoint = reader.readLine()) != null) { + if (!mountPoints.add(mountPoint)) { + System.err.printf + ("Config error: duplicate mount point %s%n", + mountPoint); areMountPointsOK.set(false); + break; } - } catch (IllegalThreadStateException ignored) { - System.err.println("df command apparently hung"); + } + } + + try { + proc.waitFor(90, TimeUnit.SECONDS); + } catch (InterruptedException ignored) { + } + try { + int exitValue = proc.exitValue(); + if (exitValue != 0) { + System.err.printf("df process exited with %d != 0%n", + exitValue); areMountPointsOK.set(false); } - } catch (IOException ioe) { - throw new RuntimeException(ioe); - }; + } catch (IllegalThreadStateException ignored) { + System.err.println("df command apparently hung"); + areMountPointsOK.set(false); + } + } catch (IOException ioe) { + throw new RuntimeException(ioe); + }; + }); + + final AtomicReference throwableReference = + new AtomicReference(); + thr.setUncaughtExceptionHandler( + new Thread.UncaughtExceptionHandler() { + public void uncaughtException(Thread t, Throwable e) { + throwableReference.set(e); + } }); - final AtomicReference throwableReference = - new AtomicReference(); - thr.setUncaughtExceptionHandler( - new Thread.UncaughtExceptionHandler() { - public void uncaughtException(Thread t, Throwable e) { - throwableReference.set(e); - } - }); + thr.start(); + try { + thr.join(120*1000L); + } catch (InterruptedException ie) { + throw new RuntimeException(ie); + } - thr.start(); - try { - thr.join(120*1000L); - } catch (InterruptedException ie) { - throw new RuntimeException(ie); - } + Throwable uncaughtException = (Throwable)throwableReference.get(); + if (uncaughtException != null) { + throw new RuntimeException(uncaughtException); + } - Throwable uncaughtException = (Throwable)throwableReference.get(); - if (uncaughtException != null) { - throw new RuntimeException(uncaughtException); - } - - if (thr.isAlive()) { - throw new RuntimeException("df thread did not join in time"); - } + if (thr.isAlive()) { + throw new RuntimeException("df thread did not join in time"); } return areMountPointsOK.get(); From f8f98bdbffcc63f4f2e8ddbe5c7329489f768bb5 Mon Sep 17 00:00:00 2001 From: Alexander Matveev Date: Fri, 24 Jan 2020 11:24:28 -0500 Subject: [PATCH 07/50] 8237607: [macos] Signing app bundle with jpackage fails if runtime is already signed Reviewed-by: herrick, asemenyuk, kcr --- .../jdk/incubator/jpackage/internal/MacAppImageBuilder.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/jdk.incubator.jpackage/macosx/classes/jdk/incubator/jpackage/internal/MacAppImageBuilder.java b/src/jdk.incubator.jpackage/macosx/classes/jdk/incubator/jpackage/internal/MacAppImageBuilder.java index c08067562fa..c7c226eba94 100644 --- a/src/jdk.incubator.jpackage/macosx/classes/jdk/incubator/jpackage/internal/MacAppImageBuilder.java +++ b/src/jdk.incubator.jpackage/macosx/classes/jdk/incubator/jpackage/internal/MacAppImageBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2020, 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 @@ -823,6 +823,7 @@ public class MacAppImageBuilder extends AbstractAppImageBuilder { try { List args = new ArrayList<>(); args.addAll(Arrays.asList("codesign", + "-f", "-s", signingIdentity, // sign with this key "--prefix", identifierPrefix, // use the identifier as a prefix From 2760497b01c2320cc4ff54e83d27e04eda0a7e2e Mon Sep 17 00:00:00 2001 From: Roger Riggs Date: Fri, 24 Jan 2020 13:33:31 -0500 Subject: [PATCH 08/50] 8237368: Problem with NullPointerException in RMI TCPEndpoint.read Reviewed-by: mchung, alanb --- .../sun/rmi/transport/tcp/TCPEndpoint.java | 2 +- .../unicast/TCPEndpointReadBug.java | 113 ++++++++++++++++++ 2 files changed, 114 insertions(+), 1 deletion(-) create mode 100644 test/jdk/java/rmi/server/RMISocketFactory/useSocketFactory/unicast/TCPEndpointReadBug.java diff --git a/src/java.rmi/share/classes/sun/rmi/transport/tcp/TCPEndpoint.java b/src/java.rmi/share/classes/sun/rmi/transport/tcp/TCPEndpoint.java index 1b5627e001f..d6d47357e0f 100644 --- a/src/java.rmi/share/classes/sun/rmi/transport/tcp/TCPEndpoint.java +++ b/src/java.rmi/share/classes/sun/rmi/transport/tcp/TCPEndpoint.java @@ -554,7 +554,7 @@ public class TCPEndpoint implements Endpoint { host = in.readUTF(); port = in.readInt(); csf = (RMIClientSocketFactory) in.readObject(); - if (Proxy.isProxyClass(csf.getClass())) { + if (csf != null && Proxy.isProxyClass(csf.getClass())) { throw new IOException("Invalid SocketFactory"); } break; diff --git a/test/jdk/java/rmi/server/RMISocketFactory/useSocketFactory/unicast/TCPEndpointReadBug.java b/test/jdk/java/rmi/server/RMISocketFactory/useSocketFactory/unicast/TCPEndpointReadBug.java new file mode 100644 index 00000000000..9c29aad9548 --- /dev/null +++ b/test/jdk/java/rmi/server/RMISocketFactory/useSocketFactory/unicast/TCPEndpointReadBug.java @@ -0,0 +1,113 @@ +/* + * Copyright (c) 2020, 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. + */ + + +import java.io.IOException; +import java.io.Serializable; +import java.io.ObjectInputStream; +import java.net.Socket; +import java.rmi.Remote; +import java.rmi.RemoteException; +import java.rmi.server.RMIClientSocketFactory; +import java.rmi.server.RMISocketFactory; +import java.rmi.server.UnicastRemoteObject; + +/* @test + * @bug 8237368 + * @summary Allow custom socket factory to be null in TCPEndpoint. + * @run main/othervm TCPEndpointReadBug + */ +public class TCPEndpointReadBug { + + public static void main(String[] args) throws Exception { + final I implC = new C(); + final I remoteC = (I)UnicastRemoteObject.exportObject( + implC, 0, new CSF(), RMISocketFactory.getDefaultSocketFactory()); + + // Pass a remote object with a custom socket factory as an argument + remoteC.echo(remoteC); + + // Pass nothing and get an object with a custom socket factory in return + remoteC.echo(null); + } + + interface I extends Remote { + I echo(I intf) throws RemoteException; + } + + static class C implements I { + @Override + public I echo(I intf) { + try { + return (I)UnicastRemoteObject + .exportObject(new C(),0, new CSF(), RMISocketFactory.getDefaultSocketFactory()); + } catch (RemoteException e) { + e.printStackTrace(); + } + return null; + } + } + + /** + * A configurable socket factory in which for test purposes supplies null. + */ + static class CSF implements Serializable, RMIClientSocketFactory { + private static final long serialVersionUID = 1; + + @Override + public boolean equals(Object object) { + return object instanceof CSF; + } + + @Override + public int hashCode() { + return 424242; + } + + @Override + public Socket createSocket(String host, int port) + throws IOException { + + final RMIClientSocketFactory defaultFactory = + RMISocketFactory.getDefaultSocketFactory(); + return defaultFactory.createSocket(host, port); + } + + /** + * Use writeReplace to use a different client socket factory. In the + * problematic case, the replacement is null. + */ + private Object writeReplace() { + return null; + } + + /** + * Instances of this class should never be deserialized because they + * are always replaced during serialization. + */ + @SuppressWarnings("unused") + private void readObject(ObjectInputStream in) { + throw new AssertionError(); + } + } +} From 42726a87e94c9a8486bc659cf212042a40d22907 Mon Sep 17 00:00:00 2001 From: Roger Riggs Date: Fri, 24 Jan 2020 14:32:04 -0500 Subject: [PATCH 09/50] 8215361: (doc) Cleanup package-info markup - smartcardio, java.sql, java.sql.rowset Reviewed-by: lancea, prappo, naoto --- .../java/util/stream/package-info.java | 4 +- .../javax/smartcardio/package-info.java | 4 +- .../classes/com/sun/rowset/package-info.java | 30 +- .../sun/rowset/providers/package-info.java | 94 ++--- .../javax/sql/rowset/package-info.java | 194 +++++----- .../javax/sql/rowset/serial/package-info.java | 129 +++---- .../javax/sql/rowset/spi/package-info.java | 332 +++++++++--------- .../share/classes/java/sql/package-info.java | 202 +++++------ .../share/classes/javax/sql/package-info.java | 186 +++++----- 9 files changed, 588 insertions(+), 587 deletions(-) diff --git a/src/java.base/share/classes/java/util/stream/package-info.java b/src/java.base/share/classes/java/util/stream/package-info.java index d28c0597292..e2109b9e9d7 100644 --- a/src/java.base/share/classes/java/util/stream/package-info.java +++ b/src/java.base/share/classes/java/util/stream/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2020, 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 @@ -176,7 +176,7 @@ * do: * *
{@code
- *     int sumOfWeights = widgets.}parallelStream(){@code
+ *     int sumOfWeights = widgets.parallelStream()
  *                               .filter(b -> b.getColor() == RED)
  *                               .mapToInt(b -> b.getWeight())
  *                               .sum();
diff --git a/src/java.smartcardio/share/classes/javax/smartcardio/package-info.java b/src/java.smartcardio/share/classes/javax/smartcardio/package-info.java
index 180128c0a3d..ef6489509df 100644
--- a/src/java.smartcardio/share/classes/javax/smartcardio/package-info.java
+++ b/src/java.smartcardio/share/classes/javax/smartcardio/package-info.java
@@ -1,5 +1,5 @@
 /*
- *  Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved.
+ *  Copyright (c) 2005, 2020, 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
@@ -36,7 +36,7 @@
  *
  * 

* The API is defined by classes in the package - * javax.smartcardio. They can be classified as follows: + * {@code javax.smartcardio}. They can be classified as follows: * *

*
Classes describing the corresponding Smart Card structures diff --git a/src/java.sql.rowset/share/classes/com/sun/rowset/package-info.java b/src/java.sql.rowset/share/classes/com/sun/rowset/package-info.java index 2c74358edd1..950f4bfaa39 100644 --- a/src/java.sql.rowset/share/classes/com/sun/rowset/package-info.java +++ b/src/java.sql.rowset/share/classes/com/sun/rowset/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2020, 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 @@ -24,48 +24,48 @@ */ /** - * Provides five standard implementations of the standard JDBC RowSet implementation + * Provides five standard implementations of the standard JDBC {@code RowSet} implementation * interface definitions. These reference implementations are included with the J2SE version - * 1.5 platform and represent the benchmark standard RowSet implementations as verified + * 1.5 platform and represent the benchmark standard {@code RowSet} implementations as verified * by the Test Compatibility Kit (TCK) as mandated by the Java Community Process. *
* *

1.0 Available JDBC RowSet Reference Implementations

* The following implementations are provided:
* - *
JdbcRowSetImpl - The javax.sql.rowset.JdbcRowSet + *
{@code JdbcRowSetImpl} - The {@code javax.sql.rowset.JdbcRowSet} * interface reference implementation.
*
- * CachedRowSetImpl - The javax.sql.rowset.CachedRowSet interface + * {@code CachedRowSetImpl} - The {@code javax.sql.rowset.CachedRowSet} interface * reference implementation.
*
- * WebRowSetImpl - The javax.sql.rowset.WebRowSet interface + * {@code WebRowSetImpl} - The {@code javax.sql.rowset.WebRowSet} interface * reference implementation.
*
- * FilteredRowSetImpl - The javax.sql.rowset.FilteredRowSet + * {@code FilteredRowSetImpl} - The {@code javax.sql.rowset.FilteredRowSet} * interface reference implementation.
*
- * JoinRowSetImpl - The javax.sql.rowset.JoinRowSet interface + * {@code JoinRowSetImpl} - The {@code javax.sql.rowset.JoinRowSet} interface * reference implementation.
*
* - * All details on their expected behavior, including their interactions with the SyncProvider - * SPI and helper classes are provided in the interface definitions in the javax.sql.rowset + * All details on their expected behavior, including their interactions with the {@code SyncProvider} + * SPI and helper classes are provided in the interface definitions in the {@code javax.sql.rowset} * package specification.
* *

2.0 Usage

* The reference implementations represent robust implementations of the standard - * RowSet interfaces defined in the javax.sql.rowset package. - * All disconnected RowSet implementations, such as the CachedRowSetImpl - * and WebRowSetImpl, are flexible enough to use the SyncFactory SPIs to - * leverage non-reference implementation SyncProvider implementations to obtain + * {@code RowSet} interfaces defined in the {@code javax.sql.rowset} package. + * All disconnected {@code RowSet} implementations, such as the {@code CachedRowSetImpl} + * and {@code WebRowSetImpl}, are flexible enough to use the {@code SyncFactory} SPIs to + * leverage non-reference implementation {@code SyncProvider} implementations to obtain * differing synchronization semantics. Furthermore, developers and vendors alike are free * to use these implementations and integrate them into their products just as they * can with to other components of the Java platform.
* *

3.0 Extending the JDBC RowSet Implementations

* - * The JDBC RowSet reference implementations are provided as non-final + * The JDBC {@code RowSet} reference implementations are provided as non-final * classes so that any developer can extend them to provide additional features * while maintaining the core required standard functionality and compatibility. It * is anticipated that many vendors and developers will extend the standard feature diff --git a/src/java.sql.rowset/share/classes/com/sun/rowset/providers/package-info.java b/src/java.sql.rowset/share/classes/com/sun/rowset/providers/package-info.java index e58a581625e..f25376c0e3b 100644 --- a/src/java.sql.rowset/share/classes/com/sun/rowset/providers/package-info.java +++ b/src/java.sql.rowset/share/classes/com/sun/rowset/providers/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2020, 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 @@ -25,39 +25,39 @@ /** * - * Repository for the RowSet reference implementations of the - * SyncProvider abstract class. These implementations provide a - * disconnected RowSet + * Repository for the {@code RowSet} reference implementations of the + * {@code SyncProvider} abstract class. These implementations provide a + * disconnected {@code RowSet} * object with the ability to synchronize the data in the underlying data * source with its data. These implementations are provided as - * the default SyncProvider implementations and are accessible via the - * SyncProvider SPI managed by the SyncFactory. + * the default {@code SyncProvider} implementations and are accessible via the + * {@code SyncProvider} SPI managed by the {@code SyncFactory}. * - *

1.0 SyncProvider Reference Implementations

- * The main job of a SyncProvider implementation is to manage + *

1.0 {@code SyncProvider} Reference Implementations

+ * The main job of a {@code SyncProvider} implementation is to manage * the reader and writer mechanisms. - * The SyncProvider SPI, as specified in the javax.sql.rowset.spi - * package, provides a pluggable mechanism by which javax.sql.RowSetReader - * and javax.sql.RowSetWriter implementations can be supplied to a disconnected - * RowSet object. + * The {@code SyncProvider} SPI, as specified in the {@code javax.sql.rowset.spi} + * package, provides a pluggable mechanism by which {@code javax.sql.RowSetReader} + * and {@code javax.sql.RowSetWriter} implementations can be supplied to a disconnected + * {@code RowSet} object. *

- * A reader, a javax.sql.RowSetReader - * object, does the work necessary to populate a RowSet object with data. - * A writer, a javax.sql.RowSetWriter object, does the work necessary for - * synchronizing a RowSet object's data with the data in the originating - * source of data. Put another way, a writer writes a RowSet + * A reader, a {@code javax.sql.RowSetReader} + * object, does the work necessary to populate a {@code RowSet} object with data. + * A writer, a {@code javax.sql.RowSetWriter} object, does the work necessary for + * synchronizing a {@code RowSet} object's data with the data in the originating + * source of data. Put another way, a writer writes a {@code RowSet} * object's data back to the data source. *

* Generally speaking, the course of events is this. The reader makes a connection to - * the data source and reads the data from a ResultSet object into its - * RowSet object. Then it closes the connection. While - * the RowSet object is disconnected, an application makes some modifications - * to the data and calls the method acceptChanges. At this point, the + * the data source and reads the data from a {@code ResultSet} object into its + * {@code RowSet} object. Then it closes the connection. While + * the {@code RowSet} object is disconnected, an application makes some modifications + * to the data and calls the method {@code acceptChanges}. At this point, the * writer is called to write the changes back to the database table or view * from which the original data came. This is called synchronization. *

* If the data in the originating data source has not changed, there is no problem - * with just writing the RowSet object's new data to the data source. + * with just writing the {@code RowSet} object's new data to the data source. * If it has changed, however, there is a conflict that needs to be resolved. One * way to solve the problem is not to let the data in the data source be changed in * the first place, which can be done by setting locks on a row, a table, or the @@ -65,44 +65,44 @@ * very expensive. Another approach, which is at the other end of the spectrum, * is simply to assume that no conflicts will occur and thus do nothing to avoid * conflicts. - * Different SyncProvider implementations may handle synchronization in + * Different {@code SyncProvider} implementations may handle synchronization in * any of these ways, varying from doing no checking for * conflicts, to doing various levels of checking, to guaranteeing that there are no * conflicts. *

- * The SyncProvider class offers methods to help a RowSet + * The {@code SyncProvider} class offers methods to help a {@code RowSet} * object discover and manage how a provider handles synchronization. - * The method getProviderGrade returns the + * The method {@code getProviderGrade} returns the * grade of synchronization a provider offers. An application can * direct the provider to use a particular level of locking by calling - * the method setDataSourceLock and specifying the level of locking desired. - * If a RowSet object's data came from an SQL VIEW, an - * application may call the method supportsUpdatableView to - * find out whether the VIEW can be updated. + * the method {@code setDataSourceLock} and specifying the level of locking desired. + * If a {@code RowSet} object's data came from an SQL {@code VIEW}, an + * application may call the method {@code supportsUpdatableView} to + * find out whether the {@code VIEW} can be updated. *

* Synchronization is done completely behind the scenes, so it is third party vendors of * synchronization provider implementations who have to take care of this complex task. * Application programmers can decide which provider to use and the level of locking to * be done, but they are free from having to worry about the implementation details. *

- * The JDBC RowSet Implementations reference implementation provides two - * implementations of the SyncProvider class: + * The JDBC {@code RowSet} Implementations reference implementation provides two + * implementations of the {@code SyncProvider} class: * *

    *
  • - * RIOptimisticProvider - provides the javax.sql.RowSetReader - * and javax.sql.RowSetWriter interface implementations and provides + * {@code RIOptimisticProvider} - provides the {@code javax.sql.RowSetReader} + * and {@code javax.sql.RowSetWriter} interface implementations and provides * an optimistic concurrency model for synchronization. This model assumes that there * will be few conflicts and therefore uses a relatively low grade of synchronization. * If no other provider is available, this is the default provider that the - * SyncFactory will supply to a RowSet object. + * {@code SyncFactory} will supply to a {@code RowSet} object. *
    *
  • - * RIXMLProvider - provides the XmlReader (an extension - * of the javax.sql.RowSetReader interface) and the XmlWriter - * (an extension of the javax.sql.RowSetWriter interface) to enable - * WebRowSet objects to write their state to a - * well formed XML document according to the WebRowSet XML schema + * {@code RIXMLProvider} - provides the {@code XmlReader} (an extension + * of the {@code javax.sql.RowSetReader} interface) and the {@code XmlWriter} + * (an extension of the {@code javax.sql.RowSetWriter} interface) to enable + * {@code WebRowSet} objects to write their state to a + * well formed XML document according to the {@code WebRowSet} XML schema * definition.
    *
* @@ -117,12 +117,12 @@ * properties. The general rule is that a RowSet is required to set only the * properties that it uses.
*
- * The command property contains the query that determines what - * data a RowSet will contain. Rowsets have methods for setting a query's + * The {@code command} property contains the query that determines what + * data a {@code RowSet} will contain. Rowsets have methods for setting a query's * parameter(s), which means that a query can be executed multiple times with * different parameters to produce different result sets. Or the query can be * changed to something completely new to get a new result set. - *

Once a rowset contains the rows from a ResultSet object or some + *

Once a rowset contains the rows from a {@code ResultSet} object or some * other data source, its column values can be updated, and its rows can be * inserted or deleted. Any method that causes a change in the rowset's values * or cursor position also notifies any object that has been registered as @@ -134,13 +134,13 @@ * source to keep the rowset and its data source synchronized. Although this * involves many operations behind the scenes, it is completely transparent * to the application programmer and remains the concern of the RowSet provider - * developer. All an application has to do is invoke the method acceptChanges, + * developer. All an application has to do is invoke the method {@code acceptChanges}, * and the data source backing the rowset will be updated to match the current * values in the rowset.

* - *

A disconnected rowset, such as a CachedRowSet or WebRowSet + *

A disconnected rowset, such as a {@code CachedRowSet} or {@code WebRowSet} * object, establishes a connection to populate itself with data from a database - * and then closes the connection. The RowSet object will remain + * and then closes the connection. The {@code RowSet} object will remain * disconnected until it wants to propagate changes back to its database table, * which is optional. To write its changes back to the database (synchronize with * the database), the rowset establishes a connection, write the changes, and then @@ -148,9 +148,9 @@ *

* *

3.0 Other Possible Implementations

- * There are many other possible implementations of the SyncProvider abstract + * There are many other possible implementations of the {@code SyncProvider} abstract * class. One possibility is to employ a more robust synchronization model, which - * would give a RowSet object increased trust in the provider's + * would give a {@code RowSet} object increased trust in the provider's * ability to get any updates back to the original data source. Another possibility * is a more formal synchronization mechanism such as SyncML * (http://www.syncml.org/)
diff --git a/src/java.sql.rowset/share/classes/javax/sql/rowset/package-info.java b/src/java.sql.rowset/share/classes/javax/sql/rowset/package-info.java index a2079df3d45..947a072c36f 100644 --- a/src/java.sql.rowset/share/classes/javax/sql/rowset/package-info.java +++ b/src/java.sql.rowset/share/classes/javax/sql/rowset/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2020, 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 @@ -24,9 +24,9 @@ */ /** - * Standard interfaces and base classes for JDBC RowSet + * Standard interfaces and base classes for JDBC {@code RowSet} * implementations. This package contains interfaces and classes - * that a standard RowSet implementation either implements or extends. + * that a standard {@code RowSet} implementation either implements or extends. * *

Table of Contents

*
    @@ -38,133 +38,133 @@ *
* *

1.0 Package Specification

- * This package specifies five standard JDBC RowSet interfaces. + * This package specifies five standard JDBC {@code RowSet} interfaces. * All five extend the * RowSet interface described in the JDBC 3.0 * specification. It is anticipated that additional definitions - * of more specialized JDBC RowSet types will emerge as this technology + * of more specialized JDBC {@code RowSet} types will emerge as this technology * matures. Future definitions should be specified as subinterfaces using * inheritance similar to the way it is used in this specification. *

* Note: The interface definitions provided in this package form the basis for - * all compliant JDBC RowSet implementations. Vendors and more advanced - * developers who intend to provide their own compliant RowSet implementations + * all compliant JDBC {@code RowSet} implementations. Vendors and more advanced + * developers who intend to provide their own compliant {@code RowSet} implementations * should pay particular attention to the assertions detailed in specification * interfaces. * *

2.0 Standard RowSet Definitions

*
    - *
  • JdbcRowSet - A wrapper around - * a ResultSet object that makes it possible to use the result set as a + *
  • {@code JdbcRowSet} - A wrapper around + * a {@code ResultSet} object that makes it possible to use the result set as a * JavaBeans™ component. Thus, - * a JdbcRowSet object can be a Bean that any tool + * a {@code JdbcRowSet} object can be a Bean that any tool * makes available for assembling an application as part of a component based - * architecture. A JdbcRowSet object is a connected RowSet + * architecture. A {@code JdbcRowSet} object is a connected {@code RowSet} * object, that is, it * must continually maintain its connection to its data source using a JDBC - * technology-enabled driver ("JDBC driver"). In addition, a JdbcRowSet + * technology-enabled driver ("JDBC driver"). In addition, a {@code JdbcRowSet} * object provides a fully updatable and scrollable tabular * data structure as defined in the JDBC 3.0 specification. * *
  • - * CachedRowSet - * - A CachedRowSet object is a JavaBeans™ + * {@code CachedRowSet}™ + * - A {@code CachedRowSet} object is a JavaBeans™ * component that is scrollable, updatable, serializable, and generally disconnected from - * the source of its data. A CachedRowSet object + * the source of its data. A {@code CachedRowSet} object * typically contains rows from a result set, but it can also contain rows from any - * file with a tabular format, such as a spreadsheet. CachedRowSet implementations - * must use the SyncFactory to manage and obtain pluggable - * SyncProvider objects to provide synchronization between the - * disconnected RowSet object and the originating data source. - * Typically a SyncProvider implementation relies upon a JDBC + * file with a tabular format, such as a spreadsheet. {@code CachedRowSet} implementations + * must use the {@code SyncFactory} to manage and obtain pluggable + * {@code SyncProvider} objects to provide synchronization between the + * disconnected {@code RowSet} object and the originating data source. + * Typically a {@code SyncProvider} implementation relies upon a JDBC * driver to obtain connectivity to a particular data source. * Further details on this mechanism are discussed in the javax.sql.rowset.spi package + * href="spi/package-summary.html">{@code javax.sql.rowset.spi} package * specification. * - *
  • WebRowSet - A - * WebRowSet object is an extension of CachedRowSet - * that can read and write a RowSet object in a well formed XML format. - * This class calls an XmlReader object - * (an extension of the RowSetReader + *
  • {@code WebRowSet} - A + * {@code WebRowSet} object is an extension of {@code CachedRowSet} + * that can read and write a {@code RowSet} object in a well formed XML format. + * This class calls an {@code XmlReader} object + * (an extension of the {@code RowSetReader} * interface) to read a rowset in XML format. It calls an - * XmlWriter object (an extension of the - * RowSetWriter interface) + * {@code XmlWriter} object (an extension of the + * {@code RowSetWriter} interface) * to write a rowset in XML format. The reader and writer required by - * WebRowSet objects are provided by the - * SyncFactory in the form of SyncProvider + * {@code WebRowSet} objects are provided by the + * {@code SyncFactory} in the form of {@code SyncProvider} * implementations. In order to ensure well formed XML usage, a standard generic XML * Schema is defined and published at * - * http://xmlns.jcp.org/xml/ns//jdbc/webrowset.xsd. + * {@code http://xmlns.jcp.org/xml/ns//jdbc/webrowset.xsd}. * - *
  • FilteredRowSet - A - * FilteredRowSet object provides filtering functionality in a programmatic - * and extensible way. There are many instances when a RowSet object + *
  • {@code FilteredRowSet} - A + * {@code FilteredRowSet} object provides filtering functionality in a programmatic + * and extensible way. There are many instances when a {@code RowSet} {@code object} * has a need to provide filtering in its contents without sacrificing the disconnected * environment, thus saving the expense of having to create a connection to the data source. * Solutions to this need vary from providing heavyweight full scale * SQL query abilities, to portable components, to more lightweight - * approaches. A FilteredRowSet object consumes - * an implementation of the Predicate + * approaches. A {@code FilteredRowSet} object consumes + * an implementation of the {@code Predicate} * interface, which may define a filter at run time. In turn, a - * FilteredRowSet object is tasked with enforcing the set filter for both + * {@code FilteredRowSet} object is tasked with enforcing the set filter for both * inbound and outbound read and write operations. That is, all filters can be * considered as bi-directional. No standard filters are defined; * however, sufficient mechanics are specified to permit any required filter to be * implemented. * - *
  • JoinRowSet - The JoinRowSet + *
  • {@code JoinRowSet} - The {@code JoinRowSet} * interface describes a mechanism by which relationships can be established between - * two or more standard RowSet implementations. Any number of RowSet - * objects can be added to a JoinRowSet object provided the RowSetobjects - * can be related in a SQL JOIN like fashion. By definition, the SQL JOIN + * two or more standard {@code RowSet} implementations. Any number of {@code RowSet} + * objects can be added to a {@code JoinRowSet} object provided the {@code RowSet}objects + * can be related in a SQL {@code JOIN} like fashion. By definition, the SQL {@code JOIN} * statement is used to combine the data contained in two (or more) relational * database tables based upon a common attribute. By establishing and then enforcing - * column matches, a JoinRowSet object establishes relationships between - * RowSet instances without the need to touch the originating data source. + * column matches, a {@code JoinRowSet} object establishes relationships between + * {@code RowSet} instances without the need to touch the originating data source. *
* *

3.0 Implementer's Guide

- * Compliant implementations of JDBC RowSet Implementations + * Compliant implementations of JDBC {@code RowSet} Implementations * must follow the assertions described in this specification. In accordance * with the terms of the Java Community Process, a * Test Compatibility Kit (TCK) can be licensed to ensure compatibility with the * specification. The following paragraphs outline a number of starting points for - * implementers of the standard JDBC RowSet definitions. Implementers + * implementers of the standard JDBC {@code RowSet} definitions. Implementers * should also consult the Implementer's Guide in the javax.sql.rowset.spi package for guidelines - * on SyncProvider implementations. + * on {@code SyncProvider} implementations. * *
    *
  • 3.1 Constructor *

    - * All RowSet implementations must provide a + * All {@code RowSet} implementations must provide a * no-argument constructor. *

  • - *
  • 3.2 Role of the BaseRowSet Class + *
  • 3.2 Role of the {@code BaseRowSet} Class *

    - * A compliant JDBC RowSet implementation must implement one or more + * A compliant JDBC {@code RowSet} implementation must implement one or more * standard interfaces specified in this package and may extend the - * BaseRowSet abstract class. For example, a - * CachedRowSet implementation must implement the CachedRowSet - * interface and extend the BaseRowSet abstract class. The - * BaseRowSet class provides the standard architecture on which all - * RowSet implementations should be built, regardless of whether the - * RowSet objects exist in a connected or disconnected environment. - * The BaseRowSet abstract class provides any RowSet implementation + * {@code BaseRowSet} abstract class. For example, a + * {@code CachedRowSet} implementation must implement the {@code CachedRowSet} + * interface and extend the {@code BaseRowSet} abstract class. The + * {@code BaseRowSet} class provides the standard architecture on which all + * {@code RowSet} implementations should be built, regardless of whether the + * {@code RowSet} objects exist in a connected or disconnected environment. + * The {@code BaseRowSet} abstract class provides any {@code RowSet} implementation * with its base functionality, including property manipulation and event notification * that is fully compliant with * JavaBeans * component requirements. As an example, all implementations provided in the - * reference implementations (contained in the com.sun.rowset package) use - * the BaseRowSet class as a basis for their implementations. + * reference implementations (contained in the {@code com.sun.rowset} package) use + * the {@code BaseRowSet} class as a basis for their implementations. *

    - * The following table illustrates the features that the BaseRowSet + * The following table illustrates the features that the {@code BaseRowSet} * abstract class provides. *

    * - * + * * * * @@ -175,15 +175,15 @@ * * * + * the standard {@code RowSet} properties. * * * * @@ -204,70 +204,70 @@ * *
  • 3.3 Connected RowSet Requirements *

    - * The JdbcRowSet describes a RowSet object that must always - * be connected to the originating data source. Implementations of the JdbcRowSet + * The {@code JdbcRowSet} describes a {@code RowSet} object that must always + * be connected to the originating data source. Implementations of the {@code JdbcRowSet} * should ensure that this connection is provided solely by a JDBC driver. - * Furthermore, RowSet objects that are implementations of the - * JdbcRowSet interface and are therefore operating in a connected environment - * do not use the SyncFactory to obtain a RowSetReader object - * or a RowSetWriter object. They can safely rely on the JDBC driver to + * Furthermore, {@code RowSet} objects that are implementations of the + * {@code JdbcRowSet} interface and are therefore operating in a connected environment + * do not use the {@code SyncFactory} to obtain a {@code RowSetReader} object + * or a {@code RowSetWriter} object. They can safely rely on the JDBC driver to * supply their needs by virtue of the presence of an underlying updatable and scrollable - * ResultSet implementation. + * {@code ResultSet} implementation. * *

  • * 3.4 Disconnected RowSet Requirements *

    - * A disconnected RowSet object, such as a CachedRowSet object, + * A disconnected {@code RowSet} object, such as a {@code CachedRowSet} object, * should delegate - * connection management to a SyncProvider object provided by the - * SyncFactory. To ensure fully disconnected semantics, all - * disconnected RowSet objects must ensure - * that the original connection made to the data source to populate the RowSet + * connection management to a {@code SyncProvider} object provided by the + * {@code SyncFactory}. To ensure fully disconnected semantics, all + * disconnected {@code RowSet} objects must ensure + * that the original connection made to the data source to populate the {@code RowSet} * object is closed to permit the garbage collector to recover and release resources. The - * SyncProvider object ensures that the critical JDBC properties are + * {@code SyncProvider} object ensures that the critical JDBC properties are * maintained in order to re-establish a connection to the data source when a - * synchronization is required. A disconnected RowSet object should + * synchronization is required. A disconnected {@code RowSet} object should * therefore ensure that no - * extraneous references remain on the Connection object. + * extraneous references remain on the {@code Connection} object. * *

  • 3.5 Role of RowSetMetaDataImpl *

    - * The RowsetMetaDataImpl class is a utility class that provides an implementation of the + * The {@code RowsetMetaDataImpl} class is a utility class that provides an implementation of the * RowSetMetaData interface, supplying standard setter * method implementations for metadata for both connected and disconnected - * RowSet objects. All implementations are free to use this standard + * {@code RowSet} objects. All implementations are free to use this standard * implementation but are not required to do so. * *

  • 3.6 RowSetWarning Class *

    - * The RowSetWarning class provides warnings that can be set - * on RowSet implementations. + * The {@code RowSetWarning} class provides warnings that can be set + * on {@code RowSet} implementations. * Similar to SQLWarning objects, - * RowSetWarning objects are silently chained to the object whose method - * caused the warning to be thrown. All RowSet implementations should + * {@code RowSetWarning} objects are silently chained to the object whose method + * caused the warning to be thrown. All {@code RowSet} implementations should * ensure that this chaining occurs if a warning is generated and also ensure that the - * warnings are available via the getRowSetWarnings method defined in either - * the JdbcRowSet interface or the CachedRowSet interface. + * warnings are available via the {@code getRowSetWarnings} method defined in either + * the {@code JdbcRowSet} interface or the {@code CachedRowSet} interface. * After a warning has been retrieved with one of the - * getRowSetWarnings methods, the RowSetWarning method - * getNextWarning can be called on it to retrieve any warnings that might - * be chained on it. If a warning is returned, getNextWarning can be called + * {@code getRowSetWarnings} methods, the {@code RowSetWarning} method + * {@code getNextWarning} can be called on it to retrieve any warnings that might + * be chained on it. If a warning is returned, {@code getNextWarning} can be called * on it, and so on until there are no more warnings. * *

  • 3.7 The Joinable Interface *

    - * The Joinable interface provides both connected and disconnected - * RowSet objects with the capability to be added to a - * JoinRowSet object in an SQL JOIN operation. - * A RowSet object that has implemented the Joinable + * The {@code Joinable} interface provides both connected and disconnected + * {@code RowSet} objects with the capability to be added to a + * {@code JoinRowSet} object in an SQL {@code JOIN} operation. + * A {@code RowSet} object that has implemented the {@code Joinable} * interface can set a match column, retrieve a match column, or unset a match column. - * A JoinRowSet object can then use the RowSet object's - * match column as a basis for adding the RowSet object. + * A {@code JoinRowSet} object can then use the {@code RowSet} object's + * match column as a basis for adding the {@code RowSet} object. *

  • * *
  • 3.8 The RowSetFactory Interface *

    - * A RowSetFactory implementation must + * A {@code RowSetFactory} implementation must * be provided. *

  • * diff --git a/src/java.sql.rowset/share/classes/javax/sql/rowset/serial/package-info.java b/src/java.sql.rowset/share/classes/javax/sql/rowset/serial/package-info.java index c56afc0521c..3ee24f76843 100644 --- a/src/java.sql.rowset/share/classes/javax/sql/rowset/serial/package-info.java +++ b/src/java.sql.rowset/share/classes/javax/sql/rowset/serial/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2020, 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 @@ -26,11 +26,11 @@ /** * Provides utility classes to allow serializable mappings between SQL types * and data types in the Java programming language. - *

    Standard JDBC RowSet implementations may use these utility + *

    Standard JDBC {@code RowSet} implementations may use these utility * classes to - * assist in the serialization of disconnected RowSet objects. + * assist in the serialization of disconnected {@code RowSet} objects. * This is useful - * when transmitting a disconnected RowSet object over the wire to + * when transmitting a disconnected {@code RowSet} object over the wire to * a different VM or across layers within an application.
    *

    * @@ -38,40 +38,40 @@ * A serializable mapping in the Java programming language of an SQL ARRAY * value.
    *
    - * The SerialArray class provides a constructor for creating a SerialArray + * The {@code SerialArray} class provides a constructor for creating a {@code SerialArray} * instance from an Array object, methods for getting the base type and * the SQL name for the base type, and methods for copying all or part of a - * SerialArray object.
    + * {@code SerialArray} object.
    * *

    2.0 SerialBlob

    * A serializable mapping in the Java programming language of an SQL BLOB * value.
    *
    - * The SerialBlobclass provides a constructor for creating an instance + * The {@code SerialBlob} class provides a constructor for creating an instance * from a Blob object. Note that the Blob object should have brought the SQL - * BLOB value's data over to the client before a SerialBlobobject + * BLOB value's data over to the client before a {@code SerialBlob} object * is constructed from it. The data of an SQL BLOB value can be materialized - * on the client as an array of bytes (using the method Blob.getBytes) - * or as a stream of uninterpreted bytes (using the method Blob.getBinaryStream). + * on the client as an array of bytes (using the method {@code Blob.getBytes}) + * or as a stream of uninterpreted bytes (using the method {@code Blob.getBinaryStream}). *
    *
    - * SerialBlob methods make it possible to make a copy of a SerialBlob + * {@code SerialBlob} methods make it possible to make a copy of a {@code SerialBlob} * object as an array of bytes or as a stream. They also make it possible - * to locate a given pattern of bytes or a Blob object within a SerialBlob + * to locate a given pattern of bytes or a {@code Blob} object within a {@code SerialBlob} * object.
    * *

    3.0 SerialClob

    * A serializable mapping in the Java programming language of an SQL CLOB * value.
    *
    - * The SerialClob class provides a constructor for creating an instance - * from a Clob object. Note that the Clob object should have - * brought the SQL CLOB value's data over to the client before a SerialClob + * The {@code SerialClob} class provides a constructor for creating an instance + * from a {@code Clob} object. Note that the {@code Clob} object should have + * brought the SQL CLOB value's data over to the client before a {@code SerialClob} * object is constructed from it. The data of an SQL CLOB value can be * materialized on the client as a stream of Unicode characters.
    *
    - * SerialClob methods make it possible to get a substring from a - * SerialClob object or to locate the start of a pattern of characters. + * {@code SerialClob} methods make it possible to get a substring from a + * {@code SerialClob} object or to locate the start of a pattern of characters. *
    * *

    5.0 SerialDatalink

    @@ -79,11 +79,12 @@ * value. A DATALINK value references a file outside of the underlying data source * that the originating data source manages.
    *
    - * RowSet implementations can use the method RowSet.getURL() to retrieve - * a java.net.URL object, which can be used to manipulate the external data. + * {@code RowSet} implementations can use the method {@code RowSet.getURL()} to retrieve + * a {@code java.net.URL} object, which can be used to manipulate the external data. *
    - *
    - *       java.net.URL url = rowset.getURL(1);
    + *
    + *    java.net.URL url = rowset.getURL(1);
    + * 
    * *

    6.0 SerialJavaObject

    * A serializable mapping in the Java programming language of an SQL JAVA_OBJECT @@ -94,15 +95,15 @@ * object is not immediately serializable, this class will attempt to serialize * all non static members to permit the object instance state to be serialized. * Static or transient fields cannot be serialized and attempting to do so - * will result in a SerialException being thrown.
    + * will result in a {@code SerialException} being thrown.
    * *

    7.0 SerialRef

    * A serializable mapping between the SQL REF type and the Java programming * language.
    *
    - * The SerialRef class provides a constructor for creating a SerialRef - * instance from a Ref type and provides methods for getting - * and setting the Ref object type.
    + * The {@code SerialRef} class provides a constructor for creating a {@code SerialRef} + * instance from a {@code Ref} type and provides methods for getting + * and setting the {@code Ref} object type.
    * *

    8.0 SerialStruct

    * A serializable mapping in the Java programming language of an SQL structured @@ -110,36 +111,36 @@ * form, and if an attribute is itself a structured type, each of its attributes * that is not already serializable is mapped to a serializable form.
    *
    - * In addition, if a Map object is passed to one of the constructors or - * to the method getAttributes, the structured type is custom mapped - * according to the mapping specified in the Map object. + * In addition, if a {@code Map} object is passed to one of the constructors or + * to the method {@code getAttributes}, the structured type is custom mapped + * according to the mapping specified in the {@code Map} object. *
    - * The SerialStruct class provides a constructor for creating an - * instance from a Struct object, a method for retrieving the SQL + * The {@code SerialStruct} class provides a constructor for creating an + * instance from a {@code Struct} object, a method for retrieving the SQL * type name of the SQL structured type in the database, and methods for retrieving * its attribute values.
    * *

    9.0 SQLInputImpl

    * An input stream used for custom mapping user-defined types (UDTs). An - * SQLInputImpl object is an input stream that contains a stream of + * {@code SQLInputImpl} object is an input stream that contains a stream of * values that are * the attributes of a UDT. This class is used by the driver behind the scenes - * when the method getObject is called on an SQL structured or distinct - * type that has a custom mapping; a programmer never invokes SQLInputImpl + * when the method {@code getObject} is called on an SQL structured or distinct + * type that has a custom mapping; a programmer never invokes {@code SQLInputImpl} * methods directly.
    *
    - * The SQLInputImpl class provides a set of reader methods - * analogous to the ResultSet getter methods. These methods make it - * possible to read the values in an SQLInputImpl object. The method - * wasNull is used to determine whether the last value read was SQL NULL. + * The {@code SQLInputImpl} class provides a set of reader methods + * analogous to the {@code ResultSet} getter methods. These methods make it + * possible to read the values in an {@code SQLInputImpl} object. The method + * {@code wasNull} is used to determine whether the last value read was SQL NULL. *
    *
    - * When a constructor or getter method that takes a Map object is called, + * When a constructor or getter method that takes a {@code Map} object is called, * the JDBC driver calls the method - * SQLData.getSQLType to determine the SQL type of the UDT being custom - * mapped. The driver creates an instance of SQLInputImpl, populating it with + * {@code SQLData.getSQLType} to determine the SQL type of the UDT being custom + * mapped. The driver creates an instance of {@code SQLInputImpl}, populating it with * the attributes of the UDT. The driver then passes the input stream to the - * method SQLData.readSQL, which in turn calls the SQLInputImpl + * method {@code SQLData.readSQL}, which in turn calls the {@code SQLInputImpl} * methods to read the attributes from the input stream.
    * *

    10.0 SQLOutputImpl

    @@ -148,16 +149,16 @@ * and its methods are never directly invoked by an application programmer. *
    *
    - * When an application calls the method PreparedStatement.setObject, the + * When an application calls the method {@code PreparedStatement.setObject}, the * driver checks to see whether the value to be written is a UDT with a custom * mapping. If it is, there will be an entry in a type map containing the Class - * object for the class that implements SQLData for this UDT. If the - * value to be written is an instance of SQLData, the driver will - * create an instance of SQLOutputImpl and pass it to the method - * SQLData.writeSQL. - * The method writeSQL in turn calls the appropriate SQLOutputImpl - * writer methods to write data from the SQLData object to the - * SQLOutputImpl + * object for the class that implements {@code SQLData} for this UDT. If the + * value to be written is an instance of {@code SQLData}, the driver will + * create an instance of {@code SQLOutputImpl} and pass it to the method + * {@code SQLData.writeSQL}. + * The method {@code writeSQL} in turn calls the appropriate {@code SQLOutputImpl} + * writer methods to write data from the {@code SQLData} object to the + * {@code SQLOutputImpl} * output stream as the representation of an SQL user-defined type. * *

    Custom Mapping

    @@ -167,12 +168,12 @@ * (A DISTINCT type can thought of as having one attribute.) However, there are * many other possibilities, and there may be any number of different mappings. *

    - * A programmer defines the mapping by implementing the interface SQLData. + * A programmer defines the mapping by implementing the interface {@code SQLData}. * For example, if an SQL structured type named AUTHORS has the attributes NAME, * TITLE, and PUBLISHER, it could be mapped to a Java class named Authors. The * Authors class could have the fields name, title, and publisher, to which the * attributes of AUTHORS are mapped. In such a case, the implementation of - * SQLData could look like the following: + * {@code SQLData} could look like the following: *

      *    public class Authors implements SQLData {
      *        public String name;
    @@ -200,27 +201,27 @@
      *    }
      * 
    * - * A java.util.Map object is used to associate the SQL structured - * type with its mapping to the class Authors. The following code fragment shows - * how a Map object might be created and given an entry associating - * AUTHORS and Authors. + * A {@code java.util.Map} object is used to associate the SQL structured + * type with its mapping to the class {@code Authors}. The following code fragment shows + * how a {@code Map} object might be created and given an entry associating + * {@code AUTHORS} and {@code Authors}. *
      *     java.util.Map map = new java.util.HashMap();
      *     map.put("SCHEMA_NAME.AUTHORS", Class.forName("Authors");
      * 
    * - * The Map object map now contains an entry with the - * fully qualified name of the SQL structured type and the Class - * object for the class Authors. It can be passed to a method - * to tell the driver how to map AUTHORS to Authors. + * The {@code Map} object map now contains an entry with the + * fully qualified name of the SQL structured type and the {@code Class} + * object for the class {@code Authors}. It can be passed to a method + * to tell the driver how to map {@code AUTHORS} to {@code Authors}. *

    - * For a disconnected RowSet object, custom mapping can be done - * only when a Map object is passed to the method or constructor + * For a disconnected {@code RowSet} object, custom mapping can be done + * only when a {@code Map} object is passed to the method or constructor * that will be doing the custom mapping. The situation is different for - * connected RowSet objects because they maintain a connection + * connected {@code RowSet} objects because they maintain a connection * with the data source. A method that does custom mapping and is called by - * a disconnected RowSet object may use the Map - * object that is associated with the Connection object being + * a disconnected {@code RowSet} object may use the {@code Map} + * object that is associated with the {@code Connection} object being * used. So, in other words, if no map is specified, the connection's type * map can be used by default. */ diff --git a/src/java.sql.rowset/share/classes/javax/sql/rowset/spi/package-info.java b/src/java.sql.rowset/share/classes/javax/sql/rowset/spi/package-info.java index 5c7f2661b82..2117e63ef93 100644 --- a/src/java.sql.rowset/share/classes/javax/sql/rowset/spi/package-info.java +++ b/src/java.sql.rowset/share/classes/javax/sql/rowset/spi/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2020, 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 @@ -27,9 +27,9 @@ * The standard classes and interfaces that a third party vendor has to * use in its implementation of a synchronization provider. These classes and * interfaces are referred to as the Service Provider Interface (SPI). To make it possible - * for a RowSet object to use an implementation, the vendor must register - * it with the SyncFactory singleton. (See the class comment for - * SyncProvider for a full explanation of the registration process and + * for a {@code RowSet} object to use an implementation, the vendor must register + * it with the {@code SyncFactory} singleton. (See the class comment for + * {@code SyncProvider} for a full explanation of the registration process and * the naming convention to be used.) * *

    Table of Contents

    @@ -44,46 +44,46 @@ * *

    1.0 Package Specification

    *

    - * The following classes and interfaces make up the javax.sql.rowset.spi + * The following classes and interfaces make up the {@code javax.sql.rowset.spi} * package: *

      - *
    • SyncFactory - *
    • SyncProvider - *
    • SyncFactoryException - *
    • SyncProviderException - *
    • SyncResolver - *
    • XmlReader - *
    • XmlWriter - *
    • TransactionalWriter + *
    • {@code SyncFactory} + *
    • {@code SyncProvider} + *
    • {@code SyncFactoryException} + *
    • {@code SyncProviderException} + *
    • {@code SyncResolver} + *
    • {@code XmlReader} + *
    • {@code XmlWriter} + *
    • {@code TransactionalWriter} *
    - * The following interfaces, in the javax.sql package, are also part of the SPI: + * The following interfaces, in the {@code javax.sql} package, are also part of the SPI: *
      - *
    • RowSetReader - *
    • RowSetWriter + *
    • {@code RowSetReader} + *
    • {@code RowSetWriter} *
    *

    - * A SyncProvider implementation provides a disconnected RowSet + * A {@code SyncProvider} implementation provides a disconnected {@code RowSet} * object with the mechanisms for reading data into it and for writing data that has been * modified in it - * back to the underlying data source. A reader, a RowSetReader or - * XMLReader object, reads data into a RowSet object when the - * CachedRowSet methods execute or populate - * are called. A writer, a RowSetWriter or XMLWriter + * back to the underlying data source. A reader, a {@code RowSetReader} or + * {@code XMLReader} object, reads data into a {@code RowSet} object when the + * {@code CachedRowSet} methods {@code execute} or {@code populate} + * are called. A writer, a {@code RowSetWriter} or {@code XMLWriter} * object, writes changes back to the underlying data source when the - * CachedRowSet method acceptChanges is called. + * {@code CachedRowSet} method {@code acceptChanges} is called. *

    - * The process of writing changes in a RowSet object to its data source - * is known as synchronization. The SyncProvider implementation that a - * RowSet object is using determines the level of synchronization that the - * RowSet object's writer uses. The various levels of synchronization are + * The process of writing changes in a {@code RowSet} object to its data source + * is known as synchronization. The {@code SyncProvider} implementation that a + * {@code RowSet} object is using determines the level of synchronization that the + * {@code RowSet} object's writer uses. The various levels of synchronization are * referred to as grades. *

    * The lower grades of synchronization are * known as optimistic concurrency levels because they optimistically * assume that there will be no conflicts or very few conflicts. A conflict exists when - * the same data modified in the RowSet object has also been modified + * the same data modified in the {@code RowSet} object has also been modified * in the data source. Using the optimistic concurrency model means that if there - * is a conflict, modifications to either the data source or the RowSet + * is a conflict, modifications to either the data source or the {@code RowSet} * object will be lost. *

    * Higher grades of synchronization are called pessimistic because they assume @@ -92,114 +92,114 @@ * occur. *

    * The lowest level of synchronization is simply writing any changes made to the - * RowSet object to its underlying data source. The writer does + * {@code RowSet} object to its underlying data source. The writer does * nothing to check for conflicts. * If there is a conflict and the data * source values are overwritten, the changes other parties have made by to the data * source are lost. *

    - * The RIXMLProvider implementation uses the lowest level - * of synchronization and just writes RowSet changes to the data source. + * The {@code RIXMLProvider} implementation uses the lowest level + * of synchronization and just writes {@code RowSet} changes to the data source. * *

    * For the next level up, the * writer checks to see if there are any conflicts, and if there are, * it does not write anything to the data source. The problem with this concurrency * level is that if another party has modified the corresponding data in the data source - * since the RowSet object got its data, - * the changes made to the RowSet object are lost. The - * RIOptimisticProvider implementation uses this level of synchronization. + * since the {@code RowSet} object got its data, + * the changes made to the {@code RowSet} object are lost. The + * {@code RIOptimisticProvider} implementation uses this level of synchronization. *

    * At higher levels of synchronization, referred to as pessimistic concurrency, * the writer take steps to avoid conflicts by setting locks. Setting locks * can vary from setting a lock on a single row to setting a lock on a table * or the entire data source. The level of synchronization is therefore a tradeoff * between the ability of users to access the data source concurrently and the ability - * of the writer to keep the data in the RowSet object and its data source + * of the writer to keep the data in the {@code RowSet} object and its data source * synchronized. *

    - * It is a requirement that all disconnected RowSet objects - * (CachedRowSet, FilteredRowSet, JoinRowSet, - * and WebRowSet objects) obtain their SyncProvider objects - * from the SyncFactory mechanism. + * It is a requirement that all disconnected {@code RowSet} objects + * ({@code CachedRowSet}, {@code FilteredRowSet}, {@code JoinRowSet}, + * and {@code WebRowSet} objects) obtain their {@code SyncProvider} objects + * from the {@code SyncFactory} mechanism. *

    * The reference implementation (RI) provides two synchronization providers. *

      - *
    • RIOptimisticProvider
      - * The default provider that the SyncFactory instance will - * supply to a disconnected RowSet object when no provider + *
    • {@code RIOptimisticProvider}
      + * The default provider that the {@code SyncFactory} instance will + * supply to a disconnected {@code RowSet} object when no provider * implementation is specified.
      * This synchronization provider uses an optimistic concurrency model, * assuming that there will be few conflicts among users * who are accessing the same data in a database. It avoids * using locks; rather, it checks to see if there is a conflict - * before trying to synchronize the RowSet object and the + * before trying to synchronize the {@code RowSet} object and the * data source. If there is a conflict, it does nothing, meaning that - * changes to the RowSet object are not persisted to the data + * changes to the {@code RowSet} object are not persisted to the data * source. - *
    • RIXMLProvider
      + *
    • {@code RIXMLProvider}
      * A synchronization provider that can be used with a - * WebRowSet object, which is a rowset that can be written + * {@code WebRowSet} object, which is a rowset that can be written * in XML format or read from XML format. The - * RIXMLProvider implementation does no checking at all for + * {@code RIXMLProvider} implementation does no checking at all for * conflicts and simply writes any updated data in the - * WebRowSet object to the underlying data source. - * WebRowSet objects use this provider when they are + * {@code WebRowSet} object to the underlying data source. + * {@code WebRowSet} objects use this provider when they are * dealing with XML data. *
    * - * These SyncProvider implementations + * These {@code SyncProvider} implementations * are bundled with the reference implementation, which makes them always available to - * RowSet implementations. - * SyncProvider implementations make themselves available by being - * registered with the SyncFactory singleton. When a RowSet + * {@code RowSet} implementations. + * {@code SyncProvider} implementations make themselves available by being + * registered with the {@code SyncFactory} singleton. When a {@code RowSet} * object requests a provider, by specifying it in the constructor or as an argument to the - * CachedRowSet method setSyncProvider, - * the SyncFactory singleton + * {@code CachedRowSet} method {@code setSyncProvider}, + * the {@code SyncFactory} singleton * checks to see if the requested provider has been registered with it. - * If it has, the SyncFactory creates an instance of it and passes it to the - * requesting RowSet object. - * If the SyncProvider implementation that is specified has not been registered, - * the SyncFactory singleton causes a SyncFactoryException object + * If it has, the {@code SyncFactory} creates an instance of it and passes it to the + * requesting {@code RowSet} object. + * If the {@code SyncProvider} implementation that is specified has not been registered, + * the {@code SyncFactory} singleton causes a {@code SyncFactoryException} object * to be thrown. If no provider is specified, - * the SyncFactory singleton will create an instance of the default - * provider implementation, RIOptimisticProvider, - * and pass it to the requesting RowSet object. + * the {@code SyncFactory} singleton will create an instance of the default + * provider implementation, {@code RIOptimisticProvider}, + * and pass it to the requesting {@code RowSet} object. * *

    - * If a WebRowSet object does not specify a provider in its constructor, the - * SyncFactory will give it an instance of RIOptimisticProvider. - * However, the constructor for WebRowSet is implemented to set the provider - * to the RIXMLProvider, which reads and writes a RowSet object + * If a {@code WebRowSet} object does not specify a provider in its constructor, the + * {@code SyncFactory} will give it an instance of {@code RIOptimisticProvider}. + * However, the constructor for {@code WebRowSet} is implemented to set the provider + * to the {@code RIXMLProvider}, which reads and writes a {@code RowSet} object * in XML format. *

    * See the SyncProvider class * specification for further details. *

    - * Vendors may develop a SyncProvider implementation with any one of the possible - * levels of synchronization, thus giving RowSet objects a choice of + * Vendors may develop a {@code SyncProvider} implementation with any one of the possible + * levels of synchronization, thus giving {@code RowSet} objects a choice of * synchronization mechanisms. * *

    2.0 Service Provider Interface Architecture

    * 2.1 Overview *

    * The Service Provider Interface provides a pluggable mechanism by which - * SyncProvider implementations can be registered and then generated when - * required. The lazy reference mechanism employed by the SyncFactory limits + * {@code SyncProvider} implementations can be registered and then generated when + * required. The lazy reference mechanism employed by the {@code SyncFactory} limits * unnecessary resource consumption by not creating an instance until it is * required by a disconnected - * RowSet object. The SyncFactory class also provides + * {@code RowSet} object. The {@code SyncFactory} class also provides * a standard API to configure logging options and streams that may be provided - * by a particular SyncProvider implementation. + * by a particular {@code SyncProvider} implementation. *

    - * 2.2 Registering with the SyncFactory + * 2.2 Registering with the {@code SyncFactory} *

    - * A third party SyncProvider implementation must be registered with the - * SyncFactory in order for a disconnected RowSet object - * to obtain it and thereby use its javax.sql.RowSetReader and - * javax.sql.RowSetWriter + * A third party {@code SyncProvider} implementation must be registered with the + * {@code SyncFactory} in order for a disconnected {@code RowSet} object + * to obtain it and thereby use its {@code javax.sql.RowSetReader} and + * {@code javax.sql.RowSetWriter} * implementations. The following registration mechanisms are available to all - * SyncProvider implementations: + * {@code SyncProvider} implementations: *

      *
    • System properties - Properties set at the command line. These * properties are set at run time and apply system-wide per invocation of the Java @@ -210,159 +210,159 @@ * This can be specified using a System Property or by modifying a standard * property file located in the platform run-time. The * reference implementation of this technology includes a standard property - * file than can be edited to add additional SyncProvider objects. + * file than can be edited to add additional {@code SyncProvider} objects. * *
    • JNDI Context - Available providers can be registered on a JNDI - * context. The SyncFactory will attempt to load SyncProvider + * context. The {@code SyncFactory} will attempt to load {@code SyncProvider} * objects bound to the context and register them with the factory. This - * context must be supplied to the SyncFactory for the mechanism to + * context must be supplied to the {@code SyncFactory} for the mechanism to * function correctly. *
    *

    * Details on how to specify the system properties or properties in a property file * and how to configure the JNDI Context are explained in detail in the - * SyncFactory class description. + * {@code SyncFactory} class description. *

    * 2.3 SyncFactory Provider Instance Generation Policies *

    - * The SyncFactory generates a requested SyncProvider + * The {@code SyncFactory} generates a requested {@code SyncProvider} * object if the provider has been correctly registered. The - * following policies are adhered to when either a disconnected RowSet object - * is instantiated with a specified SyncProvider implementation or is - * reconfigured at runtime with an alternative SyncProvider object. + * following policies are adhered to when either a disconnected {@code RowSet} object + * is instantiated with a specified {@code SyncProvider} implementation or is + * reconfigured at runtime with an alternative {@code SyncProvider} object. *

      - *
    • If a SyncProvider object is specified and the SyncFactory - * contains no reference to the provider, a SyncFactoryException is + *
    • If a {@code SyncProvider} object is specified and the {@code SyncFactory} + * contains no reference to the provider, a {@code SyncFactoryException} is * thrown. * - *
    • If a SyncProvider object is specified and the SyncFactory + *
    • If a {@code SyncProvider} object is specified and the {@code SyncFactory} * contains a reference to the provider, the requested provider is supplied. * - *
    • If no SyncProvider object is specified, the reference - * implementation provider RIOptimisticProvider is supplied. + *
    • If no {@code SyncProvider} object is specified, the reference + * implementation provider {@code RIOptimisticProvider} is supplied. *
    *

    * These policies are explored in more detail in the - * SyncFactory class. + * {@code SyncFactory} class. * *

    3.0 SyncProvider Implementer's Guide

    * * 3.1 Requirements *

    - * A compliant SyncProvider implementation that is fully pluggable - * into the SyncFactory must extend and implement all - * abstract methods in the SyncProvider + * A compliant {@code SyncProvider} implementation that is fully pluggable + * into the {@code SyncFactory} must extend and implement all + * abstract methods in the {@code SyncProvider} * class. In addition, an implementation must determine the * grade, locking and updatable view capabilities defined in the - * SyncProvider class definition. One or more of the - * SyncProvider description criteria must be supported. It + * {@code SyncProvider} class definition. One or more of the + * {@code SyncProvider} description criteria must be supported. It * is expected that vendor implementations will offer a range of grade, locking, and * updatable view capabilities. *

    - * Furthermore, the SyncProvider naming convention must be followed as - * detailed in the SyncProvider class + * Furthermore, the {@code SyncProvider} naming convention must be followed as + * detailed in the {@code SyncProvider} class * description. *

    * 3.2 Grades *

    * JSR 114 defines a set of grades to describe the quality of synchronization - * a SyncProvider object can offer a disconnected RowSet + * a {@code SyncProvider} object can offer a disconnected {@code RowSet} * object. These grades are listed from the lowest quality of service to the highest. *

      *
    • GRADE_NONE - No synchronization with the originating data source is - * provided. A SyncProvider implementation returning this grade will simply - * attempt to write any data that has changed in the RowSet object to the + * provided. A {@code SyncProvider} implementation returning this grade will simply + * attempt to write any data that has changed in the {@code RowSet} object to the *underlying data source, overwriting whatever is there. No attempt is made to compare * original values with current values to see if there is a conflict. The - * RIXMLProvider is implemented with this grade. + * {@code RIXMLProvider} is implemented with this grade. * *
    • GRADE_CHECK_MODIFIED_AT_COMMIT - A low grade of optimistic synchronization. - * A SyncProvider implementation returning this grade + * A {@code SyncProvider} implementation returning this grade * will check for conflicts in rows that have changed between the last synchronization * and the current synchronization under way. Any changes in the originating data source - * that have been modified will not be reflected in the disconnected RowSet - * object. If there are no conflicts, changes in the RowSet object will be + * that have been modified will not be reflected in the disconnected {@code RowSet} + * object. If there are no conflicts, changes in the {@code RowSet} object will be * written to the data source. If there are conflicts, no changes are written. - * The RIOptimisticProvider implementation uses this grade. + * The {@code RIOptimisticProvider} implementation uses this grade. * *
    • GRADE_CHECK_ALL_AT_COMMIT - A high grade of optimistic synchronization. - * A SyncProvider implementation returning this grade + * A {@code SyncProvider} implementation returning this grade * will check all rows, including rows that have not changed in the disconnected - * RowSet object. In this way, any changes to rows in the underlying - * data source will be reflected in the disconnected RowSet object + * {@code RowSet} object. In this way, any changes to rows in the underlying + * data source will be reflected in the disconnected {@code RowSet} object * when the synchronization finishes successfully. * *
    • GRADE_LOCK_WHEN_MODIFIED - A pessimistic grade of synchronization. - * SyncProvider implementations returning this grade will lock + * {@code SyncProvider} implementations returning this grade will lock * the row in the originating data source that corresponds to the row being changed - * in the RowSet object to reduce the possibility of other + * in the {@code RowSet} object to reduce the possibility of other * processes modifying the same data in the data source. * *
    • GRADE_LOCK_WHEN_LOADED - A higher pessimistic synchronization grade. - * A SyncProvider implementation returning this grade will lock + * A {@code SyncProvider} implementation returning this grade will lock * the entire view and/or table affected by the original query used to - * populate a RowSet object. + * populate a {@code RowSet} object. *
    *

    * 3.3 Locks *

    * JSR 114 defines a set of constants that specify whether any locks have been - * placed on a RowSet object's underlying data source and, if so, + * placed on a {@code RowSet} object's underlying data source and, if so, * on which constructs the locks are placed. These locks will remain on the data - * source while the RowSet object is disconnected from the data source. + * source while the {@code RowSet} object is disconnected from the data source. *

    * These constants should be considered complementary to the * grade constants. The default setting for the majority of grade settings requires - * that no data source locks remain when a RowSet object is disconnected + * that no data source locks remain when a {@code RowSet} object is disconnected * from its data source. - * The grades GRADE_LOCK_WHEN_MODIFIED and - * GRADE_LOCK_WHEN_LOADED allow a disconnected RowSet object + * The grades {@code GRADE_LOCK_WHEN_MODIFIED} and + * {@code GRADE_LOCK_WHEN_LOADED} allow a disconnected {@code RowSet} object * to have a fine-grained control over the degree of locking. *

      *
    • DATASOURCE_NO_LOCK - No locks remain on the originating data source. - * This is the default lock setting for all SyncProvider implementations - * unless otherwise directed by a RowSet object. + * This is the default lock setting for all {@code SyncProvider} implementations + * unless otherwise directed by a {@code RowSet} object. * *
    • DATASOURCE_ROW_LOCK - A lock is placed on the rows that are touched by - * the original SQL query used to populate the RowSet object. + * the original SQL query used to populate the {@code RowSet} object. * *
    • DATASOURCE_TABLE_LOCK - A lock is placed on all tables that are touched - * by the query that was used to populate the RowSet object. + * by the query that was used to populate the {@code RowSet} object. * *
    • DATASOURCE_DB_LOCK - * A lock is placed on the entire data source that is used by the RowSet + * A lock is placed on the entire data source that is used by the {@code RowSet} * object. *
    *

    * 3.4 Updatable Views *

    - * A RowSet object may be populated with data from an SQL VIEW. - * The following constants indicate whether a SyncProvider object can - * update data in the table or tables from which the VIEW was derived. + * A {@code RowSet} object may be populated with data from an SQL {@code VIEW}. + * The following constants indicate whether a {@code SyncProvider} object can + * update data in the table or tables from which the {@code VIEW} was derived. *

      *
    • UPDATABLE_VIEW_SYNC - * Indicates that a SyncProvider implementation supports synchronization - * to the table or tables from which the SQL VIEW used to populate - * a RowSet object is derived. + * Indicates that a {@code SyncProvider} implementation supports synchronization + * to the table or tables from which the SQL {@code VIEW} used to populate + * a {@code RowSet} object is derived. * *
    • NONUPDATABLE_VIEW_SYNC - * Indicates that a SyncProvider implementation does not support - * synchronization to the table or tables from which the SQL VIEW - * used to populate a RowSet object is derived. + * Indicates that a {@code SyncProvider} implementation does not support + * synchronization to the table or tables from which the SQL {@code VIEW} + * used to populate a {@code RowSet} object is derived. *
    *

    - * 3.5 Usage of SyncProvider Grading and Locking + * 3.5 Usage of {@code SyncProvider} Grading and Locking *

    - * In the example below, the reference CachedRowSetImpl implementation - * reconfigures its current SyncProvider object by calling the - * setSyncProvider method.
    + * In the example below, the reference {@code CachedRowSetImpl} implementation + * reconfigures its current {@code SyncProvider} object by calling the + * {@code setSyncProvider} method.
    * *

      *   CachedRowSetImpl crs = new CachedRowSetImpl();
      *   crs.setSyncProvider("com.foo.bar.HASyncProvider");
      * 
    - * An application can retrieve the SyncProvider object currently in use - * by a disconnected RowSet object. It can also retrieve the + * An application can retrieve the {@code SyncProvider} object currently in use + * by a disconnected {@code RowSet} object. It can also retrieve the * grade of synchronization with which the provider was implemented and the degree of * locking currently in use. In addition, an application has the flexibility to set * the degree of locking to be used, which can increase the possibilities for successful @@ -388,10 +388,10 @@ * break; * } * - * switch (sync.getDataSourcLock() { + * switch (sync.getDataSourceLock() { * case: SyncProvider.DATASOURCE_DB_LOCK * // A lock is placed on the entire datasource that is used by the - * // RowSet object + * // {@code RowSet} object * break; * * case: SyncProvider.DATASOURCE_NO_LOCK @@ -412,8 +412,8 @@ * * * It is also possible using the static utility method in the - * SyncFactory class to determine the list of SyncProvider - * implementations currently registered with the SyncFactory. + * {@code SyncFactory} class to determine the list of {@code SyncProvider} + * implementations currently registered with the {@code SyncFactory}. * *
      *       Enumeration e = SyncFactory.getRegisteredProviders();
    @@ -422,48 +422,48 @@
      *
      * 

    4.0 Resolving Synchronization Conflicts

    * - * The interface SyncResolver provides a way for an application to - * decide manually what to do when a conflict occurs. When the CachedRowSet - * method acceptChanges finishes and has detected one or more conflicts, - * it throws a SyncProviderException object. An application can + * The interface {@code SyncResolver} provides a way for an application to + * decide manually what to do when a conflict occurs. When the {@code CachedRowSet} + * method {@code acceptChanges} finishes and has detected one or more conflicts, + * it throws a {@code SyncProviderException} object. An application can * catch the exception and - * have it retrieve a SyncResolver object by calling the method - * SyncProviderException.getSyncResolver(). + * have it retrieve a {@code SyncResolver} object by calling the method + * {@code SyncProviderException.getSyncResolver()}. *

    - * A SyncResolver object, which is a special kind of - * CachedRowSet object or - * a JdbcRowSet object that has implemented the SyncResolver + * A {@code SyncResolver} object, which is a special kind of + * {@code CachedRowSet} object or + * a {@code JdbcRowSet} object that has implemented the {@code SyncResolver} * interface, examines the conflicts row by row. It is a duplicate of the - * RowSet object being synchronized except that it contains only the data + * {@code RowSet} object being synchronized except that it contains only the data * from the data source this is causing a conflict. All of the other column values are - * set to null. To navigate from one conflict value to another, a - * SyncResolver object provides the methods nextConflict and - * previousConflict. + * set to {@code null}. To navigate from one conflict value to another, a + * {@code SyncResolver} object provides the methods {@code nextConflict} and + * {@code previousConflict}. *

    - * The SyncResolver interface also + * The {@code SyncResolver} interface also * provides methods for doing the following: *

      *
    • finding out whether the conflict involved an update, a delete, or an insert *
    • getting the value in the data source that caused the conflict *
    • setting the value that should be in the data source if it needs to be changed - * or setting the value that should be in the RowSet object if it needs + * or setting the value that should be in the {@code RowSet} object if it needs * to be changed *
    *

    - * When the CachedRowSet method acceptChanges is called, it - * delegates to the RowSet object's SyncProvider object. - * How the writer provided by that SyncProvider object is implemented + * When the {@code CachedRowSet} method {@code acceptChanges} is called, it + * delegates to the {@code RowSet} object's {@code SyncProvider} object. + * How the writer provided by that {@code SyncProvider} object is implemented * determines what level (grade) of checking for conflicts will be done. After all * checking for conflicts is completed and one or more conflicts has been found, the method - * acceptChanges throws a SyncProviderException object. The - * application can catch the exception and use it to obtain a SyncResolver object. + * {@code acceptChanges} throws a {@code SyncProviderException} object. The + * application can catch the exception and use it to obtain a {@code SyncResolver} object. *

    - * The application can then use SyncResolver methods to get information + * The application can then use {@code SyncResolver} methods to get information * about each conflict and decide what to do. If the application logic or the user - * decides that a value in the RowSet object should be the one to + * decides that a value in the {@code RowSet} object should be the one to * persist, the application or user can overwrite the data source value with it. *

    - * The comment for the SyncResolver interface has more detail. + * The comment for the {@code SyncResolver} interface has more detail. * *

    5.0 Related Specifications

    *
      diff --git a/src/java.sql/share/classes/java/sql/package-info.java b/src/java.sql/share/classes/java/sql/package-info.java index 374c2a04b00..2e15beb4b7b 100644 --- a/src/java.sql/share/classes/java/sql/package-info.java +++ b/src/java.sql/share/classes/java/sql/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2020, 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 @@ -34,17 +34,17 @@ * to passing SQL statements to a database, it provides for reading and * writing data from any data source with a tabular format. * The reader/writer facility, available through the - * javax.sql.RowSet group of interfaces, can be customized to + * {@code javax.sql.RowSet} group of interfaces, can be customized to * use and update data from a spread sheet, flat file, or any other tabular * data source. * *

      What the JDBC™ 4.3 API Includes

      * The JDBC™ 4.3 API includes both - * the java.sql package, referred to as the JDBC core API, - * and the javax.sql package, referred to as the JDBC Optional + * the {@code java.sql} package, referred to as the JDBC core API, + * and the {@code javax.sql} package, referred to as the JDBC Optional * Package API. This complete JDBC API * is included in the Java™ Standard Edition (Java SE™), version 7. - * The javax.sql package extends the functionality of the JDBC API + * The {@code javax.sql} package extends the functionality of the JDBC API * from a client-side API to a server-side API, and it is an essential part * of the Java™ Enterprise Edition * (Java EE™) technology. @@ -91,141 +91,141 @@ * check your driver's documentation to see whether it supports a feature before * you try to use it. *

      - * NOTE: The class SQLPermission was added in the + * NOTE: The class {@code SQLPermission} was added in the * Java™ 2 SDK, Standard Edition, * version 1.3 release. This class is used to prevent unauthorized - * access to the logging stream associated with the DriverManager, + * access to the logging stream associated with the {@code DriverManager}, * which may contain information such as table names, column data, and so on. * - *

      What the java.sql Package Contains

      - * The java.sql package contains API for the following: + *

      What the {@code java.sql} Package Contains

      + * The {@code java.sql} package contains API for the following: *
        - *
      • Making a connection with a database via the DriverManager facility + *
      • Making a connection with a database via the {@code DriverManager} facility *
          - *
        • DriverManager class -- makes a connection with a driver - *
        • SQLPermission class -- provides permission when code + *
        • {@code DriverManager} class -- makes a connection with a driver + *
        • {@code SQLPermission} class -- provides permission when code * running within a Security Manager, such as an applet, * attempts to set up a logging stream through the - * DriverManager - *
        • Driver interface -- provides the API for registering + * {@code DriverManager} + *
        • {@code Driver} interface -- provides the API for registering * and connecting drivers based on JDBC technology ("JDBC drivers"); - * generally used only by the DriverManager class - *
        • DriverPropertyInfo class -- provides properties for a + * generally used only by the {@code DriverManager} class + *
        • {@code DriverPropertyInfo} class -- provides properties for a * JDBC driver; not used by the general user *
        *
      • Sending SQL statements to a database *
          - *
        • Statement -- used to send basic SQL statements - *
        • PreparedStatement -- used to send prepared statements or - * basic SQL statements (derived from Statement) - *
        • CallableStatement -- used to call database stored - * procedures (derived from PreparedStatement) - *
        • Connection interface -- provides methods for creating + *
        • {@code Statement} -- used to send basic SQL statements + *
        • {@code PreparedStatement} -- used to send prepared statements or + * basic SQL statements (derived from {@code Statement}) + *
        • {@code CallableStatement} -- used to call database stored + * procedures (derived from {@code PreparedStatement}) + *
        • {@code Connection} interface -- provides methods for creating * statements and managing connections and their properties - *
        • Savepoint -- provides savepoints in a transaction + *
        • {@code Savepoint} -- provides savepoints in a transaction * *
        *
      • Retrieving and updating the results of a query *
          - *
        • ResultSet interface + *
        • {@code ResultSet} interface *
        *
      • Standard mappings for SQL types to classes and interfaces in the * Java programming language *
          - *
        • Array interface -- mapping for SQL ARRAY - *
        • Blob interface -- mapping for SQL BLOB - *
        • Clob interface -- mapping for SQL CLOB - *
        • Date class -- mapping for SQL DATE - *
        • NClob interface -- mapping for SQL NCLOB - *
        • Ref interface -- mapping for SQL REF - *
        • RowId interface -- mapping for SQL ROWID - *
        • Struct interface -- mapping for SQL STRUCT - *
        • SQLXML interface -- mapping for SQL XML - *
        • Time class -- mapping for SQL TIME - *
        • Timestamp class -- mapping for SQL TIMESTAMP - *
        • Types class -- provides constants for SQL types + *
        • {@code Array} interface -- mapping for SQL {@code ARRAY} + *
        • {@code Blob} interface -- mapping for SQL {@code BLOB} + *
        • {@code Clob} interface -- mapping for SQL {@code CLOB} + *
        • {@code Date} class -- mapping for SQL {@code DATE} + *
        • {@code NClob} interface -- mapping for SQL {@code NCLOB} + *
        • {@code Ref} interface -- mapping for SQL {@code REF} + *
        • {@code RowId} interface -- mapping for SQL {@code ROWID} + *
        • {@code Struct} interface -- mapping for SQL {@code STRUCT} + *
        • {@code SQLXML} interface -- mapping for SQL {@code XML} + *
        • {@code Time} class -- mapping for SQL {@code TIME} + *
        • {@code Timestamp} class -- mapping for SQL {@code TIMESTAMP} + *
        • {@code Types} class -- provides constants for SQL types *
        *
      • Custom mapping an SQL user-defined type (UDT) to a class in the * Java programming language *
          - *
        • SQLData interface -- specifies the mapping of + *
        • {@code SQLData} interface -- specifies the mapping of * a UDT to an instance of this class - *
        • SQLInput interface -- provides methods for reading + *
        • {@code SQLInput} interface -- provides methods for reading * UDT attributes from a stream - *
        • SQLOutput interface -- provides methods for writing + *
        • {@code SQLOutput} interface -- provides methods for writing * UDT attributes back to a stream *
        *
      • Metadata *
          - *
        • DatabaseMetaData interface -- provides information + *
        • {@code DatabaseMetaData} interface -- provides information * about the database - *
        • ResultSetMetaData interface -- provides information - * about the columns of a ResultSet object - *
        • ParameterMetaData interface -- provides information - * about the parameters to PreparedStatement commands + *
        • {@code ResultSetMetaData} interface -- provides information + * about the columns of a {@code ResultSet} object + *
        • {@code ParameterMetaData} interface -- provides information + * about the parameters to {@code PreparedStatement} commands *
        *
      • Exceptions *
          - *
        • SQLException -- thrown by most methods when there + *
        • {@code SQLException} -- thrown by most methods when there * is a problem accessing data and by some methods for other reasons - *
        • SQLWarning -- thrown to indicate a warning - *
        • DataTruncation -- thrown to indicate that data may have + *
        • {@code SQLWarning} -- thrown to indicate a warning + *
        • {@code DataTruncation} -- thrown to indicate that data may have * been truncated - *
        • BatchUpdateException -- thrown to indicate that not all + *
        • {@code BatchUpdateException} -- thrown to indicate that not all * commands in a batch update executed successfully *
        *
      * - *

      java.sql and javax.sql Features Introduced in the JDBC 4.3 API

      + *

      {@code java.sql} and {@code javax.sql} Features Introduced in the JDBC 4.3 API

      *
        - *
      • Added Sharding support
      • - *
      • Enhanced Connection to be able to provide hints + *
      • Added {@code Sharding} support
      • + *
      • Enhanced {@code Connection} to be able to provide hints * to the driver that a request, an independent unit of work, * is beginning or ending
      • - *
      • Enhanced DatabaseMetaData to determine if Sharding is + *
      • Enhanced {@code DatabaseMetaData} to determine if Sharding is * supported
      • - *
      • Added the method drivers to DriverManager + *
      • Added the method {@code drivers} to {@code DriverManager} * to return a Stream of the currently loaded and * available JDBC drivers
      • - *
      • Added support to Statement for enquoting literals + *
      • Added support to {@code Statement} for enquoting literals * and simple identifiers
      • *
      • Clarified the Java SE version that methods were deprecated
      • *
      * - *

      java.sql and javax.sql Features Introduced in the JDBC 4.2 API

      + *

      {@code java.sql} and {@code javax.sql} Features Introduced in the JDBC 4.2 API

      *
        - *
      • Added JDBCType enum and SQLType interface
      • - *
      • Support for REF CURSORS in CallableStatement + *
      • Added {@code JDBCType} enum and {@code SQLType} interface
      • + *
      • Support for {@code REF CURSORS} in {@code CallableStatement} *
      • - *
      • DatabaseMetaData methods to return maximum Logical LOB size + *
      • {@code DatabaseMetaData} methods to return maximum Logical LOB size * and if Ref Cursors are supported
      • *
      • Added support for large update counts
      • * *
      * - *

      java.sql and javax.sql Features Introduced in the JDBC 4.1 API

      + *

      {@code java.sql} and {@code javax.sql} Features Introduced in the JDBC 4.1 API

      *
        - *
      • Allow Connection, - * ResultSet and Statement objects to be + *
      • Allow {@code Connection}, + * {@code ResultSet} and {@code Statement} objects to be * used with the try-with-resources statement
      • - *
      • Support added to CallableStatement and - * ResultSet to specify the Java type to convert to via the - * getObject method
      • - *
      • DatabaseMetaData methods to return PseudoColumns and if a + *
      • Support added to {@code CallableStatement} and + * {@code ResultSet} to specify the Java type to convert to via the + * {@code getObject} method
      • + *
      • {@code DatabaseMetaData} methods to return PseudoColumns and if a * generated key is always returned
      • - *
      • Added support to Connection to specify a database schema, + *
      • Added support to {@code Connection} to specify a database schema, * abort and timeout a physical connection.
      • - *
      • Added support to close a Statement object when its dependent + *
      • Added support to close a {@code Statement} object when its dependent * objects have been closed
      • - *
      • Support for obtaining the parent logger for a Driver, - * DataSource, ConnectionPoolDataSource and - * XADataSource
      • + *
      • Support for obtaining the parent logger for a {@code Driver}, + * {@code DataSource}, {@code ConnectionPoolDataSource} and + * {@code XADataSource}
      • * *
      - *

      java.sql and javax.sql Features Introduced in the JDBC 4.0 API

      + *

      {@code java.sql} and {@code javax.sql} Features Introduced in the JDBC 4.0 API

      *
        *
      • auto java.sql.Driver discovery -- no longer need to load a - * java.sql.Driver class via Class.forName + * {@code java.sql.Driver} class via {@code Class.forName} *
      • National Character Set support added *
      • Support added for the SQL:2003 XML data type *
      • SQLException enhancements -- Added support for cause chaining; New SQLExceptions @@ -236,92 +236,92 @@ *
      • Support added to allow a JDBC application to access an instance of a JDBC resource * that has been wrapped by a vendor, usually in an application server or connection * pooling environment. - *
      • Availability to be notified when a PreparedStatement that is associated - * with a PooledConnection has been closed or the driver determines is invalid + *
      • Availability to be notified when a {@code PreparedStatement} that is associated + * with a {@code PooledConnection} has been closed or the driver determines is invalid * * *
      * * - *

      java.sql and javax.sql Features Introduced in the JDBC 3.0 API

      + *

      {@code java.sql} and {@code javax.sql} Features Introduced in the JDBC 3.0 API

      *
        *
      • Pooled statements -- reuse of statements associated with a pooled * connection *
      • Savepoints -- allow a transaction to be rolled back to a designated * savepoint - *
      • Properties defined for ConnectionPoolDataSource -- specify + *
      • Properties defined for {@code ConnectionPoolDataSource} -- specify * how connections are to be pooled - *
      • Metadata for parameters of a PreparedStatement object + *
      • Metadata for parameters of a {@code PreparedStatement} object *
      • Ability to retrieve values from automatically generated columns - *
      • Ability to have multiple ResultSet objects - * returned from CallableStatement objects open at the + *
      • Ability to have multiple {@code ResultSet} objects + * returned from {@code CallableStatement} objects open at the * same time - *
      • Ability to identify parameters to CallableStatement + *
      • Ability to identify parameters to {@code CallableStatement} * objects by name as well as by index - *
      • ResultSet holdability -- ability to specify whether cursors + *
      • {@code ResultSet} holdability -- ability to specify whether cursors * should be held open or closed at the end of a transaction *
      • Ability to retrieve and update the SQL structured type instance that a - * Ref object references - *
      • Ability to programmatically update BLOB, - * CLOB, ARRAY, and REF values. - *
      • Addition of the java.sql.Types.DATALINK data type -- + * {@code Ref} object references + *
      • Ability to programmatically update {@code BLOB}, + * {@code CLOB}, {@code ARRAY}, and {@code REF} values. + *
      • Addition of the {@code java.sql.Types.DATALINK} data type -- * allows JDBC drivers access to objects stored outside a data source *
      • Addition of metadata for retrieving SQL type hierarchies *
      * - *

      java.sql Features Introduced in the JDBC 2.1 Core API

      + *

      {@code java.sql} Features Introduced in the JDBC 2.1 Core API

      *
        - *
      • Scrollable result sets--using new methods in the ResultSet + *
      • Scrollable result sets--using new methods in the {@code ResultSet} * interface that allow the cursor to be moved to a particular row or to a * position relative to its current position *
      • Batch updates - *
      • Programmatic updates--using ResultSet updater methods + *
      • Programmatic updates--using {@code ResultSet} updater methods *
      • New data types--interfaces mapping the SQL3 data types *
      • Custom mapping of user-defined types (UDTs) *
      • Miscellaneous features, including performance hints, the use of character - * streams, full precision for java.math.BigDecimal values, + * streams, full precision for {@code java.math.BigDecimal} values, * additional security, and * support for time zones in date, time, and timestamp values. *
      * - *

      javax.sql Features Introduced in the JDBC 2.0 Optional + *

      {@code javax.sql} Features Introduced in the JDBC 2.0 Optional * Package API

      *
        - *
      • The DataSource interface as a means of making a connection. The + *
      • The {@code DataSource} interface as a means of making a connection. The * Java Naming and Directory Interface™ - * (JNDI) is used for registering a DataSource object with a + * (JNDI) is used for registering a {@code DataSource} object with a * naming service and also for retrieving it. *
      • Pooled connections -- allowing connections to be used and reused *
      • Distributed transactions -- allowing a transaction to span diverse * DBMS servers - *
      • RowSet technology -- providing a convenient means of + *
      • {@code RowSet} technology -- providing a convenient means of * handling and passing data *
      * * *

      Custom Mapping of UDTs

      * A user-defined type (UDT) defined in SQL can be mapped to a class in the Java - * programming language. An SQL structured type or an SQL DISTINCT + * programming language. An SQL structured type or an SQL {@code DISTINCT} * type are the UDTs that may be custom mapped. The following three * steps set up a custom mapping: *
        - *
      1. Defining the SQL structured type or DISTINCT type in SQL + *
      2. Defining the SQL structured type or {@code DISTINCT} type in SQL *
      3. Defining the class in the Java programming language to which the * SQL UDT will be mapped. This class must implement the - * SQLData interface. - *
      4. Making an entry in a Connection object's type map + * {@code SQLData} interface. + *
      5. Making an entry in a {@code Connection} object's type map * that contains two things: *
          *
        • the fully-qualified SQL name of the UDT - *
        • the Class object for the class that implements the - * SQLData interface + *
        • the {@code Class} object for the class that implements the + * {@code SQLData} interface *
        *
      *

      * When these are in place for a UDT, calling the methods - * ResultSet.getObject or CallableStatement.getObject + * {@code ResultSet.getObject} or {@code CallableStatement.getObject} * on that UDT will automatically retrieve the custom mapping for it. Also, the - * PreparedStatement.setObject method will automatically map the + * {@code PreparedStatement.setObject} method will automatically map the * object back to its SQL type to store it in the data source. * *

      Package Specification

      diff --git a/src/java.sql/share/classes/javax/sql/package-info.java b/src/java.sql/share/classes/javax/sql/package-info.java index 628b4d36030..64028801302 100644 --- a/src/java.sql/share/classes/javax/sql/package-info.java +++ b/src/java.sql/share/classes/javax/sql/package-info.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2020, 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 @@ -26,36 +26,36 @@ /** * Provides the API for server side data source access and processing from * the Java™ programming language. - * This package supplements the java.sql + * This package supplements the {@code java.sql} * package and, as of the version 1.4 release, is included in the * Java Platform, Standard Edition (Java SE™). * It remains an essential part of the Java Platform, Enterprise Edition * (Java EE™). *

      - * The javax.sql package provides for the following: + * The {@code javax.sql} package provides for the following: *

        - *
      1. The DataSource interface as an alternative to the - * DriverManager for establishing a + *
      2. The {@code DataSource} interface as an alternative to the + * {@code DriverManager} for establishing a * connection with a data source *
      3. Connection pooling and Statement pooling *
      4. Distributed transactions *
      5. Rowsets *
      *

      - * Applications use the DataSource and RowSet + * Applications use the {@code DataSource} and {@code RowSet} * APIs directly, but the connection pooling and distributed transaction * APIs are used internally by the middle-tier infrastructure. * - *

      Using a DataSource Object to Make a Connection

      + *

      Using a {@code DataSource} Object to Make a Connection

      *

      - * The javax.sql package provides the preferred - * way to make a connection with a data source. The DriverManager + * The {@code javax.sql} package provides the preferred + * way to make a connection with a data source. The {@code DriverManager} * class, the original mechanism, is still valid, and code using it will - * continue to run. However, the newer DataSource mechanism + * continue to run. However, the newer {@code DataSource} mechanism * is preferred because it offers many advantages over the - * DriverManager mechanism. + * {@code DriverManager} mechanism. *

      - * These are the main advantages of using a DataSource object to + * These are the main advantages of using a {@code DataSource} object to * make a connection: *

        * @@ -63,39 +63,39 @@ * that it is not necessary to make changes in application code when * something about the data source or driver changes. *
      • Connection and Statement pooling and distributed transactions are available - * through a DataSource object that is + * through a {@code DataSource} object that is * implemented to work with the middle-tier infrastructure. - * Connections made through the DriverManager + * Connections made through the {@code DriverManager} * do not have connection and statement pooling or distributed transaction * capabilities. *
      *

      - * Driver vendors provide DataSource implementations. A - * particular DataSource object represents a particular - * physical data source, and each connection the DataSource object + * Driver vendors provide {@code DataSource} implementations. A + * particular {@code DataSource} object represents a particular + * physical data source, and each connection the {@code DataSource} object * creates is a connection to that physical data source. *

      * A logical name for the data source is registered with a naming service that * uses the Java Naming and Directory Interface™ * (JNDI) API, usually by a system administrator or someone performing the * duties of a system administrator. An application can retrieve the - * DataSource object it wants by doing a lookup on the logical + * {@code DataSource} object it wants by doing a lookup on the logical * name that has been registered for it. The application can then use the - * DataSource object to create a connection to the physical data + * {@code DataSource} object to create a connection to the physical data * source it represents. *

      - * A DataSource object can be implemented to work with the + * A {@code DataSource} object can be implemented to work with the * middle tier infrastructure so that the connections it produces will be - * pooled for reuse. An application that uses such a DataSource + * pooled for reuse. An application that uses such a {@code DataSource} * implementation will automatically get a connection that participates in * connection pooling. - * A DataSource object can also be implemented to work with the + * A {@code DataSource} object can also be implemented to work with the * middle tier infrastructure so that the connections it produces can be * used for distributed transactions without any special coding. * *

      Connection Pooling and Statement Pooling

      *

      - * Connections made via a DataSource + * Connections made via a {@code DataSource} * object that is implemented to work with a middle tier connection pool manager * will participate in connection pooling. This can improve performance * dramatically because creating new connections is very expensive. @@ -106,40 +106,40 @@ * Connection pooling is totally transparent. It is done automatically * in the middle tier of a Java EE configuration, so from an application's * viewpoint, no change in code is required. An application simply uses - * the DataSource.getConnection method to get the pooled - * connection and uses it the same way it uses any Connection + * the {@code DataSource.getConnection} method to get the pooled + * connection and uses it the same way it uses any {@code Connection} * object. *

      * The classes and interfaces used for connection pooling are: *

        - *
      • ConnectionPoolDataSource - *
      • PooledConnection - *
      • ConnectionEvent - *
      • ConnectionEventListener - *
      • StatementEvent - *
      • StatementEventListener + *
      • {@code ConnectionPoolDataSource} + *
      • {@code PooledConnection} + *
      • {@code ConnectionEvent} + *
      • {@code ConnectionEventListener} + *
      • {@code StatementEvent} + *
      • {@code StatementEventListener} *
      * The connection pool manager, a facility in the middle tier of * a three-tier architecture, uses these classes and interfaces - * behind the scenes. When a ConnectionPoolDataSource object - * is called on to create a PooledConnection object, the - * connection pool manager will register as a ConnectionEventListener - * object with the new PooledConnection object. When the connection + * behind the scenes. When a {@code ConnectionPoolDataSource} object + * is called on to create a {@code PooledConnection} object, the + * connection pool manager will register as a {@code ConnectionEventListener} + * object with the new {@code PooledConnection} object. When the connection * is closed or there is an error, the connection pool manager (being a listener) - * gets a notification that includes a ConnectionEvent object. + * gets a notification that includes a {@code ConnectionEvent} object. *

      - * If the connection pool manager supports Statement pooling, for - * PreparedStatements, which can be determined by invoking the method - * DatabaseMetaData.supportsStatementPooling, the - * connection pool manager will register as a StatementEventListener - * object with the new PooledConnection object. When the - * PreparedStatement is closed or there is an error, the connection + * If the connection pool manager supports {@code Statement} pooling, for + * {@code PreparedStatements}, which can be determined by invoking the method + * {@code DatabaseMetaData.supportsStatementPooling}, the + * connection pool manager will register as a {@code StatementEventListener} + * object with the new {@code PooledConnection} object. When the + * {@code PreparedStatement} is closed or there is an error, the connection * pool manager (being a listener) - * gets a notification that includes a StatementEvent object. + * gets a notification that includes a {@code StatementEvent} object. * *

      Distributed Transactions

      *

      - * As with pooled connections, connections made via a DataSource + * As with pooled connections, connections made via a {@code DataSource} * object that is implemented to work with the middle tier infrastructure * may participate in distributed transactions. This gives an application * the ability to involve data sources on multiple servers in a single @@ -147,112 +147,112 @@ *

      * The classes and interfaces used for distributed transactions are: *

        - *
      • XADataSource - *
      • XAConnection + *
      • {@code XADataSource} + *
      • {@code XAConnection} *
      * These interfaces are used by the transaction manager; an application does * not use them directly. *

      - * The XAConnection interface is derived from the - * PooledConnection interface, so what applies to a pooled connection + * The {@code XAConnection} interface is derived from the + * {@code PooledConnection} interface, so what applies to a pooled connection * also applies to a connection that is part of a distributed transaction. * A transaction manager in the middle tier handles everything transparently. * The only change in application code is that an application cannot do anything * that would interfere with the transaction manager's handling of the transaction. - * Specifically, an application cannot call the methods Connection.commit - * or Connection.rollback, and it cannot set the connection to be in + * Specifically, an application cannot call the methods {@code Connection.commit} + * or {@code Connection.rollback}, and it cannot set the connection to be in * auto-commit mode (that is, it cannot call - * Connection.setAutoCommit(true)). + * {@code Connection.setAutoCommit(true)}). *

      * An application does not need to do anything special to participate in a * distributed transaction. * It simply creates connections to the data sources it wants to use via - * the DataSource.getConnection method, just as it normally does. + * the {@code DataSource.getConnection} method, just as it normally does. * The transaction manager manages the transaction behind the scenes. The - * XADataSource interface creates XAConnection objects, and - * each XAConnection object creates an XAResource object + * {@code XADataSource} interface creates {@code XAConnection} objects, and + * each {@code XAConnection} object creates an {@code XAResource} object * that the transaction manager uses to manage the connection. * * *

      Rowsets

      - * The RowSet interface works with various other classes and + * The {@code RowSet} interface works with various other classes and * interfaces behind the scenes. These can be grouped into three categories. *
        *
      1. Event Notification *
          - *
        • RowSetListener
          - * A RowSet object is a JavaBeans™ + *
        • {@code RowSetListener}
          + * A {@code RowSet} object is a JavaBeans™ * component because it has properties and participates in the JavaBeans - * event notification mechanism. The RowSetListener interface + * event notification mechanism. The {@code RowSetListener} interface * is implemented by a component that wants to be notified about events that - * occur to a particular RowSet object. Such a component registers - * itself as a listener with a rowset via the RowSet.addRowSetListener + * occur to a particular {@code RowSet} object. Such a component registers + * itself as a listener with a rowset via the {@code RowSet.addRowSetListener} * method. *

          - * When the RowSet object changes one of its rows, changes all of + * When the {@code RowSet} object changes one of its rows, changes all of * it rows, or moves its cursor, it also notifies each listener that is registered * with it. The listener reacts by carrying out its implementation of the * notification method called on it. - *

        • RowSetEvent
          - * As part of its internal notification process, a RowSet object - * creates an instance of RowSetEvent and passes it to the listener. - * The listener can use this RowSetEvent object to find out which rowset + *
        • {@code RowSetEvent}
          + * As part of its internal notification process, a {@code RowSet} object + * creates an instance of {@code RowSetEvent} and passes it to the listener. + * The listener can use this {@code RowSetEvent} object to find out which rowset * had the event. *
        *
      2. Metadata *
          - *
        • RowSetMetaData
          + *
        • {@code RowSetMetaData}
          * This interface, derived from the - * ResultSetMetaData interface, provides information about - * the columns in a RowSet object. An application can use - * RowSetMetaData methods to find out how many columns the + * {@code ResultSetMetaData} interface, provides information about + * the columns in a {@code RowSet} object. An application can use + * {@code RowSetMetaData} methods to find out how many columns the * rowset contains and what kind of data each column can contain. *

          - * The RowSetMetaData interface provides methods for + * The {@code RowSetMetaData} interface provides methods for * setting the information about columns, but an application would not - * normally use these methods. When an application calls the RowSet - * method execute, the RowSet object will contain - * a new set of rows, and its RowSetMetaData object will have been + * normally use these methods. When an application calls the {@code RowSet} + * method {@code execute}, the {@code RowSet} object will contain + * a new set of rows, and its {@code RowSetMetaData} object will have been * internally updated to contain information about the new columns. *

        *
      3. The Reader/Writer Facility
        - * A RowSet object that implements the RowSetInternal - * interface can call on the RowSetReader object associated with it - * to populate itself with data. It can also call on the RowSetWriter + * A {@code RowSet} object that implements the {@code RowSetInternal} + * interface can call on the {@code RowSetReader} object associated with it + * to populate itself with data. It can also call on the {@code RowSetWriter} * object associated with it to write any changes to its rows back to the * data source from which it originally got the rows. * A rowset that remains connected to its data source does not need to use a * reader and writer because it can simply operate on the data source directly. * *
          - *
        • RowSetInternal
          - * By implementing the RowSetInternal interface, a - * RowSet object gets access to + *
        • {@code RowSetInternal}
          + * By implementing the {@code RowSetInternal} interface, a + * {@code RowSet} object gets access to * its internal state and is able to call on its reader and writer. A rowset * keeps track of the values in its current rows and of the values that immediately * preceded the current ones, referred to as the original values. A rowset * also keeps track of (1) the parameters that have been set for its command and * (2) the connection that was passed to it, if any. A rowset uses the - * RowSetInternal methods behind the scenes to get access to + * {@code RowSetInternal} methods behind the scenes to get access to * this information. An application does not normally invoke these methods directly. * - *
        • RowSetReader
          - * A disconnected RowSet object that has implemented the - * RowSetInternal interface can call on its reader (the - * RowSetReader object associated with it) to populate it with - * data. When an application calls the RowSet.execute method, + *
        • {@code RowSetReader}
          + * A disconnected {@code RowSet} object that has implemented the + * {@code RowSetInternal} interface can call on its reader (the + * {@code RowSetReader} object associated with it) to populate it with + * data. When an application calls the {@code RowSet.execute} method, * that method calls on the rowset's reader to do much of the work. Implementations * can vary widely, but generally a reader makes a connection to the data source, * reads data from the data source and populates the rowset with it, and closes - * the connection. A reader may also update the RowSetMetaData object + * the connection. A reader may also update the {@code RowSetMetaData} object * for its rowset. The rowset's internal state is also updated, either by the - * reader or directly by the method RowSet.execute. + * reader or directly by the method {@code RowSet.execute}. * * - *
        • RowSetWriter
          - * A disconnected RowSet object that has implemented the - * RowSetInternal interface can call on its writer (the - * RowSetWriter object associated with it) to write changes + *
        • {@code RowSetWriter}
          + * A disconnected {@code RowSet} object that has implemented the + * {@code RowSetInternal} interface can call on its writer (the + * {@code RowSetWriter} object associated with it) to write changes * back to the underlying data source. Implementations may vary widely, but * generally, a writer will do the following: * @@ -269,7 +269,7 @@ *
        *
      *

      - * The RowSet interface may be implemented in any number of + * The {@code RowSet} interface may be implemented in any number of * ways, and anyone may write an implementation. Developers are encouraged * to use their imaginations in coming up with new ways to use rowsets. * @@ -283,7 +283,7 @@ *

      Related Documentation

      *

      * The Java Series book published by Addison-Wesley Longman provides detailed - * information about the classes and interfaces in the javax.sql + * information about the classes and interfaces in the {@code javax.sql} * package: * *

        From 933bb55c492a6133b208769bbbd7ceb75b8aa934 Mon Sep 17 00:00:00 2001 From: Roger Riggs Date: Mon, 27 Jan 2020 08:36:55 -0500 Subject: [PATCH 10/50] 8237651: Clarify initialization of jdk.serialFilter Reviewed-by: bchristi --- .../share/classes/java/io/ObjectInputFilter.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/java.base/share/classes/java/io/ObjectInputFilter.java b/src/java.base/share/classes/java/io/ObjectInputFilter.java index dbcf0c74163..9df7c6ed280 100644 --- a/src/java.base/share/classes/java/io/ObjectInputFilter.java +++ b/src/java.base/share/classes/java/io/ObjectInputFilter.java @@ -206,11 +206,10 @@ public interface ObjectInputFilter { *

        * The filter is configured during the initialization of the {@code ObjectInputFilter.Config} * class. For example, by calling {@link #getSerialFilter() Config.getSerialFilter}. - * If the system property {@systemProperty jdk.serialFilter} is defined on the command line, - * it is used to configure the filter. - * If the system property is not defined on the command line, and the - * {@link java.security.Security} property {@code jdk.serialFilter} is defined - * then it is used to configure the filter. + * If the Java virtual machine is started with the system property + * {@systemProperty jdk.serialFilter}, its value is used to configure the filter. + * If the system property is not defined, and the {@link java.security.Security} property + * {@code jdk.serialFilter} is defined then it is used to configure the filter. * Otherwise, the filter is not configured during initialization and * can be set with {@link #setSerialFilter(ObjectInputFilter) Config.setSerialFilter}. * Setting the {@code jdk.serialFilter} with {@link System#setProperty(String, String) From cdedede9ca830f43c8e6cbc92016033f2e014c85 Mon Sep 17 00:00:00 2001 From: Jonathan Gibbons Date: Mon, 27 Jan 2020 16:19:25 -0800 Subject: [PATCH 11/50] 8237916: Bad copyright line in a jshell source file Reviewed-by: vromero --- src/jdk.jshell/share/classes/jdk/jshell/OuterWrap.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/jdk.jshell/share/classes/jdk/jshell/OuterWrap.java b/src/jdk.jshell/share/classes/jdk/jshell/OuterWrap.java index 8cb1ae848a1..015b97bdad6 100644 --- a/src/jdk.jshell/share/classes/jdk/jshell/OuterWrap.java +++ b/src/jdk.jshell/share/classes/jdk/jshell/OuterWrap.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015-2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2016, 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 From 8c33bba22623ddaa125e6cf0ea93cfd65f9b0090 Mon Sep 17 00:00:00 2001 From: David Holmes Date: Mon, 27 Jan 2020 20:01:35 -0500 Subject: [PATCH 12/50] 8237918: Bad copyright line in a hotspot test Reviewed-by: jjg --- test/hotspot/jtreg/runtime/execstack/Test.java | 2 +- test/hotspot/jtreg/runtime/execstack/TestMT.java | 2 +- test/hotspot/jtreg/runtime/execstack/libtest-rw.c | 2 +- test/hotspot/jtreg/runtime/execstack/libtest-rwx.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/hotspot/jtreg/runtime/execstack/Test.java b/test/hotspot/jtreg/runtime/execstack/Test.java index 4fd931ee504..67891a523aa 100644 --- a/test/hotspot/jtreg/runtime/execstack/Test.java +++ b/test/hotspot/jtreg/runtime/execstack/Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011 SAP AG. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * diff --git a/test/hotspot/jtreg/runtime/execstack/TestMT.java b/test/hotspot/jtreg/runtime/execstack/TestMT.java index 5451679db1b..0be1a461c0a 100644 --- a/test/hotspot/jtreg/runtime/execstack/TestMT.java +++ b/test/hotspot/jtreg/runtime/execstack/TestMT.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011 SAP AG. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * diff --git a/test/hotspot/jtreg/runtime/execstack/libtest-rw.c b/test/hotspot/jtreg/runtime/execstack/libtest-rw.c index 93b11a17542..7ad4b95d25e 100644 --- a/test/hotspot/jtreg/runtime/execstack/libtest-rw.c +++ b/test/hotspot/jtreg/runtime/execstack/libtest-rw.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011 SAP AG. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * diff --git a/test/hotspot/jtreg/runtime/execstack/libtest-rwx.c b/test/hotspot/jtreg/runtime/execstack/libtest-rwx.c index 62b5ac9055e..bce4f853106 100644 --- a/test/hotspot/jtreg/runtime/execstack/libtest-rwx.c +++ b/test/hotspot/jtreg/runtime/execstack/libtest-rwx.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011 SAP AG. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * From c2e69df562a9de07aff8036c74ef4b3f755c7121 Mon Sep 17 00:00:00 2001 From: Vicente Romero Date: Mon, 27 Jan 2020 23:06:46 -0500 Subject: [PATCH 13/50] 8235778: No compilation error reported when a record is declared in a local class Reviewed-by: mcimadamore --- .../com/sun/tools/javac/comp/Check.java | 3 ++ .../javac/records/RecordCompilationTests.java | 37 +++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Check.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Check.java index f19d9f62514..59f22a0cf3c 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Check.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Check.java @@ -1207,6 +1207,9 @@ public class Check { mask = (flags & RECORD) != 0 ? LocalRecordFlags : LocalClassFlags; if ((flags & RECORD) != 0) { implicit = STATIC; + if (sym.owner.kind == TYP) { + log.error(pos, Errors.RecordDeclarationNotAllowedInInnerClasses); + } } if ((sym.owner.flags_field & STATIC) == 0 && (flags & ENUM) != 0) { diff --git a/test/langtools/tools/javac/records/RecordCompilationTests.java b/test/langtools/tools/javac/records/RecordCompilationTests.java index 33c443d184d..bc204ab3ede 100644 --- a/test/langtools/tools/javac/records/RecordCompilationTests.java +++ b/test/langtools/tools/javac/records/RecordCompilationTests.java @@ -417,6 +417,14 @@ public class RecordCompilationTests extends CompilationTestCase { " record RR(int x) { public int x() { return z; }};\n" + " }\n" + "}"); + // can be contained inside a lambda + assertOK(""" + class Outer { + Runnable run = () -> { + record TestRecord(int i) {} + }; + } + """); // Can't self-shadow assertFail("compiler.err.already.defined", @@ -488,6 +496,35 @@ public class RecordCompilationTests extends CompilationTestCase { " record R(int a) {}\n" + " }\n" + "}"); + assertFail("compiler.err.record.declaration.not.allowed.in.inner.classes", + """ + class Outer { + public void test() { + class Inner extends Outer { + record R(int i) {} + } + } + } + """); + assertFail("compiler.err.record.declaration.not.allowed.in.inner.classes", + """ + class Outer { + Runnable run = new Runnable() { + record TestRecord(int i) {} + public void run() {} + }; + } + """); + assertFail("compiler.err.record.declaration.not.allowed.in.inner.classes", + """ + class Outer { + void m() { + record A() { + record B() { } + } + } + } + """); } public void testReceiverParameter() { From cdd3cc4a0bc1df732ec33dff958d0cd5c3ee232e Mon Sep 17 00:00:00 2001 From: Andy Herrick Date: Wed, 29 Jan 2020 14:35:04 -0500 Subject: [PATCH 14/50] 8238168: Remove Copyright from WinLauncher.template Reviewed-by: kcr, prr, asemenyuk --- .../internal/resources/WinLauncher.template | 26 ------------------- 1 file changed, 26 deletions(-) diff --git a/src/jdk.incubator.jpackage/windows/classes/jdk/incubator/jpackage/internal/resources/WinLauncher.template b/src/jdk.incubator.jpackage/windows/classes/jdk/incubator/jpackage/internal/resources/WinLauncher.template index f37a2b82f29..d17a31662d0 100644 --- a/src/jdk.incubator.jpackage/windows/classes/jdk/incubator/jpackage/internal/resources/WinLauncher.template +++ b/src/jdk.incubator.jpackage/windows/classes/jdk/incubator/jpackage/internal/resources/WinLauncher.template @@ -1,29 +1,3 @@ -# -# Copyright (c) 2017, 2019, 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. Oracle designates this -# particular file as subject to the "Classpath" exception as provided -# by Oracle in the LICENSE file that accompanied this code. -# -# 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. -# -# - CompanyName=COMPANY_NAME FileDescription=FILE_DESCRIPTION FileVersion=FILE_VERSION From 06bf842d9ae22576752f6cf1969572b6004cd01e Mon Sep 17 00:00:00 2001 From: Jesper Wilhelmsson Date: Thu, 30 Jan 2020 03:23:28 +0100 Subject: [PATCH 15/50] Added tag jdk-14+34 for changeset a96bc204e3b3 --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index 24a1ee83ead..51935add895 100644 --- a/.hgtags +++ b/.hgtags @@ -608,3 +608,4 @@ d54ce919da90dab361995bb4d87be9851f00537a jdk-14+31 decd3d2953b640f1043ee76953ff89238bff92e8 jdk-14+31 2776da28515e087cc8849acf1e131a65ea7e77b6 jdk-14+32 f728b6c7f4910d6bd6070cb4dde8393f4ba95113 jdk-14+33 +a96bc204e3b31ddbf909b20088964112f052927e jdk-14+34 From 5495efdb84137840f115967c6752450617fe7b9c Mon Sep 17 00:00:00 2001 From: Jerry Zhou Date: Thu, 30 Jan 2020 18:02:39 +0100 Subject: [PATCH 16/50] 8236092: Remove EA from JDK 14 version string starting with Initial RC promotion Reviewed-by: tbell, erikj --- make/autoconf/version-numbers | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/make/autoconf/version-numbers b/make/autoconf/version-numbers index 3942715d066..4f92f3d5e04 100644 --- a/make/autoconf/version-numbers +++ b/make/autoconf/version-numbers @@ -38,7 +38,7 @@ DEFAULT_VERSION_CLASSFILE_MAJOR=58 # "`$EXPR $DEFAULT_VERSION_FEATURE + 44`" DEFAULT_VERSION_CLASSFILE_MINOR=0 DEFAULT_ACCEPTABLE_BOOT_VERSIONS="13 14" DEFAULT_JDK_SOURCE_TARGET_VERSION=14 -DEFAULT_PROMOTED_VERSION_PRE=ea +DEFAULT_PROMOTED_VERSION_PRE= LAUNCHER_NAME=openjdk PRODUCT_NAME=OpenJDK From 953fbd2e66bd22f87545cba4ccf3b62eb05325cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Gr=C3=B6nlund?= Date: Fri, 31 Jan 2020 12:17:55 +0100 Subject: [PATCH 17/50] 8236743: JFR: assert(klass != __null) failed: invariant in ObjectSampleCheckpoint::add_to_leakp_set Reviewed-by: egahlin --- .../checkpoint/objectSampleCheckpoint.cpp | 42 +++++++----- .../checkpoint/objectSampleCheckpoint.hpp | 6 +- .../checkpoint/types/traceid/jfrTraceId.hpp | 2 +- .../types/traceid/jfrTraceId.inline.hpp | 16 +++-- .../jfr/recorder/stacktrace/jfrStackTrace.cpp | 23 ++++--- .../jfr/recorder/stacktrace/jfrStackTrace.hpp | 10 +-- .../share/jfr/support/jfrMethodLookup.cpp | 65 +++++++++++++++++++ .../share/jfr/support/jfrMethodLookup.hpp | 43 ++++++++++++ 8 files changed, 167 insertions(+), 40 deletions(-) create mode 100644 src/hotspot/share/jfr/support/jfrMethodLookup.cpp create mode 100644 src/hotspot/share/jfr/support/jfrMethodLookup.hpp diff --git a/src/hotspot/share/jfr/leakprofiler/checkpoint/objectSampleCheckpoint.cpp b/src/hotspot/share/jfr/leakprofiler/checkpoint/objectSampleCheckpoint.cpp index 362b4bf4c6f..bc1e6108e8d 100644 --- a/src/hotspot/share/jfr/leakprofiler/checkpoint/objectSampleCheckpoint.cpp +++ b/src/hotspot/share/jfr/leakprofiler/checkpoint/objectSampleCheckpoint.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2020, 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 @@ -35,8 +35,10 @@ #include "jfr/recorder/checkpoint/types/traceid/jfrTraceId.inline.hpp" #include "jfr/recorder/service/jfrOptionSet.hpp" #include "jfr/recorder/stacktrace/jfrStackTraceRepository.hpp" +#include "jfr/support/jfrMethodLookup.hpp" #include "jfr/utilities/jfrHashtable.hpp" #include "jfr/utilities/jfrTypes.hpp" +#include "oops/instanceKlass.inline.hpp" #include "runtime/mutexLocker.hpp" #include "runtime/safepoint.hpp" #include "runtime/thread.hpp" @@ -108,6 +110,7 @@ void ObjectSampleCheckpoint::on_thread_exit(JavaThread* jt) { static GrowableArray* unloaded_klass_set = NULL; static void add_to_unloaded_klass_set(traceid klass_id) { + assert_locked_or_safepoint(ClassLoaderDataGraph_lock); if (unloaded_klass_set == NULL) { unloaded_klass_set = c_heap_allocate_array(); } @@ -115,14 +118,16 @@ static void add_to_unloaded_klass_set(traceid klass_id) { } static void sort_unloaded_klass_set() { + assert_locked_or_safepoint(ClassLoaderDataGraph_lock); if (unloaded_klass_set != NULL && unloaded_klass_set->length() > 1) { unloaded_klass_set->sort(sort_traceid); } } void ObjectSampleCheckpoint::on_klass_unload(const Klass* k) { + assert_locked_or_safepoint(ClassLoaderDataGraph_lock); assert(k != NULL, "invariant"); - add_to_unloaded_klass_set(TRACE_ID(k)); + add_to_unloaded_klass_set(JfrTraceId::get(k)); } template @@ -295,29 +300,31 @@ void ObjectSampleCheckpoint::on_rotation(const ObjectSampler* sampler, JfrStackT assert(JfrStream_lock->owned_by_self(), "invariant"); assert(sampler != NULL, "invariant"); assert(LeakProfiler::is_running(), "invariant"); + MutexLocker lock(ClassLoaderDataGraph_lock); + // the lock is needed to ensure the unload lists do not grow in the middle of inspection. install_stack_traces(sampler, stack_trace_repo); } -static traceid get_klass_id(traceid method_id) { +static bool is_klass_unloaded(traceid klass_id) { + assert(ClassLoaderDataGraph_lock->owned_by_self(), "invariant"); + return unloaded_klass_set != NULL && predicate(unloaded_klass_set, klass_id); +} + +static bool is_processed(traceid method_id) { assert(method_id != 0, "invariant"); - return method_id >> TRACE_ID_SHIFT; -} - -static bool is_klass_unloaded(traceid method_id) { - return unloaded_klass_set != NULL && predicate(unloaded_klass_set, get_klass_id(method_id)); -} - -static bool is_processed(traceid id) { - assert(id != 0, "invariant"); assert(id_set != NULL, "invariant"); - return mutable_predicate(id_set, id); + return mutable_predicate(id_set, method_id); } -void ObjectSampleCheckpoint::add_to_leakp_set(const Method* method, traceid method_id) { - if (is_processed(method_id) || is_klass_unloaded(method_id)) { +void ObjectSampleCheckpoint::add_to_leakp_set(const InstanceKlass* ik, traceid method_id) { + assert(ik != NULL, "invariant"); + if (is_processed(method_id) || is_klass_unloaded(JfrMethodLookup::klass_id(method_id))) { return; } - JfrTraceId::set_leakp(method); + const Method* const method = JfrMethodLookup::lookup(ik, method_id); + assert(method != NULL, "invariant"); + assert(method->method_holder() == ik, "invariant"); + JfrTraceId::set_leakp(ik, method); } void ObjectSampleCheckpoint::write_stacktrace(const JfrStackTrace* trace, JfrCheckpointWriter& writer) { @@ -330,7 +337,7 @@ void ObjectSampleCheckpoint::write_stacktrace(const JfrStackTrace* trace, JfrChe for (u4 i = 0; i < trace->_nr_of_frames; ++i) { const JfrStackFrame& frame = trace->_frames[i]; frame.write(writer); - add_to_leakp_set(frame._method, frame._methodid); + add_to_leakp_set(frame._klass, frame._methodid); } } @@ -413,6 +420,7 @@ void ObjectSampleCheckpoint::write(const ObjectSampler* sampler, EdgeStore* edge } static void clear_unloaded_klass_set() { + assert(ClassLoaderDataGraph_lock->owned_by_self(), "invariant"); if (unloaded_klass_set != NULL && unloaded_klass_set->is_nonempty()) { unloaded_klass_set->clear(); } diff --git a/src/hotspot/share/jfr/leakprofiler/checkpoint/objectSampleCheckpoint.hpp b/src/hotspot/share/jfr/leakprofiler/checkpoint/objectSampleCheckpoint.hpp index 4c5607c7f15..c8cd972400e 100644 --- a/src/hotspot/share/jfr/leakprofiler/checkpoint/objectSampleCheckpoint.hpp +++ b/src/hotspot/share/jfr/leakprofiler/checkpoint/objectSampleCheckpoint.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2020, 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 @@ -29,12 +29,12 @@ #include "jfr/utilities/jfrTypes.hpp" class EdgeStore; +class InstanceKlass; class JavaThread; class JfrCheckpointWriter; class JfrStackTrace; class JfrStackTraceRepository; class Klass; -class Method; class ObjectSample; class ObjectSampleMarker; class ObjectSampler; @@ -45,7 +45,7 @@ class ObjectSampleCheckpoint : AllStatic { friend class PathToGcRootsOperation; friend class StackTraceBlobInstaller; private: - static void add_to_leakp_set(const Method* method, traceid method_id); + static void add_to_leakp_set(const InstanceKlass* ik, traceid method_id); static int save_mark_words(const ObjectSampler* sampler, ObjectSampleMarker& marker, bool emit_all); static void write_stacktrace(const JfrStackTrace* trace, JfrCheckpointWriter& writer); static void write(const ObjectSampler* sampler, EdgeStore* edge_store, bool emit_all, Thread* thread); diff --git a/src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceId.hpp b/src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceId.hpp index 1279a43b229..dca78bb32f4 100644 --- a/src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceId.hpp +++ b/src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceId.hpp @@ -99,7 +99,7 @@ class JfrTraceId : public AllStatic { static traceid use(const ClassLoaderData* cld); // leak profiler - static void set_leakp(const Method* method); + static void set_leakp(const Klass* klass, const Method* method); static void remove(const Klass* klass); static void restore(const Klass* klass); diff --git a/src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceId.inline.hpp b/src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceId.inline.hpp index b036b29d849..0dea7b36896 100644 --- a/src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceId.inline.hpp +++ b/src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceId.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2020, 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 @@ -117,12 +117,18 @@ inline traceid JfrTraceId::use(const ClassLoaderData* cld) { return cld->is_unsafe_anonymous() ? 0 : set_used_and_get(cld); } -inline void JfrTraceId::set_leakp(const Method* method) { - assert(method != NULL, "invariant"); - const Klass* const klass = method->method_holder(); +inline void JfrTraceId::set_leakp(const Klass* klass, const Method* method) { assert(klass != NULL, "invariant"); assert(METHOD_AND_CLASS_USED_THIS_EPOCH(klass), "invariant"); - assert(METHOD_FLAG_USED_THIS_EPOCH(method), "invariant"); + assert(method != NULL, "invariant"); + assert(klass == method->method_holder(), "invariant"); + if (METHOD_FLAG_NOT_USED_THIS_EPOCH(method)) { + // the method is already logically tagged, just like the klass, + // but because of redefinition, the latest Method* + // representation might not have a reified tag. + SET_METHOD_FLAG_USED_THIS_EPOCH(method); + assert(METHOD_FLAG_USED_THIS_EPOCH(method), "invariant"); + } SET_LEAKP(klass); SET_METHOD_LEAKP(method); } diff --git a/src/hotspot/share/jfr/recorder/stacktrace/jfrStackTrace.cpp b/src/hotspot/share/jfr/recorder/stacktrace/jfrStackTrace.cpp index 90709fbbd76..10e84c95d11 100644 --- a/src/hotspot/share/jfr/recorder/stacktrace/jfrStackTrace.cpp +++ b/src/hotspot/share/jfr/recorder/stacktrace/jfrStackTrace.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2020, 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 @@ -27,7 +27,9 @@ #include "jfr/recorder/checkpoint/types/traceid/jfrTraceId.inline.hpp" #include "jfr/recorder/repository/jfrChunkWriter.hpp" #include "jfr/recorder/stacktrace/jfrStackTrace.hpp" +#include "jfr/support/jfrMethodLookup.hpp" #include "memory/allocation.inline.hpp" +#include "oops/instanceKlass.inline.hpp" #include "runtime/vframe.inline.hpp" static void copy_frames(JfrStackFrame** lhs_frames, u4 length, const JfrStackFrame* rhs_frames) { @@ -39,11 +41,11 @@ static void copy_frames(JfrStackFrame** lhs_frames, u4 length, const JfrStackFra } } -JfrStackFrame::JfrStackFrame(const traceid& id, int bci, int type, const Method* method) : - _method(method), _methodid(id), _line(0), _bci(bci), _type(type) {} +JfrStackFrame::JfrStackFrame(const traceid& id, int bci, int type, const InstanceKlass* ik) : + _klass(ik), _methodid(id), _line(0), _bci(bci), _type(type) {} -JfrStackFrame::JfrStackFrame(const traceid& id, int bci, int type, int lineno) : - _method(NULL), _methodid(id), _line(lineno), _bci(bci), _type(type) {} +JfrStackFrame::JfrStackFrame(const traceid& id, int bci, int type, int lineno, const InstanceKlass* ik) : + _klass(ik), _methodid(id), _line(lineno), _bci(bci), _type(type) {} JfrStackTrace::JfrStackTrace(JfrStackFrame* frames, u4 max_frames) : _next(NULL), @@ -200,7 +202,7 @@ bool JfrStackTrace::record_thread(JavaThread& thread, frame& frame) { const int lineno = method->line_number_from_bci(bci); // Can we determine if it's inlined? _hash = (_hash << 2) + (unsigned int)(((size_t)mid >> 2) + (bci << 4) + type); - _frames[count] = JfrStackFrame(mid, bci, type, method); + _frames[count] = JfrStackFrame(mid, bci, type, lineno, method->method_holder()); st.samples_next(); count++; } @@ -211,9 +213,12 @@ bool JfrStackTrace::record_thread(JavaThread& thread, frame& frame) { } void JfrStackFrame::resolve_lineno() const { - assert(_method, "no method pointer"); + assert(_klass, "no klass pointer"); assert(_line == 0, "already have linenumber"); - _line = _method->line_number_from_bci(_bci); + const Method* const method = JfrMethodLookup::lookup(_klass, _methodid); + assert(method != NULL, "invariant"); + assert(method->method_holder() == _klass, "invariant"); + _line = method->line_number_from_bci(_bci); } void JfrStackTrace::resolve_linenos() const { @@ -252,7 +257,7 @@ bool JfrStackTrace::record_safe(JavaThread* thread, int skip) { } // Can we determine if it's inlined? _hash = (_hash << 2) + (unsigned int)(((size_t)mid >> 2) + (bci << 4) + type); - _frames[count] = JfrStackFrame(mid, bci, type, method); + _frames[count] = JfrStackFrame(mid, bci, type, method->method_holder()); vfs.next(); count++; } diff --git a/src/hotspot/share/jfr/recorder/stacktrace/jfrStackTrace.hpp b/src/hotspot/share/jfr/recorder/stacktrace/jfrStackTrace.hpp index 9cebed5e634..c3aabca4038 100644 --- a/src/hotspot/share/jfr/recorder/stacktrace/jfrStackTrace.hpp +++ b/src/hotspot/share/jfr/recorder/stacktrace/jfrStackTrace.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2020, 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 @@ -29,23 +29,23 @@ #include "jfr/utilities/jfrTypes.hpp" class frame; +class InstanceKlass; class JavaThread; class JfrCheckpointWriter; class JfrChunkWriter; -class Method; class JfrStackFrame { friend class ObjectSampleCheckpoint; private: - const Method* _method; + const InstanceKlass* _klass; traceid _methodid; mutable int _line; int _bci; u1 _type; public: - JfrStackFrame(const traceid& id, int bci, int type, const Method* method); - JfrStackFrame(const traceid& id, int bci, int type, int lineno); + JfrStackFrame(const traceid& id, int bci, int type, const InstanceKlass* klass); + JfrStackFrame(const traceid& id, int bci, int type, int lineno, const InstanceKlass* klass); bool equals(const JfrStackFrame& rhs) const; void write(JfrChunkWriter& cw) const; diff --git a/src/hotspot/share/jfr/support/jfrMethodLookup.cpp b/src/hotspot/share/jfr/support/jfrMethodLookup.cpp new file mode 100644 index 00000000000..5b61372a34f --- /dev/null +++ b/src/hotspot/share/jfr/support/jfrMethodLookup.cpp @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2020, 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. + * + */ + +#include "precompiled.hpp" +#include "jfr/recorder/checkpoint/types/traceid/jfrTraceIdEpoch.hpp" +#include "jfr/recorder/checkpoint/types/traceid/jfrTraceIdMacros.hpp" +#include "jfr/support/jfrMethodLookup.hpp" +#include "oops/instanceKlass.inline.hpp" +#include "oops/method.inline.hpp" + +// The InstanceKlass is assumed to be the method holder for the method to be looked up. +static const Method* lookup_method(InstanceKlass* ik, int orig_method_id_num) { + assert(ik != NULL, "invariant"); + assert(orig_method_id_num >= 0, "invariant"); + assert(orig_method_id_num < ik->methods()->length(), "invariant"); + const Method* const m = ik->method_with_orig_idnum(orig_method_id_num); + assert(m != NULL, "invariant"); + assert(m->orig_method_idnum() == orig_method_id_num, "invariant"); + assert(!m->is_obsolete(), "invariant"); + assert(ik == m->method_holder(), "invariant"); + return m; +} + +const Method* JfrMethodLookup::lookup(const InstanceKlass* ik, traceid method_id) { + assert(ik != NULL, "invariant"); + return lookup_method(const_cast(ik), method_id_num(method_id)); +} + +int JfrMethodLookup::method_id_num(traceid method_id) { + return (int)(method_id & METHOD_ID_NUM_MASK); +} + +traceid JfrMethodLookup::method_id(const Method* method) { + assert(method != NULL, "invariant"); + return METHOD_ID(method->method_holder(), method); +} + +traceid JfrMethodLookup::klass_id(traceid method_id) { + return method_id >> TRACE_ID_SHIFT; +} + +traceid JfrMethodLookup::klass_id(const Method* method) { + return klass_id(method_id(method)); +} diff --git a/src/hotspot/share/jfr/support/jfrMethodLookup.hpp b/src/hotspot/share/jfr/support/jfrMethodLookup.hpp new file mode 100644 index 00000000000..2f998a9def3 --- /dev/null +++ b/src/hotspot/share/jfr/support/jfrMethodLookup.hpp @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2020, 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. + * + */ + +#ifndef SHARE_JFR_SUPPORT_JFRMETHODLOOKUP_HPP +#define SHARE_JFR_SUPPORT_JFRMETHODLOOKUP_HPP + +#include "jfr/utilities/jfrTypes.hpp" +#include "memory/allocation.hpp" + +class InstanceKlass; +class Method; + +class JfrMethodLookup : AllStatic { + public: + static const Method* lookup(const InstanceKlass* ik, traceid method_id); + static traceid method_id(const Method* method); + static int method_id_num(traceid method_id); + static traceid klass_id(const Method* method); + static traceid klass_id(traceid method_id); +}; + +#endif // SHARE_JFR_SUPPORT_JFRMETHODLOOKUP_HPP From 7db8a1762fb5f1a2a78a9b11be442f64fc9afa1e Mon Sep 17 00:00:00 2001 From: Brian Burkhalter Date: Fri, 31 Jan 2020 08:04:11 -0800 Subject: [PATCH 18/50] 8237514: Spec Clarification - ByteBuffer::alignmentOffset Spec Reviewed-by: alanb, psandoz --- .../classes/java/nio/X-Buffer.java.template | 15 +++++---- .../jdk/java/nio/Buffer/Basic-X.java.template | 33 +++++++++++++++++++ test/jdk/java/nio/Buffer/Basic.java | 2 +- test/jdk/java/nio/Buffer/BasicByte.java | 33 +++++++++++++++++++ 4 files changed, 75 insertions(+), 8 deletions(-) diff --git a/src/java.base/share/classes/java/nio/X-Buffer.java.template b/src/java.base/share/classes/java/nio/X-Buffer.java.template index 2a249bca2b9..4c550d1fb0c 100644 --- a/src/java.base/share/classes/java/nio/X-Buffer.java.template +++ b/src/java.base/share/classes/java/nio/X-Buffer.java.template @@ -1871,19 +1871,20 @@ public abstract class $Type$Buffer * Returns the memory address, pointing to the byte at the given index, * modulo the given unit size. * - *

        The return value is non-negative, with {@code 0} indicating that the - * address of the byte at the index is aligned for the unit size, and a - * positive value that the address is misaligned for the unit size. If the - * address of the byte at the index is misaligned, the return value + *

        The return value is non-negative in the range of {@code 0} + * (inclusive) up to {@code unitSize} (exclusive), with zero indicating + * that the address of the byte at the index is aligned for the unit size, + * and a positive value that the address is misaligned for the unit size. + * If the address of the byte at the index is misaligned, the return value * represents how much the index should be adjusted to locate a byte at an * aligned address. Specifically, the index should either be decremented by - * the return value, or incremented by the unit size minus the return value. - * Therefore given + * the return value if the latter is not greater than {@code index}, or be + * incremented by the unit size minus the return value. Therefore given *

              * int value = alignmentOffset(index, unitSize)
        * then the identities *
        -     * alignmentOffset(index - value, unitSize) == 0
        + * alignmentOffset(index - value, unitSize) == 0, value ≤ index
    * and *
          * alignmentOffset(index + (unitSize - value), unitSize) == 0
    diff --git a/test/jdk/java/nio/Buffer/Basic-X.java.template b/test/jdk/java/nio/Buffer/Basic-X.java.template index 057a1842130..0879a61c61c 100644 --- a/test/jdk/java/nio/Buffer/Basic-X.java.template +++ b/test/jdk/java/nio/Buffer/Basic-X.java.template @@ -39,6 +39,7 @@ import java.nio.*; import java.nio.channels.FileChannel; import java.nio.file.Files; import java.nio.file.Path; +import java.util.Random; #end[byte] @@ -492,6 +493,38 @@ public class Basic$Type$ } catch (IOException e) { throw new UncheckedIOException(e); } + + // alignment identities + final int maxPow2 = 12; + ByteBuffer bb = ByteBuffer.allocateDirect(1 << maxPow2); // cap 4096 + + Random rnd = new Random(); + long seed = rnd.nextLong(); + rnd = new Random(seed); + + for (int i = 0; i < 100; i++) { + // 1 == 2^0 <= unitSize == 2^k <= bb.capacity()/2 + int unitSize = 1 << rnd.nextInt(maxPow2); + // 0 <= index < 2*unitSize + int index = rnd.nextInt(unitSize << 1); + int value = bb.alignmentOffset(index, unitSize); + try { + if (value < 0 || value >= unitSize) { + throw new RuntimeException(value + " < 0 || " + + value + " >= " + unitSize); + } + if (value <= index && + bb.alignmentOffset(index - value, unitSize) != 0) + throw new RuntimeException("Identity 1"); + if (bb.alignmentOffset(index + (unitSize - value), + unitSize) != 0) + throw new RuntimeException("Identity 2"); + } catch (RuntimeException re) { + System.err.format("seed %d, index %d, unitSize %d, value %d%n", + seed, index, unitSize, value); + throw re; + } + } } private static MappedByteBuffer[] mappedBuffers() throws IOException { diff --git a/test/jdk/java/nio/Buffer/Basic.java b/test/jdk/java/nio/Buffer/Basic.java index f3875a97ddb..90d5ec943ab 100644 --- a/test/jdk/java/nio/Buffer/Basic.java +++ b/test/jdk/java/nio/Buffer/Basic.java @@ -26,7 +26,7 @@ * @bug 4413135 4414911 4416536 4416562 4418782 4471053 4472779 4490253 4523725 * 4526177 4463011 4660660 4661219 4663521 4782970 4804304 4938424 5029431 * 5071718 6231529 6221101 6234263 6535542 6591971 6593946 6795561 7190219 - * 7199551 8065556 8149469 8230665 + * 7199551 8065556 8149469 8230665 8237514 * @modules java.base/java.nio:open * java.base/jdk.internal.misc * @author Mark Reinhold diff --git a/test/jdk/java/nio/Buffer/BasicByte.java b/test/jdk/java/nio/Buffer/BasicByte.java index c510ee78d0d..f4790e72483 100644 --- a/test/jdk/java/nio/Buffer/BasicByte.java +++ b/test/jdk/java/nio/Buffer/BasicByte.java @@ -39,6 +39,7 @@ import java.nio.*; import java.nio.channels.FileChannel; import java.nio.file.Files; import java.nio.file.Path; +import java.util.Random; @@ -492,6 +493,38 @@ public class BasicByte } catch (IOException e) { throw new UncheckedIOException(e); } + + // alignment identities + final int maxPow2 = 12; + ByteBuffer bb = ByteBuffer.allocateDirect(1 << maxPow2); // cap 4096 + + Random rnd = new Random(); + long seed = rnd.nextLong(); + rnd = new Random(seed); + + for (int i = 0; i < 100; i++) { + // 1 == 2^0 <= unitSize == 2^k <= bb.capacity()/2 + int unitSize = 1 << rnd.nextInt(maxPow2); + // 0 <= index < 2*unitSize + int index = rnd.nextInt(unitSize << 1); + int value = bb.alignmentOffset(index, unitSize); + try { + if (value < 0 || value >= unitSize) { + throw new RuntimeException(value + " < 0 || " + + value + " >= " + unitSize); + } + if (value <= index && + bb.alignmentOffset(index - value, unitSize) != 0) + throw new RuntimeException("Identity 1"); + if (bb.alignmentOffset(index + (unitSize - value), + unitSize) != 0) + throw new RuntimeException("Identity 2"); + } catch (RuntimeException re) { + System.err.format("seed %d, index %d, unitSize %d, value %d%n", + seed, index, unitSize, value); + throw re; + } + } } private static MappedByteBuffer[] mappedBuffers() throws IOException { From 9ec5da00bc7970a75ec2013f76277c2c63df9951 Mon Sep 17 00:00:00 2001 From: Leo Jiang Date: Tue, 4 Feb 2020 16:26:54 +0000 Subject: [PATCH 19/50] 8238377: JDK 14 L10N resource file update - msgdrop 20 Reviewed-by: naoto, herrick, mchung --- .../internal/resources/MsiInstallerStrings_ja.wxl | 10 +++++----- .../internal/resources/MsiInstallerStrings_zh_CN.wxl | 10 +++++----- .../sun/tools/jdeps/resources/jdeps_ja.properties | 5 ++--- .../sun/tools/jdeps/resources/jdeps_zh_CN.properties | 5 ++--- .../jshell/tool/resources/l10n_ja.properties | 12 ++++++------ .../jshell/tool/resources/l10n_zh_CN.properties | 10 +++++----- 6 files changed, 25 insertions(+), 27 deletions(-) diff --git a/src/jdk.incubator.jpackage/windows/classes/jdk/incubator/jpackage/internal/resources/MsiInstallerStrings_ja.wxl b/src/jdk.incubator.jpackage/windows/classes/jdk/incubator/jpackage/internal/resources/MsiInstallerStrings_ja.wxl index f0770b8820a..61037204d12 100644 --- a/src/jdk.incubator.jpackage/windows/classes/jdk/incubator/jpackage/internal/resources/MsiInstallerStrings_ja.wxl +++ b/src/jdk.incubator.jpackage/windows/classes/jdk/incubator/jpackage/internal/resources/MsiInstallerStrings_ja.wxl @@ -1,7 +1,7 @@ - - The folder [INSTALLDIR] already exist. Would you like to install to that folder anyway? - Main Feature - A higher version of [ProductName] is already installed. Downgrades disabled. Setup will now exit. - A lower version of [ProductName] is already installed. Upgrades disabled. Setup will now exit. + + フォルダ[INSTALLDIR]はすでに存在します。そのフォルダにインストールしますか? + 主な機能 + [ProductName]のより上位のバージョンがすでにインストールされています。ダウングレードは無効です。セットアップを終了します。 + [ProductName]のより下位のバージョンがすでにインストールされています。アップグレードは無効です。セットアップを終了します。 diff --git a/src/jdk.incubator.jpackage/windows/classes/jdk/incubator/jpackage/internal/resources/MsiInstallerStrings_zh_CN.wxl b/src/jdk.incubator.jpackage/windows/classes/jdk/incubator/jpackage/internal/resources/MsiInstallerStrings_zh_CN.wxl index 14a684d586c..63e28b05a35 100644 --- a/src/jdk.incubator.jpackage/windows/classes/jdk/incubator/jpackage/internal/resources/MsiInstallerStrings_zh_CN.wxl +++ b/src/jdk.incubator.jpackage/windows/classes/jdk/incubator/jpackage/internal/resources/MsiInstallerStrings_zh_CN.wxl @@ -1,7 +1,7 @@ - - The folder [INSTALLDIR] already exist. Would you like to install to that folder anyway? - Main Feature - A higher version of [ProductName] is already installed. Downgrades disabled. Setup will now exit. - A lower version of [ProductName] is already installed. Upgrades disabled. Setup will now exit. + + 文件夹 [INSTALLDIR] 已存在。是否仍要安装到该文件夹? + 主要功能 + 已安装更高版本的 [ProductName]。降级已禁用。现在将退出安装。 + 已安装更低版本的 [ProductName]。升级已禁用。现在将退出安装。 diff --git a/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/resources/jdeps_ja.properties b/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/resources/jdeps_ja.properties index 5c596f4355c..de912dc7850 100644 --- a/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/resources/jdeps_ja.properties +++ b/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/resources/jdeps_ja.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2012, 2020, 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 @@ -100,7 +100,6 @@ main.opt.multi-release=\ --multi-release \u30DE\u30EB\u30C1\u30EA err.command.set=\u30AA\u30D7\u30B7\u30E7\u30F3{0}\u3068{1}\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u3059\u3002 err.unknown.option=\u4E0D\u660E\u306A\u30AA\u30D7\u30B7\u30E7\u30F3: {0} err.missing.arg={0}\u306B\u5024\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093 -err.missing.dependences=\u4F9D\u5B58\u6027\u304C\u6B20\u843D\u3057\u3066\u3044\u307E\u3059 err.invalid.arg.for.option=\u30AA\u30D7\u30B7\u30E7\u30F3\u306E\u5F15\u6570\u304C\u7121\u52B9\u3067\u3059: {0} err.option.after.class=\u30AA\u30D7\u30B7\u30E7\u30F3\u306F\u30AF\u30E9\u30B9\u306E\u524D\u306B\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059: {0} err.genmoduleinfo.not.jarfile={0}\u306F\u3001--generate-module-info\u30AA\u30D7\u30B7\u30E7\u30F3\u3068\u3068\u3082\u306B\u6307\u5B9A\u3067\u304D\u306A\u3044\u30E2\u30B8\u30E5\u30E9JAR\u30D5\u30A1\u30A4\u30EB\u3067\u3059 @@ -117,7 +116,7 @@ err.multirelease.option.exists={0}\u306F\u30DE\u30EB\u30C1\u30EA\u30EA\u30FC\u30 err.multirelease.option.notfound={0}\u306F\u30DE\u30EB\u30C1\u30EA\u30EA\u30FC\u30B9jar\u30D5\u30A1\u30A4\u30EB\u3067\u3059\u304C--multi-release\u30AA\u30D7\u30B7\u30E7\u30F3\u304C\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093 err.multirelease.version.associated=\u30AF\u30E9\u30B9{0}\u306F\u3059\u3067\u306B\u30D0\u30FC\u30B8\u30E7\u30F3{1}\u306B\u95A2\u9023\u4ED8\u3051\u3089\u308C\u3066\u3044\u307E\u3059\u3002\u30D0\u30FC\u30B8\u30E7\u30F3{2}\u306E\u8FFD\u52A0\u3092\u8A66\u307F\u307E\u3059 err.multirelease.jar.malformed=\u4E0D\u6B63\u306A\u30DE\u30EB\u30C1\u30EA\u30EA\u30FC\u30B9jar\u3001{0}\u3001\u4E0D\u6B63\u306A\u30A8\u30F3\u30C8\u30EA: {1} -err.cant.list.module.deps=\u30E2\u30B8\u30E5\u30FC\u30EB\u30FB\u30D1\u30B9\u3068\u30AF\u30E9\u30B9\u30D1\u30B9\u304B\u3089\u306E\u4F9D\u5B58\u6027\u304C\u6B20\u843D\u3057\u3066\u3044\u307E\u3059\u3002\n\u3053\u306E\u30A8\u30E9\u30FC\u3092\u6291\u6B62\u3059\u308B\u306B\u306F\u3001--ignore-missing-deps\u3092\u4F7F\u7528\u3057\u3066\u7D9A\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002 +err.missing.dependences=\u4F9D\u5B58\u6027\u306E\u6B20\u843D:\u30E2\u30B8\u30E5\u30FC\u30EB\u30FB\u30D1\u30B9\u3068\u30AF\u30E9\u30B9\u30D1\u30B9\u304B\u3089\u30AF\u30E9\u30B9\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002\n\u3053\u306E\u30A8\u30E9\u30FC\u3092\u6291\u6B62\u3059\u308B\u306B\u306F\u3001--ignore-missing-deps\u3092\u4F7F\u7528\u3057\u3066\u7D9A\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002 warn.invalid.arg=\u30D1\u30B9\u304C\u5B58\u5728\u3057\u307E\u305B\u3093: {0} warn.skipped.entry={0} diff --git a/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/resources/jdeps_zh_CN.properties b/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/resources/jdeps_zh_CN.properties index cfff9ba5b5a..6b26b17a9c6 100644 --- a/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/resources/jdeps_zh_CN.properties +++ b/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/resources/jdeps_zh_CN.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2012, 2020, 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 @@ -100,7 +100,6 @@ main.opt.multi-release=\ --multi-release <\u7248\u672C> \u6307\u5B9A\u59 err.command.set=\u6307\u5B9A\u4E86 {0} \u548C {1} \u9009\u9879\u3002 err.unknown.option=\u672A\u77E5\u9009\u9879: {0} err.missing.arg=\u6CA1\u6709\u4E3A{0}\u6307\u5B9A\u503C -err.missing.dependences=\u7F3A\u5C11\u88AB\u4F9D\u8D56\u5BF9\u8C61 err.invalid.arg.for.option=\u9009\u9879\u7684\u53C2\u6570\u65E0\u6548: {0} err.option.after.class=\u5FC5\u987B\u5728\u7C7B\u4E4B\u524D\u6307\u5B9A\u9009\u9879: {0} err.genmoduleinfo.not.jarfile={0} \u662F\u65E0\u6CD5\u4F7F\u7528 --generate-module-info \u9009\u9879\u6307\u5B9A\u7684\u6A21\u5757\u5316 JAR \u6587\u4EF6 @@ -117,7 +116,7 @@ err.multirelease.option.exists={0} \u4E0D\u662F\u591A\u53D1\u884C\u7248 jar \u65 err.multirelease.option.notfound={0} \u662F\u591A\u53D1\u884C\u7248 jar \u6587\u4EF6, \u4F46\u672A\u8BBE\u7F6E --multi-release \u9009\u9879 err.multirelease.version.associated=\u7C7B {0} \u5DF2\u4E0E\u7248\u672C {1} \u5173\u8054, \u6B63\u5728\u5C1D\u8BD5\u6DFB\u52A0\u7248\u672C {2} err.multirelease.jar.malformed=\u683C\u5F0F\u9519\u8BEF\u7684\u591A\u53D1\u884C\u7248 jar, {0}, \u9519\u8BEF\u6761\u76EE: {1} -err.cant.list.module.deps=\u6A21\u5757\u8DEF\u5F84\u548C\u7C7B\u8DEF\u5F84\u4E2D\u7F3A\u5C11\u88AB\u4F9D\u8D56\u5BF9\u8C61\u3002\n\u8981\u9690\u85CF\u6B64\u9519\u8BEF\uFF0C\u8BF7\u4F7F\u7528 --ignore-missing-deps \u7EE7\u7EED\u3002 +err.missing.dependences=\u7F3A\u5C11\u88AB\u4F9D\u8D56\u5BF9\u8C61\uFF1A\u5728\u6A21\u5757\u8DEF\u5F84\u548C\u7C7B\u8DEF\u5F84\u4E2D\u672A\u627E\u5230\u7C7B\u3002\n\u8981\u9690\u85CF\u6B64\u9519\u8BEF\uFF0C\u8BF7\u4F7F\u7528 --ignore-missing-deps \u7EE7\u7EED\u3002 warn.invalid.arg=\u8DEF\u5F84\u4E0D\u5B58\u5728: {0} warn.skipped.entry={0} diff --git a/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/resources/l10n_ja.properties b/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/resources/l10n_ja.properties index 6c401bb8e9f..3ca5c9970e9 100644 --- a/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/resources/l10n_ja.properties +++ b/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/resources/l10n_ja.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2016, 2020, 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 @@ -291,8 +291,8 @@ help.set._retain = '-retain'\u30AA\u30D7\u30B7\u30E7\u30F3\u306B\u3088\u308A\u30 help.set.format.summary = \u30B9\u30CB\u30DA\u30C3\u30C8\u30FB\u30A4\u30D9\u30F3\u30C8\u3092\u30EC\u30DD\u30FC\u30C8\u3059\u308B\u30D5\u30A9\u30FC\u30DE\u30C3\u30C8\u3092\u8A2D\u5B9A\u3057\u307E\u3059 help.set.format = \u30B9\u30CB\u30DA\u30C3\u30C8\u30FB\u30A4\u30D9\u30F3\u30C8\u3092\u30EC\u30DD\u30FC\u30C8\u3059\u308B\u30D5\u30A9\u30FC\u30DE\u30C3\u30C8\u3092\u8A2D\u5B9A\u3057\u307E\u3059:\n\n\t/set format "" ...\n\n\u30D5\u30A9\u30FC\u30DE\u30C3\u30C8\u8A2D\u5B9A\u3092\u8868\u793A\u3057\u307E\u3059:\n\n\t/set format [ []]\n\n\u306F\u4E8B\u524D\u306B\u5B9A\u7FA9\u3055\u308C\u305F\u30D5\u30A3\u30FC\u30C9\u30D0\u30C3\u30AF\u30FB\u30E2\u30FC\u30C9\u306E\u540D\u524D\u3067\u3059 -- '/help /set mode'\u3092\u53C2\u7167\u3057\u3066\u304F\u3060\u3055\u3044\u3002\n\u306F\u5B9A\u7FA9\u3059\u308B\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u56FA\u6709\u306E\u30D5\u30A9\u30FC\u30DE\u30C3\u30C8\u306E\u540D\u524D\u3067\u3059\u3002\n\u306F\u5F15\u7528\u7B26\u306B\u56F2\u307E\u308C\u305F\u6587\u5B57\u5217\u3067\u3001\u6B21\u306E\u5834\u5408\u306E\u30D5\u30A3\u30FC\u30EB\u30C9\u306E\u5024\u3067\u3059: \n\u30BB\u30EC\u30AF\u30BF\u304C\u4E00\u81F4\u3059\u308B(\u307E\u305F\u306F\u30BB\u30EC\u30AF\u30BF\u304C\u306A\u3044)\u3002\u30D5\u30A9\u30FC\u30DE\u30C3\u30C8\u304C\u4F7F\u7528\u3055\u308C\u308B\u5834\u5408\u3001\n\u4E2D\u30AB\u30C3\u30B3\u3067\u56F2\u307E\u308C\u3066\u3044\u308B\u30D5\u30A3\u30FC\u30EB\u30C9\u540D\u304C\u305D\u306E\u3068\u304D\u306E\u30D5\u30A3\u30FC\u30EB\u30C9\u306E\u5024\u3067\u7F6E\u63DB\u3055\u308C\u307E\u3059\n\u3053\u308C\u3089\u306E\u30D5\u30A3\u30FC\u30EB\u30C9\u306F\u3001\u3053\u306E\u30B3\u30DE\u30F3\u30C9\u3067\u4E8B\u524D\u306B\u5B9A\u7FA9\u3055\u308C\u3066\u3044\u308B\u5834\u5408\u3082\u3001\n\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u306B\u56FA\u6709\u306E\u3053\u308C\u3089\u306E\u4E8B\u524D\u5B9A\u7FA9\u6E08\u30D5\u30A3\u30FC\u30EB\u30C9\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5834\u5408\u3082\u3042\u308A\u307E\u3059:\n\t{name} == \u540D\u524D\u3001\u4F8B: \u5909\u6570\u540D\u3001 ...\n\t{type} == \u30BF\u30A4\u30D7\u540D\u3002\u5909\u6570\u307E\u305F\u306F\u5F0F\u306E\u30BF\u30A4\u30D7\u3001\n\t\t\t\u30E1\u30BD\u30C3\u30C9\u306E\u30D1\u30E9\u30E1\u30FC\u30BF\u30FB\u30BF\u30A4\u30D7\n\t{value} == \u5F0F\u307E\u305F\u306F\u5909\u6570\u306E\u521D\u671F\u5316\u306E\u7D50\u679C\u5024\n\t{unresolved} == \u672A\u89E3\u6C7A\u306E\u53C2\u7167\u306E\u30EA\u30B9\u30C8\n\t{errors} == \u30EA\u30AB\u30D0\u30EA\u53EF\u80FD\u306A\u30A8\u30E9\u30FC\u306E\u30EA\u30B9\u30C8(\u51E6\u7406\u6642-\n\t\t\t"display"\u30D5\u30A3\u30FC\u30EB\u30C9\u306E\u307F)\n\t{err} == \u672A\u30D5\u30A9\u30FC\u30DE\u30C3\u30C8\u30FB\u30A8\u30E9\u30FC\u884C(\u51E6\u7406\u6642-\n\t\t\t"errorline"\u30D5\u30A3\u30FC\u30EB\u30C9\u306E\u307F)\n\u6B21\u306E\u30D5\u30A3\u30FC\u30EB\u30C9\u306F\u30C4\u30FC\u30EB\u306B\u3088\u3063\u3066\u30A2\u30AF\u30BB\u30B9\u3055\u308C\u3001\u8868\u793A\u3055\u308C\u308B\u30D5\u30A3\u30FC\u30C9\u30D0\u30C3\u30AF\u3092\u6C7A\u5B9A\u3057\u307E\u3059:\n\t{display} == \u30B9\u30CB\u30DA\u30C3\u30C8\u30FB\u30A4\u30D9\u30F3\u30C8\u306B\u5BFE\u3057\u3066\u8868\u793A\u3055\u308C\u308B\u30E1\u30C3\u30BB\u30FC\u30B8\n\t{errorline} == \u300Cerrors\u300D\u30D5\u30A3\u30FC\u30EB\u30C9\u5185\u306E\u30A8\u30E9\u30FC\u884C\u306E\u30D5\u30A9\u30FC\u30DE\u30C3\u30C8\n\t{pre} == \u30D5\u30A3\u30FC\u30C9\u30D0\u30C3\u30AF\u63A5\u982D\u8F9E(\u30B3\u30DE\u30F3\u30C9\u30FB\u30D5\u30A3\u30FC\u30C9\u30D0\u30C3\u30AF\u3092\u958B\u59CB\u3059\u308B)\n\t{post} == \u30D5\u30A3\u30FC\u30C9\u30D0\u30C3\u30AF\u63A5\u5C3E\u8F9E(\u30B3\u30DE\u30F3\u30C9\u30FB\u30D5\u30A3\u30FC\u30C9\u30D0\u30C3\u30AF\u3092\u7D42\u4E86\u3059\u308B)\n\t{errorpre} == \u30A8\u30E9\u30FC\u63A5\u982D\u8F9E(\u30A8\u30E9\u30FC\u30FB\u30D5\u30A3\u30FC\u30C9\u30D0\u30C3\u30AF\u3092\u958B\u59CB\u3059\u308B)\n\t{errorpost} == \ -\u30A8\u30E9\u30FC\u63A5\u5C3E\u8F9E(\u30A8\u30E9\u30FC\u30FB\u30D5\u30A3\u30FC\u30C9\u30D0\u30C3\u30AF\u3092\u7D42\u4E86\u3059\u308B)\n\u3053\u308C\u3089\u306E\u30D5\u30A3\u30FC\u30EB\u30C9\u306B\u306F\u30C7\u30D5\u30A9\u30EB\u30C8\u306E\u8A2D\u5B9A\u304C\u3042\u308A\u307E\u3059(\u4E0A\u66F8\u304D\u3055\u308C\u308B\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059)\u3002\n\u306F\u30D5\u30A9\u30FC\u30DE\u30C3\u30C8\u304C\u9069\u7528\u3055\u308C\u308B\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u3067\u3059\u3002\n\u30BB\u30EC\u30AF\u30BF\u69CB\u9020\u306F\u30BB\u30EC\u30AF\u30BF\u7A2E\u985E\u30EA\u30B9\u30C8\u306E\u30CF\u30A4\u30D5\u30F3\u533A\u5207\u308A\u30EA\u30B9\u30C8\u3067\u3059\u3002\n\u30BB\u30EC\u30AF\u30BF\u7A2E\u985E\u30EA\u30B9\u30C8\u306F\u30011\u3064\u306E\u30BB\u30EC\u30AF\u30BF\u7A2E\u985E\u306E\u5024\u306E\u30AB\u30F3\u30DE\u533A\u5207\u308A\u30EA\u30B9\u30C8\u3067\u3059\u3002\n\u30BB\u30EC\u30AF\u30BF\u306F\u5404\u30BB\u30EC\u30AF\u30BF\u7A2E\u985E\u30EA\u30B9\u30C8\u304C\u4E00\u81F4\u3059\u308C\u3070\u4E00\u81F4\u3068\u306A\u308A\u307E\u3059\u3002\u30BB\u30EC\u30AF\u30BF\u7A2E\u985E\u30EA\u30B9\u30C8\u306F\n\u3044\u305A\u308C\u304B\u306E\u5024\u304C\u4E00\u81F4\u3059\u308C\u3070\u4E00\u81F4\u3068\u306A\u308A\u307E\u3059\u3002\n\n\u30B1\u30FC\u30B9\u30FB\u30BB\u30EC\u30AF\u30BF\u7A2E\u985E\u306F\u3001\u30B9\u30CB\u30DA\u30C3\u30C8\u306E\u7A2E\u985E\u3092\u793A\u3057\u307E\u3059\u3002\u5024\u306F\u6B21\u306E\u3068\u304A\u308A\u3067\u3059:\n\timport -- \u30A4\u30F3\u30DD\u30FC\u30C8\u5BA3\u8A00\n\tclass -- \u30AF\u30E9\u30B9\u5BA3\u8A00\n\tinterface -- \u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u5BA3\u8A00\n\tenum -- \u5217\u6319\u578B\u306E\u5BA3\u8A00\n\tannotation -- \u6CE8\u91C8\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u5BA3\u8A00\n\tmethod -- \u30E1\u30BD\u30C3\u30C9\u5BA3\u8A00 -- \u6CE8\u610F: {type}==parameter-types\n\tvardecl -- \u521D\u671F\u5316\u3057\u306A\u3044\u5909\u6570\u5BA3\u8A00\n\tvarinit -- \u521D\u671F\u5316\u3059\u308B\u5909\u6570\u5BA3\u8A00\n\texpression -- \u5F0F -- \u6CE8\u610F: {name}==scratch-variable-name\n\tvarvalue -- \u5909\u6570\u5024\u5F0F\n\tassignment -- \u5909\u6570\u3092\u5272\u308A\u5F53\u3066\u307E\u3059\n\tstatement -- \u6587\n\u30A2\u30AF\u30B7\u30E7\u30F3\u30FB\u30BB\u30EC\u30AF\u30BF\u7A2E\u985E\u306F\u3001\u30B9\u30CB\u30DA\u30C3\u30C8\u306B\u767A\u751F\u3057\u305F\u5185\u5BB9\u3092\u793A\u3057\u307E\u3059\u3002\u5024\u306F\u6B21\u306E\u3068\u304A\u308A\u3067\u3059:\n\tadded -- \u30B9\u30CB\u30DA\u30C3\u30C8\u304C\u8FFD\u52A0\u3055\u308C\u307E\u3057\u305F\n\tmodified -- \u65E2\u5B58\u306E\u30B9\u30CB\u30DA\u30C3\u30C8\u304C\u5909\u66F4\u3055\u308C\u307E\u3057\u305F\n\treplaced -- \u65E2\u5B58\u306E\u30B9\u30CB\u30DA\u30C3\u30C8\u304C\u65B0\u898F\u30B9\u30CB\u30DA\u30C3\u30C8\u3067\u7F6E\u63DB\u3055\u308C\u307E\u3057\u305F\n\toverwrote -- \u65E2\u5B58\u306E\u30B9\u30CB\u30DA\u30C3\u30C8\u304C\u4E0A\u66F8\u304D\u3055\u308C\u307E\u3057\u305F\n\tdropped -- \u30B9\u30CB\u30DA\u30C3\u30C8\u304C\u524A\u9664\u3055\u308C\u307E\u3057\u305F\n\tused -- \u4F7F\u7528\u3067\u304D\u306A\u3044\u3068\u304D\u306B\u30B9\u30CB\u30DA\u30C3\u30C8\u304C\u4F7F\u7528\u3055\u308C\u307E\u3057\u305F\n\u767A\u751F\u6642\u30BB\u30EC\u30AF\u30BF\u7A2E\u985E\u306F\u3001\u3053\u308C\u304C\u76F4\u63A5\u307E\u305F\u306F\u9593\u63A5\u30A2\u30AF\u30B7\u30E7\u30F3\u3067\u3042\u308B\u304B\u3092\u793A\u3057\u307E\u3059\u3002\u5024\u306F\u6B21\u306E\u3068\u304A\u308A\u3067\u3059:\n\tprimary -- \u5165\u529B\u3057\u305F\u30B9\u30CB\u30DA\u30C3\u30C8\n\tupdate -- \u4F9D\u5B58\u30B9\u30CB\u30DA\u30C3\u30C8\u3078\u306E\u66F4\u65B0\n\u89E3\u6C7A\u72B6\u614B\u30BB\u30EC\u30AF\u30BF\u7A2E\u985E\u306F\u3001\u30B9\u30CB\u30DA\u30C3\u30C8\u306E\u89E3\u6C7A/\u5B9A\u7FA9\u306E\u72B6\u614B\u3092\u793A\u3057\u307E\u3059\u3002\u5024\u306F\u6B21\u306E\u3068\u304A\u308A\u3067\u3059:\n\tok -- \u6B63\u3057\u304F\u89E3\u6C7A\u3055\u308C\u307E\u3057\u305F\n\tdefined -- \ -\u5FA9\u5143\u53EF\u80FD\u3067\u672A\u89E3\u6C7A\u306E\u53C2\u7167\u306B\u3082\u304B\u304B\u308F\u3089\u305A\u5B9A\u7FA9\u3055\u308C\u307E\u3057\u305F\n\tnotdefined -- \u5FA9\u5143\u53EF\u80FD\u3067\u672A\u89E3\u6C7A\u306E\u53C2\u7167\u306E\u305F\u3081\u5B9A\u7FA9\u3055\u308C\u307E\u305B\u3093\n\u672A\u89E3\u6C7A\u6570\u30BB\u30EC\u30AF\u30BF\u7A2E\u985E\u306F\u3001\u672A\u89E3\u6C7A\u306E\u53C2\u7167\u306E\u6570\u3092\u793A\u3057\u307E\u3059\u3002\u5024\u306F\u6B21\u306E\u3068\u304A\u308A\u3067\u3059:\n\tunresolved0 -- \u672A\u89E3\u6C7A\u306E\u540D\u524D\u306F\u3042\u308A\u307E\u305B\u3093\n\tunresolved1 -- 1\u3064\u306E\u540D\u524D\u304C\u89E3\u6C7A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\n\tunresolved2 -- 2\u3064\u4EE5\u4E0A\u306E\u540D\u524D\u304C\u89E3\u6C7A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\n\u30A8\u30E9\u30FC\u6570\u30BB\u30EC\u30AF\u30BF\u7A2E\u985E\u306F\u3001\u30A8\u30E9\u30FC\u306E\u6570\u3092\u793A\u3057\u307E\u3059\u3002\u5024\u306F\u6B21\u306E\u3068\u304A\u308A\u3067\u3059:\n\terror0 -- \u30A8\u30E9\u30FC\u306A\u3057\n\terror1 -- 1\u3064\u306E\u30A8\u30E9\u30FC\n\terror2 -- 2\u3064\u4EE5\u4E0A\u306E\u30A8\u30E9\u30FC\n\n\u4F8B:\n\t/set format mymode action '\u6B21\u3092\u4F5C\u6210\u3057\u307E\u3057\u305F:' added-primary\n\t/set format mymode action '\u6B21\u3092\u66F4\u65B0/\u7F6E\u63DB\u3057\u307E\u3057\u305F:' replaced-update\n\t/set format mymode display '{pre}{action} \u30AF\u30E9\u30B9 {name}{post}' class-ok\n\t/set format mymode display '{pre}{action} \u5909\u6570 {name}\u3001null\u306B\u30EA\u30BB\u30C3\u30C8\u3055\u308C\u307E\u3057\u305F{post}' replaced-vardecl,varinit-ok-update\n\n\u30D5\u30A3\u30FC\u30EB\u30C9\u306B\u5BFE\u3059\u308B\u5F8C\u7D9A\u306E\u30BB\u30EC\u30AF\u30BF\u306B\u3088\u308A\u3001\u4EE5\u524D\u306B\u4F7F\u7528\u3055\u308C\u305F\u30BB\u30EC\u30AF\u30C8\u306E\u4E00\u90E8\u307E\u305F\u306F\u3059\u3079\u3066\u304C\u4E0A\u66F8\u304D\u3055\u308C\u308B\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059 -- \u6700\u5F8C\u306E\u30BB\u30EC\u30AF\u30BF\u304C\u6709\u52B9\u306B\u306A\u308A\u307E\u3059\n\n\u306E\u306A\u3044\u5F62\u5F0F\u306F\u3001\u73FE\u5728\u306E\u30D5\u30A9\u30FC\u30DE\u30C3\u30C8\u8A2D\u5B9A\u3092\u8868\u793A\u3057\u307E\u3059\u3002\n\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u308B\u5834\u5408\u3001\u305D\u306E\u30E2\u30FC\u30C9\u306E\u30D5\u30A9\u30FC\u30DE\u30C3\u30C8\u8A2D\u5B9A\u306E\u307F\u304C\u8868\u793A\u3055\u308C\u307E\u3059\u3002\n\u3068\u306E\u4E21\u65B9\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u308B\u5834\u5408\u3001\n\u305D\u306E\u30E2\u30FC\u30C9\u304A\u3088\u3073\u30D5\u30A3\u30FC\u30EB\u30C9\u306E\u30D5\u30A9\u30FC\u30DE\u30C3\u30C8\u8A2D\u5B9A\u306E\u307F\u304C\u8868\u793A\u3055\u308C\u307E\u3059\u3002\u4F8B:\n\t/set format mymode\n\u30E2\u30FC\u30C9mymode\u306E\u30D5\u30A9\u30FC\u30DE\u30C3\u30C8\u8A2D\u5B9A\u3092\u8868\u793A\u3057\u307E\u3059\n +\u30A8\u30E9\u30FC\u63A5\u5C3E\u8F9E(\u30A8\u30E9\u30FC\u30FB\u30D5\u30A3\u30FC\u30C9\u30D0\u30C3\u30AF\u3092\u7D42\u4E86\u3059\u308B)\n\u3053\u308C\u3089\u306E\u30D5\u30A3\u30FC\u30EB\u30C9\u306B\u306F\u30C7\u30D5\u30A9\u30EB\u30C8\u306E\u8A2D\u5B9A\u304C\u3042\u308A\u307E\u3059(\u4E0A\u66F8\u304D\u3055\u308C\u308B\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059)\u3002\n\u306F\u30D5\u30A9\u30FC\u30DE\u30C3\u30C8\u304C\u9069\u7528\u3055\u308C\u308B\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u3067\u3059\u3002\n\u30BB\u30EC\u30AF\u30BF\u69CB\u9020\u306F\u30BB\u30EC\u30AF\u30BF\u7A2E\u985E\u30EA\u30B9\u30C8\u306E\u30CF\u30A4\u30D5\u30F3\u533A\u5207\u308A\u30EA\u30B9\u30C8\u3067\u3059\u3002\n\u30BB\u30EC\u30AF\u30BF\u7A2E\u985E\u30EA\u30B9\u30C8\u306F\u30011\u3064\u306E\u30BB\u30EC\u30AF\u30BF\u7A2E\u985E\u306E\u5024\u306E\u30AB\u30F3\u30DE\u533A\u5207\u308A\u30EA\u30B9\u30C8\u3067\u3059\u3002\n\u30BB\u30EC\u30AF\u30BF\u306F\u5404\u30BB\u30EC\u30AF\u30BF\u7A2E\u985E\u30EA\u30B9\u30C8\u304C\u4E00\u81F4\u3059\u308C\u3070\u4E00\u81F4\u3068\u306A\u308A\u307E\u3059\u3002\u30BB\u30EC\u30AF\u30BF\u7A2E\u985E\u30EA\u30B9\u30C8\u306F\n\u3044\u305A\u308C\u304B\u306E\u5024\u304C\u4E00\u81F4\u3059\u308C\u3070\u4E00\u81F4\u3068\u306A\u308A\u307E\u3059\u3002\n\n\u30B1\u30FC\u30B9\u30FB\u30BB\u30EC\u30AF\u30BF\u7A2E\u985E\u306F\u3001\u30B9\u30CB\u30DA\u30C3\u30C8\u306E\u7A2E\u985E\u3092\u793A\u3057\u307E\u3059\u3002\u5024\u306F\u6B21\u306E\u3068\u304A\u308A\u3067\u3059:\n\timport -- \u30A4\u30F3\u30DD\u30FC\u30C8\u5BA3\u8A00\n\tclass -- \u30AF\u30E9\u30B9\u5BA3\u8A00\n\tinterface -- \u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u5BA3\u8A00\n\tenum -- \u5217\u6319\u578B\u306E\u5BA3\u8A00\n\tannotation -- \u6CE8\u91C8\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u5BA3\u8A00\n\trecord -- \u30EC\u30B3\u30FC\u30C9\u5BA3\u8A00\n\tmethod -- \u30E1\u30BD\u30C3\u30C9\u5BA3\u8A00 -- \u6CE8\u610F: {type}==parameter-types\n\tvardecl -- \u521D\u671F\u5316\u3057\u306A\u3044\u5909\u6570\u5BA3\u8A00\n\tvarinit -- \u521D\u671F\u5316\u3059\u308B\u5909\u6570\u5BA3\u8A00\n\texpression -- \u5F0F -- \u6CE8\u610F: {name}==scratch-variable-name\n\tvarvalue -- \u5909\u6570\u5024\u5F0F\n\tassignment -- \u5909\u6570\u3092\u5272\u308A\u5F53\u3066\u307E\u3059\n\tstatement -- \u6587\n\u30A2\u30AF\u30B7\u30E7\u30F3\u30FB\u30BB\u30EC\u30AF\u30BF\u7A2E\u985E\u306F\u3001\u30B9\u30CB\u30DA\u30C3\u30C8\u306B\u767A\u751F\u3057\u305F\u5185\u5BB9\u3092\u793A\u3057\u307E\u3059\u3002\u5024\u306F\u6B21\u306E\u3068\u304A\u308A\u3067\u3059:\n\tadded -- \u30B9\u30CB\u30DA\u30C3\u30C8\u304C\u8FFD\u52A0\u3055\u308C\u307E\u3057\u305F\n\tmodified -- \u65E2\u5B58\u306E\u30B9\u30CB\u30DA\u30C3\u30C8\u304C\u5909\u66F4\u3055\u308C\u307E\u3057\u305F\n\treplaced -- \u65E2\u5B58\u306E\u30B9\u30CB\u30DA\u30C3\u30C8\u304C\u65B0\u898F\u30B9\u30CB\u30DA\u30C3\u30C8\u3067\u7F6E\u63DB\u3055\u308C\u307E\u3057\u305F\n\toverwrote -- \u65E2\u5B58\u306E\u30B9\u30CB\u30DA\u30C3\u30C8\u304C\u4E0A\u66F8\u304D\u3055\u308C\u307E\u3057\u305F\n\tdropped -- \u30B9\u30CB\u30DA\u30C3\u30C8\u304C\u524A\u9664\u3055\u308C\u307E\u3057\u305F\n\tused -- \u4F7F\u7528\u3067\u304D\u306A\u3044\u3068\u304D\u306B\u30B9\u30CB\u30DA\u30C3\u30C8\u304C\u4F7F\u7528\u3055\u308C\u307E\u3057\u305F\n\u767A\u751F\u6642\u30BB\u30EC\u30AF\u30BF\u7A2E\u985E\u306F\u3001\u3053\u308C\u304C\u76F4\u63A5\u307E\u305F\u306F\u9593\u63A5\u30A2\u30AF\u30B7\u30E7\u30F3\u3067\u3042\u308B\u304B\u3092\u793A\u3057\u307E\u3059\u3002\u5024\u306F\u6B21\u306E\u3068\u304A\u308A\u3067\u3059:\n\tprimary -- \u5165\u529B\u3057\u305F\u30B9\u30CB\u30DA\u30C3\u30C8\n\tupdate -- \u4F9D\u5B58\u30B9\u30CB\u30DA\u30C3\u30C8\u3078\u306E\u66F4\u65B0\n\u89E3\u6C7A\u72B6\u614B\u30BB\u30EC\u30AF\u30BF\u7A2E\u985E\u306F\u3001\u30B9\u30CB\u30DA\u30C3\u30C8\u306E\u89E3\u6C7A/\u5B9A\u7FA9\u306E\u72B6\u614B\u3092\u793A\u3057\u307E\u3059\u3002\u5024\u306F\u6B21\u306E\u3068\u304A\u308A\u3067\u3059:\n\tok -- \ +\u6B63\u3057\u304F\u89E3\u6C7A\u3055\u308C\u307E\u3057\u305F\n\tdefined -- \u5FA9\u5143\u53EF\u80FD\u3067\u672A\u89E3\u6C7A\u306E\u53C2\u7167\u306B\u3082\u304B\u304B\u308F\u3089\u305A\u5B9A\u7FA9\u3055\u308C\u307E\u3057\u305F\n\tnotdefined -- \u5FA9\u5143\u53EF\u80FD\u3067\u672A\u89E3\u6C7A\u306E\u53C2\u7167\u306E\u305F\u3081\u5B9A\u7FA9\u3055\u308C\u307E\u305B\u3093\n\u672A\u89E3\u6C7A\u6570\u30BB\u30EC\u30AF\u30BF\u7A2E\u985E\u306F\u3001\u672A\u89E3\u6C7A\u306E\u53C2\u7167\u306E\u6570\u3092\u793A\u3057\u307E\u3059\u3002\u5024\u306F\u6B21\u306E\u3068\u304A\u308A\u3067\u3059:\n\tunresolved0 -- \u672A\u89E3\u6C7A\u306E\u540D\u524D\u306F\u3042\u308A\u307E\u305B\u3093\n\tunresolved1 -- 1\u3064\u306E\u540D\u524D\u304C\u89E3\u6C7A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\n\tunresolved2 -- 2\u3064\u4EE5\u4E0A\u306E\u540D\u524D\u304C\u89E3\u6C7A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\n\u30A8\u30E9\u30FC\u6570\u30BB\u30EC\u30AF\u30BF\u7A2E\u985E\u306F\u3001\u30A8\u30E9\u30FC\u306E\u6570\u3092\u793A\u3057\u307E\u3059\u3002\u5024\u306F\u6B21\u306E\u3068\u304A\u308A\u3067\u3059:\n\terror0 -- \u30A8\u30E9\u30FC\u306A\u3057\n\terror1 -- 1\u3064\u306E\u30A8\u30E9\u30FC\n\terror2 -- 2\u3064\u4EE5\u4E0A\u306E\u30A8\u30E9\u30FC\n\n\u4F8B:\n\t/set format mymode action '\u6B21\u3092\u4F5C\u6210\u3057\u307E\u3057\u305F:' added-primary\n\t/set format mymode action '\u6B21\u3092\u66F4\u65B0/\u7F6E\u63DB\u3057\u307E\u3057\u305F:' replaced-update\n\t/set format mymode display '{pre}{action} \u30AF\u30E9\u30B9 {name}{post}' class-ok\n\t/set format mymode display '{pre}{action} \u5909\u6570 {name}\u3001null\u306B\u30EA\u30BB\u30C3\u30C8\u3055\u308C\u307E\u3057\u305F{post}' replaced-vardecl,varinit-ok-update\n\n\u30D5\u30A3\u30FC\u30EB\u30C9\u306B\u5BFE\u3059\u308B\u5F8C\u7D9A\u306E\u30BB\u30EC\u30AF\u30BF\u306B\u3088\u308A\u3001\u4EE5\u524D\u306B\u4F7F\u7528\u3055\u308C\u305F\u30BB\u30EC\u30AF\u30C8\u306E\u4E00\u90E8\u307E\u305F\u306F\u3059\u3079\u3066\u304C\u4E0A\u66F8\u304D\u3055\u308C\u308B\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059 -- \u6700\u5F8C\u306E\u30BB\u30EC\u30AF\u30BF\u304C\u6709\u52B9\u306B\u306A\u308A\u307E\u3059\n\n\u306E\u306A\u3044\u5F62\u5F0F\u306F\u3001\u73FE\u5728\u306E\u30D5\u30A9\u30FC\u30DE\u30C3\u30C8\u8A2D\u5B9A\u3092\u8868\u793A\u3057\u307E\u3059\u3002\n\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u308B\u5834\u5408\u3001\u305D\u306E\u30E2\u30FC\u30C9\u306E\u30D5\u30A9\u30FC\u30DE\u30C3\u30C8\u8A2D\u5B9A\u306E\u307F\u304C\u8868\u793A\u3055\u308C\u307E\u3059\u3002\n\u3068\u306E\u4E21\u65B9\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u308B\u5834\u5408\u3001\n\u305D\u306E\u30E2\u30FC\u30C9\u304A\u3088\u3073\u30D5\u30A3\u30FC\u30EB\u30C9\u306E\u30D5\u30A9\u30FC\u30DE\u30C3\u30C8\u8A2D\u5B9A\u306E\u307F\u304C\u8868\u793A\u3055\u308C\u307E\u3059\u3002\u4F8B:\n\t/set format mymode\n\u30E2\u30FC\u30C9mymode\u306E\u30D5\u30A9\u30FC\u30DE\u30C3\u30C8\u8A2D\u5B9A\u3092\u8868\u793A\u3057\u307E\u3059\n help.set.truncation.summary = \u8868\u793A\u3055\u308C\u308B\u5024\u306E\u6700\u5927\u9577\u3092\u8A2D\u5B9A\u3057\u307E\u3059 @@ -321,6 +321,6 @@ help.set.start.summary =\u8D77\u52D5\u69CB\u6210\u3092\u8A2D\u5B9A\u3057\u307E\u help.set.start =\u8D77\u52D5\u69CB\u6210\u3092\u8A2D\u5B9A\u3057\u307E\u3059 -- \u8D77\u52D5\u6642\u306B\u8AAD\u307F\u53D6\u3089\u308C\u308B\u30B9\u30CB\u30DA\u30C3\u30C8\u304A\u3088\u3073\u30B3\u30DE\u30F3\u30C9\u306E\u30B7\u30FC\u30B1\u30F3\u30B9:\n\n\t/set start [-retain] ...\n\n\t/set start [-retain] -default\n\n\t/set start [-retain] -none\n\n\u5C06\u6765\u306E\u30BB\u30C3\u30B7\u30E7\u30F3\u306E\u305F\u3081\u306B\u8D77\u52D5\u69CB\u6210\u3092\u4FDD\u6301\u3057\u307E\u3059:\n\n\t/set start -retain\n\n\u8D77\u52D5\u8A2D\u5B9A\u3092\u8868\u793A\u3057\u307E\u3059:\n\n\t/set start\n\n\u3053\u306E\u30BB\u30C3\u30B7\u30E7\u30F3\u3067/reset\u3001/reload\u307E\u305F\u306F/env\u30B3\u30DE\u30F3\u30C9\u304C\u4F7F\u7528\u3055\u308C\u308B\u5834\u5408\u3001\n\u6307\u5B9A\u3057\u305F\u306E\u5185\u5BB9\u304C\u3001\u4F7F\u7528\u3055\u308C\u308B\u8D77\u52D5\u30B9\u30CB\u30DA\u30C3\u30C8\u304A\u3088\u3073\u30B3\u30DE\u30F3\u30C9\u306B\u306A\u308A\u307E\u3059\u3002\n\u304B\u308F\u308A\u306B-default\u30AA\u30D7\u30B7\u30E7\u30F3\u3092\u6307\u5B9A\u3059\u308B\u3068\u3001\u4E8B\u524D\u306B\u5B9A\u7FA9\u3055\u308C\u305F\u8D77\u52D5\u30A4\u30F3\u30DD\u30FC\u30C8\u30FB\u30B9\u30CB\u30DA\u30C3\u30C8\u304C\n\u4F7F\u7528\u3055\u308C\u307E\u3059\u3002\n-none\u30AA\u30D7\u30B7\u30E7\u30F3\u3092\u4F7F\u7528\u3059\u308B\u3068\u3001\u8D77\u52D5\u304C\u7A7A\u306B\u306A\u308A\u307E\u3059 -- \u8D77\u52D5\u30B9\u30CB\u30DA\u30C3\u30C8\u307E\u305F\u306F\n\u30B3\u30DE\u30F3\u30C9\u304C\u4F7F\u7528\u3055\u308C\u307E\u305B\u3093\u3002\n\u3053\u306E\u30B3\u30DE\u30F3\u30C9\u306F\u8D77\u52D5\u8A2D\u5B9A\u3092\u30C6\u30B9\u30C8\u3059\u308B\u306E\u306B\u6709\u52B9\u3067\u3059\u3002jshell\u30C4\u30FC\u30EB\u306E\u4ECA\u5F8C\u306E\u5B9F\u884C\u306E\u305F\u3081\u306B\n\u305D\u308C\u3089\u3092\u4FDD\u6301\u3059\u308B\u306B\u306F\u3001\u6B21\u306E\u30B3\u30DE\u30F3\u30C9\u3092\u4F7F\u7528\u3057\u307E\u3059:\n\t/set start -retain\n\n-retain\u30AA\u30D7\u30B7\u30E7\u30F3\u304C\u4F7F\u7528\u3055\u308C\u3066\u3044\u308B\u5834\u5408\u3001\u8A2D\u5B9A\u306Fjshell\u30C4\u30FC\u30EB\u306E\u3053\u306E\u5B9F\u884C\u3068\u5C06\u6765\u306E\n\u5B9F\u884C\u3067\u4F7F\u7528\u3055\u308C\u307E\u3059\u3002\n\n\u307E\u305F\u306F\u30AA\u30D7\u30B7\u30E7\u30F3\u306E\u306A\u3044\u5F62\u5F0F\u306F\u3001\u8D77\u52D5\u8A2D\u5B9A\u3092\u8868\u793A\u3057\u307E\u3059\u3002\n\u6CE8\u610F: \u8D77\u52D5\u304C\u6700\u5F8C\u306B\u30D5\u30A1\u30A4\u30EB\u304B\u3089\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u308B\u5834\u5408\u3001\u3053\u308C\u306F'set start'\u30B3\u30DE\u30F3\u30C9\u304A\u3088\u3073\n\u305D\u306E\u30D5\u30A1\u30A4\u30EB\u306E\u5185\u5BB9\u3068\u3068\u3082\u306B\u8868\u793A\u3055\u308C\u307E\u3059\u3002\n\n\u306F\u30AA\u30DA\u30EC\u30FC\u30C6\u30A3\u30F3\u30B0\u30FB\u30B7\u30B9\u30C6\u30E0\u306E\u30D5\u30A1\u30A4\u30EB\u540D\u304B\u3001\u4E8B\u524D\u5B9A\u7FA9\u3055\u308C\u305F\n\u8D77\u52D5\u30D5\u30A1\u30A4\u30EB\u540D\u306E\u3044\u305A\u308C\u304B(DEFAULT\u3001PRINTING\u307E\u305F\u306FJAVASE)\u306B\u306A\u308A\u307E\u3059\u3002\n\u3053\u308C\u3089\u306F\u3001\u305D\u308C\u305E\u308C\u30C7\u30D5\u30A9\u30EB\u30C8\u30FB\u30A4\u30F3\u30DD\u30FC\u30C8\u30FB\u30B9\u30CB\u30DA\u30C3\u30C8(-default\u3067\u4F7F\u7528)\u3001print()\u3001\nprintln()\u304A\u3088\u3073printf()\u30E1\u30BD\u30C3\u30C9\u30FB\u30B9\u30CB\u30DA\u30C3\u30C8\u306E\u5B9A\u7FA9\u3001\u307E\u305F\u306F\u3059\u3079\u3066\u306EJava SE\u30D1\u30C3\u30B1\u30FC\u30B8\u306E\n\u30A4\u30F3\u30DD\u30FC\u30C8\u3067\u3059\u3002\n\u8907\u6570\u306E\u3092\u6307\u5B9A\u3067\u304D\u307E\u3059\u3002\u4F8B\u3092\u6B21\u306B\u793A\u3057\u307E\u3059:\n\n\t/set start -retain DEFAULT PRINTING -startup.feedback = /set mode verbose -command \n\n/set prompt verbose '\\njshell> ' ' ...> ' \n\n/set format verbose pre '| ' \n/set format verbose post '%n' \n/set format verbose errorpre '| ' \n/set format verbose errorpost '%n' \n\n/set format verbose errorline '{post}{pre} {err}' \n\n/set format verbose action '\u6B21\u3092\u4F5C\u6210\u3057\u307E\u3057\u305F:' added-primary \n/set format verbose action '\u6B21\u3092\u5909\u66F4\u3057\u307E\u3057\u305F:' modified-primary \n/set format verbose action '\u6B21\u3092\u7F6E\u63DB\u3057\u307E\u3057\u305F:' replaced-primary \n/set format verbose action '\u6B21\u3092\u4E0A\u66F8\u304D\u3057\u307E\u3057\u305F:' overwrote-primary \n/set format verbose action '\u6B21\u3092\u524A\u9664\u3057\u307E\u3057\u305F:' dropped-primary \n/set format verbose action ' \u6B21\u3092\u66F4\u65B0/\u4F5C\u6210\u3057\u307E\u3057\u305F:' added-update \n/set format verbose action ' \u6B21\u3092\u66F4\u65B0/\u5909\u66F4\u3057\u307E\u3057\u305F:' modified-update \n/set format verbose action ' \u6B21\u3092\u66F4\u65B0/\u7F6E\u63DB\u3057\u307E\u3057\u305F:' replaced-update \n/set format verbose action ' \u6B21\u3092\u66F4\u65B0/\u4E0A\u66F8\u304D\u3057\u307E\u3057\u305F:' overwrote-update \n/set format verbose action ' \u6B21\u3092\u66F4\u65B0/\u524A\u9664\u3057\u307E\u3057\u305F:' dropped-update \n\n/set format verbose until '\u307E\u3067\u3001\u30A4\u30F3\u30B9\u30BF\u30F3\u30B9\u5316\u3067\u304D\u306A\u3044\u304B\u3001\u305D\u306E\u30E1\u30BD\u30C3\u30C9\u3092\u8D77\u52D5\u3067\u304D\u307E\u305B\u3093' defined-class-primary \n/set format verbose until '\u307E\u3067\u3001\u305D\u306E\u30E1\u30BD\u30C3\u30C9\u3092\u8D77\u52D5\u3067\u304D\u307E\u305B\u3093' defined-interface-primary \n/set format verbose until '\u307E\u3067\u3001\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093' defined-enum,annotation-primary \n/set format verbose until '\u307E\u3067\u3001\u8D77\u52D5\u3067\u304D\u307E\u305B\u3093' defined-method-primary \n/set format verbose until '\u307E\u3067\u3001\u53C2\u7167\u3067\u304D\u307E\u305B\u3093' notdefined-primary \n/set format verbose until '\u307E\u3067\u3001\u30A4\u30F3\u30B9\u30BF\u30F3\u30B9\u5316\u3067\u304D\u306A\u3044\u304B\u3001\u305D\u306E\u30E1\u30BD\u30C3\u30C9\u3092\u8D77\u52D5\u3067\u304D\u307E\u305B\u3093' defined-class-update \n/set format verbose until '\u307E\u3067\u3001\u305D\u306E\u30E1\u30BD\u30C3\u30C9\u3092\u8D77\u52D5\u3067\u304D\u307E\u305B\u3093' defined-interface-update \n/set format verbose until '\u307E\u3067\u3001\u8D77\u52D5\u3067\u304D\u307E\u305B\u3093' defined-method-update \n/set format verbose until '\u307E\u3067\u3001\u53C2\u7167\u3067\u304D\u307E\u305B\u3093' notdefined-update \n\n/set format verbose unrerr '\u3002\u3057\u304B\u3057\u3001{unresolved}\u304C\u5BA3\u8A00\u3055\u308C\u308B' unresolved1-error0 \n/set format verbose unrerr '\u3002\u3057\u304B\u3057\u3001{unresolved}\u304C\u5BA3\u8A00\u3055\u308C\u308B' unresolved2-error0 \n/set format verbose unrerr '\u3002\u3057\u304B\u3057\u3001\u3053\u306E\u30A8\u30E9\u30FC({errors})\u304C\u4FEE\u6B63\u3055\u308C\u308B' unresolved0-error1 \n/set format verbose unrerr '\u3002\u3057\u304B\u3057\u3001{unresolved}\u304C\u5BA3\u8A00\u3055\u308C\u3001\u3053\u306E\u30A8\u30E9\u30FC({errors})\u304C\u4FEE\u6B63\u3055\u308C\u308B' unresolved1-error1 \n/set format verbose unrerr '\u3002\u3057\u304B\u3057\u3001{unresolved}\u304C\u5BA3\u8A00\u3055\u308C\u3001\u3053\u306E\u30A8\u30E9\u30FC({errors})\u304C\u4FEE\u6B63\u3055\u308C\u308B' unresolved2-error1 \n/set format verbose unrerr \ -'\u3002\u3057\u304B\u3057\u3001\u3053\u308C\u3089\u306E\u30A8\u30E9\u30FC({errors})\u304C\u4FEE\u6B63\u3055\u308C\u308B' unresolved0-error2 \n/set format verbose unrerr '\u3002\u3057\u304B\u3057\u3001{unresolved}\u304C\u5BA3\u8A00\u3055\u308C\u3001\u3053\u308C\u3089\u306E\u30A8\u30E9\u30FC({errors})\u304C\u4FEE\u6B63\u3055\u308C\u308B' unresolved1-error2 \n/set format verbose unrerr '\u3002\u3057\u304B\u3057\u3001{unresolved}\u304C\u5BA3\u8A00\u3055\u308C\u3001\u3053\u308C\u3089\u306E\u30A8\u30E9\u30FC({errors})\u304C\u4FEE\u6B63\u3055\u308C\u308B' unresolved2-error2 \n\n/set format verbose resolve '{unrerr}{until}' defined,notdefined-added,modified,replaced,used \n\n/set format verbose typeKind '\u30AF\u30E9\u30B9' class \n/set format verbose typeKind '\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9' interface \n/set format verbose typeKind '\u5217\u6319\u578B' enum \n/set format verbose typeKind '\u6CE8\u91C8\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9' annotation \n\n/set format verbose result '{name} ==> {value}{post}' added,modified,replaced-ok-primary \n\n/set format verbose display '{result}{pre}\u30B9\u30AF\u30E9\u30C3\u30C1\u5909\u6570{name} : {type}\u304C\u4F5C\u6210\u3055\u308C\u307E\u3057\u305F{post}' expression-added,modified,replaced-primary \n/set format verbose display '{result}{pre}{name} : {type}\u306E\u5024{post}' varvalue-added,modified,replaced-primary \n/set format verbose display '{result}{pre}{name} : {type}\u306B\u5272\u308A\u5F53\u3066\u3089\u308C\u307E\u3057\u305F{post}' assignment-primary \n/set format verbose display '{result}{pre}{action} \u5909\u6570 {name} : {type}{resolve}{post}' varinit,vardecl \n/set format verbose display '{pre}{action} \u5909\u6570 {name}{resolve}{post}' vardecl,varinit-notdefined \n/set format verbose display '{pre}{action} \u5909\u6570 {name}{post}' dropped-vardecl,varinit,expression \n/set format verbose display '{pre}{action} \u5909\u6570 {name}\u3002null\u306B\u30EA\u30BB\u30C3\u30C8\u3057\u307E\u3057\u305F{post}' replaced-vardecl,varinit-ok-update \n\n/set format verbose display '{pre}{action} {typeKind} {name}{resolve}{post}' class,interface,enum,annotation \n/set format verbose display '{pre}{action} \u30E1\u30BD\u30C3\u30C9 {name}({type}){resolve}{post}' method \n\n/set format verbose display '{pre}{typeKind} {name}\u3092\u4F7F\u7528\u3057\u3088\u3046\u3068\u3057\u307E\u3057\u305F{resolve}{post}' used-class,interface,enum,annotation \n/set format verbose display '{pre}\u30E1\u30BD\u30C3\u30C9{name}({type})\u3092\u547C\u3073\u51FA\u305D\u3046\u3068\u3057\u307E\u3057\u305F{resolve}{post}' used-method \n\n/set truncation verbose 80\n/set truncation verbose 1000 varvalue,expression\n\n/set mode normal -command verbose \n/set format normal display '' added,modified,replaced,overwrote,dropped-update \n/set format normal display '{pre}{action} \u5909\u6570 {name}\u3001null\u306B\u30EA\u30BB\u30C3\u30C8\u3055\u308C\u307E\u3057\u305F{post}' replaced-vardecl,varinit-ok-update \n/set format normal display '{result}' added,modified,replaced-expression,varvalue,assignment,varinit,vardecl-ok-primary \n/set mode concise -quiet normal \n\n/set prompt concise 'jshell> ' ' ...> ' \n\n/set format concise display '' class,interface,enum,annotation,method,assignment,varinit,vardecl-ok \n\n/set feedback normal \n\n/set mode silent -quiet \n/set prompt silent '-> ' '>> ' \ -\n/set truncation silent 80\n/set truncation silent 1000 varvalue,expression\n/set format silent pre '| ' \n/set format silent post '%n' \n/set format silent errorpre '| ' \n/set format silent errorpost '%n' \n/set format silent display '' \n +startup.feedback = /set mode verbose -command \n\n/set prompt verbose '\\njshell> ' ' ...> ' \n\n/set format verbose pre '| ' \n/set format verbose post '%n' \n/set format verbose errorpre '| ' \n/set format verbose errorpost '%n' \n\n/set format verbose errorline '{post}{pre} {err}' \n\n/set format verbose action '\u6B21\u3092\u4F5C\u6210\u3057\u307E\u3057\u305F:' added-primary \n/set format verbose action '\u6B21\u3092\u5909\u66F4\u3057\u307E\u3057\u305F:' modified-primary \n/set format verbose action '\u6B21\u3092\u7F6E\u63DB\u3057\u307E\u3057\u305F:' replaced-primary \n/set format verbose action '\u6B21\u3092\u4E0A\u66F8\u304D\u3057\u307E\u3057\u305F:' overwrote-primary \n/set format verbose action '\u6B21\u3092\u524A\u9664\u3057\u307E\u3057\u305F:' dropped-primary \n/set format verbose action ' \u6B21\u3092\u66F4\u65B0/\u4F5C\u6210\u3057\u307E\u3057\u305F:' added-update \n/set format verbose action ' \u6B21\u3092\u66F4\u65B0/\u5909\u66F4\u3057\u307E\u3057\u305F:' modified-update \n/set format verbose action ' \u6B21\u3092\u66F4\u65B0/\u7F6E\u63DB\u3057\u307E\u3057\u305F:' replaced-update \n/set format verbose action ' \u6B21\u3092\u66F4\u65B0/\u4E0A\u66F8\u304D\u3057\u307E\u3057\u305F:' overwrote-update \n/set format verbose action ' \u6B21\u3092\u66F4\u65B0/\u524A\u9664\u3057\u307E\u3057\u305F:' dropped-update \n\n/set format verbose until '\u307E\u3067\u3001\u30A4\u30F3\u30B9\u30BF\u30F3\u30B9\u5316\u3067\u304D\u306A\u3044\u304B\u3001\u305D\u306E\u30E1\u30BD\u30C3\u30C9\u3092\u8D77\u52D5\u3067\u304D\u307E\u305B\u3093' defined-class,record-primary \n/set format verbose until '\u307E\u3067\u3001\u305D\u306E\u30E1\u30BD\u30C3\u30C9\u3092\u8D77\u52D5\u3067\u304D\u307E\u305B\u3093' defined-interface-primary \n/set format verbose until '\u307E\u3067\u3001\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093' defined-enum,annotation-primary \n/set format verbose until '\u307E\u3067\u3001\u8D77\u52D5\u3067\u304D\u307E\u305B\u3093' defined-method-primary \n/set format verbose until '\u307E\u3067\u3001\u53C2\u7167\u3067\u304D\u307E\u305B\u3093' notdefined-primary \n/set format verbose until '\u307E\u3067\u3001\u30A4\u30F3\u30B9\u30BF\u30F3\u30B9\u5316\u3067\u304D\u306A\u3044\u304B\u3001\u305D\u306E\u30E1\u30BD\u30C3\u30C9\u3092\u8D77\u52D5\u3067\u304D\u307E\u305B\u3093' defined-class,record-update \n/set format verbose until '\u307E\u3067\u3001\u305D\u306E\u30E1\u30BD\u30C3\u30C9\u3092\u8D77\u52D5\u3067\u304D\u307E\u305B\u3093' defined-interface-update \n/set format verbose until '\u307E\u3067\u3001\u8D77\u52D5\u3067\u304D\u307E\u305B\u3093' defined-method-update \n/set format verbose until '\u307E\u3067\u3001\u53C2\u7167\u3067\u304D\u307E\u305B\u3093' notdefined-update \n\n/set format verbose unrerr '\u3002\u3057\u304B\u3057\u3001{unresolved}\u304C\u5BA3\u8A00\u3055\u308C\u308B' unresolved1-error0 \n/set format verbose unrerr '\u3002\u3057\u304B\u3057\u3001{unresolved}\u304C\u5BA3\u8A00\u3055\u308C\u308B' unresolved2-error0 \n/set format verbose unrerr '\u3002\u3057\u304B\u3057\u3001\u3053\u306E\u30A8\u30E9\u30FC({errors})\u304C\u4FEE\u6B63\u3055\u308C\u308B' unresolved0-error1 \n/set format verbose unrerr '\u3002\u3057\u304B\u3057\u3001{unresolved}\u304C\u5BA3\u8A00\u3055\u308C\u3001\u3053\u306E\u30A8\u30E9\u30FC({errors})\u304C\u4FEE\u6B63\u3055\u308C\u308B' unresolved1-error1 \n/set format verbose unrerr '\u3002\u3057\u304B\u3057\u3001{unresolved}\u304C\u5BA3\u8A00\u3055\u308C\u3001\u3053\u306E\u30A8\u30E9\u30FC({errors})\u304C\u4FEE\u6B63\u3055\u308C\u308B' unresolved2-error1 \n/set format \ +verbose unrerr '\u3002\u3057\u304B\u3057\u3001\u3053\u308C\u3089\u306E\u30A8\u30E9\u30FC({errors})\u304C\u4FEE\u6B63\u3055\u308C\u308B' unresolved0-error2 \n/set format verbose unrerr '\u3002\u3057\u304B\u3057\u3001{unresolved}\u304C\u5BA3\u8A00\u3055\u308C\u3001\u3053\u308C\u3089\u306E\u30A8\u30E9\u30FC({errors})\u304C\u4FEE\u6B63\u3055\u308C\u308B' unresolved1-error2 \n/set format verbose unrerr '\u3002\u3057\u304B\u3057\u3001{unresolved}\u304C\u5BA3\u8A00\u3055\u308C\u3001\u3053\u308C\u3089\u306E\u30A8\u30E9\u30FC({errors})\u304C\u4FEE\u6B63\u3055\u308C\u308B' unresolved2-error2 \n\n/set format verbose resolve '{unrerr}{until}' defined,notdefined-added,modified,replaced,used \n\n/set format verbose typeKind '\u30AF\u30E9\u30B9' class \n/set format verbose typeKind '\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9' interface \n/set format verbose typeKind '\u5217\u6319\u578B' enum \n/set format verbose typeKind '\u6CE8\u91C8\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9' annotation \n/set format verbose typeKind '\u30EC\u30B3\u30FC\u30C9' record \n\n/set format verbose result '{name} ==> {value}{post}' added,modified,replaced-ok-primary \n\n/set format verbose display '{result}{pre}\u30B9\u30AF\u30E9\u30C3\u30C1\u5909\u6570{name} : {type}\u304C\u4F5C\u6210\u3055\u308C\u307E\u3057\u305F{post}' expression-added,modified,replaced-primary \n/set format verbose display '{result}{pre}{name} : {type}\u306E\u5024{post}' varvalue-added,modified,replaced-primary \n/set format verbose display '{result}{pre}{name} : {type}\u306B\u5272\u308A\u5F53\u3066\u3089\u308C\u307E\u3057\u305F{post}' assignment-primary \n/set format verbose display '{result}{pre}{action} \u5909\u6570 {name} : {type}{resolve}{post}' varinit,vardecl \n/set format verbose display '{pre}{action} \u5909\u6570 {name}{resolve}{post}' vardecl,varinit-notdefined \n/set format verbose display '{pre}{action} \u5909\u6570 {name}{post}' dropped-vardecl,varinit,expression \n/set format verbose display '{pre}{action} \u5909\u6570 {name}\u3002null\u306B\u30EA\u30BB\u30C3\u30C8\u3057\u307E\u3057\u305F{post}' replaced-vardecl,varinit-ok-update \n\n/set format verbose display '{pre}{action} {typeKind} {name}{resolve}{post}' class,interface,enum,annotation,record \n/set format verbose display '{pre}{action} \u30E1\u30BD\u30C3\u30C9 {name}({type}){resolve}{post}' method \n\n/set format verbose display '{pre}\u3092\u4F7F\u7528\u3057\u3088\u3046\u3068\u3057\u307E\u3057\u305F {typeKind} {name}{resolve}{post}' used-class,interface,enum,annotation,record \n/set format verbose display '{pre}\u30E1\u30BD\u30C3\u30C9{name}({type})\u3092\u547C\u3073\u51FA\u305D\u3046\u3068\u3057\u307E\u3057\u305F{resolve}{post}' used-method \n\n/set truncation verbose 80\n/set truncation verbose 1000 varvalue,expression\n\n/set mode normal -command verbose \n/set format normal display '' added,modified,replaced,overwrote,dropped-update \n/set format normal display '{pre}{action} \u5909\u6570 {name}\u3001null\u306B\u30EA\u30BB\u30C3\u30C8\u3055\u308C\u307E\u3057\u305F{post}' replaced-vardecl,varinit-ok-update \n/set format normal display '{result}' added,modified,replaced-expression,varvalue,assignment,varinit,vardecl-ok-primary \n/set mode concise -quiet normal \n\n/set prompt concise 'jshell> ' ' ...> ' \n\n/set format concise display '' \ +class,interface,enum,annotation,record,method,assignment,varinit,vardecl-ok \n\n/set feedback normal \n\n/set mode silent -quiet \n/set prompt silent '-> ' '>> ' \n/set truncation silent 80\n/set truncation silent 1000 varvalue,expression\n/set format silent pre '| ' \n/set format silent post '%n' \n/set format silent errorpre '| ' \n/set format silent errorpost '%n' \n/set format silent display '' \n diff --git a/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/resources/l10n_zh_CN.properties b/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/resources/l10n_zh_CN.properties index a91d50d4d26..ed83fa272ab 100644 --- a/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/resources/l10n_zh_CN.properties +++ b/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/resources/l10n_zh_CN.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2016, 2020, 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 @@ -287,8 +287,8 @@ help.set._retain = '-retain' \u9009\u9879\u4FDD\u5B58\u8BBE\u7F6E\u4EE5\u4FBF\u5 help.set.format.summary = \u8BBE\u7F6E\u7528\u4E8E\u62A5\u544A\u7247\u6BB5\u4E8B\u4EF6\u7684\u683C\u5F0F -help.set.format = \u8BBE\u7F6E\u7528\u4E8E\u62A5\u544A\u7247\u6BB5\u4E8B\u4EF6\u7684\u683C\u5F0F\uFF1A\n\n\t/set format <\u6A21\u5F0F> <\u5B57\u6BB5> "<\u683C\u5F0F>" <\u9009\u62E9\u5668>...\n\n\u663E\u793A\u683C\u5F0F\u8BBE\u7F6E:\n\n\t/set format [<\u6A21\u5F0F> [<\u5B57\u6BB5>]]\n\n\u5176\u4E2D <\u6A21\u5F0F> \u662F\u4EE5\u524D\u5B9A\u4E49\u7684\u53CD\u9988\u6A21\u5F0F\u7684\u540D\u79F0 -- \u8BF7\u53C2\u9605 '/help /set mode'\u3002\n\u5176\u4E2D <\u5B57\u6BB5> \u662F\u8981\u5B9A\u4E49\u7684\u4E0A\u4E0B\u6587\u7279\u5B9A\u683C\u5F0F\u7684\u540D\u79F0\u3002\n\u5176\u4E2D <\u683C\u5F0F> \u662F\u4E00\u4E2A\u5E26\u5F15\u53F7\u7684\u5B57\u7B26\u4E32, \u8BE5\u5B57\u7B26\u4E32\u5C06\u4E3A\n\u5B57\u6BB5\u7684\u503C (\u5982\u679C\u9009\u62E9\u5668\u5339\u914D, \u6216\u8005\u6CA1\u6709\u4EFB\u4F55\u9009\u62E9\u5668)\u3002\n\u5728\u4F7F\u7528\u683C\u5F0F\u65F6, \u7528\u5927\u62EC\u53F7\u62EC\u8D77\u7684\u5B57\u6BB5\u540D\u5C06\u4F1A\u5728\u76F8\u5E94\u65F6\u95F4\n\u4F7F\u7528\u5B57\u6BB5\u503C\u66FF\u6362\u3002\u8FD9\u4E9B\u5B57\u6BB5\u53EF\u80FD\u5DF2\u4F7F\u7528\u6B64\u547D\u4EE4\u5B9A\u4E49, \n\u4E5F\u53EF\u80FD\u662F\u7279\u5B9A\u4E8E\u4E0A\u4E0B\u6587\u7684\u4EE5\u4E0B\u9884\u5B9A\u4E49\u5B57\u6BB5\u4E4B\u4E00:\n\t{name} == \u540D\u79F0, \u4F8B\u5982: \u53D8\u91CF\u7684\u540D\u79F0, ...\n\t{type} == \u7C7B\u578B\u540D\u79F0\u3002\u53D8\u91CF\u6216\u8868\u8FBE\u5F0F\u7684\u7C7B\u578B,\n\t\t\t\u65B9\u6CD5\u7684\u53C2\u6570\u7C7B\u578B\n\t{value} == \u8868\u8FBE\u5F0F\u6216\u53D8\u91CF\u521D\u59CB\u5316\u7684\u7ED3\u679C\u503C\n\t{unresolved} == \u672A\u89E3\u6790\u5F15\u7528\u7684\u5217\u8868\n\t{errors} == \u53EF\u6062\u590D\u9519\u8BEF\u7684\u5217\u8868 (\u53EA\u5728\u5904\u7406\n\t\t\t"display" \u5B57\u6BB5\u671F\u95F4)\n\t{err} == \u65E0\u683C\u5F0F\u7684\u9519\u8BEF\u884C (\u53EA\u5728\u5904\u7406\n\t\t\t"errorline" \u5B57\u6BB5\u671F\u95F4)\n\u8BE5\u5DE5\u5177\u8BBF\u95EE\u4EE5\u4E0B\u5B57\u6BB5\u6765\u786E\u5B9A\u6240\u663E\u793A\u7684\u53CD\u9988:\n\t{display} == \u4E3A\u7247\u6BB5\u4E8B\u4EF6\u663E\u793A\u7684\u6D88\u606F\n\t{errorline} == "errors" \u5B57\u6BB5\u4E2D\u7684\u4E00\u4E2A\u9519\u8BEF\u884C\u7684\u683C\u5F0F\n\t{pre} == \u53CD\u9988\u524D\u7F00 (\u4F5C\u4E3A\u547D\u4EE4\u53CD\u9988\u7684\u5F00\u5934)\n\t{post} == \u53CD\u9988\u540E\u7F00 (\u4F5C\u4E3A\u547D\u4EE4\u53CD\u9988\u7684\u7ED3\u5C3E)\n\t{errorpre} == \u9519\u8BEF\u524D\u7F00 (\u4F5C\u4E3A\u9519\u8BEF\u53CD\u9988\u7684\u5F00\u5934)\n\t{errorpost} == \u9519\u8BEF\u540E\u7F00 (\u4F5C\u4E3A\u9519\u8BEF\u53CD\u9988\u7684\u7ED3\u5C3E)\n\u8FD9\u4E9B\u5B57\u6BB5\u5177\u6709\u9ED8\u8BA4\u8BBE\u7F6E (\u53EF\u8986\u76D6)\u3002\n\u5176\u4E2D \u662F\u5E94\u7528\u683C\u5F0F\u7684\u4E0A\u4E0B\u6587\u3002\n\u9009\u62E9\u5668\u7ED3\u6784\u662F\u4E00\u4E2A\u7531\u9009\u62E9\u5668\u7C7B\u578B\u5217\u8868\u6784\u6210\u7684\u5217\u8868, \u4F7F\u7528\u8FDE\u5B57\u7B26\u5206\u9694\u3002\n\u9009\u62E9\u5668\u7C7B\u578B\u5217\u8868\u662F\u5355\u4E2A\u9009\u62E9\u5668\u7C7B\u578B\u7684\u503C\u7684\u5217\u8868, \u4F7F\u7528\u9017\u53F7\u5206\u9694\u3002\n\u5982\u679C\u6BCF\u4E2A\u9009\u62E9\u5668\u7C7B\u578B\u5217\u8868\u5339\u914D, \u5219\u9009\u62E9\u5668\u5339\u914D; \u5982\u679C\u5176\u4E2D\u67D0\u4E2A\u503C\n\u5339\u914D, \u5219\u9009\u62E9\u5668\u7C7B\u578B\u5217\u8868\u5339\u914D\u3002\n\ncase \u9009\u62E9\u5668\u7C7B\u578B\u63CF\u8FF0\u4E86\u7247\u6BB5\u7684\u7C7B\u578B\u3002\u503C\u5305\u62EC:\n\timport -- \u5BFC\u5165\u58F0\u660E\n\tclass -- \u7C7B\u58F0\u660E\n\tinterface -- \u63A5\u53E3\u58F0\u660E\n\tenum -- \u679A\u4E3E\u58F0\u660E\n\tannotation -- \u6CE8\u91CA\u63A5\u53E3\u58F0\u660E\n\tmethod -- \u65B9\u6CD5\u58F0\u660E -- \u6CE8: {type}==parameter-types\n\tvardecl -- \u4E0D\u5E26\u521D\u59CB\u5316\u7684\u53D8\u91CF\u58F0\u660E\n\tvardecl -- \u5E26\u521D\u59CB\u5316\u7684\u53D8\u91CF\u58F0\u660E\n\texpression -- \u8868\u8FBE\u5F0F -- \u6CE8: \ -{name}==scratch-variable-name\n\tvarvalue -- \u53D8\u91CF\u503C\u8868\u8FBE\u5F0F\n\tassignment -- \u5206\u914D\u53D8\u91CF\n\tstatement -- \u8BED\u53E5\n\u64CD\u4F5C\u9009\u62E9\u5668\u7C7B\u578B\u63CF\u8FF0\u4E86\u5BF9\u7247\u6BB5\u6267\u884C\u7684\u64CD\u4F5C\u3002\u503C\u5305\u62EC:\n\tadded -- \u7247\u6BB5\u5DF2\u6DFB\u52A0\n\tmodified -- \u73B0\u6709\u7247\u6BB5\u5DF2\u4FEE\u6539\n\treplaced -- \u73B0\u6709\u7247\u6BB5\u5DF2\u66FF\u6362\u4E3A\u65B0\u7247\u6BB5\n\toverwrote -- \u73B0\u6709\u7247\u6BB5\u5DF2\u8986\u76D6\n\tdropped -- \u7247\u6BB5\u5DF2\u5220\u9664\n\tused -- \u7247\u6BB5\u5728\u4E0D\u80FD\u4F7F\u7528\u7684\u65F6\u5019\u5DF2\u88AB\u4F7F\u7528\nwhen-did-it-occur \u9009\u62E9\u5668\u7C7B\u578B\u63CF\u8FF0\u4E86\u8FD9\u662F\u76F4\u63A5\u64CD\u4F5C\u8FD8\u662F\u95F4\u63A5\u64CD\u4F5C\u3002\u503C\u5305\u62EC:\n\tprimary -- \u8F93\u5165\u7684\u7247\u6BB5\n\tupdate -- \u5BF9\u76F8\u5173\u7247\u6BB5\u7684\u66F4\u65B0\nresolution-state \u9009\u62E9\u5668\u7C7B\u578B\u63CF\u8FF0\u4E86\u7247\u6BB5\u7684\u89E3\u6790/\u5B9A\u4E49\u72B6\u6001\u3002\u503C\u5305\u62EC:\n\tok -- \u5DF2\u6B63\u786E\u89E3\u6790\n\tdefined -- \u5DF2\u5B9A\u4E49, \u4F46\u5B58\u5728\u53EF\u6062\u590D\u7684\u672A\u89E3\u6790\u5F15\u7528\n\tnotdefined -- \u7531\u4E8E\u5B58\u5728\u53EF\u6062\u590D\u7684\u672A\u89E3\u6790\u5F15\u7528\u800C\u672A\u5B9A\u4E49\nunresolved-count \u9009\u62E9\u5668\u7C7B\u578B\u63CF\u8FF0\u4E86\u672A\u89E3\u6790\u5F15\u7528\u7684\u6570\u91CF\u3002\u503C\u5305\u62EC:\n\tunresolved0 -- \u4E0D\u5B58\u5728\u672A\u89E3\u6790\u7684\u540D\u79F0\n\tunresolved1 -- \u4E00\u4E2A\u540D\u79F0\u672A\u89E3\u6790\n\tunresolved2 -- \u4E24\u4E2A\u6216\u66F4\u591A\u540D\u79F0\u672A\u89E3\u6790\nerrors-count \u9009\u62E9\u5668\u7C7B\u578B\u63CF\u8FF0\u4E86\u9519\u8BEF\u7684\u6570\u91CF\u3002\u503C\u5305\u62EC:\n\terror0 -- \u65E0\u9519\u8BEF\n\terror1 -- \u4E00\u4E2A\u9519\u8BEF\n\terror2 -- \u4E24\u4E2A\u6216\u66F4\u591A\u9519\u8BEF\n\n\u793A\u4F8B:\n\t/set format mymode action '\u5DF2\u521B\u5EFA' added-primary\n\t/set format mymode action '\u66F4\u65B0\u5DF2\u66FF\u6362' replaced-update\n\t/set format mymode display '{pre}{action} \u7C7B {name}{post}' class-ok\n\t/set format mymode display '{pre}{action} \u53D8\u91CF {name}, \u91CD\u7F6E\u4E3A\u7A7A\u503C{post}' replaced-vardecl,varinit-ok-update\n\n\u8BF7\u6CE8\u610F, \u67D0\u4E2A\u5B57\u6BB5\u7684\u540E\u7EED\u9009\u62E9\u5668\u53EF\u80FD\u4F1A\u8986\u76D6\u90E8\u5206\u6216\u5168\u90E8\u4EE5\u524D\u4F7F\u7528\u7684\u9009\u62E9\u5668 -- \u91C7\u7528\u6700\u540E\u4E00\u4E2A\u9009\u62E9\u5668\n\n\u4E0D\u5E26 <\u683C\u5F0F> \u7684\u683C\u5F0F\u663E\u793A\u5F53\u524D\u683C\u5F0F\u8BBE\u7F6E\u3002\n\u6307\u5B9A <\u6A21\u5F0F> \u65F6, \u5C06\u4EC5\u663E\u793A\u8BE5\u6A21\u5F0F\u7684\u683C\u5F0F\u8BBE\u7F6E\u3002\n\u540C\u65F6\u6307\u5B9A <\u6A21\u5F0F> \u548C <\u5B57\u6BB5> \u65F6, \u5C06\u4EC5\u663E\u793A\u8BE5\u6A21\u5F0F\u548C\u5B57\u6BB5\u7684\n\u683C\u5F0F\u8BBE\u7F6E\u3002\u793A\u4F8B:\n\t/set format mymode\n\u663E\u793A\u6A21\u5F0F mymode \u7684\u683C\u5F0F\u8BBE\u7F6E\n +help.set.format = \u8BBE\u7F6E\u7528\u4E8E\u62A5\u544A\u7247\u6BB5\u4E8B\u4EF6\u7684\u683C\u5F0F\uFF1A\n\n\t/set format <\u6A21\u5F0F> <\u5B57\u6BB5> "<\u683C\u5F0F>" <\u9009\u62E9\u5668>...\n\n\u663E\u793A\u683C\u5F0F\u8BBE\u7F6E:\n\n\t/set format [<\u6A21\u5F0F> [<\u5B57\u6BB5>]]\n\n\u5176\u4E2D <\u6A21\u5F0F> \u662F\u4EE5\u524D\u5B9A\u4E49\u7684\u53CD\u9988\u6A21\u5F0F\u7684\u540D\u79F0 -- \u8BF7\u53C2\u9605 '/help /set mode'\u3002\n\u5176\u4E2D <\u5B57\u6BB5> \u662F\u8981\u5B9A\u4E49\u7684\u4E0A\u4E0B\u6587\u7279\u5B9A\u683C\u5F0F\u7684\u540D\u79F0\u3002\n\u5176\u4E2D <\u683C\u5F0F> \u662F\u4E00\u4E2A\u5E26\u5F15\u53F7\u7684\u5B57\u7B26\u4E32, \u8BE5\u5B57\u7B26\u4E32\u5C06\u4E3A\n\u5B57\u6BB5\u7684\u503C (\u5982\u679C\u9009\u62E9\u5668\u5339\u914D, \u6216\u8005\u6CA1\u6709\u4EFB\u4F55\u9009\u62E9\u5668)\u3002\n\u5728\u4F7F\u7528\u683C\u5F0F\u65F6, \u7528\u5927\u62EC\u53F7\u62EC\u8D77\u7684\u5B57\u6BB5\u540D\u5C06\u4F1A\u5728\u76F8\u5E94\u65F6\u95F4\n\u4F7F\u7528\u5B57\u6BB5\u503C\u66FF\u6362\u3002\u8FD9\u4E9B\u5B57\u6BB5\u53EF\u80FD\u5DF2\u4F7F\u7528\u6B64\u547D\u4EE4\u5B9A\u4E49, \n\u4E5F\u53EF\u80FD\u662F\u7279\u5B9A\u4E8E\u4E0A\u4E0B\u6587\u7684\u4EE5\u4E0B\u9884\u5B9A\u4E49\u5B57\u6BB5\u4E4B\u4E00:\n\t{name} == \u540D\u79F0, \u4F8B\u5982: \u53D8\u91CF\u7684\u540D\u79F0, ...\n\t{type} == \u7C7B\u578B\u540D\u79F0\u3002\u53D8\u91CF\u6216\u8868\u8FBE\u5F0F\u7684\u7C7B\u578B,\n\t\t\t\u65B9\u6CD5\u7684\u53C2\u6570\u7C7B\u578B\n\t{value} == \u8868\u8FBE\u5F0F\u6216\u53D8\u91CF\u521D\u59CB\u5316\u7684\u7ED3\u679C\u503C\n\t{unresolved} == \u672A\u89E3\u6790\u5F15\u7528\u7684\u5217\u8868\n\t{errors} == \u53EF\u6062\u590D\u9519\u8BEF\u7684\u5217\u8868 (\u53EA\u5728\u5904\u7406\n\t\t\t"display" \u5B57\u6BB5\u671F\u95F4)\n\t{err} == \u65E0\u683C\u5F0F\u7684\u9519\u8BEF\u884C (\u53EA\u5728\u5904\u7406\n\t\t\t"errorline" \u5B57\u6BB5\u671F\u95F4)\n\u8BE5\u5DE5\u5177\u8BBF\u95EE\u4EE5\u4E0B\u5B57\u6BB5\u6765\u786E\u5B9A\u6240\u663E\u793A\u7684\u53CD\u9988:\n\t{display} == \u4E3A\u7247\u6BB5\u4E8B\u4EF6\u663E\u793A\u7684\u6D88\u606F\n\t{errorline} == "errors" \u5B57\u6BB5\u4E2D\u7684\u4E00\u4E2A\u9519\u8BEF\u884C\u7684\u683C\u5F0F\n\t{pre} == \u53CD\u9988\u524D\u7F00 (\u4F5C\u4E3A\u547D\u4EE4\u53CD\u9988\u7684\u5F00\u5934)\n\t{post} == \u53CD\u9988\u540E\u7F00 (\u4F5C\u4E3A\u547D\u4EE4\u53CD\u9988\u7684\u7ED3\u5C3E)\n\t{errorpre} == \u9519\u8BEF\u524D\u7F00 (\u4F5C\u4E3A\u9519\u8BEF\u53CD\u9988\u7684\u5F00\u5934)\n\t{errorpost} == \u9519\u8BEF\u540E\u7F00 (\u4F5C\u4E3A\u9519\u8BEF\u53CD\u9988\u7684\u7ED3\u5C3E)\n\u8FD9\u4E9B\u5B57\u6BB5\u5177\u6709\u9ED8\u8BA4\u8BBE\u7F6E (\u53EF\u8986\u76D6)\u3002\n\u5176\u4E2D \u662F\u5E94\u7528\u683C\u5F0F\u7684\u4E0A\u4E0B\u6587\u3002\n\u9009\u62E9\u5668\u7ED3\u6784\u662F\u4E00\u4E2A\u7531\u9009\u62E9\u5668\u7C7B\u578B\u5217\u8868\u6784\u6210\u7684\u5217\u8868, \u4F7F\u7528\u8FDE\u5B57\u7B26\u5206\u9694\u3002\n\u9009\u62E9\u5668\u7C7B\u578B\u5217\u8868\u662F\u5355\u4E2A\u9009\u62E9\u5668\u7C7B\u578B\u7684\u503C\u7684\u5217\u8868, \u4F7F\u7528\u9017\u53F7\u5206\u9694\u3002\n\u5982\u679C\u6BCF\u4E2A\u9009\u62E9\u5668\u7C7B\u578B\u5217\u8868\u5339\u914D, \u5219\u9009\u62E9\u5668\u5339\u914D; \u5982\u679C\u5176\u4E2D\u67D0\u4E2A\u503C\n\u5339\u914D, \u5219\u9009\u62E9\u5668\u7C7B\u578B\u5217\u8868\u5339\u914D\u3002\n\ncase \u9009\u62E9\u5668\u7C7B\u578B\u63CF\u8FF0\u4E86\u7247\u6BB5\u7684\u7C7B\u578B\u3002\u503C\u5305\u62EC:\n\timport -- \u5BFC\u5165\u58F0\u660E\n\tclass -- \u7C7B\u58F0\u660E\n\tinterface -- \u63A5\u53E3\u58F0\u660E\n\tenum -- \u679A\u4E3E\u58F0\u660E\n\tannotation -- \u6CE8\u91CA\u63A5\u53E3\u58F0\u660E\n\trecord -- \u8BB0\u5F55\u58F0\u660E\n\tmethod -- \u65B9\u6CD5\u58F0\u660E -- \u6CE8: {type}==parameter-types\n\tvardecl -- \u4E0D\u5E26\u521D\u59CB\u5316\u7684\u53D8\u91CF\u58F0\u660E\n\tvardecl -- \u5E26\u521D\u59CB\u5316\u7684\u53D8\u91CF\u58F0\u660E\n\texpression -- \u8868\u8FBE\u5F0F -- \ +\u6CE8: {name}==scratch-variable-name\n\tvarvalue -- \u53D8\u91CF\u503C\u8868\u8FBE\u5F0F\n\tassignment -- \u5206\u914D\u53D8\u91CF\n\tstatement -- \u8BED\u53E5\n\u64CD\u4F5C\u9009\u62E9\u5668\u7C7B\u578B\u63CF\u8FF0\u4E86\u5BF9\u7247\u6BB5\u6267\u884C\u7684\u64CD\u4F5C\u3002\u503C\u5305\u62EC:\n\tadded -- \u7247\u6BB5\u5DF2\u6DFB\u52A0\n\tmodified -- \u73B0\u6709\u7247\u6BB5\u5DF2\u4FEE\u6539\n\treplaced -- \u73B0\u6709\u7247\u6BB5\u5DF2\u66FF\u6362\u4E3A\u65B0\u7247\u6BB5\n\toverwrote -- \u73B0\u6709\u7247\u6BB5\u5DF2\u8986\u76D6\n\tdropped -- \u7247\u6BB5\u5DF2\u5220\u9664\n\tused -- \u7247\u6BB5\u5728\u4E0D\u80FD\u4F7F\u7528\u7684\u65F6\u5019\u5DF2\u88AB\u4F7F\u7528\nwhen-did-it-occur \u9009\u62E9\u5668\u7C7B\u578B\u63CF\u8FF0\u4E86\u8FD9\u662F\u76F4\u63A5\u64CD\u4F5C\u8FD8\u662F\u95F4\u63A5\u64CD\u4F5C\u3002\u503C\u5305\u62EC:\n\tprimary -- \u8F93\u5165\u7684\u7247\u6BB5\n\tupdate -- \u5BF9\u76F8\u5173\u7247\u6BB5\u7684\u66F4\u65B0\nresolution-state \u9009\u62E9\u5668\u7C7B\u578B\u63CF\u8FF0\u4E86\u7247\u6BB5\u7684\u89E3\u6790/\u5B9A\u4E49\u72B6\u6001\u3002\u503C\u5305\u62EC:\n\tok -- \u5DF2\u6B63\u786E\u89E3\u6790\n\tdefined -- \u5DF2\u5B9A\u4E49, \u4F46\u5B58\u5728\u53EF\u6062\u590D\u7684\u672A\u89E3\u6790\u5F15\u7528\n\tnotdefined -- \u7531\u4E8E\u5B58\u5728\u53EF\u6062\u590D\u7684\u672A\u89E3\u6790\u5F15\u7528\u800C\u672A\u5B9A\u4E49\nunresolved-count \u9009\u62E9\u5668\u7C7B\u578B\u63CF\u8FF0\u4E86\u672A\u89E3\u6790\u5F15\u7528\u7684\u6570\u91CF\u3002\u503C\u5305\u62EC:\n\tunresolved0 -- \u4E0D\u5B58\u5728\u672A\u89E3\u6790\u7684\u540D\u79F0\n\tunresolved1 -- \u4E00\u4E2A\u540D\u79F0\u672A\u89E3\u6790\n\tunresolved2 -- \u4E24\u4E2A\u6216\u66F4\u591A\u540D\u79F0\u672A\u89E3\u6790\nerrors-count \u9009\u62E9\u5668\u7C7B\u578B\u63CF\u8FF0\u4E86\u9519\u8BEF\u7684\u6570\u91CF\u3002\u503C\u5305\u62EC:\n\terror0 -- \u65E0\u9519\u8BEF\n\terror1 -- \u4E00\u4E2A\u9519\u8BEF\n\terror2 -- \u4E24\u4E2A\u6216\u66F4\u591A\u9519\u8BEF\n\n\u793A\u4F8B:\n\t/set format mymode action '\u5DF2\u521B\u5EFA' added-primary\n\t/set format mymode action '\u66F4\u65B0\u5DF2\u66FF\u6362' replaced-update\n\t/set format mymode display '{pre}{action} \u7C7B {name}{post}' class-ok\n\t/set format mymode display '{pre}{action} \u53D8\u91CF {name}, \u91CD\u7F6E\u4E3A\u7A7A\u503C{post}' replaced-vardecl,varinit-ok-update\n\n\u8BF7\u6CE8\u610F, \u67D0\u4E2A\u5B57\u6BB5\u7684\u540E\u7EED\u9009\u62E9\u5668\u53EF\u80FD\u4F1A\u8986\u76D6\u90E8\u5206\u6216\u5168\u90E8\u4EE5\u524D\u4F7F\u7528\u7684\u9009\u62E9\u5668 -- \u91C7\u7528\u6700\u540E\u4E00\u4E2A\u9009\u62E9\u5668\n\n\u4E0D\u5E26 <\u683C\u5F0F> \u7684\u683C\u5F0F\u663E\u793A\u5F53\u524D\u683C\u5F0F\u8BBE\u7F6E\u3002\n\u6307\u5B9A <\u6A21\u5F0F> \u65F6, \u5C06\u4EC5\u663E\u793A\u8BE5\u6A21\u5F0F\u7684\u683C\u5F0F\u8BBE\u7F6E\u3002\n\u540C\u65F6\u6307\u5B9A <\u6A21\u5F0F> \u548C <\u5B57\u6BB5> \u65F6, \u5C06\u4EC5\u663E\u793A\u8BE5\u6A21\u5F0F\u548C\u5B57\u6BB5\u7684\n\u683C\u5F0F\u8BBE\u7F6E\u3002\u793A\u4F8B:\n\t/set format mymode\n\u663E\u793A\u6A21\u5F0F mymode \u7684\u683C\u5F0F\u8BBE\u7F6E\n help.set.truncation.summary = \u8BBE\u7F6E\u663E\u793A\u503C\u7684\u6700\u5927\u957F\u5EA6 @@ -314,5 +314,5 @@ help.set.start.summary =\u8BBE\u7F6E\u542F\u52A8\u914D\u7F6E help.set.start =\u8BBE\u7F6E\u542F\u52A8\u914D\u7F6E -- \u542F\u52A8\u65F6\u8BFB\u53D6\u7684\u7247\u6BB5\u548C\u547D\u4EE4\u5E8F\u5217\uFF1A\n\n\t/set start [-retain] <\u6587\u4EF6>...\n\n\t/set start [-retain] -default\n\n\t/set start [-retain] -none\n\n\u4FDD\u7559\u542F\u52A8\u914D\u7F6E\u4EE5\u4FBF\u5728\u5C06\u6765\u4F1A\u8BDD\u4E2D\u4F7F\u7528\uFF1A\n\n\t/set start -retain\n\n\u663E\u793A\u542F\u52A8\u8BBE\u7F6E\uFF1A\n\n\t/set start\n\n\u5728\u6B64\u4F1A\u8BDD\u4E2D\u4F7F\u7528 /reset\u3001/reload \u6216 /env \u547D\u4EE4\u65F6\uFF0C\n\u6307\u5B9A <\u6587\u4EF6> \u7684\u5185\u5BB9\u5C06\u6210\u4E3A\u4F7F\u7528\u7684\u542F\u52A8\u7247\u6BB5\u548C\u547D\u4EE4\u3002\n\u5982\u679C\u6539\u4E3A\u6307\u5B9A -default \u9009\u9879\uFF0C\u5219\u5C06\u4F7F\u7528\u9884\u5B9A\u4E49\u7684\n\u542F\u52A8\u5BFC\u5165\u7247\u6BB5\u3002\n\u5982\u679C\u4F7F\u7528 -none \u9009\u9879\uFF0C\u5219\u542F\u52A8\u8BBE\u7F6E\u5C06\u4E3A\u7A7A -- \u5C06\u4E0D\u4F7F\u7528\n\u542F\u52A8\u7247\u6BB5\u6216\u547D\u4EE4\n\u6B64\u547D\u4EE4\u5BF9\u4E8E\u6D4B\u8BD5\u542F\u52A8\u8BBE\u7F6E\u975E\u5E38\u6709\u7528\u3002\u8981\u4FDD\u7559\u8FD9\u4E9B\u5185\u5BB9\n\u4EE5\u4FBF\u5C06\u6765\u8FD0\u884C jshell \u5DE5\u5177\u65F6\u4F7F\u7528\uFF0C\u8BF7\u4F7F\u7528\u547D\u4EE4\uFF1A\n\t/set start -retain\n\n\u4F7F\u7528 -retain \u9009\u9879\u65F6\uFF0C\u5C06\u5728\u672C\u6B21\u8FD0\u884C\u548C\u5C06\u6765\n\u8FD0\u884C jshell \u5DE5\u5177\u65F6\u4F7F\u7528\u8BE5\u8BBE\u7F6E\u3002\n\n\u4E0D\u5E26 <\u6587\u4EF6> \u6216\u9009\u9879\u7684\u683C\u5F0F\u663E\u793A\u542F\u52A8\u8BBE\u7F6E\u3002\n\u6CE8\uFF1A\u5982\u679C\u542F\u52A8\u8BBE\u7F6E\u6700\u540E\u4E00\u6B21\u662F\u4ECE\u6587\u4EF6\u8BBE\u7F6E\u7684\uFF0C\u5219\u4F1A\u968F\n'set start' \u547D\u4EE4\uFF08\u540E\u8DDF\u6587\u4EF6\u5185\u5BB9\uFF09\u4E00\u8D77\u663E\u793A\u6B64\u5185\u5BB9\u3002\n\n<\u6587\u4EF6> \u53EF\u4EE5\u662F\u64CD\u4F5C\u7CFB\u7EDF\u6587\u4EF6\u540D\uFF0C\u4E5F\u53EF\u662F\u9884\u5B9A\u4E49\u7684\n\u542F\u52A8\u6587\u4EF6\u540D\u4E4B\u4E00\uFF1ADEFAULT\u3001PRINTING \u6216 JAVASE\u3002\n\u8FD9\u4E9B\u9879\u7684\u8BF4\u660E\u5206\u522B\u5982\u4E0B\uFF1A\u9ED8\u8BA4\u5BFC\u5165\u7247\u6BB5\uFF08\u5982 -default \u6240\u4F7F\u7528\u7684\uFF09\u3001\nprint()\u3001println() \u548C printf() \u65B9\u6CD5\u7247\u6BB5\u7684\u5B9A\u4E49\uFF0C\u6216\n\u6240\u6709 Java SE \u7A0B\u5E8F\u5305\u7684\u5BFC\u5165\u9879\u3002\n\u53EF\u4EE5\u6307\u5B9A\u591A\u4E2A <\u6587\u4EF6>\uFF0C\u4F8B\u5982\uFF1A\n\n\t/set start -retain DEFAULT PRINTING -startup.feedback = /set mode verbose -command \n\n/set prompt verbose '\\njshell> ' ' ...> ' \n\n/set format verbose pre '| ' \n/set format verbose post '%n' \n/set format verbose errorpre '| ' \n/set format verbose errorpost '%n' \n\n/set format verbose errorline '{post}{pre} {err}' \n\n/set format verbose action '\u5DF2\u521B\u5EFA' added-primary \n/set format verbose action '\u5DF2\u4FEE\u6539' modified-primary \n/set format verbose action '\u5DF2\u66FF\u6362' replaced-primary \n/set format verbose action '\u5DF2\u8986\u76D6' overwrote-primary \n/set format verbose action '\u5DF2\u5220\u9664' dropped-primary \n/set format verbose action ' \u66F4\u65B0\u5DF2\u521B\u5EFA' added-update \n/set format verbose action ' \u66F4\u65B0\u5DF2\u4FEE\u6539' modified-update \n/set format verbose action ' \u66F4\u65B0\u5DF2\u66FF\u6362' replaced-update \n/set format verbose action ' \u66F4\u65B0\u5DF2\u8986\u76D6' overwrote-update \n/set format verbose action ' \u66F4\u65B0\u5DF2\u5220\u9664' dropped-update \n\n/set format verbose until ', \u4E0D\u8FC7, \u5B83\u65E0\u6CD5\u5B9E\u4F8B\u5316\u6216\u8005\u5176\u65B9\u6CD5\u65E0\u6CD5\u8C03\u7528, \u76F4\u81F3' defined-class-primary \n/set format verbose until ', \u4E0D\u8FC7, \u5176\u65B9\u6CD5\u65E0\u6CD5\u8C03\u7528, \u76F4\u81F3' defined-interface-primary \n/set format verbose until ', \u4E0D\u8FC7, \u5B83\u65E0\u6CD5\u4F7F\u7528, \u76F4\u81F3' defined-enum,annotation-primary \n/set format verbose until ', \u4E0D\u8FC7, \u5B83\u65E0\u6CD5\u8C03\u7528, \u76F4\u81F3' defined-method-primary \n/set format verbose until ', \u4E0D\u8FC7, \u5B83\u65E0\u6CD5\u5F15\u7528, \u76F4\u81F3' notdefined-primary \n/set format verbose until ' \u5B83\u65E0\u6CD5\u5B9E\u4F8B\u5316\u6216\u8005\u5176\u65B9\u6CD5\u65E0\u6CD5\u8C03\u7528, \u76F4\u81F3' defined-class-update \n/set format verbose until ' \u5176\u65B9\u6CD5\u65E0\u6CD5\u8C03\u7528, \u76F4\u81F3' defined-interface-update \n/set format verbose until ' \u5B83\u65E0\u6CD5\u8C03\u7528, \u76F4\u81F3' defined-method-update \n/set format verbose until ' \u5B83\u65E0\u6CD5\u5F15\u7528, \u76F4\u81F3' notdefined-update \n\n/set format verbose unrerr '{unresolved} \u5DF2\u58F0\u660E' unresolved1-error0 \n/set format verbose unrerr '{unresolved} \u5DF2\u58F0\u660E' unresolved2-error0 \n/set format verbose unrerr ' \u6B64\u9519\u8BEF\u5DF2\u66F4\u6B63: {errors}' unresolved0-error1 \n/set format verbose unrerr '{unresolved} \u5DF2\u58F0\u660E, \u5E76\u4E14\u6B64\u9519\u8BEF\u5DF2\u66F4\u6B63: {errors}' unresolved1-error1 \n/set format verbose unrerr '{unresolved} \u5DF2\u58F0\u660E, \u5E76\u4E14\u6B64\u9519\u8BEF\u5DF2\u66F4\u6B63: {errors}' unresolved2-error1 \n/set format verbose unrerr ' \u8FD9\u4E9B\u9519\u8BEF\u5DF2\u66F4\u6B63: {errors}' unresolved0-error2 \n/set format verbose unrerr '{unresolved} \u5DF2\u58F0\u660E\u5E76\u4E14\u8FD9\u4E9B\u9519\u8BEF\u5DF2\u66F4\u6B63: {errors}' unresolved1-error2 \n/set format verbose unrerr '{unresolved} \u5DF2\u58F0\u660E\u5E76\u4E14\u8FD9\u4E9B\u9519\u8BEF\u5DF2\u66F4\u6B63: {errors}' unresolved2-error2 \n\n/set format verbose resolve '{until}{unrerr}' defined,notdefined-added,modified,replaced,used \n\n/set format verbose typeKind '\u7C7B' class \n/set format verbose typeKind '\u63A5\u53E3' interface \n/set format verbose typeKind '\u679A\u4E3E' enum \n/set format verbose typeKind '\u6CE8\u91CA\u63A5\u53E3' annotation \ -\n\n/set format verbose result '{name} ==> {value}{post}' added,modified,replaced-ok-primary \n\n/set format verbose display '{result}{pre}\u5DF2\u521B\u5EFA\u6682\u5B58\u53D8\u91CF {name} : {type}{post}' expression-added,modified,replaced-primary \n/set format verbose display '{result}{pre}{name} \u7684\u503C: {type}{post}' varvalue-added,modified,replaced-primary \n/set format verbose display '{result}{pre}\u5DF2\u5206\u914D\u7ED9 {name} : {type}{post}' assignment-primary \n/set format verbose display '{result}{pre}{action} \u53D8\u91CF {name} : {type}{resolve}{post}' varinit,vardecl \n/set format verbose display '{pre}{action} \u53D8\u91CF {name}{resolve}{post}' vardecl,varinit-notdefined \n/set format verbose display '{pre}{action} \u53D8\u91CF {name}{post}' dropped-vardecl,varinit,expression \n/set format verbose display '{pre}{action} \u53D8\u91CF {name}, \u91CD\u7F6E\u4E3A\u7A7A\u503C{post}' replaced-vardecl,varinit-ok-update \n\n/set format verbose display '{pre}{action} {typeKind} {name}{resolve}{post}' class,interface,enum,annotation \n/set format verbose display '{pre}{action} \u65B9\u6CD5 {name}({type}){resolve}{post}' method \n\n/set format verbose display '{pre}\u5DF2\u5C1D\u8BD5\u4F7F\u7528 {typeKind} {name}{resolve}{post}' used-class,interface,enum,annotation \n/set format verbose display '{pre}\u5DF2\u5C1D\u8BD5\u8C03\u7528\u65B9\u6CD5 {name}({type}){resolve}{post}' used-method \n\n/set truncation verbose 80\n/set truncation verbose 1000 varvalue,expression\n\n/set mode normal -command verbose \n/set format normal display '' added,modified,replaced,overwrote,dropped-update \n/set format normal display '{pre}{action} \u53D8\u91CF {name}, \u91CD\u7F6E\u4E3A\u7A7A\u503C{post}' replaced-vardecl,varinit-ok-update \n/set format normal display '{result}' added,modified,replaced-expression,varvalue,assignment,varinit,vardecl-ok-primary \n/set mode concise -quiet normal \n\n/set prompt concise 'jshell> ' ' ...> ' \n\n/set format concise display '' class,interface,enum,annotation,method,assignment,varinit,vardecl-ok \n\n/set feedback normal \n\n/set mode silent -quiet \n/set prompt silent '-> ' '>> ' \n/set truncation silent 80\n/set truncation silent 1000 varvalue,expression\n/set format silent pre '| ' \n/set format silent post '%n' \n/set format silent errorpre '| ' \n/set format silent errorpost '%n' \n/set format silent display '' \n +startup.feedback = /set mode verbose -command \n\n/set prompt verbose '\\njshell> ' ' ...> ' \n\n/set format verbose pre '| ' \n/set format verbose post '%n' \n/set format verbose errorpre '| ' \n/set format verbose errorpost '%n' \n\n/set format verbose errorline '{post}{pre} {err}' \n\n/set format verbose action '\u5DF2\u521B\u5EFA' added-primary \n/set format verbose action '\u5DF2\u4FEE\u6539' modified-primary \n/set format verbose action '\u5DF2\u66FF\u6362' replaced-primary \n/set format verbose action '\u5DF2\u8986\u76D6' overwrote-primary \n/set format verbose action '\u5DF2\u5220\u9664' dropped-primary \n/set format verbose action ' \u66F4\u65B0\u5DF2\u521B\u5EFA' added-update \n/set format verbose action ' \u66F4\u65B0\u5DF2\u4FEE\u6539' modified-update \n/set format verbose action ' \u66F4\u65B0\u5DF2\u66FF\u6362' replaced-update \n/set format verbose action ' \u66F4\u65B0\u5DF2\u8986\u76D6' overwrote-update \n/set format verbose action ' \u66F4\u65B0\u5DF2\u5220\u9664' dropped-update \n\n/set format verbose until '\uFF0C\u4E0D\u8FC7\uFF0C\u5B83\u65E0\u6CD5\u5B9E\u4F8B\u5316\u6216\u8005\u5176\u65B9\u6CD5\u65E0\u6CD5\u8C03\u7528\uFF0C\u76F4\u81F3' defined-class,record-primary \n/set format verbose until ', \u4E0D\u8FC7, \u5176\u65B9\u6CD5\u65E0\u6CD5\u8C03\u7528, \u76F4\u81F3' defined-interface-primary \n/set format verbose until ', \u4E0D\u8FC7, \u5B83\u65E0\u6CD5\u4F7F\u7528, \u76F4\u81F3' defined-enum,annotation-primary \n/set format verbose until ', \u4E0D\u8FC7, \u5B83\u65E0\u6CD5\u8C03\u7528, \u76F4\u81F3' defined-method-primary \n/set format verbose until ', \u4E0D\u8FC7, \u5B83\u65E0\u6CD5\u5F15\u7528, \u76F4\u81F3' notdefined-primary \n/set format verbose until '\u5B83\u65E0\u6CD5\u5B9E\u4F8B\u5316\u6216\u8005\u5176\u65B9\u6CD5\u65E0\u6CD5\u8C03\u7528\uFF0C\u76F4\u81F3' defined-class,record-update \n/set format verbose until ' \u5176\u65B9\u6CD5\u65E0\u6CD5\u8C03\u7528, \u76F4\u81F3' defined-interface-update \n/set format verbose until ' \u5B83\u65E0\u6CD5\u8C03\u7528, \u76F4\u81F3' defined-method-update \n/set format verbose until ' \u5B83\u65E0\u6CD5\u5F15\u7528, \u76F4\u81F3' notdefined-update \n\n/set format verbose unrerr '{unresolved} \u5DF2\u58F0\u660E' unresolved1-error0 \n/set format verbose unrerr '{unresolved} \u5DF2\u58F0\u660E' unresolved2-error0 \n/set format verbose unrerr ' \u6B64\u9519\u8BEF\u5DF2\u66F4\u6B63: {errors}' unresolved0-error1 \n/set format verbose unrerr '{unresolved} \u5DF2\u58F0\u660E, \u5E76\u4E14\u6B64\u9519\u8BEF\u5DF2\u66F4\u6B63: {errors}' unresolved1-error1 \n/set format verbose unrerr '{unresolved} \u5DF2\u58F0\u660E, \u5E76\u4E14\u6B64\u9519\u8BEF\u5DF2\u66F4\u6B63: {errors}' unresolved2-error1 \n/set format verbose unrerr ' \u8FD9\u4E9B\u9519\u8BEF\u5DF2\u66F4\u6B63: {errors}' unresolved0-error2 \n/set format verbose unrerr '{unresolved} \u5DF2\u58F0\u660E\u5E76\u4E14\u8FD9\u4E9B\u9519\u8BEF\u5DF2\u66F4\u6B63: {errors}' unresolved1-error2 \n/set format verbose unrerr '{unresolved} \u5DF2\u58F0\u660E\u5E76\u4E14\u8FD9\u4E9B\u9519\u8BEF\u5DF2\u66F4\u6B63: {errors}' unresolved2-error2 \n\n/set format verbose resolve '{until}{unrerr}' defined,notdefined-added,modified,replaced,used \n\n/set format verbose typeKind '\u7C7B' class \n/set format verbose typeKind '\u63A5\u53E3' interface \n/set format verbose typeKind '\u679A\u4E3E' enum \n/set format verbose typeKind \ +'\u6CE8\u91CA\u63A5\u53E3' annotation \n/set format verbose typeKind '\u8BB0\u5F55' record \n\n/set format verbose result '{name} ==> {value}{post}' added,modified,replaced-ok-primary \n\n/set format verbose display '{result}{pre}\u5DF2\u521B\u5EFA\u6682\u5B58\u53D8\u91CF {name} : {type}{post}' expression-added,modified,replaced-primary \n/set format verbose display '{result}{pre}{name} \u7684\u503C: {type}{post}' varvalue-added,modified,replaced-primary \n/set format verbose display '{result}{pre}\u5DF2\u5206\u914D\u7ED9 {name} : {type}{post}' assignment-primary \n/set format verbose display '{result}{pre}{action} \u53D8\u91CF {name} : {type}{resolve}{post}' varinit,vardecl \n/set format verbose display '{pre}{action} \u53D8\u91CF {name}{resolve}{post}' vardecl,varinit-notdefined \n/set format verbose display '{pre}{action} \u53D8\u91CF {name}{post}' dropped-vardecl,varinit,expression \n/set format verbose display '{pre}{action} \u53D8\u91CF {name}, \u91CD\u7F6E\u4E3A\u7A7A\u503C{post}' replaced-vardecl,varinit-ok-update \n\n/set format verbose display '{pre}{action} {typeKind} {name}{resolve}{post}' class,interface,enum,annotation,record \n/set format verbose display '{pre}{action} \u65B9\u6CD5 {name}({type}){resolve}{post}' method \n\n/set format verbose display '{pre}\u5DF2\u5C1D\u8BD5\u4F7F\u7528 {typeKind} {name}{resolve}{post}' used-class,interface,enum,annotation,record \n/set format verbose display '{pre}\u5DF2\u5C1D\u8BD5\u8C03\u7528\u65B9\u6CD5 {name}({type}){resolve}{post}' used-method \n\n/set truncation verbose 80\n/set truncation verbose 1000 varvalue,expression\n\n/set mode normal -command verbose \n/set format normal display '' added,modified,replaced,overwrote,dropped-update \n/set format normal display '{pre}{action} \u53D8\u91CF {name}, \u91CD\u7F6E\u4E3A\u7A7A\u503C{post}' replaced-vardecl,varinit-ok-update \n/set format normal display '{result}' added,modified,replaced-expression,varvalue,assignment,varinit,vardecl-ok-primary \n/set mode concise -quiet normal \n\n/set prompt concise 'jshell> ' ' ...> ' \n\n/set format concise display '' class,interface,enum,annotation,record,method,assignment,varinit,vardecl-ok \n\n/set feedback normal \n\n/set mode silent -quiet \n/set prompt silent '-> ' '>> ' \n/set truncation silent 80\n/set truncation silent 1000 varvalue,expression\n/set format silent pre '| ' \n/set format silent post '%n' \n/set format silent errorpre '| ' \n/set format silent errorpost '%n' \n/set format silent display '' \n From ba7d18db8600354339f0355569a00de95122650c Mon Sep 17 00:00:00 2001 From: Roland Westrelin Date: Fri, 31 Jan 2020 14:36:07 +0100 Subject: [PATCH 20/50] 8237776: Shenandoah: Wrong result with Lucene test Reviewed-by: rkennke, zgu, shade --- .../shenandoahBarrierSetAssembler_x86.cpp | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/hotspot/cpu/x86/gc/shenandoah/shenandoahBarrierSetAssembler_x86.cpp b/src/hotspot/cpu/x86/gc/shenandoah/shenandoahBarrierSetAssembler_x86.cpp index 551433b8f66..57d2a88b921 100644 --- a/src/hotspot/cpu/x86/gc/shenandoah/shenandoahBarrierSetAssembler_x86.cpp +++ b/src/hotspot/cpu/x86/gc/shenandoah/shenandoahBarrierSetAssembler_x86.cpp @@ -512,6 +512,19 @@ void ShenandoahBarrierSetAssembler::load_at(MacroAssembler* masm, DecoratorSet d // 3: apply keep-alive barrier if needed if (ShenandoahBarrierSet::need_keep_alive_barrier(decorators, type)) { __ push_IU_state(); + // That path can be reached from the c2i adapter with live fp + // arguments in registers. + LP64_ONLY(assert(Argument::n_float_register_parameters_j == 8, "8 fp registers to save at java call")); + __ subptr(rsp, 64); + __ movdbl(Address(rsp, 0), xmm0); + __ movdbl(Address(rsp, 8), xmm1); + __ movdbl(Address(rsp, 16), xmm2); + __ movdbl(Address(rsp, 24), xmm3); + __ movdbl(Address(rsp, 32), xmm4); + __ movdbl(Address(rsp, 40), xmm5); + __ movdbl(Address(rsp, 48), xmm6); + __ movdbl(Address(rsp, 56), xmm7); + Register thread = NOT_LP64(tmp_thread) LP64_ONLY(r15_thread); assert_different_registers(dst, tmp1, tmp_thread); if (!thread->is_valid()) { @@ -527,6 +540,15 @@ void ShenandoahBarrierSetAssembler::load_at(MacroAssembler* masm, DecoratorSet d tmp1 /* tmp */, true /* tosca_live */, true /* expand_call */); + __ movdbl(xmm0, Address(rsp, 0)); + __ movdbl(xmm1, Address(rsp, 8)); + __ movdbl(xmm2, Address(rsp, 16)); + __ movdbl(xmm3, Address(rsp, 24)); + __ movdbl(xmm4, Address(rsp, 32)); + __ movdbl(xmm5, Address(rsp, 40)); + __ movdbl(xmm6, Address(rsp, 48)); + __ movdbl(xmm7, Address(rsp, 56)); + __ addptr(rsp, 64); __ pop_IU_state(); } } From c63a8d109047f00ce185ae0936952bc134809068 Mon Sep 17 00:00:00 2001 From: Jesper Wilhelmsson Date: Thu, 6 Feb 2020 02:52:17 +0100 Subject: [PATCH 21/50] Added tag jdk-14+35 for changeset 4a87bb7ebfd7 --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index 51935add895..96c22bf7a44 100644 --- a/.hgtags +++ b/.hgtags @@ -609,3 +609,4 @@ decd3d2953b640f1043ee76953ff89238bff92e8 jdk-14+31 2776da28515e087cc8849acf1e131a65ea7e77b6 jdk-14+32 f728b6c7f4910d6bd6070cb4dde8393f4ba95113 jdk-14+33 a96bc204e3b31ddbf909b20088964112f052927e jdk-14+34 +4a87bb7ebfd7f6a25ec59a5982fe3607242777f8 jdk-14+35 From ae39310243b0486f5a6f1049c6ec5f29db31170c Mon Sep 17 00:00:00 2001 From: Naoto Sato Date: Thu, 6 Feb 2020 10:10:54 -0800 Subject: [PATCH 22/50] 8238605: Correct the CLDR version number in cldr.md files Reviewed-by: joehw, alanb --- src/java.base/share/legal/cldr.md | 2 +- src/jdk.localedata/share/legal/cldr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/java.base/share/legal/cldr.md b/src/java.base/share/legal/cldr.md index 7e07378f2c1..fba90f6e9d4 100644 --- a/src/java.base/share/legal/cldr.md +++ b/src/java.base/share/legal/cldr.md @@ -1,4 +1,4 @@ -## Unicode Common Local Data Repository (CLDR) v35.1 +## Unicode Common Local Data Repository (CLDR) v36 ### CLDR License diff --git a/src/jdk.localedata/share/legal/cldr.md b/src/jdk.localedata/share/legal/cldr.md index 7e07378f2c1..fba90f6e9d4 100644 --- a/src/jdk.localedata/share/legal/cldr.md +++ b/src/jdk.localedata/share/legal/cldr.md @@ -1,4 +1,4 @@ -## Unicode Common Local Data Repository (CLDR) v35.1 +## Unicode Common Local Data Repository (CLDR) v36 ### CLDR License From 5ed4b9f2c0a1572da09fef84aaf0ce899689c4c2 Mon Sep 17 00:00:00 2001 From: Jesper Wilhelmsson Date: Fri, 7 Feb 2020 00:17:01 +0100 Subject: [PATCH 23/50] Added tag jdk-14+36 for changeset bc54620a3848 --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index 96c22bf7a44..a0c6d841593 100644 --- a/.hgtags +++ b/.hgtags @@ -610,3 +610,4 @@ decd3d2953b640f1043ee76953ff89238bff92e8 jdk-14+31 f728b6c7f4910d6bd6070cb4dde8393f4ba95113 jdk-14+33 a96bc204e3b31ddbf909b20088964112f052927e jdk-14+34 4a87bb7ebfd7f6a25ec59a5982fe3607242777f8 jdk-14+35 +bc54620a3848c26cff9766e5e2a6e5ddab98ed18 jdk-14+36 From 214edaf9c200c0614d841054c5040702c7cb76b6 Mon Sep 17 00:00:00 2001 From: Mikhailo Seledtsov Date: Fri, 7 Feb 2020 13:04:00 -0800 Subject: [PATCH 24/50] 8219999: TestJFREvents container test should not use jdk.CPUInformation event for container CPU values Updated the testcase not to test jdk.CPUInformation Reviewed-by: egahlin --- .../containers/docker/TestJFREvents.java | 29 ++++++++++--------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/test/hotspot/jtreg/containers/docker/TestJFREvents.java b/test/hotspot/jtreg/containers/docker/TestJFREvents.java index 0b30e66b20f..6b27ee03baf 100644 --- a/test/hotspot/jtreg/containers/docker/TestJFREvents.java +++ b/test/hotspot/jtreg/containers/docker/TestJFREvents.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2020, 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 @@ -60,11 +60,6 @@ public class TestJFREvents { DockerTestUtils.buildJdkDockerImage(imageName, "Dockerfile-BasicTest", "jdk-docker"); try { - // leave one CPU for system and tools, otherwise this test may be unstable - int maxNrOfAvailableCpus = availableCPUs - 1; - for (int i=1; i < maxNrOfAvailableCpus; i = i * 2) { - testCPUInfo(i, i); - } long MB = 1024*1024; testMemory("200m", "" + 200*MB); @@ -79,18 +74,26 @@ public class TestJFREvents { } } + // This test case is currently not in use. + // Once new Container events are available, this test case can be used to test + // processor-related configuration such as active processor count (see JDK-8203359). + private static void cpuTestCase() throws Exception { + // leave one CPU for system and tools, otherwise this test may be unstable + int maxNrOfAvailableCpus = availableCPUs - 1; + for (int i=1; i < maxNrOfAvailableCpus; i = i * 2) { + testCPUInfo("jdk.ContainerConfiguration", i, i); + } + } - private static void testCPUInfo(int valueToSet, int expectedValue) throws Exception { + private static void testCPUInfo(String eventName, int valueToSet, int expectedValue) throws Exception { Common.logNewTestCase("CPUInfo: --cpus = " + valueToSet); + String fieldName = "activeProcessorCount"; DockerTestUtils.dockerRunJava( commonDockerOpts() .addDockerOpts("--cpus=" + valueToSet) - .addClassOptions("jdk.CPUInformation")) - .shouldHaveExitValue(0); - // The following assertion is currently disabled due to JFR reporting incorrect values. - // JFR reports values for the host system as opposed to values for the container. - // @ignore 8219999 - // .shouldContain("cores = " + expectedValue"); + .addClassOptions(eventName)) + .shouldHaveExitValue(0) + .shouldContain(fieldName + " = " + expectedValue); } From c33107053b6bd22e16a86d25d414a92b496348ed Mon Sep 17 00:00:00 2001 From: Jonathan Gibbons Date: Fri, 7 Feb 2020 16:16:01 -0800 Subject: [PATCH 25/50] 8238648: Rename and simplify Utils.WeakSoftHashMap Reviewed-by: hannesw --- .../internal/doclets/toolkit/util/Utils.java | 135 +++++++----------- 1 file changed, 48 insertions(+), 87 deletions(-) diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Utils.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Utils.java index d2aa865035f..3ee748dfa26 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Utils.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Utils.java @@ -32,9 +32,28 @@ import java.text.CollationKey; import java.text.Collator; import java.text.ParseException; import java.text.RuleBasedCollator; -import java.util.*; -import java.util.AbstractMap.SimpleEntry; +import java.util.ArrayDeque; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.Comparator; +import java.util.Deque; +import java.util.EnumSet; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Locale; +import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; +import java.util.SortedSet; +import java.util.TreeMap; +import java.util.TreeSet; import java.util.function.Predicate; import java.util.stream.Collectors; @@ -937,7 +956,7 @@ public class Utils { * @return */ public TypeMirror getDeclaredType(Collection values, - TypeElement enclosing, TypeMirror target) { + TypeElement enclosing, TypeMirror target) { TypeElement targetElement = asTypeElement(target); List targetTypeArgs = targetElement.getTypeParameters(); if (targetTypeArgs.isEmpty()) { @@ -2546,7 +2565,7 @@ public class Utils { }.visit(e); } - EnumSet nestedKinds = EnumSet.of(ANNOTATION_TYPE, CLASS, ENUM, INTERFACE); + Set nestedKinds = EnumSet.of(ANNOTATION_TYPE, CLASS, ENUM, INTERFACE); void recursiveGetItems(Collection list, Element e, boolean filter, ElementKind... select) { list.addAll(getItems0(e, filter, select)); List classes = getItems0(e, filter, nestedKinds); @@ -2559,7 +2578,7 @@ public class Utils { } private List getItems0(Element te, boolean filter, ElementKind... select) { - EnumSet kinds = EnumSet.copyOf(Arrays.asList(select)); + Set kinds = EnumSet.copyOf(Arrays.asList(select)); return getItems0(te, filter, kinds); } @@ -3002,14 +3021,14 @@ public class Utils { return doctree.getKind() == match; } - private final WeakSoftHashMap wksMap = new WeakSoftHashMap(this); + private final CommentHelperCache commentHelperCache = new CommentHelperCache(this); public CommentHelper getCommentHelper(Element element) { - return wksMap.computeIfAbsent(element); + return commentHelperCache.computeIfAbsent(element); } public void removeCommentHelper(Element element) { - wksMap.remove(element); + commentHelperCache.remove(element); } public List getBlockTags(Element element) { @@ -3177,13 +3196,13 @@ public class Utils { } public DocCommentTree getDocCommentTree(Element element) { - CommentHelper ch = wksMap.get(element); + CommentHelper ch = commentHelperCache.get(element); if (ch != null) { return ch.dctree; } DocCommentTree dcTree = getDocCommentTree0(element); if (dcTree != null) { - wksMap.put(element, new CommentHelper(configuration, element, getTreePath(element), dcTree)); + commentHelperCache.put(element, new CommentHelper(configuration, element, getTreePath(element), dcTree)); } return dcTree; } @@ -3297,106 +3316,48 @@ public class Utils { return outer; } - static class WeakSoftHashMap implements Map { + /** + * A memory-sensitive cache for {@link CommentHelper} objects, + * which are expensive to compute. + */ + private static class CommentHelperCache { - private final WeakHashMap> wkMap; + private final Map> map; private final Utils utils; - public WeakSoftHashMap(Utils utils) { - wkMap = new WeakHashMap<>(); + + public CommentHelperCache(Utils utils) { + map = new HashMap<>(); this.utils = utils; } - @Override - public boolean containsKey(Object key) { - return wkMap.containsKey(key); - } - - @Override - public Collection values() { - Set out = new LinkedHashSet<>(); - for (SoftReference v : wkMap.values()) { - out.add(v.get()); - } - return out; - } - - @Override - public boolean containsValue(Object value) { - return wkMap.containsValue(new SoftReference<>((CommentHelper)value)); - } - - @Override - public CommentHelper remove(Object key) { - SoftReference value = wkMap.remove(key); + public CommentHelper remove(Element key) { + SoftReference value = map.remove(key); return value == null ? null : value.get(); } - - @Override public CommentHelper put(Element key, CommentHelper value) { - SoftReference nvalue = wkMap.put(key, new SoftReference<>(value)); - return nvalue == null ? null : nvalue.get(); + SoftReference prev = map.put(key, new SoftReference<>(value)); + return prev == null ? null : prev.get(); } - @Override public CommentHelper get(Object key) { - SoftReference value = wkMap.get(key); + SoftReference value = map.get(key); return value == null ? null : value.get(); } - @Override - public int size() { - return wkMap.size(); - } - - @Override - public boolean isEmpty() { - return wkMap.isEmpty(); - } - - @Override - public void clear() { - wkMap.clear(); - } - public CommentHelper computeIfAbsent(Element key) { - if (wkMap.containsKey(key)) { - SoftReference value = wkMap.get(key); + SoftReference refValue = map.get(key); + if (refValue != null) { + CommentHelper value = refValue.get(); if (value != null) { - CommentHelper cvalue = value.get(); - if (cvalue != null) { - return cvalue; - } + return value; } } CommentHelper newValue = new CommentHelper(utils.configuration, key, utils.getTreePath(key), utils.getDocCommentTree(key)); - wkMap.put(key, new SoftReference<>(newValue)); + map.put(key, new SoftReference<>(newValue)); return newValue; } - - - @Override - public void putAll(Map map) { - for (Map.Entry entry : map.entrySet()) { - put(entry.getKey(), entry.getValue()); - } - } - - @Override - public Set keySet() { - return wkMap.keySet(); - } - - @Override - public Set> entrySet() { - Set> out = new LinkedHashSet<>(); - for (Element e : wkMap.keySet()) { - SimpleEntry n = new SimpleEntry<>(e, get(e)); - out.add(n); - } - return out; - } } /** From faa88c1da68a94c520f947832614ef5816f43c9f Mon Sep 17 00:00:00 2001 From: Jonathan Gibbons Date: Fri, 7 Feb 2020 16:43:09 -0800 Subject: [PATCH 26/50] 8238506: fix obsolete comments and inconsistent exceptions in BaseTaglet Reviewed-by: prappo --- .../toolkit/taglets/BasePropertyTaglet.java | 16 ++----- .../doclets/toolkit/taglets/BaseTaglet.java | 10 +++++ .../doclets/toolkit/taglets/Taglet.java | 39 +++++++++-------- .../doclets/toolkit/taglets/ThrowsTaglet.java | 42 +++++++++---------- .../jdk/javadoc/internal/tool/Start.java | 14 +++---- 5 files changed, 59 insertions(+), 62 deletions(-) diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/BasePropertyTaglet.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/BasePropertyTaglet.java index dae3c7bcf01..b7c58ff3826 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/BasePropertyTaglet.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/BasePropertyTaglet.java @@ -49,23 +49,13 @@ public abstract class BasePropertyTaglet extends BaseTaglet { } /** - * This method returns the text to be put in the resulting javadoc before - * the property name. + * Returns the text to be included in the documentation before the property name. * - * @param tagletWriter the taglet writer for output - * @return the string to be put in the resulting javadoc. + * @param tagletWriter the taglet-writer used by the doclet + * @return the text to be included in the documentation before the property name */ abstract String getText(TagletWriter tagletWriter); - /** - * Given the Tag representation of this custom - * tag, return its string representation, which is output - * to the generated page. - * @param element - * @param tag the Tag representation of this custom tag. - * @param tagletWriter the taglet writer for output. - * @return the TagletOutput representation of this Tag. - */ @Override public Content getTagletOutput(Element element, DocTree tag, TagletWriter tagletWriter) { return tagletWriter.propertyTagOutput(element, tag, getText(tagletWriter)); diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/BaseTaglet.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/BaseTaglet.java index 9958e10b4a7..ffd7303a21d 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/BaseTaglet.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/BaseTaglet.java @@ -188,11 +188,21 @@ public class BaseTaglet implements Taglet { : tree.getKind() == tagKind; } + /** + * {@inheritDoc} + * + * @implSpec This implementation throws {@link UnsupportedTagletOperationException}. + */ @Override public Content getTagletOutput(Element element, DocTree tag, TagletWriter writer) { throw new UnsupportedTagletOperationException("Method not supported in taglet " + getName() + "."); } + /** + * {@inheritDoc} + * + * @implSpec This implementation throws {@link UnsupportedTagletOperationException} + */ @Override public Content getTagletOutput(Element holder, TagletWriter writer) { throw new UnsupportedTagletOperationException("Method not supported in taglet " + getName() + "."); diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/Taglet.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/Taglet.java index 3d355a2e5a9..0d360a88dc0 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/Taglet.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/Taglet.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2020, 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 @@ -135,29 +135,28 @@ public interface Taglet { String getName(); /** - * Given the Tag representation of this custom - * tag, return its Content representation, which is output - * to the generated page. - * @param holder the element holding the tag - * @param tag the Tag representation of this custom tag. - * @param writer a {@link TagletWriter} Taglet writer. - * @throws UnsupportedOperationException thrown when the method is not supported by the taglet. - * @return the Content representation of this Tag. + * Returns the content to be included in the generated output for an + * instance of a tag handled by this taglet. + * + * @param element the element for the enclosing doc comment + * @param tag the tag + * @param writer the taglet-writer used in this doclet + * @return the output for this tag + * @throws UnsupportedTagletOperationException thrown when the method is not supported by the taglet */ - Content getTagletOutput(Element holder, DocTree tag, TagletWriter writer) throws - UnsupportedOperationException; + Content getTagletOutput(Element element, DocTree tag, TagletWriter writer) throws + UnsupportedTagletOperationException; /** - * Given an element object, check if it holds any tags of - * this type. If it does, return the content representing the output. - * If it does not, return null. - * @param holder an element holding the custom tag. - * @param writer a {@link TagletWriter} Taglet writer. - * @throws UnsupportedTagletOperationException thrown when the method is not - * supported by the taglet. - * @return the content representation of this Tag. + * Returns the content to be included in the generated output for all + * instances of tags handled by this taglet. + * + * @param element the element for the enclosing doc comment + * @param writer the taglet-writer used in this doclet + * @return the output for this tag + * @throws UnsupportedTagletOperationException thrown when the method is not supported by the taglet */ - Content getTagletOutput(Element holder, TagletWriter writer) throws + Content getTagletOutput(Element element, TagletWriter writer) throws UnsupportedTagletOperationException; class UnsupportedTagletOperationException extends UnsupportedOperationException { diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/ThrowsTaglet.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/ThrowsTaglet.java index dc7318b692e..4342cd30917 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/ThrowsTaglet.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/ThrowsTaglet.java @@ -77,21 +77,20 @@ public class ThrowsTaglet extends BaseTaglet ? ch.getExceptionName(input.docTreeInfo.docTree).getSignature() : utils.getFullyQualifiedName(exception); } else { - TypeElement element = input.utils.findClass(input.element, input.tagId); - exception = (element == null) ? null : element; + exception = input.utils.findClass(input.element, input.tagId); } for (DocTree dt : input.utils.getThrowsTrees(input.element)) { - Element texception = ch.getException(utils.configuration, dt); - if (texception != null && (input.tagId.equals(utils.getSimpleName(texception)) || - (input.tagId.equals(utils.getFullyQualifiedName(texception))))) { + Element exc = ch.getException(utils.configuration, dt); + if (exc != null && (input.tagId.equals(utils.getSimpleName(exc)) || + (input.tagId.equals(utils.getFullyQualifiedName(exc))))) { output.holder = input.element; output.holderTag = dt; output.inlineTags = ch.getBody(input.utils.configuration, output.holderTag); output.tagList.add(dt); - } else if (exception != null && texception != null && - utils.isTypeElement(texception) && utils.isTypeElement(exception) && - utils.isSubclassOf((TypeElement)texception, (TypeElement)exception)) { + } else if (exception != null && exc != null && + utils.isTypeElement(exc) && utils.isTypeElement(exception) && + utils.isSubclassOf((TypeElement)exc, (TypeElement)exception)) { output.tagList.add(dt); } } @@ -106,15 +105,15 @@ public class ThrowsTaglet extends BaseTaglet Content result = writer.getOutputInstance(); //Add links to the exceptions declared but not documented. for (TypeMirror declaredExceptionType : declaredExceptionTypes) { - TypeElement klass = utils.asTypeElement(declaredExceptionType); - if (klass != null && + TypeElement te = utils.asTypeElement(declaredExceptionType); + if (te != null && !alreadyDocumented.contains(declaredExceptionType.toString()) && - !alreadyDocumented.contains(utils.getFullyQualifiedName(klass, false))) { + !alreadyDocumented.contains(utils.getFullyQualifiedName(te, false))) { if (alreadyDocumented.isEmpty()) { result.add(writer.getThrowsHeader()); } result.add(writer.throwsTagOutput(declaredExceptionType)); - alreadyDocumented.add(utils.getSimpleName(klass)); + alreadyDocumented.add(utils.getSimpleName(te)); } } return result; @@ -176,18 +175,17 @@ public class ThrowsTaglet extends BaseTaglet } /** - * Given an array of Tags representing this custom - * tag, return its string representation. - * @param throwTags the array of ThrowsTags to convert. - * @param writer the TagletWriter that will write this tag. - * @param alreadyDocumented the set of exceptions that have already - * been documented. - * @param allowDups True if we allow duplicate throws tags to be documented. - * @return the Content representation of this Tag. + * Returns the generated content for a collection of {@code @throws} tags. + * + * @param throwTags the collection of tags to be converted + * @param writer the taglet-writer used by the doclet + * @param alreadyDocumented the set of exceptions that have already been documented + * @param allowDuplicates {@code true} if we allow duplicate tags to be documented + * @return the generated content for the tags */ protected Content throwsTagsOutput(Map, ExecutableElement> throwTags, TagletWriter writer, Set alreadyDocumented, - Map typeSubstitutions, boolean allowDups) { + Map typeSubstitutions, boolean allowDuplicates) { Utils utils = writer.configuration().utils; Content result = writer.getOutputInstance(); if (!throwTags.isEmpty()) { @@ -198,7 +196,7 @@ public class ThrowsTaglet extends BaseTaglet Element te = ch.getException(utils.configuration, dt); String excName = ch.getExceptionName(dt).toString(); TypeMirror substituteType = typeSubstitutions.get(excName); - if ((!allowDups) && + if ((!allowDuplicates) && (alreadyDocumented.contains(excName) || (te != null && alreadyDocumented.contains(utils.getFullyQualifiedName(te, false)))) || (substituteType != null && alreadyDocumented.contains(substituteType.toString()))) { diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/Start.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/Start.java index 3e54c82c6bc..106f7c971bf 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/Start.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/Start.java @@ -399,14 +399,14 @@ public class Start { Throwable t = e.getCause(); dumpStack(t == null ? e : t); return ERROR; - } catch (OptionException toe) { - if (toe.message != null) - messager.printError(toe.message); + } catch (OptionException oe) { + if (oe.message != null) + messager.printError(oe.message); - toe.m.run(); - Throwable t = toe.getCause(); - dumpStack(t == null ? toe : t); - return toe.result; + oe.m.run(); + Throwable t = oe.getCause(); + dumpStack(t == null ? oe : t); + return oe.result; } catch (ToolException exc) { if (exc.message != null) { messager.printError(exc.message); From 3461ce98003534b0fb5e13a50b1ec8dae26c17d1 Mon Sep 17 00:00:00 2001 From: Jonathan Gibbons Date: Fri, 7 Feb 2020 17:00:23 -0800 Subject: [PATCH 27/50] 8238437: Support separate locales for console messages and HTML content Reviewed-by: prappo --- .../formats/html/AbstractMemberWriter.java | 2 +- .../doclets/formats/html/Contents.java | 4 +- .../formats/html/HtmlConfiguration.java | 40 +++-- .../formats/html/HtmlDocletWriter.java | 2 +- .../doclets/formats/html/HtmlOptions.java | 49 +++--- .../doclets/formats/html/LinkFactoryImpl.java | 2 +- .../formats/html/SourceToHTMLConverter.java | 2 +- .../formats/html/TagletWriterImpl.java | 2 +- .../formats/html/markup/Navigation.java | 2 +- .../doclets/toolkit/AbstractDoclet.java | 2 +- .../doclets/toolkit/BaseConfiguration.java | 28 ++-- .../internal/doclets/toolkit/BaseOptions.java | 4 +- .../doclets/toolkit/CommentUtils.java | 4 +- .../internal/doclets/toolkit/Messages.java | 20 ++- .../internal/doclets/toolkit/Resources.java | 1 - .../toolkit/builders/AbstractBuilder.java | 2 +- .../doclets/toolkit/taglets/ParamTaglet.java | 4 +- .../toolkit/taglets/PropertyGetterTaglet.java | 11 +- .../toolkit/taglets/PropertySetterTaglet.java | 4 +- .../toolkit/taglets/TagletManager.java | 2 +- .../internal/doclets/toolkit/util/Extern.java | 4 +- .../internal/doclets/toolkit/util/Group.java | 8 +- .../doclets/toolkit/util/MetaKeywords.java | 2 +- .../toolkit/util/StandardDocFileFactory.java | 2 +- .../internal/doclets/toolkit/util/Utils.java | 2 +- .../jdk/javadoc/internal/tool/Start.java | 23 +-- .../javadoc/doclet/testSearch/TestSearch.java | 75 +++++++-- .../testLocaleOption/TestLocaleOption.java | 150 ++++++++++++------ 28 files changed, 267 insertions(+), 186 deletions(-) diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractMemberWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractMemberWriter.java index 67c5869504a..11cf718aac1 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractMemberWriter.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractMemberWriter.java @@ -89,7 +89,7 @@ public abstract class AbstractMemberWriter implements MemberSummaryWriter { this.typeElement = typeElement; this.utils = configuration.utils; this.contents = configuration.contents; - this.resources = configuration.resources; + this.resources = configuration.docResources; this.links = writer.links; } diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/Contents.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/Contents.java index a453ff78b5a..e722b3560f4 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/Contents.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/Contents.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2020, 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 @@ -182,7 +182,7 @@ public class Contents { * resources used to look up resource keys, and other details. */ Contents(HtmlConfiguration configuration) { - this.resources = configuration.getResources(); + this.resources = configuration.getDocResources(); allClassesLabel = getNonBreakContent("doclet.All_Classes"); allImplementedInterfacesLabel = getContent("doclet.All_Implemented_Interfaces"); diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlConfiguration.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlConfiguration.java index 93f3762fe34..3dc3d0febdf 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlConfiguration.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlConfiguration.java @@ -78,7 +78,7 @@ public class HtmlConfiguration extends BaseConfiguration { */ public static final String HTML_DEFAULT_CHARSET = "utf-8"; - public final Resources resources; + public final Resources docResources; /** * First file to appear in the right-hand frame in the generated @@ -133,17 +133,31 @@ public class HtmlConfiguration extends BaseConfiguration { */ public HtmlConfiguration(Doclet doclet, Locale locale, Reporter reporter) { super(doclet, locale, reporter); - resources = new Resources(locale, + + // Use the default locale for console messages. + Resources msgResources = new Resources(Locale.getDefault(), BaseConfiguration.sharedResourceBundleName, "jdk.javadoc.internal.doclets.formats.html.resources.standard"); - messages = new Messages(this); + // Use the provided locale for generated docs + // Ideally, the doc resources would be in different resource files than the + // message resources, so that we do not have different copies of the same resources. + if (locale.equals(Locale.getDefault())) { + docResources = msgResources; + } else { + docResources = new Resources(locale, + BaseConfiguration.sharedResourceBundleName, + "jdk.javadoc.internal.doclets.formats.html.resources.standard"); + } + + messages = new Messages(this, msgResources); contents = new Contents(this); options = new HtmlOptions(this); String v; try { - ResourceBundle rb = ResourceBundle.getBundle(versionBundleName, getLocale()); + // the version bundle is not localized + ResourceBundle rb = ResourceBundle.getBundle(versionBundleName, Locale.getDefault()); try { v = rb.getString("release"); } catch (MissingResourceException e) { @@ -166,10 +180,15 @@ public class HtmlConfiguration extends BaseConfiguration { } @Override - public Resources getResources() { - return resources; + public Resources getDocResources() { + return docResources; } + /** + * Returns a utility object providing commonly used fragments of content. + * + * @return a utility object providing commonly used fragments of content + */ public Contents getContents() { return contents; } @@ -335,12 +354,7 @@ public class HtmlConfiguration extends BaseConfiguration { Character unicode = (tagLabel.length() == 0) ? '*' : Character.toUpperCase(tagLabel.charAt(0)); - List list = tagSearchIndexMap.get(unicode); - if (list == null) { - list = new ArrayList<>(); - tagSearchIndexMap.put(unicode, list); - } - list.add(sii); + tagSearchIndexMap.computeIfAbsent(unicode, k -> new ArrayList<>()).add(sii); } tagSearchIndexKeys = tagSearchIndexMap.keySet(); } @@ -359,7 +373,7 @@ public class HtmlConfiguration extends BaseConfiguration { if (options.charset() == null) { options.setCharset(options.docEncoding()); } else if (!options.charset().equals(options.docEncoding())) { - reporter.print(ERROR, resources.getText("doclet.Option_conflict", "-charset", "-docencoding")); + messages.error("doclet.Option_conflict", "-charset", "-docencoding"); return false; } } diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java index bcd8ec13a8a..34062eba539 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java @@ -213,7 +213,7 @@ public class HtmlDocletWriter { this.options = configuration.getOptions(); this.contents = configuration.contents; this.messages = configuration.messages; - this.resources = configuration.resources; + this.resources = configuration.docResources; this.links = new Links(path); this.utils = configuration.utils; this.path = path; diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlOptions.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlOptions.java index ba1848bf42a..8f1b9051de3 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlOptions.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlOptions.java @@ -33,15 +33,12 @@ import java.util.Set; import java.util.TreeSet; import com.sun.tools.doclint.DocLint; -import jdk.javadoc.doclet.Reporter; import jdk.javadoc.internal.doclets.toolkit.BaseOptions; +import jdk.javadoc.internal.doclets.toolkit.Messages; import jdk.javadoc.internal.doclets.toolkit.Resources; import jdk.javadoc.internal.doclets.toolkit.util.DocFile; import jdk.javadoc.internal.doclets.toolkit.util.Utils; -import static javax.tools.Diagnostic.Kind.ERROR; -import static javax.tools.Diagnostic.Kind.WARNING; - /** * Storage for all options supported by the * {@link jdk.javadoc.doclet.StandardDoclet standard doclet}, @@ -199,8 +196,8 @@ public class HtmlOptions extends BaseOptions { @Override public Set getSupportedOptions() { - Resources resources = config.getResources(); - Reporter reporter = config.getReporter(); + Messages messages = config.getMessages(); + Resources resources = messages.getResources(); List", - "", - ""); + @Test + public void testHelloWorldDefault_ALLCAPS(Path base) throws Exception { + testHelloWorld(base, ALLCAPS, null); } @Test public void testHelloWorldLocale(Path base) throws Exception { + testHelloWorld(base, null, ALLCAPS); + } + + private void testHelloWorld(Path base, Locale defaultLocale, Locale localeOption) throws Exception { Path apiDir = base.resolve("api"); - String stdOut = javadoc(patchDir, - "-locale", LOCALE, + String stdOut = javadoc(defaultLocale, + localeOption, "-sourcepath", srcDir.toString(), "-d", apiDir.toString(), "p") .writeAll() .getOutput(Task.OutputKind.STDOUT); - checkContains(stdOut, - "LOADING SOURCE FILES FOR PACKAGE p...\n" - + "CONSTRUCTING JAVADOC INFORMATION..."); + // check console messages + if (Objects.equals(defaultLocale, ALLCAPS)) { + checkContains(stdOut, + "LOADING SOURCE FILES FOR PACKAGE p...\n" + + "CONSTRUCTING JAVADOC INFORMATION..."); + } else { + checkContains(stdOut, + "Loading source files for package p...\n" + + "Constructing Javadoc information..."); + } + // check generated files String hw = Files.readString(apiDir.resolve("p/HelloWorld.html")); - checkContains(hw, - "

    METHOD SUMMARY

    ", - "", - "", - ""); + Locale docLocale = localeOption != null ? localeOption : defaultLocale; + if (Objects.equals(docLocale, ALLCAPS)) { + checkContains(hw, + "

    METHOD SUMMARY

    ", + "", + "", + ""); + } else { + checkContains(hw, + "

    Method Summary

    ", + "", + "", + ""); + } } + /** + * Generates a copy of a resource bundle, with the values converted to uppercase. + * + * @param dir the root directory in which to write the bundle + * @param name the name of the bundle + * @throws Exception if an error occurs + */ private void generateBundle(Path dir, String name) throws Exception { Module m = Main.class.getModule(); ResourceBundle rb = ResourceBundle.getBundle(name, m); @@ -175,7 +205,8 @@ public class TestLocaleOption extends TestRunner { String value = rb.getString(key); p.put(key, value.toUpperCase(Locale.US)); } - Path outPath = dir.resolve(name.replace(".", File.separator) + "_" + LOCALE + ".properties"); + String localeSuffix = ALLCAPS.toString().replace("-", "_"); + Path outPath = dir.resolve(name.replace(".", File.separator) + "_" + localeSuffix + ".properties"); Files.createDirectories(outPath.getParent()); try (Writer out = Files.newBufferedWriter(outPath)) { p.store(out, "Generated by TestLocaleOption"); @@ -183,10 +214,29 @@ public class TestLocaleOption extends TestRunner { } } - private Task.Result javadoc(Path patchDir, String... args) { + /** + * Runs javadoc, with the specified arguments, + * optionally specifying the default locale and locale option + * + * @param defaultLocale the default locale for the VM, or null if not specified + * @param localeOption the value for the locale option, or null if not specified + * @param args additional command-line args + * @return the task result + */ + private Task.Result javadoc(Locale defaultLocale, Locale localeOption, String... args) { List options = new ArrayList<>(); options.add("-J--patch-module=jdk.javadoc=" + patchDir); + if (defaultLocale != null) { + options.add("-J-Duser.language=" + defaultLocale.getLanguage()); + options.add("-J-Duser.country=" + defaultLocale.getCountry()); + options.add("-J-Duser.variant=" + defaultLocale.getVariant()); + } + if (localeOption != null) { + options.addAll(List.of("-locale", localeOption.toString())); + } options.addAll(List.of(args)); + System.err.println("Options: " + options); + return new JavadocTask(tb, Task.Mode.EXEC) .options(options) .run(); From 7552915d3ff1bf2cb57cf10ec67b57ddf8321d87 Mon Sep 17 00:00:00 2001 From: Jia Huang Date: Sat, 8 Feb 2020 15:46:39 +0800 Subject: [PATCH 28/50] 8238586: [TESTBUG] vmTestbase/jit/tiered/Test.java failed when TieredCompilation is disabled Reviewed-by: iignatyev --- test/hotspot/jtreg/vmTestbase/jit/tiered/Test.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/hotspot/jtreg/vmTestbase/jit/tiered/Test.java b/test/hotspot/jtreg/vmTestbase/jit/tiered/Test.java index 89ea240b96b..a82ae0a3e7c 100644 --- a/test/hotspot/jtreg/vmTestbase/jit/tiered/Test.java +++ b/test/hotspot/jtreg/vmTestbase/jit/tiered/Test.java @@ -49,7 +49,7 @@ import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.process.ProcessTools; public class Test { - private static String UNSUPPORTED_OPTION_MESSAGE = "-XX:TieredCompilation not supported in this VM"; + private static String UNSUPPORTED_OPTION_MESSAGE = "-XX:+TieredCompilation not supported in this VM"; private static String REGEXP = "^[0-9.]+: \\[compile level=\\d"; public static void main(String[] args) throws Exception { { @@ -59,7 +59,7 @@ public class Test { "-XX:+PrintTieredEvents", "-version"); var output = new OutputAnalyzer(pb.start()); - if (output.getStdout().contains(UNSUPPORTED_OPTION_MESSAGE)) { + if (output.getStderr().contains(UNSUPPORTED_OPTION_MESSAGE)) { throw new SkippedException(UNSUPPORTED_OPTION_MESSAGE); } output.shouldHaveExitValue(0) From ac69c7894dafa684b9c61672ea57411895466e19 Mon Sep 17 00:00:00 2001 From: Claes Redestad Date: Sat, 8 Feb 2020 15:21:25 +0100 Subject: [PATCH 29/50] 8238684: Override getOrDefault in immutable Map implementation Reviewed-by: forax, psandoz, smarks --- .../classes/java/util/ImmutableCollections.java | 14 ++++++++++++++ .../openjdk/bench/java/util/ImmutableColls.java | 10 ++++++++++ 2 files changed, 24 insertions(+) diff --git a/src/java.base/share/classes/java/util/ImmutableCollections.java b/src/java.base/share/classes/java/util/ImmutableCollections.java index 950c55dff7d..91fe4c6965d 100644 --- a/src/java.base/share/classes/java/util/ImmutableCollections.java +++ b/src/java.base/share/classes/java/util/ImmutableCollections.java @@ -904,6 +904,20 @@ class ImmutableCollections { @Override public V replace(K key, V value) { throw uoe(); } @Override public boolean replace(K key, V oldValue, V newValue) { throw uoe(); } @Override public void replaceAll(BiFunction f) { throw uoe(); } + + /** + * @implNote {@code null} values are disallowed in these immutable maps, + * so we can improve upon the default implementation since a + * {@code null} return from {@code get(key)} always means the default + * value should be returned. + */ + @Override + public V getOrDefault(Object key, V defaultValue) { + V v; + return ((v = get(key)) != null) + ? v + : defaultValue; + } } static final class Map1 extends AbstractImmutableMap { diff --git a/test/micro/org/openjdk/bench/java/util/ImmutableColls.java b/test/micro/org/openjdk/bench/java/util/ImmutableColls.java index 018870a4b36..197312852a2 100644 --- a/test/micro/org/openjdk/bench/java/util/ImmutableColls.java +++ b/test/micro/org/openjdk/bench/java/util/ImmutableColls.java @@ -34,6 +34,9 @@ import java.util.concurrent.TimeUnit; */ @State(Scope.Benchmark) @OutputTimeUnit(TimeUnit.MICROSECONDS) +@Fork(value = 3) +@Warmup(iterations = 5, time = 1, timeUnit = TimeUnit.SECONDS) +@Measurement(iterations = 5, time = 2, timeUnit = TimeUnit.SECONDS) public class ImmutableColls { public static String[] STRINGS = {"hi", "all", "of", "you"}; @@ -217,6 +220,13 @@ public class ImmutableColls { fm4.containsValue("hi"); } + @Benchmark + @CompilerControl(CompilerControl.Mode.DONT_INLINE) + public void getOrDefault(Blackhole bh) { + bh.consume(fm4.getOrDefault("hi", "test")); + bh.consume(fm4.getOrDefault("not_in_this_map", "test")); + } + public int sizeOf(List list) { return list.size(); } From f1a2c6019e6b2da98fef8496d7f21b79e89648aa Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Mon, 10 Feb 2020 06:18:10 +0100 Subject: [PATCH 30/50] 8238366: CTW runner closes standard output on exit Reviewed-by: adinn, iignatyev --- .../ctw/src/sun/hotspot/tools/ctw/CompileTheWorld.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test/hotspot/jtreg/testlibrary/ctw/src/sun/hotspot/tools/ctw/CompileTheWorld.java b/test/hotspot/jtreg/testlibrary/ctw/src/sun/hotspot/tools/ctw/CompileTheWorld.java index 24978b04679..7052fefe3b8 100644 --- a/test/hotspot/jtreg/testlibrary/ctw/src/sun/hotspot/tools/ctw/CompileTheWorld.java +++ b/test/hotspot/jtreg/testlibrary/ctw/src/sun/hotspot/tools/ctw/CompileTheWorld.java @@ -99,9 +99,11 @@ public class CompileTheWorld { } catch (Throwable t){ t.printStackTrace(ERR); } finally { - try { - OUT.close(); - } catch (Throwable ignore) { + if (OUT != System.out) { + try { + OUT.close(); + } catch (Throwable ignore) { + } } // might have started new threads System.exit(passed ? 0 : 1); From 970283b6014336189f994d6c4b36925d0a5f99ad Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Mon, 10 Feb 2020 06:18:28 +0100 Subject: [PATCH 31/50] 8238247: CTW runner should sweep nmethods more aggressively Reviewed-by: adinn, simonis, iignatyev --- .../testlibrary/ctw/src/sun/hotspot/tools/ctw/Compiler.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/hotspot/jtreg/testlibrary/ctw/src/sun/hotspot/tools/ctw/Compiler.java b/test/hotspot/jtreg/testlibrary/ctw/src/sun/hotspot/tools/ctw/Compiler.java index 9a2489c84a8..fb13eb8d986 100644 --- a/test/hotspot/jtreg/testlibrary/ctw/src/sun/hotspot/tools/ctw/Compiler.java +++ b/test/hotspot/jtreg/testlibrary/ctw/src/sun/hotspot/tools/ctw/Compiler.java @@ -150,6 +150,9 @@ public class Compiler { } else { compileAtLevel(compLevel); } + + // Make the method eligible for sweeping sooner + WHITE_BOX.deoptimizeMethod(method); } private void waitCompilation() { From 71d7af4b236cab0892602d5fcd4c0c6851fa2cc1 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Mon, 10 Feb 2020 06:18:46 +0100 Subject: [PATCH 32/50] 8238591: CTW: Split applications/ctw/modules/jdk_localedata.java Reviewed-by: iignatyev --- test/hotspot/jtreg/TEST.groups | 1 + .../ctw/modules/jdk_localedata.java | 6 +-- .../ctw/modules/jdk_localedata_2.java | 39 +++++++++++++++++++ 3 files changed, 43 insertions(+), 3 deletions(-) create mode 100644 test/hotspot/jtreg/applications/ctw/modules/jdk_localedata_2.java diff --git a/test/hotspot/jtreg/TEST.groups b/test/hotspot/jtreg/TEST.groups index 945c3421d20..045d9eee99f 100644 --- a/test/hotspot/jtreg/TEST.groups +++ b/test/hotspot/jtreg/TEST.groups @@ -177,6 +177,7 @@ ctw_3 = \ applications/ctw/modules/jdk_compiler.java \ applications/ctw/modules/jdk_internal_vm_compiler.java \ applications/ctw/modules/jdk_localedata.java \ + applications/ctw/modules/jdk_localedata_2.java \ applications/ctw/modules/jdk_scripting_nashorn.java \ tier1_gc = \ diff --git a/test/hotspot/jtreg/applications/ctw/modules/jdk_localedata.java b/test/hotspot/jtreg/applications/ctw/modules/jdk_localedata.java index 58366b975c2..4e128b707b2 100644 --- a/test/hotspot/jtreg/applications/ctw/modules/jdk_localedata.java +++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_localedata.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2020, 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 @@ -23,7 +23,7 @@ /* * @test - * @summary run CTW for all classes from jdk.localedata module + * @summary run CTW for some classes from jdk.localedata module * * @library /test/lib / /testlibrary/ctw/src * @modules java.base/jdk.internal.access @@ -35,5 +35,5 @@ * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission - * @run driver/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.localedata + * @run driver/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.localedata 0% 50% */ diff --git a/test/hotspot/jtreg/applications/ctw/modules/jdk_localedata_2.java b/test/hotspot/jtreg/applications/ctw/modules/jdk_localedata_2.java new file mode 100644 index 00000000000..c2bedb3cd55 --- /dev/null +++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_localedata_2.java @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2017, 2020, 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 + * @summary run CTW for some classes from jdk.localedata module + * + * @library /test/lib / /testlibrary/ctw/src + * @modules java.base/jdk.internal.access + * java.base/jdk.internal.jimage + * java.base/jdk.internal.misc + * java.base/jdk.internal.reflect + * @modules jdk.localedata + * + * @build sun.hotspot.WhiteBox + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run driver/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.localedata 50% 100% + */ From 04c1e2e931e2c8806ef9cdeaa3b0a50c0d6381c8 Mon Sep 17 00:00:00 2001 From: Sean Coffey Date: Sun, 9 Feb 2020 21:55:56 +0000 Subject: [PATCH 33/50] 8223260: NamingManager should cache InitialContextFactory Reviewed-by: alanb, plevart, dfuchs --- src/java.base/share/classes/module-info.java | 3 +- .../javax/naming/spi/NamingManager.java | 106 ++++++++----- .../javax/naming/spi/DummyContextFactory.java | 139 ++++++++++++++++++ .../naming/spi/DummyContextFactory2.java | 55 +++++++ .../javax/naming/spi/FactoryCacheTest.java | 91 ++++++++++++ 5 files changed, 360 insertions(+), 34 deletions(-) create mode 100644 test/jdk/javax/naming/spi/DummyContextFactory.java create mode 100644 test/jdk/javax/naming/spi/DummyContextFactory2.java create mode 100644 test/jdk/javax/naming/spi/FactoryCacheTest.java diff --git a/src/java.base/share/classes/module-info.java b/src/java.base/share/classes/module-info.java index b6f4c6b2103..0b0dbebeaa1 100644 --- a/src/java.base/share/classes/module-info.java +++ b/src/java.base/share/classes/module-info.java @@ -162,7 +162,8 @@ module java.base { jdk.jlink; exports jdk.internal.loader to java.instrument, - java.logging; + java.logging, + java.naming; exports jdk.internal.jmod to jdk.compiler, jdk.jlink; diff --git a/src/java.naming/share/classes/javax/naming/spi/NamingManager.java b/src/java.naming/share/classes/javax/naming/spi/NamingManager.java index 6e60b6bffa9..0f8086359a5 100644 --- a/src/java.naming/share/classes/javax/naming/spi/NamingManager.java +++ b/src/java.naming/share/classes/javax/naming/spi/NamingManager.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2020, 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 @@ -26,13 +26,15 @@ package javax.naming.spi; import java.net.MalformedURLException; +import java.security.AccessController; +import java.security.PrivilegedAction; import java.util.*; - import javax.naming.*; import com.sun.naming.internal.VersionHelper; import com.sun.naming.internal.ResourceManager; import com.sun.naming.internal.FactoryEnumeration; +import jdk.internal.loader.ClassLoaderValue; /** * This class contains methods for creating context objects @@ -79,6 +81,9 @@ public class NamingManager { */ private static ObjectFactoryBuilder object_factory_builder = null; + private static final ClassLoaderValue FACTORIES_CACHE = + new ClassLoaderValue<>(); + /** * The ObjectFactoryBuilder determines the policy used when * trying to load object factories. @@ -672,6 +677,7 @@ public class NamingManager { */ public static Context getInitialContext(Hashtable env) throws NamingException { + ClassLoader loader; InitialContextFactory factory = null; InitialContextFactoryBuilder builder = getInitialContextFactoryBuilder(); @@ -689,39 +695,22 @@ public class NamingManager { throw ne; } - ServiceLoader loader = - ServiceLoader.load(InitialContextFactory.class); - - Iterator iterator = loader.iterator(); - try { - while (iterator.hasNext()) { - InitialContextFactory f = iterator.next(); - if (f.getClass().getName().equals(className)) { - factory = f; - break; - } - } - } catch (ServiceConfigurationError e) { - NoInitialContextException ne = - new NoInitialContextException( - "Cannot load initial context factory " - + "'" + className + "'"); - ne.setRootCause(e); - throw ne; + if (System.getSecurityManager() == null) { + loader = Thread.currentThread().getContextClassLoader(); + if (loader == null) loader = ClassLoader.getSystemClassLoader(); + } else { + PrivilegedAction pa = () -> { + ClassLoader cl = Thread.currentThread().getContextClassLoader(); + return (cl == null) ? ClassLoader.getSystemClassLoader() : cl; + }; + loader = AccessController.doPrivileged(pa); } - if (factory == null) { - try { - @SuppressWarnings("deprecation") - Object o = helper.loadClass(className).newInstance(); - factory = (InitialContextFactory) o; - } catch (Exception e) { - NoInitialContextException ne = - new NoInitialContextException( - "Cannot instantiate class: " + className); - ne.setRootCause(e); - throw ne; - } + var key = FACTORIES_CACHE.sub(className); + try { + factory = key.computeIfAbsent(loader, (ld, ky) -> getFactory(ky.key())); + } catch (FactoryInitializationError e) { + throw e.getCause(); } } else { factory = builder.createInitialContextFactory(env); @@ -730,6 +719,43 @@ public class NamingManager { return factory.getInitialContext(env); } + private static InitialContextFactory getFactory(String className) { + InitialContextFactory factory; + try { + ServiceLoader loader = + ServiceLoader.load(InitialContextFactory.class); + + factory = loader + .stream() + .filter(p -> p.type().getName().equals(className)) + .findFirst() + .map(ServiceLoader.Provider::get) + .orElse(null); + } catch (ServiceConfigurationError e) { + NoInitialContextException ne = + new NoInitialContextException( + "Cannot load initial context factory " + + "'" + className + "'"); + ne.setRootCause(e); + throw new FactoryInitializationError(ne); + } + + if (factory == null) { + try { + @SuppressWarnings("deprecation") + Object o = helper.loadClass(className).newInstance(); + factory = (InitialContextFactory) o; + } catch (Exception e) { + NoInitialContextException ne = + new NoInitialContextException( + "Cannot instantiate class: " + className); + ne.setRootCause(e); + throw new FactoryInitializationError(ne); + } + } + return factory; + } + /** * Sets the InitialContextFactory builder to be builder. @@ -921,4 +947,18 @@ public class NamingManager { return (answer != null) ? answer : obj; } + + private static class FactoryInitializationError extends Error { + @java.io.Serial + static final long serialVersionUID = -5805552256848841560L; + + private FactoryInitializationError(NoInitialContextException cause) { + super(cause); + } + + @Override + public NoInitialContextException getCause() { + return (NoInitialContextException) super.getCause(); + } + } } diff --git a/test/jdk/javax/naming/spi/DummyContextFactory.java b/test/jdk/javax/naming/spi/DummyContextFactory.java new file mode 100644 index 00000000000..e526a765cac --- /dev/null +++ b/test/jdk/javax/naming/spi/DummyContextFactory.java @@ -0,0 +1,139 @@ +/* + * Copyright (c) 2020, 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. + */ + +import java.io.File; +import java.lang.ref.WeakReference; +import java.net.URL; +import java.net.URLClassLoader; +import javax.naming.Context; +import javax.naming.InitialContext; +import javax.naming.NamingException; +import javax.naming.NoInitialContextException; +import javax.naming.spi.InitialContextFactory; +import javax.naming.spi.NamingManager; +import java.util.Hashtable; + +public class DummyContextFactory implements InitialContextFactory { + static final String DUMMY_FACTORY = "DummyContextFactory"; + static final String DUMMY_FACTORY2 = "DummyContextFactory2"; + static final String MISSING_FACTORY = "NonExistant"; + static int counter = 0; + ClassLoader origContextLoader = Thread.currentThread().getContextClassLoader(); + + public static void main(String[] s) throws Exception { + DummyContextFactory dcf = new DummyContextFactory(); + dcf.runTest(); + } + + private void runTest() throws Exception { + final String classes = System.getProperty("url.dir", "."); + final URL curl = new File(classes).toURI().toURL(); + URLClassLoader testLoader = new URLClassLoader(new URL[] {curl}, null); + WeakReference weakRef = new WeakReference<>(testLoader); + Thread.currentThread().setContextClassLoader(testLoader); + Hashtable env = new Hashtable<>(); + env.put(Context.INITIAL_CONTEXT_FACTORY, DUMMY_FACTORY); + testContextCalls(env); + + // now test with another factory + Thread.currentThread().setContextClassLoader(testLoader); + env.put(Context.INITIAL_CONTEXT_FACTORY, DUMMY_FACTORY2); + testContextCalls(env); + + // one count is derived from a default constructor call (ignored for test) + // class associated with this ClassLoader should have 2 counts + if (counter != 2) { + throw new RuntimeException("wrong count: " + counter); + } + + // a test for handling non-existent classes + env.put(Context.INITIAL_CONTEXT_FACTORY, MISSING_FACTORY); + testBadContextCall(env); + + // test that loader gets GC'ed + testLoader = null; + System.gc(); + while (weakRef.get() != null) { + Thread.sleep(100); + System.gc(); + } + } + + private void testContextCalls(Hashtable env) throws Exception { + // the context is returned here but it's the ContextFactory that + // we're mainly interested in. Hence the counter test. + + // 1st call populates the WeakHashMap + // Uses URLClassLoader + Context cxt = NamingManager.getInitialContext(env); + + // 2nd call uses cached factory + cxt = NamingManager.getInitialContext(env); + + Thread.currentThread().setContextClassLoader(origContextLoader); + + // 3rd call uses new factory + // AppClassLoader + cxt = NamingManager.getInitialContext(env); + + // test with null TCCL + // this shouldn't increase the count since a null TCCL + // means we default to System ClassLoader in this case (AppClassLoader) + Thread.currentThread().setContextClassLoader(null); + cxt = NamingManager.getInitialContext(env); + } + + private void testBadContextCall(Hashtable env) throws Exception { + try { + Context cxt = NamingManager.getInitialContext(env); + throw new RuntimeException("Expected NoInitialContextException"); + } catch (NoInitialContextException e) { + if (!(e.getCause() instanceof ClassNotFoundException)) { + throw new RuntimeException("unexpected cause", e.getCause()); + } + } + } + + public DummyContextFactory() { + System.out.println("New DummyContextFactory " + (++counter)); + //new Throwable().printStackTrace(System.out); + } + + @Override + public Context getInitialContext(Hashtable environment) throws NamingException { + return new DummyContext(environment); + } + + public class DummyContext extends InitialContext { + + private Hashtable env; + + DummyContext(Hashtable env) throws NamingException { + this.env = env; + } + + public Hashtable getEnvironment() { + return env; + } + } +} diff --git a/test/jdk/javax/naming/spi/DummyContextFactory2.java b/test/jdk/javax/naming/spi/DummyContextFactory2.java new file mode 100644 index 00000000000..350f64760ad --- /dev/null +++ b/test/jdk/javax/naming/spi/DummyContextFactory2.java @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2020, 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. + */ + +import javax.naming.Context; +import javax.naming.InitialContext; +import javax.naming.NamingException; +import javax.naming.spi.InitialContextFactory; +import java.util.Hashtable; + +public class DummyContextFactory2 implements InitialContextFactory { + static int counter = 0; + + public DummyContextFactory2() { + System.out.println("New DummyContextFactory2 " + (++counter)); + //new Throwable().printStackTrace(System.out); + } + + @Override + public Context getInitialContext(Hashtable environment) throws NamingException { + return new DummyContext(environment); + } + + public class DummyContext extends InitialContext { + + private Hashtable env; + + DummyContext(Hashtable env) throws NamingException { + this.env = env; + } + + public Hashtable getEnvironment() { + return env; + } + } +} \ No newline at end of file diff --git a/test/jdk/javax/naming/spi/FactoryCacheTest.java b/test/jdk/javax/naming/spi/FactoryCacheTest.java new file mode 100644 index 00000000000..29907a6bd4d --- /dev/null +++ b/test/jdk/javax/naming/spi/FactoryCacheTest.java @@ -0,0 +1,91 @@ +/* + * Copyright (c) 2020, 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 8223260 + * @summary NamingManager should cache InitialContextFactory + * @library /test/lib + * @build jdk.test.lib.util.JarUtils jdk.test.lib.process.* + * FactoryCacheTest + * DummyContextFactory + * DummyContextFactory2 + * @run main FactoryCacheTest + */ + +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.List; + +import jdk.test.lib.JDKToolFinder; +import jdk.test.lib.Utils; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.util.JarUtils; + +import static java.nio.file.StandardOpenOption.CREATE; +import static java.util.Arrays.asList; + +import static jdk.test.lib.Utils.TEST_CLASSES; + +public class FactoryCacheTest { + + private static final Path SPIJAR = Path.of("testDir", "ContextFactory.jar"); + private static final String SPIJAR_CP = SPIJAR.toAbsolutePath().toString(); + + public static void main(String[] args) throws Throwable { + List argLine = new ArrayList<>(); + argLine.add(JDKToolFinder.getJDKTool("java")); + argLine.addAll(asList(Utils.getTestJavaOpts())); + argLine.addAll(List.of("-cp", TEST_CLASSES)); + argLine.addAll(List.of("-Durl.dir=" + TEST_CLASSES)); + argLine.add("DummyContextFactory"); + + ProcessTools.executeCommand(argLine.stream() + .filter(t -> !t.isEmpty()) + .toArray(String[]::new)) + .shouldHaveExitValue(0); + + // now test the ServiceLoader approach + setupService(); + argLine = new ArrayList<>(); + argLine.add(JDKToolFinder.getJDKTool("java")); + argLine.addAll(asList(Utils.getTestJavaOpts())); + argLine.addAll(List.of("-cp", SPIJAR_CP)); + argLine.addAll(List.of("-Durl.dir=" + TEST_CLASSES)); + argLine.add("DummyContextFactory"); + + ProcessTools.executeCommand(argLine.stream() + .filter(t -> !t.isEmpty()) + .toArray(String[]::new)) + .shouldHaveExitValue(0); + } + + private static void setupService() throws Exception { + Path xdir = Path.of(TEST_CLASSES); + Path config = xdir.resolve(Path.of(TEST_CLASSES,"META-INF/services/javax.naming.spi.InitialContextFactory")); + Files.createDirectories(config.getParent()); + Files.write(config, "DummyContextFactory".getBytes(), CREATE); + JarUtils.createJarFile(SPIJAR, xdir); + } +} From 6aeb78d3dffe3087049985fe2119a456b51f1f69 Mon Sep 17 00:00:00 2001 From: David Buck Date: Mon, 10 Feb 2020 03:35:50 -0500 Subject: [PATCH 34/50] 8238596: AVX enabled by default for Skylake even when unsupported Only default to UseAVX=2 when support is detected Reviewed-by: shade, vlivanov --- src/hotspot/cpu/x86/vm_version_x86.cpp | 13 ++++++++----- src/hotspot/cpu/x86/vm_version_x86.hpp | 5 ++++- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/hotspot/cpu/x86/vm_version_x86.cpp b/src/hotspot/cpu/x86/vm_version_x86.cpp index b2c3a46e27c..3edda88244f 100644 --- a/src/hotspot/cpu/x86/vm_version_x86.cpp +++ b/src/hotspot/cpu/x86/vm_version_x86.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2020, 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 @@ -672,11 +672,14 @@ void VM_Version::get_processor_features() { } } if (FLAG_IS_DEFAULT(UseAVX)) { - FLAG_SET_DEFAULT(UseAVX, use_avx_limit); - if (is_intel_family_core() && _model == CPU_MODEL_SKYLAKE && _stepping < 5) { - FLAG_SET_DEFAULT(UseAVX, 2); //Set UseAVX=2 for Skylake + // Don't use AVX-512 on older Skylakes unless explicitly requested. + if (use_avx_limit > 2 && is_intel_skylake() && _stepping < 5) { + FLAG_SET_DEFAULT(UseAVX, 2); + } else { + FLAG_SET_DEFAULT(UseAVX, use_avx_limit); } - } else if (UseAVX > use_avx_limit) { + } + if (UseAVX > use_avx_limit) { warning("UseAVX=%d is not supported on this CPU, setting it to UseAVX=%d", (int) UseAVX, use_avx_limit); FLAG_SET_DEFAULT(UseAVX, use_avx_limit); } else if (UseAVX < 0) { diff --git a/src/hotspot/cpu/x86/vm_version_x86.hpp b/src/hotspot/cpu/x86/vm_version_x86.hpp index 22a1f678849..b546fd53631 100644 --- a/src/hotspot/cpu/x86/vm_version_x86.hpp +++ b/src/hotspot/cpu/x86/vm_version_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2020, 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 @@ -868,6 +868,9 @@ public: static bool is_intel_family_core() { return is_intel() && extended_cpu_family() == CPU_FAMILY_INTEL_CORE; } + static bool is_intel_skylake() { return is_intel_family_core() && + extended_cpu_model() == CPU_MODEL_SKYLAKE; } + static bool is_intel_tsc_synched_at_init() { if (is_intel_family_core()) { uint32_t ext_model = extended_cpu_model(); From 0b5d48b9e6f347af9abd3aaf145ae93d512509ff Mon Sep 17 00:00:00 2001 From: Claes Redestad Date: Mon, 10 Feb 2020 12:39:19 +0100 Subject: [PATCH 35/50] 8230301: Re-examine hardcoded defaults in GenerateJLIClassesPlugin Reviewed-by: mchung --- make/GenerateLinkOptData.gmk | 1 + .../build/tools/classlist/HelloClasslist.java | 44 ++++++++-- .../plugins/GenerateJLIClassesPlugin.java | 83 ++++--------------- .../plugins/GenerateJLIClassesPluginTest.java | 22 +---- 4 files changed, 59 insertions(+), 91 deletions(-) diff --git a/make/GenerateLinkOptData.gmk b/make/GenerateLinkOptData.gmk index 9339218b5d1..87ad6c35754 100644 --- a/make/GenerateLinkOptData.gmk +++ b/make/GenerateLinkOptData.gmk @@ -75,6 +75,7 @@ $(CLASSLIST_FILE): $(INTERIM_IMAGE_DIR)/bin/java$(EXE_SUFFIX) $(CLASSLIST_JAR) $(FIXPATH) $(INTERIM_IMAGE_DIR)/bin/java -XX:DumpLoadedClassList=$@.raw \ -Djava.lang.invoke.MethodHandle.TRACE_RESOLVE=true \ -Duser.language=en -Duser.country=US \ + --module-path $(SUPPORT_OUTPUTDIR)/classlist.jar \ -cp $(SUPPORT_OUTPUTDIR)/classlist.jar \ build.tools.classlist.HelloClasslist \ 2> $(LINK_OPT_DIR)/stderr > $(JLI_TRACE_FILE) \ diff --git a/make/jdk/src/classes/build/tools/classlist/HelloClasslist.java b/make/jdk/src/classes/build/tools/classlist/HelloClasslist.java index d2913e306a5..8e5dbe73d41 100644 --- a/make/jdk/src/classes/build/tools/classlist/HelloClasslist.java +++ b/make/jdk/src/classes/build/tools/classlist/HelloClasslist.java @@ -31,6 +31,9 @@ */ package build.tools.classlist; +import java.lang.invoke.MethodHandle; +import java.lang.invoke.MethodHandles; +import java.lang.invoke.MethodType; import java.net.InetAddress; import java.nio.file.FileSystems; import java.time.LocalDateTime; @@ -55,19 +58,20 @@ public class HelloClasslist { private static final Logger LOGGER = Logger.getLogger("Hello"); - public static void main(String ... args) { + public static void main(String ... args) throws Throwable { FileSystems.getDefault(); List strings = Arrays.asList("Hello", "World!", "From: ", - InetAddress.getLoopbackAddress().toString()); + InetAddress.getLoopbackAddress().toString()); String helloWorld = strings.parallelStream() - .map(s -> s.toLowerCase(Locale.ROOT)) - .collect(joining(",")); + .map(s -> s.toLowerCase(Locale.ROOT)) + .collect(joining(",")); - Stream.of(helloWorld.split(",")) - .forEach(System.out::println); + Stream.of(helloWorld.split("([,x-z]{1,3})([\\s]*)")) + .map(String::toString) + .forEach(System.out::println); // Common concatenation patterns String SS = String.valueOf(args.length) + String.valueOf(args.length); @@ -83,6 +87,10 @@ public class HelloClasslist { String SCSCS = String.valueOf(args.length) + "string" + String.valueOf(args.length) + "string" + String.valueOf(args.length); String CI = "string" + args.length; String IC = args.length + "string"; + String SI = String.valueOf(args.length) + args.length; + String IS = args.length + String.valueOf(args.length); + String CIS = "string" + args.length + String.valueOf(args.length); + String CSCI = "string" + String.valueOf(args.length) + "string" + args.length; String CIC = "string" + args.length + "string"; String CICI = "string" + args.length + "string" + args.length; String CJ = "string" + System.currentTimeMillis(); @@ -99,7 +107,31 @@ public class HelloClasslist { DateFormat.getDateInstance(DateFormat.DEFAULT, Locale.ROOT) .format(new Date())); + // A selection of trivial and relatively common MH operations + invoke(MethodHandles.identity(double.class), 1.0); + invoke(MethodHandles.identity(int.class), 1); + invoke(MethodHandles.identity(String.class), "x"); + + invoke(handle("staticMethod_V", MethodType.methodType(void.class))); + LOGGER.log(Level.FINE, "New Date: " + newDate + " - old: " + oldDate); } + public static void staticMethod_V() {} + + private static MethodHandle handle(String name, MethodType type) throws Throwable { + return MethodHandles.lookup().findStatic(HelloClasslist.class, name, type); + } + + private static Object invoke(MethodHandle mh, Object ... args) throws Throwable { + try { + for (Object o : args) { + mh = MethodHandles.insertArguments(mh, 0, o); + } + return mh.invoke(); + } catch (Throwable t) { + LOGGER.warning("Failed to find, link and/or invoke " + mh.toString() + ": " + t.getMessage()); + throw t; + } + } } diff --git a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/GenerateJLIClassesPlugin.java b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/GenerateJLIClassesPlugin.java index b9d6011000b..2d01497da9d 100644 --- a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/GenerateJLIClassesPlugin.java +++ b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/GenerateJLIClassesPlugin.java @@ -47,6 +47,21 @@ import jdk.tools.jlink.plugin.Plugin; /** * Plugin to generate java.lang.invoke classes. + * + * The plugin reads in a file generated by running any application with + * {@code -Djava.lang.invoke.MethodHandle.TRACE_RESOLVE=true}. This is done + * automatically during build, see make/GenerateLinkOptData.gmk. See + * build/tools/classlist/HelloClasslist.java for the training application. + * + * HelloClasslist tries to reflect common use of java.lang.invoke during early + * startup and warmup in various applications. To ensure a good default + * trade-off between static footprint and startup the application should be + * relatively conservative. + * + * When using jlink to build a custom application runtime, generating a trace + * file using {@code -Djava.lang.invoke.MethodHandle.TRACE_RESOLVE=true} and + * feeding that into jlink using {@code --generate-jli-classes=@trace_file} can + * help improve startup time. */ public final class GenerateJLIClassesPlugin implements Plugin { @@ -112,59 +127,6 @@ public final class GenerateJLIClassesPlugin implements Plugin { return PluginsResourceBundle.getArgument(NAME); } - /** - * @return the default Species forms to generate. - * - * This list was derived from running a small startup benchmark. - * A better long-term solution is to define and run a set of quick - * generators and extracting this list as a step in the build process. - */ - public static Set defaultSpecies() { - return Set.of("LL", "L3", "L4", "L5", "L6", "L7", "L7I", - "L7II", "L7IIL", "L8", "L9", "L10", "L10I", "L10II", "L10IIL", - "L11", "L12", "L13", "LI", "D", "L3I", "LIL", "LLI", "LLIL", - "LILL", "I", "LLILL"); - } - - /** - * @return the default invoker forms to generate. - */ - private static Set defaultInvokers() { - return Set.of("LL_L", "LL_I", "LLLL_L", "LLLL_I", "LLIL_L", "LLIL_I", - "L6_L"); - } - - /** - * @return the default call site forms to generate (linkToTargetMethod). - */ - private static Set defaultCallSiteTypes() { - return Set.of("L5_L", "LIL3_L", "ILL_L"); - } - - /** - * @return the list of default DirectMethodHandle methods to generate. - */ - private static Map> defaultDMHMethods() { - return Map.of( - DMH_INVOKE_INTERFACE, Set.of("LL_L", "L3_I", "L3_V"), - DMH_INVOKE_VIRTUAL, Set.of("LL_L", "LLI_I", "L3_V"), - DMH_INVOKE_SPECIAL, Set.of("LL_I", "LL_L", "LLF_L", "LLD_L", - "L3_I", "L3_L", "L4_L", "L5_L", "L6_L", "L7_L", "L8_L", - "LLI_I", "LLI_L", "LLIL_I", "LLIL_L", "LLII_I", "LLII_L", - "L3I_L", "L3I_I", "L3ILL_L", "LLILI_I", "LLIIL_L", "LLIILL_L", - "LLIILL_I", "LLIIL_I", "LLILIL_I", "LLILILL_I", "LLILII_I", - "LLI3_I", "LLI3L_I", "LLI3LL_I", "LLI3_L", "LLI4_I"), - DMH_INVOKE_STATIC, Set.of("LII_I", "LIL_I", "LILIL_I", "LILII_I", - "L_I", "L_L", "L_V", "LD_L", "LF_L", "LI_I", "LII_L", "LLI_L", - "LL_I", "LLILL_L", "LLIL3_L", "LL_V", "LL_L", "L3_I", "L3_L", - "L3_V", "L4_I", "L4_L", "L5_L", "L6_L", "L7_L", "L8_L", "L9_L", - "L10_L", "L10I_L", "L10II_L", "L10IIL_L", "L11_L", "L12_L", - "L13_L", "L14_L", "L14I_L", "L14II_L"), - DMH_NEW_INVOKE_SPECIAL, Set.of("L_L", "LL_L"), - DMH_INVOKE_SPECIAL_IFC, Set.of("L5_I") - ); - } - private static int DMH_INVOKE_VIRTUAL_TYPE = 0; private static int DMH_INVOKE_INTERFACE_TYPE = 4; @@ -201,19 +163,8 @@ public final class GenerateJLIClassesPlugin implements Plugin { } public void initialize(ResourcePool in) { - // Start with the default configuration - defaultSpecies().stream().forEach(this::addSpeciesType); - - defaultInvokers().stream().forEach(this::validateMethodType); - - defaultCallSiteTypes().stream().forEach(this::addCallSiteType); - - defaultDMHMethods().entrySet().stream().forEach(e -> { - e.getValue().stream().forEach(type -> addDMHMethodType(e.getKey(), type)); - }); - - // Extend the default configuration with the contents in the supplied - // input file - if none was supplied we look for the default file + // Load configuration from the contents in the supplied input file + // - if none was supplied we look for the default file if (mainArgument == null || !mainArgument.startsWith("@")) { try (InputStream traceFile = this.getClass().getResourceAsStream(DEFAULT_TRACE_FILE)) { diff --git a/test/jdk/tools/jlink/plugins/GenerateJLIClassesPluginTest.java b/test/jdk/tools/jlink/plugins/GenerateJLIClassesPluginTest.java index 7bb3d34f5ea..6f403a63536 100644 --- a/test/jdk/tools/jlink/plugins/GenerateJLIClassesPluginTest.java +++ b/test/jdk/tools/jlink/plugins/GenerateJLIClassesPluginTest.java @@ -29,8 +29,6 @@ import java.util.Collection; import java.util.List; import java.util.stream.Collectors; -import jdk.tools.jlink.internal.plugins.GenerateJLIClassesPlugin; - import tests.Helper; import tests.JImageGenerator; import tests.JImageValidator; @@ -62,32 +60,19 @@ public class GenerateJLIClassesPluginTest { helper.generateDefaultModules(); - // Test that generate-jli is enabled by default - Result result = JImageGenerator.getJLinkTask() - .modulePath(helper.defaultModulePath()) - .output(helper.createNewImageDir("generate-jli")) - .addMods("java.base") - .call(); - - Path image = result.assertSuccess(); - - JImageValidator.validate(image.resolve("lib").resolve("modules"), - classFilesForSpecies(GenerateJLIClassesPlugin.defaultSpecies()), - List.of()); - // Check that --generate-jli-classes=@file works as intended Path baseFile = Files.createTempFile("base", "trace"); String species = "LLLLLLLLLLLLLLLLLLL"; String fileString = "[SPECIES_RESOLVE] java.lang.invoke.BoundMethodHandle$Species_" + species + " (salvaged)\n"; Files.write(baseFile, fileString.getBytes(Charset.defaultCharset())); - result = JImageGenerator.getJLinkTask() + Result result = JImageGenerator.getJLinkTask() .modulePath(helper.defaultModulePath()) .output(helper.createNewImageDir("generate-jli-file")) .option("--generate-jli-classes=@" + baseFile.toString()) .addMods("java.base") .call(); - image = result.assertSuccess(); + Path image = result.assertSuccess(); JImageValidator.validate(image.resolve("lib").resolve("modules"), classFilesForSpecies(List.of(species)), // species should be in the image @@ -119,8 +104,7 @@ public class GenerateJLIClassesPluginTest { private static List classFilesForSpecies(Collection species) { return species.stream() - .map(s -> "/java.base/java/lang/invoke/BoundMethodHandle$Species_" - + GenerateJLIClassesPlugin.expandSignature(s) + ".class") + .map(s -> "/java.base/java/lang/invoke/BoundMethodHandle$Species_" + s + ".class") .collect(Collectors.toList()); } } From a59ed930f58e0a2d6eaa955ebecb6927408914bf Mon Sep 17 00:00:00 2001 From: Roland Westrelin Date: Fri, 7 Feb 2020 13:59:17 +0100 Subject: [PATCH 36/50] 8238385: CTW: C2 (Shenandoah) compilation fails with "Range check dependent CastII node was not removed" Reviewed-by: rkennke, shade --- .../shenandoah/c2/shenandoahBarrierSetC2.cpp | 3 + .../gc/shenandoah/c2/shenandoahSupport.cpp | 5 + .../compiler/FoldIfAfterExpansion.java | 91 +++++++++++++++++++ 3 files changed, 99 insertions(+) create mode 100644 test/hotspot/jtreg/gc/shenandoah/compiler/FoldIfAfterExpansion.java diff --git a/src/hotspot/share/gc/shenandoah/c2/shenandoahBarrierSetC2.cpp b/src/hotspot/share/gc/shenandoah/c2/shenandoahBarrierSetC2.cpp index 1b695c2981c..faf5b33c0b5 100644 --- a/src/hotspot/share/gc/shenandoah/c2/shenandoahBarrierSetC2.cpp +++ b/src/hotspot/share/gc/shenandoah/c2/shenandoahBarrierSetC2.cpp @@ -740,6 +740,9 @@ bool ShenandoahBarrierSetC2::is_gc_barrier_node(Node* node) const { } Node* ShenandoahBarrierSetC2::step_over_gc_barrier(Node* c) const { + if (c == NULL) { + return c; + } if (c->Opcode() == Op_ShenandoahLoadReferenceBarrier) { return c->in(ShenandoahLoadReferenceBarrierNode::ValueIn); } diff --git a/src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.cpp b/src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.cpp index 1321ce7cab4..1f1b4e342cd 100644 --- a/src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.cpp +++ b/src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.cpp @@ -58,6 +58,11 @@ bool ShenandoahBarrierC2Support::expand(Compile* C, PhaseIterGVN& igvn) { return false; } C->clear_major_progress(); + if (C->range_check_cast_count() > 0) { + // No more loop optimizations. Remove all range check dependent CastIINodes. + C->remove_range_check_casts(igvn); + igvn.optimize(); + } } } return true; diff --git a/test/hotspot/jtreg/gc/shenandoah/compiler/FoldIfAfterExpansion.java b/test/hotspot/jtreg/gc/shenandoah/compiler/FoldIfAfterExpansion.java new file mode 100644 index 00000000000..d2e854f7953 --- /dev/null +++ b/test/hotspot/jtreg/gc/shenandoah/compiler/FoldIfAfterExpansion.java @@ -0,0 +1,91 @@ +/* + * Copyright (c) 2020, Red Hat, Inc. 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 8238385 + * @summary CTW: C2 (Shenandoah) compilation fails with "Range check dependent CastII node was not removed" + * @key gc + * @requires vm.gc.Shenandoah & !vm.graal.enabled + * @modules java.base/jdk.internal.misc:+open + * + * @run main/othervm -XX:-UseOnStackReplacement -XX:-BackgroundCompilation -XX:-TieredCompilation -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC + * FoldIfAfterExpansion + * + */ + +import jdk.internal.misc.Unsafe; + +public class FoldIfAfterExpansion { + private static int[] field1 = new int[100]; + private static int[] field2 = new int[100]; + private static int[] field3; + private static volatile int barrier; + + static final jdk.internal.misc.Unsafe UNSAFE = Unsafe.getUnsafe(); + + public static void main(String[] args) { + for (int i = 0; i < 20_000; i++) { + test(true, 10, false, true); + test(false, 10, false, false); + } + } + + private static Object test(boolean flag, int i, boolean flag2, boolean flag3) { + int[] array; + if (flag) { + barrier = 1; + array = field1; + final int length = array.length; + if (flag2) { + field3 = array; + } + } else { + barrier = 1; + array = field1; + final int length = array.length; + if (flag2) { + field3 = array; + } + } + + array = field1; + + if (flag3) { + if (i < 0 || i >= array.length) { + throw new RuntimeException(); + } + long l = (long)i; + l = l * UNSAFE.ARRAY_INT_INDEX_SCALE + UNSAFE.ARRAY_INT_BASE_OFFSET; + UNSAFE.putInt(array, l, i); + } else { + if (i < 0 || i >= array.length) { + throw new RuntimeException(); + } + long l = (long)i; + l = l * UNSAFE.ARRAY_INT_INDEX_SCALE + UNSAFE.ARRAY_INT_BASE_OFFSET; + UNSAFE.putInt(array, l, i); + } + + return array; + } +} From 8c0fab8fbef5211decc9c5d15c5e33436ba19b69 Mon Sep 17 00:00:00 2001 From: Roland Westrelin Date: Tue, 28 Jan 2020 11:28:52 +0100 Subject: [PATCH 37/50] 8237837: Shenandoah: assert(mem == __null) failed: only one safepoint Reviewed-by: rkennke --- .../gc/shenandoah/c2/shenandoahSupport.cpp | 58 ++++++++++++------- .../compiler/BarrierInInfiniteLoop.java | 51 ++++++++++++++++ 2 files changed, 89 insertions(+), 20 deletions(-) create mode 100644 test/hotspot/jtreg/gc/shenandoah/compiler/BarrierInInfiniteLoop.java diff --git a/src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.cpp b/src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.cpp index 1f1b4e342cd..e4e2e95772c 100644 --- a/src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.cpp +++ b/src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.cpp @@ -2014,21 +2014,22 @@ void ShenandoahBarrierC2Support::optimize_after_expansion(VectorSet &visited, No if (loop != phase->ltree_root() && loop->_child == NULL && !loop->_irreducible) { - LoopNode* head = loop->_head->as_Loop(); - if ((!head->is_CountedLoop() || head->as_CountedLoop()->is_main_loop() || head->as_CountedLoop()->is_normal_loop()) && + Node* head = loop->_head; + if (head->is_Loop() && + (!head->is_CountedLoop() || head->as_CountedLoop()->is_main_loop() || head->as_CountedLoop()->is_normal_loop()) && !seen.test_set(head->_idx)) { IfNode* iff = find_unswitching_candidate(loop, phase); if (iff != NULL) { Node* bol = iff->in(1); - if (head->is_strip_mined()) { - head->verify_strip_mined(0); + if (head->as_Loop()->is_strip_mined()) { + head->as_Loop()->verify_strip_mined(0); } move_heap_stable_test_out_of_loop(iff, phase); AutoNodeBudget node_budget(phase); if (loop->policy_unswitching(phase)) { - if (head->is_strip_mined()) { + if (head->as_Loop()->is_strip_mined()) { OuterStripMinedLoopNode* outer = head->as_CountedLoop()->outer_loop(); hide_strip_mined_loop(outer, head->as_CountedLoop(), phase); } @@ -2296,7 +2297,12 @@ void MemoryGraphFixer::collect_memory_nodes() { if (in_opc == Op_Return || in_opc == Op_Rethrow) { mem = in->in(TypeFunc::Memory); } else if (in_opc == Op_Halt) { - if (!in->in(0)->is_Region()) { + if (in->in(0)->is_Region()) { + Node* r = in->in(0); + for (uint j = 1; j < r->req(); j++) { + assert(r->in(j)->Opcode() != Op_NeverBranch, ""); + } + } else { Node* proj = in->in(0); assert(proj->is_Proj(), ""); Node* in = proj->in(0); @@ -2308,25 +2314,37 @@ void MemoryGraphFixer::collect_memory_nodes() { assert(call->is_Call(), ""); mem = call->in(TypeFunc::Memory); } else if (in->Opcode() == Op_NeverBranch) { - ResourceMark rm; - Unique_Node_List wq; - wq.push(in); - wq.push(in->as_Multi()->proj_out(0)); - for (uint j = 1; j < wq.size(); j++) { - Node* c = wq.at(j); - assert(!c->is_Root(), "shouldn't leave loop"); - if (c->is_SafePoint()) { - assert(mem == NULL, "only one safepoint"); + Node* head = in->in(0); + assert(head->is_Region() && head->req() == 3, "unexpected infinite loop graph shape"); + assert(_phase->is_dominator(head, head->in(1)) || _phase->is_dominator(head, head->in(2)), "no back branch?"); + Node* tail = _phase->is_dominator(head, head->in(1)) ? head->in(1) : head->in(2); + Node* c = tail; + while (c != head) { + if (c->is_SafePoint() && !c->is_CallLeaf()) { mem = c->in(TypeFunc::Memory); } - for (DUIterator_Fast kmax, k = c->fast_outs(kmax); k < kmax; k++) { - Node* u = c->fast_out(k); - if (u->is_CFG()) { - wq.push(u); + c = _phase->idom(c); + } + assert(mem != NULL, "should have found safepoint"); + + Node* phi_mem = NULL; + for (DUIterator_Fast jmax, j = head->fast_outs(jmax); j < jmax; j++) { + Node* u = head->fast_out(j); + if (u->is_Phi() && u->bottom_type() == Type::MEMORY) { + if (_phase->C->get_alias_index(u->adr_type()) == _alias) { + assert(phi_mem == NULL || phi_mem->adr_type() == TypePtr::BOTTOM, ""); + phi_mem = u; + } else if (u->adr_type() == TypePtr::BOTTOM) { + assert(phi_mem == NULL || _phase->C->get_alias_index(phi_mem->adr_type()) == _alias, ""); + if (phi_mem == NULL) { + phi_mem = u; + } } } } - assert(mem != NULL, "should have found safepoint"); + if (phi_mem != NULL) { + mem = phi_mem; + } } } } else { diff --git a/test/hotspot/jtreg/gc/shenandoah/compiler/BarrierInInfiniteLoop.java b/test/hotspot/jtreg/gc/shenandoah/compiler/BarrierInInfiniteLoop.java new file mode 100644 index 00000000000..f391cfb5628 --- /dev/null +++ b/test/hotspot/jtreg/gc/shenandoah/compiler/BarrierInInfiniteLoop.java @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2020, Red Hat, Inc. 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 8237837 + * @summary Shenandoah: assert(mem == __null) failed: only one safepoint + * @key gc + * @requires vm.flavor == "server" + * @requires vm.gc.Shenandoah & !vm.graal.enabled + * + * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -Xcomp -XX:CompileOnly=BarrierInInfiniteLoop::test -XX:CompileCommand=quiet BarrierInInfiniteLoop + * + */ + +public class BarrierInInfiniteLoop { + private static Object field1 = new Object(); + private static Object field2 = new Object(); + + public static void main(String[] args) { + test(false); + } + + private static void test(boolean flag) { + if (flag) { + for (;;) { + field1 = field2; + } + } + } +} From c23d1de2f8b58e8e81a46b4f7099eb88cbb28f2d Mon Sep 17 00:00:00 2001 From: Alan Bateman Date: Mon, 10 Feb 2020 12:57:31 +0000 Subject: [PATCH 38/50] 8238376: test/jdk/java/nio/channels/DatagramChannel/Loopback.java failing on multi-homed systems Reviewed-by: dfuchs --- test/jdk/java/nio/channels/DatagramChannel/Loopback.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/test/jdk/java/nio/channels/DatagramChannel/Loopback.java b/test/jdk/java/nio/channels/DatagramChannel/Loopback.java index 64ed00d047f..a61a4d0b177 100644 --- a/test/jdk/java/nio/channels/DatagramChannel/Loopback.java +++ b/test/jdk/java/nio/channels/DatagramChannel/Loopback.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2020, 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 @@ -45,7 +45,9 @@ import java.nio.channels.SelectionKey; import java.nio.channels.Selector; import java.util.List; import java.util.stream.Collectors; -import static java.net.StandardProtocolFamily.*; +import static java.net.StandardProtocolFamily.INET; +import static java.net.StandardProtocolFamily.INET6; +import static java.net.StandardSocketOptions.IP_MULTICAST_IF; import static java.net.StandardSocketOptions.IP_MULTICAST_LOOP; import jdk.test.lib.NetworkConfiguration; @@ -106,6 +108,9 @@ public class Loopback { System.out.format("join %s @ %s%n", group.getHostAddress(), ni.getName()); dc.join(group, ni); + System.out.format("set outgoing multicast interface to %s%n", ni.getName()); + dc.setOption(IP_MULTICAST_IF, ni); + // -- IP_MULTICAST_LOOP enabled -- assertTrue(dc.getOption(IP_MULTICAST_LOOP), "IP_MULTICAST_LOOP not enabled"); From 326a939e1bed5e5c297c28d2841b1f0a4ab2e649 Mon Sep 17 00:00:00 2001 From: Claes Redestad Date: Mon, 10 Feb 2020 13:58:12 +0100 Subject: [PATCH 39/50] 8237878: Improve ModuleLoaderMap datastructures Reviewed-by: alanb, forax --- .../share/classes/java/lang/Module.java | 3 +- .../java/lang/module/ResolvedModule.java | 4 +- .../internal/module/ArchivedModuleGraph.java | 48 ++++---- .../jdk/internal/module/ModuleBootstrap.java | 23 ++-- .../jdk/internal/module/ModuleLoaderMap.java | 107 +++++++++++------- 5 files changed, 104 insertions(+), 81 deletions(-) diff --git a/src/java.base/share/classes/java/lang/Module.java b/src/java.base/share/classes/java/lang/Module.java index d92148c3a89..955c0b4babb 100644 --- a/src/java.base/share/classes/java/lang/Module.java +++ b/src/java.base/share/classes/java/lang/Module.java @@ -1094,13 +1094,14 @@ public final class Module implements AnnotatedElement { // map each module to a class loader ClassLoader pcl = ClassLoaders.platformClassLoader(); + boolean isModuleLoaderMapper = ModuleLoaderMap.isBuiltinMapper(clf); for (int index = 0; index < numModules; index++) { String name = resolvedModules[index].name(); ClassLoader loader = clf.apply(name); if (loader == null || loader == pcl) { - if (!(clf instanceof ModuleLoaderMap.Mapper)) { + if (!isModuleLoaderMapper) { throw new IllegalArgumentException("loader can't be 'null'" + " or the platform class loader"); } diff --git a/src/java.base/share/classes/java/lang/module/ResolvedModule.java b/src/java.base/share/classes/java/lang/module/ResolvedModule.java index a3858ef6c13..32ba86911d7 100644 --- a/src/java.base/share/classes/java/lang/module/ResolvedModule.java +++ b/src/java.base/share/classes/java/lang/module/ResolvedModule.java @@ -79,7 +79,7 @@ public final class ResolvedModule { * @return The module descriptor */ ModuleDescriptor descriptor() { - return reference().descriptor(); + return mref.descriptor(); } /** @@ -93,7 +93,7 @@ public final class ResolvedModule { * @return The module name */ public String name() { - return reference().descriptor().name(); + return mref.descriptor().name(); } /** diff --git a/src/java.base/share/classes/jdk/internal/module/ArchivedModuleGraph.java b/src/java.base/share/classes/jdk/internal/module/ArchivedModuleGraph.java index 6a92f052400..348d943106a 100644 --- a/src/java.base/share/classes/jdk/internal/module/ArchivedModuleGraph.java +++ b/src/java.base/share/classes/jdk/internal/module/ArchivedModuleGraph.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2020, 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 @@ -28,8 +28,8 @@ package jdk.internal.module; import java.lang.module.Configuration; import java.lang.module.ModuleFinder; import java.util.Map; -import java.util.Objects; import java.util.Set; +import java.util.function.Function; import jdk.internal.misc.VM; @@ -39,26 +39,26 @@ import jdk.internal.misc.VM; final class ArchivedModuleGraph { private static ArchivedModuleGraph archivedModuleGraph; - private final String mainModule; private final boolean hasSplitPackages; private final boolean hasIncubatorModules; private final ModuleFinder finder; private final Configuration configuration; + private final Function classLoaderFunction; private final Map> concealedPackagesToOpen; private final Map> exportedPackagesToOpen; - private ArchivedModuleGraph(String mainModule, - boolean hasSplitPackages, - boolean hasIncubatorModules, - ModuleFinder finder, - Configuration configuration, - Map> concealedPackagesToOpen, - Map> exportedPackagesToOpen) { - this.mainModule = mainModule; + public ArchivedModuleGraph(boolean hasSplitPackages, + boolean hasIncubatorModules, + ModuleFinder finder, + Configuration configuration, + Function classLoaderFunction, + Map> concealedPackagesToOpen, + Map> exportedPackagesToOpen) { this.hasSplitPackages = hasSplitPackages; this.hasIncubatorModules = hasIncubatorModules; this.finder = finder; this.configuration = configuration; + this.classLoaderFunction = classLoaderFunction; this.concealedPackagesToOpen = concealedPackagesToOpen; this.exportedPackagesToOpen = exportedPackagesToOpen; } @@ -71,6 +71,10 @@ final class ArchivedModuleGraph { return configuration; } + Function classLoaderFunction() { + return classLoaderFunction; + } + Map> concealedPackagesToOpen() { return concealedPackagesToOpen; } @@ -92,7 +96,8 @@ final class ArchivedModuleGraph { */ static ArchivedModuleGraph get(String mainModule) { ArchivedModuleGraph graph = archivedModuleGraph; - if (graph != null && Objects.equals(mainModule, graph.mainModule)) { + // We only allow the unnamed module (default) case for now + if (mainModule == null) { return graph; } else { return null; @@ -102,23 +107,8 @@ final class ArchivedModuleGraph { /** * Archive the module graph for the given initial module. */ - static void archive(String mainModule, - boolean hasSplitPackages, - boolean hasIncubatorModules, - ModuleFinder finder, - Configuration configuration, - Map> concealedPackagesToOpen, - Map> exportedPackagesToOpen) { - if (mainModule != null) { - throw new UnsupportedOperationException(); - } - archivedModuleGraph = new ArchivedModuleGraph(mainModule, - hasSplitPackages, - hasIncubatorModules, - finder, - configuration, - concealedPackagesToOpen, - exportedPackagesToOpen); + static void archive(ArchivedModuleGraph graph) { + archivedModuleGraph = graph; } static { diff --git a/src/java.base/share/classes/jdk/internal/module/ModuleBootstrap.java b/src/java.base/share/classes/jdk/internal/module/ModuleBootstrap.java index 59177178eca..ed6fb613310 100644 --- a/src/java.base/share/classes/jdk/internal/module/ModuleBootstrap.java +++ b/src/java.base/share/classes/jdk/internal/module/ModuleBootstrap.java @@ -370,7 +370,12 @@ public final class ModuleBootstrap { // loader. // mapping of modules to class loaders - Function clf = ModuleLoaderMap.mappingFunction(cf); + Function clf; + if (archivedModuleGraph != null) { + clf = archivedModuleGraph.classLoaderFunction(); + } else { + clf = ModuleLoaderMap.mappingFunction(cf); + } // check that all modules to be mapped to the boot loader will be // loaded from the runtime image @@ -440,13 +445,14 @@ public final class ModuleBootstrap { // Module graph can be archived at CDS dump time. Only allow the // unnamed module case for now. if (canArchive && (mainModule == null)) { - ArchivedModuleGraph.archive(mainModule, - hasSplitPackages, - hasIncubatorModules, - systemModuleFinder, - cf, - concealedPackagesToOpen, - exportedPackagesToOpen); + ArchivedModuleGraph.archive( + new ArchivedModuleGraph(hasSplitPackages, + hasIncubatorModules, + systemModuleFinder, + cf, + clf, + concealedPackagesToOpen, + exportedPackagesToOpen)); } // total time to initialize @@ -737,7 +743,6 @@ public final class ModuleBootstrap { Modules.addExports(m, pn, other); } } - } } } diff --git a/src/java.base/share/classes/jdk/internal/module/ModuleLoaderMap.java b/src/java.base/share/classes/jdk/internal/module/ModuleLoaderMap.java index b0f465d4776..a23a72dacec 100644 --- a/src/java.base/share/classes/jdk/internal/module/ModuleLoaderMap.java +++ b/src/java.base/share/classes/jdk/internal/module/ModuleLoaderMap.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2020, 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 @@ -28,14 +28,12 @@ package jdk.internal.module; import java.lang.module.Configuration; import java.lang.module.ResolvedModule; import java.util.HashMap; -import java.util.HashSet; import java.util.Map; import java.util.Set; import java.util.function.Function; import jdk.internal.loader.ClassLoaders; - /** * Supports the mapping of modules to class loaders. The set of modules mapped * to the boot and platform class loaders is generated at build time from @@ -46,16 +44,55 @@ public final class ModuleLoaderMap { /** * Maps the system modules to the built-in class loaders. */ - public static final class Mapper implements Function { - private final Map map; + private static final class Mapper implements Function { - Mapper(Map map) { - this.map = map; // defensive copy not needed + private static final ClassLoader PLATFORM_CLASSLOADER = + ClassLoaders.platformClassLoader(); + private static final ClassLoader APP_CLASSLOADER = + ClassLoaders.appClassLoader(); + + private static final Integer PLATFORM_LOADER_INDEX = 1; + private static final Integer APP_LOADER_INDEX = 2; + + /** + * Map from module to a class loader index. The index is resolved to the + * actual class loader in {@code apply}. + */ + private final Map map; + + /** + * Creates a Mapper to map module names in the given Configuration to + * built-in classloaders. + * + * As a proxy for the actual classloader, we store an easily archiveable + * index value in the internal map. The index is stored as a boxed value + * so that we can cheaply do identity comparisons during bootstrap. + */ + Mapper(Configuration cf) { + var map = new HashMap(); + for (ResolvedModule resolvedModule : cf.modules()) { + String mn = resolvedModule.name(); + if (!Modules.bootModules.contains(mn)) { + if (Modules.platformModules.contains(mn)) { + map.put(mn, PLATFORM_LOADER_INDEX); + } else { + map.put(mn, APP_LOADER_INDEX); + } + } + } + this.map = map; } @Override public ClassLoader apply(String name) { - return map.get(name); + Integer loader = map.get(name); + if (loader == APP_LOADER_INDEX) { + return APP_CLASSLOADER; + } else if (loader == PLATFORM_LOADER_INDEX) { + return PLATFORM_CLASSLOADER; + } else { // BOOT_LOADER_INDEX + return null; + } } } @@ -63,50 +100,40 @@ public final class ModuleLoaderMap { * Returns the names of the modules defined to the boot loader. */ public static Set bootModules() { - // The list of boot modules generated at build time. - String[] BOOT_MODULES = new String[] { "@@BOOT_MODULE_NAMES@@" }; - Set bootModules = new HashSet<>(BOOT_MODULES.length); - for (String mn : BOOT_MODULES) { - bootModules.add(mn); - } - return bootModules; + return Modules.bootModules; } /** * Returns the names of the modules defined to the platform loader. */ public static Set platformModules() { - // The list of platform modules generated at build time. - String[] PLATFORM_MODULES = new String[] { "@@PLATFORM_MODULE_NAMES@@" }; - Set platformModules = new HashSet<>(PLATFORM_MODULES.length); - for (String mn : PLATFORM_MODULES) { - platformModules.add(mn); - } - return platformModules; + return Modules.platformModules; + } + + private static class Modules { + // list of boot modules is generated at build time. + private static final Set bootModules = + Set.of(new String[] { "@@BOOT_MODULE_NAMES@@" }); + + // list of platform modules is generated at build time. + private static final Set platformModules = + Set.of(new String[] { "@@PLATFORM_MODULE_NAMES@@" }); } /** - * Returns the function to map modules in the given configuration to the + * Returns a function to map modules in the given configuration to the * built-in class loaders. */ static Function mappingFunction(Configuration cf) { - Set bootModules = bootModules(); - Set platformModules = platformModules(); + return new Mapper(cf); + } - ClassLoader platformClassLoader = ClassLoaders.platformClassLoader(); - ClassLoader appClassLoader = ClassLoaders.appClassLoader(); - - Map map = new HashMap<>(); - for (ResolvedModule resolvedModule : cf.modules()) { - String mn = resolvedModule.name(); - if (!bootModules.contains(mn)) { - if (platformModules.contains(mn)) { - map.put(mn, platformClassLoader); - } else { - map.put(mn, appClassLoader); - } - } - } - return new Mapper(map); + /** + * When defining modules for a configuration, we only allow defining modules + * to the boot or platform classloader if the ClassLoader mapping function + * originate from here. + */ + public static boolean isBuiltinMapper(Function clf) { + return clf instanceof Mapper; } } From 304d764a72bd94c3c3b890667b2b929669c19dd0 Mon Sep 17 00:00:00 2001 From: Erik Gahlin Date: Mon, 10 Feb 2020 14:21:51 +0100 Subject: [PATCH 40/50] 8238634: Reduce log verbosity of the JFR thread sampler Reviewed-by: mgronlun --- .../share/jfr/periodic/sampling/jfrThreadSampler.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/hotspot/share/jfr/periodic/sampling/jfrThreadSampler.cpp b/src/hotspot/share/jfr/periodic/sampling/jfrThreadSampler.cpp index 5ca913c0aba..ebb9b87a2db 100644 --- a/src/hotspot/share/jfr/periodic/sampling/jfrThreadSampler.cpp +++ b/src/hotspot/share/jfr/periodic/sampling/jfrThreadSampler.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2020, 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 @@ -435,7 +435,7 @@ void JfrThreadSampler::start_thread() { void JfrThreadSampler::enroll() { if (_disenrolled) { - log_info(jfr)("Enrolling thread sampler"); + log_trace(jfr)("Enrolling thread sampler"); _sample.signal(); _disenrolled = false; } @@ -445,7 +445,7 @@ void JfrThreadSampler::disenroll() { if (!_disenrolled) { _sample.wait(); _disenrolled = true; - log_info(jfr)("Disenrolling thread sampler"); + log_trace(jfr)("Disenrolling thread sampler"); } } @@ -583,12 +583,12 @@ JfrThreadSampling::~JfrThreadSampling() { } static void log(size_t interval_java, size_t interval_native) { - log_info(jfr)("Updated thread sampler for java: " SIZE_FORMAT " ms, native " SIZE_FORMAT " ms", interval_java, interval_native); + log_trace(jfr)("Updated thread sampler for java: " SIZE_FORMAT " ms, native " SIZE_FORMAT " ms", interval_java, interval_native); } void JfrThreadSampling::start_sampler(size_t interval_java, size_t interval_native) { assert(_sampler == NULL, "invariant"); - log_info(jfr)("Enrolling thread sampler"); + log_trace(jfr)("Enrolling thread sampler"); _sampler = new JfrThreadSampler(interval_java, interval_native, JfrOptionSet::stackdepth()); _sampler->start_thread(); _sampler->enroll(); @@ -608,7 +608,7 @@ void JfrThreadSampling::set_sampling_interval(bool java_interval, size_t period) } if (interval_java > 0 || interval_native > 0) { if (_sampler == NULL) { - log_info(jfr)("Creating thread sampler for java:%zu ms, native %zu ms", interval_java, interval_native); + log_trace(jfr)("Creating thread sampler for java:%zu ms, native %zu ms", interval_java, interval_native); start_sampler(interval_java, interval_native); } else { _sampler->set_java_interval(interval_java); From 9886cb401c9ee21b2dac908133805355037380f8 Mon Sep 17 00:00:00 2001 From: Frederic Parain Date: Mon, 10 Feb 2020 09:49:12 -0500 Subject: [PATCH 41/50] 8237767: Field layout computation overhaul Reviewed-by: dholmes, coleenp, lfoltan, shade --- src/hotspot/share/ci/ciInstanceKlass.cpp | 36 +- src/hotspot/share/ci/ciInstanceKlass.hpp | 6 +- .../share/classfile/classFileParser.cpp | 326 ++++---- .../share/classfile/classFileParser.hpp | 41 +- .../share/classfile/fieldLayoutBuilder.cpp | 780 ++++++++++++++++++ .../share/classfile/fieldLayoutBuilder.hpp | 267 ++++++ src/hotspot/share/jvmci/vmStructs_jvmci.cpp | 4 +- src/hotspot/share/oops/fieldStreams.hpp | 4 +- src/hotspot/share/oops/instanceKlass.cpp | 4 + src/hotspot/share/oops/instanceKlass.hpp | 50 +- src/hotspot/share/oops/instanceOop.hpp | 8 +- src/hotspot/share/runtime/arguments.cpp | 1 + src/hotspot/share/runtime/deoptimization.cpp | 20 +- src/hotspot/share/runtime/globals.hpp | 10 +- src/hotspot/share/runtime/vmStructs.cpp | 2 +- .../HotSpotResolvedObjectTypeImpl.java | 36 +- .../jdk/vm/ci/hotspot/HotSpotVMConfig.java | 4 +- .../CommandLine/VMDeprecatedOptions.java | 3 +- .../runtime/FieldLayout/FieldDensityTest.java | 157 ++++ 19 files changed, 1528 insertions(+), 231 deletions(-) create mode 100644 src/hotspot/share/classfile/fieldLayoutBuilder.cpp create mode 100644 src/hotspot/share/classfile/fieldLayoutBuilder.hpp create mode 100644 test/hotspot/jtreg/runtime/FieldLayout/FieldDensityTest.java diff --git a/src/hotspot/share/ci/ciInstanceKlass.cpp b/src/hotspot/share/ci/ciInstanceKlass.cpp index 329fb5ef435..26d8bd490ba 100644 --- a/src/hotspot/share/ci/ciInstanceKlass.cpp +++ b/src/hotspot/share/ci/ciInstanceKlass.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2020, 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 @@ -213,14 +213,19 @@ ciInstanceKlass* ciInstanceKlass::get_canonical_holder(int offset) { } ciInstanceKlass* self = this; - for (;;) { - assert(self->is_loaded(), "must be loaded to have size"); - ciInstanceKlass* super = self->super(); - if (super == NULL || super->nof_nonstatic_fields() == 0 || - !super->contains_field_offset(offset)) { - return self; - } else { - self = super; // return super->get_canonical_holder(offset) + assert(self->is_loaded(), "must be loaded to access field info"); + ciField* field = self->get_field_by_offset(offset, false); + if (field != NULL) { + return field->holder(); + } else { + for (;;) { + assert(self->is_loaded(), "must be loaded to have size"); + ciInstanceKlass* super = self->super(); + if (super == NULL || super->nof_nonstatic_fields() == 0) { + return self; + } else { + self = super; // return super->get_canonical_holder(offset) + } } } } @@ -391,6 +396,13 @@ bool ciInstanceKlass::has_finalizable_subclass() { return Dependencies::find_finalizable_subclass(get_instanceKlass()) != NULL; } +// ------------------------------------------------------------------ +// ciInstanceKlass::contains_field_offset +bool ciInstanceKlass::contains_field_offset(int offset) { + VM_ENTRY_MARK; + return get_instanceKlass()->contains_field_offset(offset); +} + // ------------------------------------------------------------------ // ciInstanceKlass::get_field_by_offset ciField* ciInstanceKlass::get_field_by_offset(int field_offset, bool is_static) { @@ -457,15 +469,9 @@ int ciInstanceKlass::compute_nonstatic_fields() { ciInstanceKlass* super = this->super(); GrowableArray* super_fields = NULL; if (super != NULL && super->has_nonstatic_fields()) { - int super_fsize = super->nonstatic_field_size() * heapOopSize; int super_flen = super->nof_nonstatic_fields(); super_fields = super->_nonstatic_fields; assert(super_flen == 0 || super_fields != NULL, "first get nof_fields"); - // See if I am no larger than my super; if so, I can use his fields. - if (fsize == super_fsize) { - _nonstatic_fields = super_fields; - return super_fields->length(); - } } GrowableArray* fields = NULL; diff --git a/src/hotspot/share/ci/ciInstanceKlass.hpp b/src/hotspot/share/ci/ciInstanceKlass.hpp index 6af24c9675c..09f2d520ace 100644 --- a/src/hotspot/share/ci/ciInstanceKlass.hpp +++ b/src/hotspot/share/ci/ciInstanceKlass.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2020, 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 @@ -225,9 +225,7 @@ public: ciInstanceKlass* unique_concrete_subklass(); bool has_finalizable_subclass(); - bool contains_field_offset(int offset) { - return instanceOopDesc::contains_field_offset(offset, nonstatic_field_size()); - } + bool contains_field_offset(int offset); // Get the instance of java.lang.Class corresponding to // this klass. This instance is used for locking of diff --git a/src/hotspot/share/classfile/classFileParser.cpp b/src/hotspot/share/classfile/classFileParser.cpp index 8c168f344cb..032eaea3757 100644 --- a/src/hotspot/share/classfile/classFileParser.cpp +++ b/src/hotspot/share/classfile/classFileParser.cpp @@ -30,6 +30,7 @@ #include "classfile/classLoaderData.inline.hpp" #include "classfile/defaultMethods.hpp" #include "classfile/dictionary.hpp" +#include "classfile/fieldLayoutBuilder.hpp" #include "classfile/javaClasses.inline.hpp" #include "classfile/moduleEntry.hpp" #include "classfile/packageEntry.hpp" @@ -60,6 +61,7 @@ #include "prims/jvmtiExport.hpp" #include "prims/jvmtiThreadState.hpp" #include "runtime/arguments.hpp" +#include "runtime/fieldDescriptor.inline.hpp" #include "runtime/handles.inline.hpp" #include "runtime/javaCalls.hpp" #include "runtime/os.hpp" @@ -1686,8 +1688,12 @@ void ClassFileParser::parse_fields(const ClassFileStream* const cfs, field->set_allocation_type(atype); // After field is initialized with type, we can augment it with aux info - if (parsed_annotations.has_any_annotations()) + if (parsed_annotations.has_any_annotations()) { parsed_annotations.apply_to(field); + if (field->is_contended()) { + _has_contended_fields = true; + } + } } int index = length; @@ -3932,39 +3938,6 @@ const InstanceKlass* ClassFileParser::parse_super_class(ConstantPool* const cp, return super_klass; } -static unsigned int compute_oop_map_count(const InstanceKlass* super, - unsigned int nonstatic_oop_map_count, - int first_nonstatic_oop_offset) { - - unsigned int map_count = - NULL == super ? 0 : super->nonstatic_oop_map_count(); - if (nonstatic_oop_map_count > 0) { - // We have oops to add to map - if (map_count == 0) { - map_count = nonstatic_oop_map_count; - } - else { - // Check whether we should add a new map block or whether the last one can - // be extended - const OopMapBlock* const first_map = super->start_of_nonstatic_oop_maps(); - const OopMapBlock* const last_map = first_map + map_count - 1; - - const int next_offset = last_map->offset() + last_map->count() * heapOopSize; - if (next_offset == first_nonstatic_oop_offset) { - // There is no gap bettwen superklass's last oop field and first - // local oop field, merge maps. - nonstatic_oop_map_count -= 1; - } - else { - // Superklass didn't end with a oop field, add extra maps - assert(next_offset < first_nonstatic_oop_offset, "just checking"); - } - map_count += nonstatic_oop_map_count; - } - } - return map_count; -} - #ifndef PRODUCT static void print_field_layout(const Symbol* name, Array* fields, @@ -4002,18 +3975,121 @@ static void print_field_layout(const Symbol* name, } #endif -// Values needed for oopmap and InstanceKlass creation -class ClassFileParser::FieldLayoutInfo : public ResourceObj { - public: - int* nonstatic_oop_offsets; - unsigned int* nonstatic_oop_counts; - unsigned int nonstatic_oop_map_count; - unsigned int total_oop_map_count; - int instance_size; - int nonstatic_field_size; - int static_field_size; - bool has_nonstatic_fields; -}; +OopMapBlocksBuilder::OopMapBlocksBuilder(unsigned int max_blocks) { + _max_nonstatic_oop_maps = max_blocks; + _nonstatic_oop_map_count = 0; + if (max_blocks == 0) { + _nonstatic_oop_maps = NULL; + } else { + _nonstatic_oop_maps = + NEW_RESOURCE_ARRAY(OopMapBlock, _max_nonstatic_oop_maps); + memset(_nonstatic_oop_maps, 0, sizeof(OopMapBlock) * max_blocks); + } +} + +OopMapBlock* OopMapBlocksBuilder::last_oop_map() const { + assert(_nonstatic_oop_map_count > 0, "Has no oop maps"); + return _nonstatic_oop_maps + (_nonstatic_oop_map_count - 1); +} + +// addition of super oop maps +void OopMapBlocksBuilder::initialize_inherited_blocks(OopMapBlock* blocks, unsigned int nof_blocks) { + assert(nof_blocks && _nonstatic_oop_map_count == 0 && + nof_blocks <= _max_nonstatic_oop_maps, "invariant"); + + memcpy(_nonstatic_oop_maps, blocks, sizeof(OopMapBlock) * nof_blocks); + _nonstatic_oop_map_count += nof_blocks; +} + +// collection of oops +void OopMapBlocksBuilder::add(int offset, int count) { + if (_nonstatic_oop_map_count == 0) { + _nonstatic_oop_map_count++; + } + OopMapBlock* nonstatic_oop_map = last_oop_map(); + if (nonstatic_oop_map->count() == 0) { // Unused map, set it up + nonstatic_oop_map->set_offset(offset); + nonstatic_oop_map->set_count(count); + } else if (nonstatic_oop_map->is_contiguous(offset)) { // contiguous, add + nonstatic_oop_map->increment_count(count); + } else { // Need a new one... + _nonstatic_oop_map_count++; + assert(_nonstatic_oop_map_count <= _max_nonstatic_oop_maps, "range check"); + nonstatic_oop_map = last_oop_map(); + nonstatic_oop_map->set_offset(offset); + nonstatic_oop_map->set_count(count); + } +} + +// general purpose copy, e.g. into allocated instanceKlass +void OopMapBlocksBuilder::copy(OopMapBlock* dst) { + if (_nonstatic_oop_map_count != 0) { + memcpy(dst, _nonstatic_oop_maps, sizeof(OopMapBlock) * _nonstatic_oop_map_count); + } +} + +// Sort and compact adjacent blocks +void OopMapBlocksBuilder::compact() { + if (_nonstatic_oop_map_count <= 1) { + return; + } + /* + * Since field layout sneeks in oops before values, we will be able to condense + * blocks. There is potential to compact between super, own refs and values + * containing refs. + * + * Currently compaction is slightly limited due to values being 8 byte aligned. + * This may well change: FixMe if it doesn't, the code below is fairly general purpose + * and maybe it doesn't need to be. + */ + qsort(_nonstatic_oop_maps, _nonstatic_oop_map_count, sizeof(OopMapBlock), + (_sort_Fn)OopMapBlock::compare_offset); + if (_nonstatic_oop_map_count < 2) { + return; + } + + // Make a temp copy, and iterate through and copy back into the original + ResourceMark rm; + OopMapBlock* oop_maps_copy = + NEW_RESOURCE_ARRAY(OopMapBlock, _nonstatic_oop_map_count); + OopMapBlock* oop_maps_copy_end = oop_maps_copy + _nonstatic_oop_map_count; + copy(oop_maps_copy); + OopMapBlock* nonstatic_oop_map = _nonstatic_oop_maps; + unsigned int new_count = 1; + oop_maps_copy++; + while(oop_maps_copy < oop_maps_copy_end) { + assert(nonstatic_oop_map->offset() < oop_maps_copy->offset(), "invariant"); + if (nonstatic_oop_map->is_contiguous(oop_maps_copy->offset())) { + nonstatic_oop_map->increment_count(oop_maps_copy->count()); + } else { + nonstatic_oop_map++; + new_count++; + nonstatic_oop_map->set_offset(oop_maps_copy->offset()); + nonstatic_oop_map->set_count(oop_maps_copy->count()); + } + oop_maps_copy++; + } + assert(new_count <= _nonstatic_oop_map_count, "end up with more maps after compact() ?"); + _nonstatic_oop_map_count = new_count; +} + +void OopMapBlocksBuilder::print_on(outputStream* st) const { + st->print_cr(" OopMapBlocks: %3d /%3d", _nonstatic_oop_map_count, _max_nonstatic_oop_maps); + if (_nonstatic_oop_map_count > 0) { + OopMapBlock* map = _nonstatic_oop_maps; + OopMapBlock* last_map = last_oop_map(); + assert(map <= last_map, "Last less than first"); + while (map <= last_map) { + st->print_cr(" Offset: %3d -%3d Count: %3d", map->offset(), + map->offset() + map->offset_span() - heapOopSize, map->count()); + map++; + } + } +} + +void OopMapBlocksBuilder::print_value_on(outputStream* st) const { + print_on(st); +} // Layout fields and fill in FieldLayoutInfo. Could use more refactoring! void ClassFileParser::layout_fields(ConstantPool* cp, @@ -4100,16 +4176,15 @@ void ClassFileParser::layout_fields(ConstantPool* cp, // count[i] oops following. Before we know how many regions are required, // we pessimistically allocate the maps to fit all the oops into the // distinct regions. - // - // TODO: We add +1 to always allocate non-zero resource arrays; we need - // to figure out if we still need to do this. - unsigned int nonstatic_oop_map_count = 0; - unsigned int max_nonstatic_oop_maps = fac->count[NONSTATIC_OOP] + 1; - int* nonstatic_oop_offsets = NEW_RESOURCE_ARRAY_IN_THREAD( - THREAD, int, max_nonstatic_oop_maps); - unsigned int* const nonstatic_oop_counts = NEW_RESOURCE_ARRAY_IN_THREAD( - THREAD, unsigned int, max_nonstatic_oop_maps); + int super_oop_map_count = (_super_klass == NULL) ? 0 :_super_klass->nonstatic_oop_map_count(); + int max_oop_map_count = super_oop_map_count + fac->count[NONSTATIC_OOP]; + + OopMapBlocksBuilder* nonstatic_oop_maps = new OopMapBlocksBuilder(max_oop_map_count); + if (super_oop_map_count > 0) { + nonstatic_oop_maps->initialize_inherited_blocks(_super_klass->start_of_nonstatic_oop_maps(), + _super_klass->nonstatic_oop_map_count()); + } int first_nonstatic_oop_offset = 0; // will be set for first oop field @@ -4260,26 +4335,7 @@ void ClassFileParser::layout_fields(ConstantPool* cp, real_offset = next_nonstatic_oop_offset; next_nonstatic_oop_offset += heapOopSize; } - - // Record this oop in the oop maps - if( nonstatic_oop_map_count > 0 && - nonstatic_oop_offsets[nonstatic_oop_map_count - 1] == - real_offset - - int(nonstatic_oop_counts[nonstatic_oop_map_count - 1]) * - heapOopSize ) { - // This oop is adjacent to the previous one, add to current oop map - assert(nonstatic_oop_map_count - 1 < max_nonstatic_oop_maps, "range check"); - nonstatic_oop_counts[nonstatic_oop_map_count - 1] += 1; - } else { - // This oop is not adjacent to the previous one, create new oop map - assert(nonstatic_oop_map_count < max_nonstatic_oop_maps, "range check"); - nonstatic_oop_offsets[nonstatic_oop_map_count] = real_offset; - nonstatic_oop_counts [nonstatic_oop_map_count] = 1; - nonstatic_oop_map_count += 1; - if( first_nonstatic_oop_offset == 0 ) { // Undefined - first_nonstatic_oop_offset = real_offset; - } - } + nonstatic_oop_maps->add(real_offset, 1); break; case NONSTATIC_BYTE: if( nonstatic_byte_space_count > 0 ) { @@ -4392,26 +4448,7 @@ void ClassFileParser::layout_fields(ConstantPool* cp, next_nonstatic_padded_offset = align_up(next_nonstatic_padded_offset, heapOopSize); real_offset = next_nonstatic_padded_offset; next_nonstatic_padded_offset += heapOopSize; - - // Record this oop in the oop maps - if( nonstatic_oop_map_count > 0 && - nonstatic_oop_offsets[nonstatic_oop_map_count - 1] == - real_offset - - int(nonstatic_oop_counts[nonstatic_oop_map_count - 1]) * - heapOopSize ) { - // This oop is adjacent to the previous one, add to current oop map - assert(nonstatic_oop_map_count - 1 < max_nonstatic_oop_maps, "range check"); - nonstatic_oop_counts[nonstatic_oop_map_count - 1] += 1; - } else { - // This oop is not adjacent to the previous one, create new oop map - assert(nonstatic_oop_map_count < max_nonstatic_oop_maps, "range check"); - nonstatic_oop_offsets[nonstatic_oop_map_count] = real_offset; - nonstatic_oop_counts [nonstatic_oop_map_count] = 1; - nonstatic_oop_map_count += 1; - if( first_nonstatic_oop_offset == 0 ) { // Undefined - first_nonstatic_oop_offset = real_offset; - } - } + nonstatic_oop_maps->add(real_offset, 1); break; default: @@ -4475,9 +4512,7 @@ void ClassFileParser::layout_fields(ConstantPool* cp, (nonstatic_fields_count > 0), "double-check nonstatic start/end"); // Number of non-static oop map blocks allocated at end of klass. - const unsigned int total_oop_map_count = - compute_oop_map_count(_super_klass, nonstatic_oop_map_count, - first_nonstatic_oop_offset); + nonstatic_oop_maps->compact(); #ifndef PRODUCT if (PrintFieldLayout) { @@ -4492,58 +4527,13 @@ void ClassFileParser::layout_fields(ConstantPool* cp, #endif // Pass back information needed for InstanceKlass creation - info->nonstatic_oop_offsets = nonstatic_oop_offsets; - info->nonstatic_oop_counts = nonstatic_oop_counts; - info->nonstatic_oop_map_count = nonstatic_oop_map_count; - info->total_oop_map_count = total_oop_map_count; - info->instance_size = instance_size; - info->static_field_size = static_field_size; - info->nonstatic_field_size = nonstatic_field_size; - info->has_nonstatic_fields = has_nonstatic_fields; + info->oop_map_blocks = nonstatic_oop_maps; + info->_instance_size = instance_size; + info->_static_field_size = static_field_size; + info->_nonstatic_field_size = nonstatic_field_size; + info->_has_nonstatic_fields = has_nonstatic_fields; } -static void fill_oop_maps(const InstanceKlass* k, - unsigned int nonstatic_oop_map_count, - const int* nonstatic_oop_offsets, - const unsigned int* nonstatic_oop_counts) { - - assert(k != NULL, "invariant"); - - OopMapBlock* this_oop_map = k->start_of_nonstatic_oop_maps(); - const InstanceKlass* const super = k->superklass(); - const unsigned int super_count = super ? super->nonstatic_oop_map_count() : 0; - if (super_count > 0) { - // Copy maps from superklass - OopMapBlock* super_oop_map = super->start_of_nonstatic_oop_maps(); - for (unsigned int i = 0; i < super_count; ++i) { - *this_oop_map++ = *super_oop_map++; - } - } - - if (nonstatic_oop_map_count > 0) { - if (super_count + nonstatic_oop_map_count > k->nonstatic_oop_map_count()) { - // The counts differ because there is no gap between superklass's last oop - // field and the first local oop field. Extend the last oop map copied - // from the superklass instead of creating new one. - nonstatic_oop_map_count--; - nonstatic_oop_offsets++; - this_oop_map--; - this_oop_map->set_count(this_oop_map->count() + *nonstatic_oop_counts++); - this_oop_map++; - } - - // Add new map blocks, fill them - while (nonstatic_oop_map_count-- > 0) { - this_oop_map->set_offset(*nonstatic_oop_offsets++); - this_oop_map->set_count(*nonstatic_oop_counts++); - this_oop_map++; - } - assert(k->start_of_nonstatic_oop_maps() + k->nonstatic_oop_map_count() == - this_oop_map, "sanity"); - } -} - - void ClassFileParser::set_precomputed_flags(InstanceKlass* ik) { assert(ik != NULL, "invariant"); @@ -5498,17 +5488,17 @@ int ClassFileParser::verify_legal_method_signature(const Symbol* name, int ClassFileParser::static_field_size() const { assert(_field_info != NULL, "invariant"); - return _field_info->static_field_size; + return _field_info->_static_field_size; } int ClassFileParser::total_oop_map_count() const { assert(_field_info != NULL, "invariant"); - return _field_info->total_oop_map_count; + return _field_info->oop_map_blocks->_nonstatic_oop_map_count; } jint ClassFileParser::layout_size() const { assert(_field_info != NULL, "invariant"); - return _field_info->instance_size; + return _field_info->_instance_size; } static void check_methods_for_intrinsics(const InstanceKlass* ik, @@ -5652,19 +5642,19 @@ void ClassFileParser::fill_instance_klass(InstanceKlass* ik, bool changed_by_loa set_klass_to_deallocate(ik); assert(_field_info != NULL, "invariant"); - assert(ik->static_field_size() == _field_info->static_field_size, "sanity"); - assert(ik->nonstatic_oop_map_count() == _field_info->total_oop_map_count, - "sanity"); + assert(ik->static_field_size() == _field_info->_static_field_size, "sanity"); + assert(ik->nonstatic_oop_map_count() == _field_info->oop_map_blocks->_nonstatic_oop_map_count, + "sanity"); assert(ik->is_instance_klass(), "sanity"); - assert(ik->size_helper() == _field_info->instance_size, "sanity"); + assert(ik->size_helper() == _field_info->_instance_size, "sanity"); // Fill in information already parsed ik->set_should_verify_class(_need_verify); // Not yet: supers are done below to support the new subtype-checking fields - ik->set_nonstatic_field_size(_field_info->nonstatic_field_size); - ik->set_has_nonstatic_fields(_field_info->has_nonstatic_fields); + ik->set_nonstatic_field_size(_field_info->_nonstatic_field_size); + ik->set_has_nonstatic_fields(_field_info->_has_nonstatic_fields); assert(_fac != NULL, "invariant"); ik->set_static_oop_field_count(_fac->count[STATIC_OOP]); @@ -5755,10 +5745,15 @@ void ClassFileParser::fill_instance_klass(InstanceKlass* ik, bool changed_by_loa // Compute transitive closure of interfaces this class implements // Do final class setup - fill_oop_maps(ik, - _field_info->nonstatic_oop_map_count, - _field_info->nonstatic_oop_offsets, - _field_info->nonstatic_oop_counts); + OopMapBlocksBuilder* oop_map_blocks = _field_info->oop_map_blocks; + if (oop_map_blocks->_nonstatic_oop_map_count > 0) { + oop_map_blocks->copy(ik->start_of_nonstatic_oop_maps()); + } + + if (_has_contended_fields || _parsed_annotations->is_contended() || + ( _super_klass != NULL && _super_klass->has_contended_annotations())) { + ik->set_has_contended_annotations(true); + } // Fill in has_finalizer, has_vanilla_constructor, and layout_helper set_precomputed_flags(ik); @@ -6001,6 +5996,7 @@ ClassFileParser::ClassFileParser(ClassFileStream* stream, _has_nonstatic_concrete_methods(false), _declares_nonstatic_concrete_methods(false), _has_final_method(false), + _has_contended_fields(false), _has_finalizer(false), _has_empty_finalizer(false), _has_vanilla_constructor(false), @@ -6478,7 +6474,13 @@ void ClassFileParser::post_process_parsed_stream(const ClassFileStream* const st assert(_parsed_annotations != NULL, "invariant"); _field_info = new FieldLayoutInfo(); - layout_fields(cp, _fac, _parsed_annotations, _field_info, CHECK); + if (UseNewFieldLayout) { + FieldLayoutBuilder lb(class_name(), super_klass(), _cp, _fields, + _parsed_annotations->is_contended(), _field_info); + lb.build_layout(); + } else { + layout_fields(cp, _fac, _parsed_annotations, _field_info, CHECK); + } // Compute reference typ _rt = (NULL ==_super_klass) ? REF_NONE : _super_klass->reference_type(); diff --git a/src/hotspot/share/classfile/classFileParser.hpp b/src/hotspot/share/classfile/classFileParser.hpp index d8cd9a17747..8945b29d05d 100644 --- a/src/hotspot/share/classfile/classFileParser.hpp +++ b/src/hotspot/share/classfile/classFileParser.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2020, 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 @@ -28,6 +28,7 @@ #include "memory/referenceType.hpp" #include "oops/annotations.hpp" #include "oops/constantPool.hpp" +#include "oops/instanceKlass.hpp" #include "oops/typeArrayOop.hpp" #include "utilities/accessFlags.hpp" @@ -45,17 +46,46 @@ class InstanceKlass; class RecordComponent; class Symbol; class TempNewSymbol; +class FieldLayoutBuilder; + +// Utility to collect and compact oop maps during layout +class OopMapBlocksBuilder : public ResourceObj { + public: + OopMapBlock* _nonstatic_oop_maps; + unsigned int _nonstatic_oop_map_count; + unsigned int _max_nonstatic_oop_maps; + + OopMapBlocksBuilder(unsigned int max_blocks); + OopMapBlock* last_oop_map() const; + void initialize_inherited_blocks(OopMapBlock* blocks, unsigned int nof_blocks); + void add(int offset, int count); + void copy(OopMapBlock* dst); + void compact(); + void print_on(outputStream* st) const; + void print_value_on(outputStream* st) const; +}; + +// Values needed for oopmap and InstanceKlass creation +class FieldLayoutInfo : public ResourceObj { + public: + OopMapBlocksBuilder* oop_map_blocks; + int _instance_size; + int _nonstatic_field_size; + int _static_field_size; + bool _has_nonstatic_fields; +}; // Parser for for .class files // // The bytes describing the class file structure is read from a Stream object class ClassFileParser { + friend class FieldLayoutBuilder; + friend class FieldLayout; - class ClassAnnotationCollector; - class FieldAllocationCount; - class FieldAnnotationCollector; - class FieldLayoutInfo; + class ClassAnnotationCollector; + class FieldAllocationCount; + class FieldAnnotationCollector; public: // The ClassFileParser has an associated "publicity" level @@ -161,6 +191,7 @@ class ClassFileParser { bool _has_nonstatic_concrete_methods; bool _declares_nonstatic_concrete_methods; bool _has_final_method; + bool _has_contended_fields; // precomputed flags bool _has_finalizer; diff --git a/src/hotspot/share/classfile/fieldLayoutBuilder.cpp b/src/hotspot/share/classfile/fieldLayoutBuilder.cpp new file mode 100644 index 00000000000..fd38a3fe246 --- /dev/null +++ b/src/hotspot/share/classfile/fieldLayoutBuilder.cpp @@ -0,0 +1,780 @@ +/* + * Copyright (c) 2020, 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. + * + */ + +#include "precompiled.hpp" +#include "jvm.h" +#include "classfile/classFileParser.hpp" +#include "classfile/fieldLayoutBuilder.hpp" +#include "memory/resourceArea.hpp" +#include "oops/array.hpp" +#include "oops/fieldStreams.inline.hpp" +#include "oops/instanceMirrorKlass.hpp" +#include "oops/klass.inline.hpp" +#include "runtime/fieldDescriptor.inline.hpp" + + +LayoutRawBlock::LayoutRawBlock(Kind kind, int size) : + _next_block(NULL), + _prev_block(NULL), + _kind(kind), + _offset(-1), + _alignment(1), + _size(size), + _field_index(-1), + _is_reference(false) { + assert(kind == EMPTY || kind == RESERVED || kind == PADDING || kind == INHERITED, + "Otherwise, should use the constructor with a field index argument"); + assert(size > 0, "Sanity check"); +} + + +LayoutRawBlock::LayoutRawBlock(int index, Kind kind, int size, int alignment, bool is_reference) : + _next_block(NULL), + _prev_block(NULL), + _kind(kind), + _offset(-1), + _alignment(alignment), + _size(size), + _field_index(index), + _is_reference(is_reference) { + assert(kind == REGULAR || kind == FLATTENED || kind == INHERITED, + "Other kind do not have a field index"); + assert(size > 0, "Sanity check"); + assert(alignment > 0, "Sanity check"); +} + +bool LayoutRawBlock::fit(int size, int alignment) { + int adjustment = 0; + if ((_offset % alignment) != 0) { + adjustment = alignment - (_offset % alignment); + } + return _size >= size + adjustment; +} + +FieldGroup::FieldGroup(int contended_group) : + _next(NULL), + _primitive_fields(NULL), + _oop_fields(NULL), + _contended_group(contended_group), // -1 means no contended group, 0 means default contended group + _oop_count(0) {} + +void FieldGroup::add_primitive_field(AllFieldStream fs, BasicType type) { + int size = type2aelembytes(type); + LayoutRawBlock* block = new LayoutRawBlock(fs.index(), LayoutRawBlock::REGULAR, size, size /* alignment == size for primitive types */, false); + if (_primitive_fields == NULL) { + _primitive_fields = new(ResourceObj::RESOURCE_AREA, mtInternal) GrowableArray(INITIAL_LIST_SIZE); + } + _primitive_fields->append(block); +} + +void FieldGroup::add_oop_field(AllFieldStream fs) { + int size = type2aelembytes(T_OBJECT); + LayoutRawBlock* block = new LayoutRawBlock(fs.index(), LayoutRawBlock::REGULAR, size, size /* alignment == size for oops */, true); + if (_oop_fields == NULL) { + _oop_fields = new(ResourceObj::RESOURCE_AREA, mtInternal) GrowableArray(INITIAL_LIST_SIZE); + } + _oop_fields->append(block); + _oop_count++; +} + +void FieldGroup::sort_by_size() { + if (_primitive_fields != NULL) { + _primitive_fields->sort(LayoutRawBlock::compare_size_inverted); + } +} + +FieldLayout::FieldLayout(Array* fields, ConstantPool* cp) : + _fields(fields), + _cp(cp), + _blocks(NULL), + _start(_blocks), + _last(_blocks) {} + +void FieldLayout::initialize_static_layout() { + _blocks = new LayoutRawBlock(LayoutRawBlock::EMPTY, INT_MAX); + _blocks->set_offset(0); + _last = _blocks; + _start = _blocks; + // Note: at this stage, InstanceMirrorKlass::offset_of_static_fields() could be zero, because + // during bootstrapping, the size of the java.lang.Class is still not known when layout + // of static field is computed. Field offsets are fixed later when the size is known + // (see java_lang_Class::fixup_mirror()) + if (InstanceMirrorKlass::offset_of_static_fields() > 0) { + insert(first_empty_block(), new LayoutRawBlock(LayoutRawBlock::RESERVED, InstanceMirrorKlass::offset_of_static_fields())); + _blocks->set_offset(0); + } +} + +void FieldLayout::initialize_instance_layout(const InstanceKlass* super_klass) { + if (super_klass == NULL) { + _blocks = new LayoutRawBlock(LayoutRawBlock::EMPTY, INT_MAX); + _blocks->set_offset(0); + _last = _blocks; + _start = _blocks; + insert(first_empty_block(), new LayoutRawBlock(LayoutRawBlock::RESERVED, instanceOopDesc::base_offset_in_bytes())); + } else { + reconstruct_layout(super_klass); + fill_holes(super_klass); + if (UseEmptySlotsInSupers && !super_klass->has_contended_annotations()) { + _start = _blocks; // Setting _start to _blocks instead of _last would allow subclasses + // to allocate fields in empty slots of their super classes + } else { + _start = _last; + } + } +} + +LayoutRawBlock* FieldLayout::first_field_block() { + LayoutRawBlock* block = _start; + while (block->kind() != LayoutRawBlock::INHERITED && block->kind() != LayoutRawBlock::REGULAR + && block->kind() != LayoutRawBlock::FLATTENED && block->kind() != LayoutRawBlock::PADDING) { + block = block->next_block(); + } + return block; +} + + +// Insert a set of fields into a layout using a best-fit strategy. +// For each field, search for the smallest empty slot able to fit the field +// (satisfying both size and alignment requirements), if none is found, +// add the field at the end of the layout. +// Fields cannot be inserted before the block specified in the "start" argument +void FieldLayout::add(GrowableArray* list, LayoutRawBlock* start) { + if (list == NULL) return; + if (start == NULL) start = this->_start; + bool last_search_success = false; + int last_size = 0; + int last_alignment = 0; + for (int i = 0; i < list->length(); i ++) { + LayoutRawBlock* b = list->at(i); + LayoutRawBlock* cursor = NULL; + LayoutRawBlock* candidate = NULL; + + // if start is the last block, just append the field + if (start == last_block()) { + candidate = last_block(); + } + // Before iterating over the layout to find an empty slot fitting the field's requirements, + // check if the previous field had the same requirements and if the search for a fitting slot + // was successful. If the requirements were the same but the search failed, a new search will + // fail the same way, so just append the field at the of the layout. + else if (b->size() == last_size && b->alignment() == last_alignment && !last_search_success) { + candidate = last_block(); + } else { + // Iterate over the layout to find an empty slot fitting the field's requirements + last_size = b->size(); + last_alignment = b->alignment(); + cursor = last_block()->prev_block(); + assert(cursor != NULL, "Sanity check"); + last_search_success = true; + while (cursor != start) { + if (cursor->kind() == LayoutRawBlock::EMPTY && cursor->fit(b->size(), b->alignment())) { + if (candidate == NULL || cursor->size() < candidate->size()) { + candidate = cursor; + } + } + cursor = cursor->prev_block(); + } + if (candidate == NULL) { + candidate = last_block(); + last_search_success = false; + } + assert(candidate != NULL, "Candidate must not be null"); + assert(candidate->kind() == LayoutRawBlock::EMPTY, "Candidate must be an empty block"); + assert(candidate->fit(b->size(), b->alignment()), "Candidate must be able to store the block"); + } + + insert_field_block(candidate, b); + } +} + +// Used for classes with hard coded field offsets, insert a field at the specified offset */ +void FieldLayout::add_field_at_offset(LayoutRawBlock* block, int offset, LayoutRawBlock* start) { + assert(block != NULL, "Sanity check"); + block->set_offset(offset); + if (start == NULL) { + start = this->_start; + } + LayoutRawBlock* slot = start; + while (slot != NULL) { + if ((slot->offset() <= block->offset() && (slot->offset() + slot->size()) > block->offset()) || + slot == _last){ + assert(slot->kind() == LayoutRawBlock::EMPTY, "Matching slot must be an empty slot"); + assert(slot->size() >= block->offset() + block->size() ,"Matching slot must be big enough"); + if (slot->offset() < block->offset()) { + int adjustment = block->offset() - slot->offset(); + LayoutRawBlock* adj = new LayoutRawBlock(LayoutRawBlock::EMPTY, adjustment); + insert(slot, adj); + } + insert(slot, block); + if (slot->size() == 0) { + remove(slot); + } + FieldInfo::from_field_array(_fields, block->field_index())->set_offset(block->offset()); + return; + } + slot = slot->next_block(); + } + fatal("Should have found a matching slot above, corrupted layout or invalid offset"); +} + +// The allocation logic uses a best fit strategy: the set of fields is allocated +// in the first empty slot big enough to contain the whole set ((including padding +// to fit alignment constraints). +void FieldLayout::add_contiguously(GrowableArray* list, LayoutRawBlock* start) { + if (list == NULL) return; + if (start == NULL) { + start = _start; + } + // This code assumes that if the first block is well aligned, the following + // blocks would naturally be well aligned (no need for adjustment) + int size = 0; + for (int i = 0; i < list->length(); i++) { + size += list->at(i)->size(); + } + + LayoutRawBlock* candidate = NULL; + if (start == last_block()) { + candidate = last_block(); + } else { + LayoutRawBlock* first = list->at(0); + candidate = last_block()->prev_block(); + while (candidate->kind() != LayoutRawBlock::EMPTY || !candidate->fit(size, first->alignment())) { + if (candidate == start) { + candidate = last_block(); + break; + } + candidate = candidate->prev_block(); + } + assert(candidate != NULL, "Candidate must not be null"); + assert(candidate->kind() == LayoutRawBlock::EMPTY, "Candidate must be an empty block"); + assert(candidate->fit(size, first->alignment()), "Candidate must be able to store the whole contiguous block"); + } + + for (int i = 0; i < list->length(); i++) { + LayoutRawBlock* b = list->at(i); + insert_field_block(candidate, b); + assert((candidate->offset() % b->alignment() == 0), "Contiguous blocks must be naturally well aligned"); + } +} + +LayoutRawBlock* FieldLayout::insert_field_block(LayoutRawBlock* slot, LayoutRawBlock* block) { + assert(slot->kind() == LayoutRawBlock::EMPTY, "Blocks can only be inserted in empty blocks"); + if (slot->offset() % block->alignment() != 0) { + int adjustment = block->alignment() - (slot->offset() % block->alignment()); + LayoutRawBlock* adj = new LayoutRawBlock(LayoutRawBlock::EMPTY, adjustment); + insert(slot, adj); + } + insert(slot, block); + if (slot->size() == 0) { + remove(slot); + } + FieldInfo::from_field_array(_fields, block->field_index())->set_offset(block->offset()); + return block; +} + +void FieldLayout::reconstruct_layout(const InstanceKlass* ik) { + GrowableArray* all_fields = new GrowableArray(32); + while (ik != NULL) { + for (AllFieldStream fs(ik->fields(), ik->constants()); !fs.done(); fs.next()) { + BasicType type = Signature::basic_type(fs.signature()); + // distinction between static and non-static fields is missing + if (fs.access_flags().is_static()) continue; + int size = type2aelembytes(type); + // INHERITED blocks are marked as non-reference because oop_maps are handled by their holder class + LayoutRawBlock* block = new LayoutRawBlock(fs.index(), LayoutRawBlock::INHERITED, size, size, false); + block->set_offset(fs.offset()); + all_fields->append(block); + } + ik = ik->super() == NULL ? NULL : InstanceKlass::cast(ik->super()); + } + + all_fields->sort(LayoutRawBlock::compare_offset); + _blocks = new LayoutRawBlock(LayoutRawBlock::RESERVED, instanceOopDesc::base_offset_in_bytes()); + _blocks->set_offset(0); + _last = _blocks; + + for(int i = 0; i < all_fields->length(); i++) { + LayoutRawBlock* b = all_fields->at(i); + _last->set_next_block(b); + b->set_prev_block(_last); + _last = b; + } + _start = _blocks; +} + +// Called during the reconstruction of a layout, after fields from super +// classes have been inserted. It fills unused slots between inserted fields +// with EMPTY blocks, so the regular field insertion methods would work. +// This method handles classes with @Contended annotations differently +// by inserting PADDING blocks instead of EMPTY block to prevent subclasses' +// fields to interfere with contended fields/classes. +void FieldLayout::fill_holes(const InstanceKlass* super_klass) { + assert(_blocks != NULL, "Sanity check"); + assert(_blocks->offset() == 0, "first block must be at offset zero"); + LayoutRawBlock::Kind filling_type = super_klass->has_contended_annotations() ? LayoutRawBlock::PADDING: LayoutRawBlock::EMPTY; + LayoutRawBlock* b = _blocks; + while (b->next_block() != NULL) { + if (b->next_block()->offset() > (b->offset() + b->size())) { + int size = b->next_block()->offset() - (b->offset() + b->size()); + LayoutRawBlock* empty = new LayoutRawBlock(filling_type, size); + empty->set_offset(b->offset() + b->size()); + empty->set_next_block(b->next_block()); + b->next_block()->set_prev_block(empty); + b->set_next_block(empty); + empty->set_prev_block(b); + } + b = b->next_block(); + } + assert(b->next_block() == NULL, "Invariant at this point"); + assert(b->kind() != LayoutRawBlock::EMPTY, "Sanity check"); + + // If the super class has @Contended annotation, a padding block is + // inserted at the end to ensure that fields from the subclasses won't share + // the cache line of the last field of the contended class + if (super_klass->has_contended_annotations()) { + LayoutRawBlock* p = new LayoutRawBlock(LayoutRawBlock::PADDING, ContendedPaddingWidth); + p->set_offset(b->offset() + b->size()); + b->set_next_block(p); + p->set_prev_block(b); + b = p; + } + + if (!UseEmptySlotsInSupers) { + // Add an empty slots to align fields of the subclass on a heapOopSize boundary + // in order to emulate the behavior of the previous algorithm + int align = (b->offset() + b->size()) % heapOopSize; + if (align != 0) { + int sz = heapOopSize - align; + LayoutRawBlock* p = new LayoutRawBlock(LayoutRawBlock::EMPTY, sz); + p->set_offset(b->offset() + b->size()); + b->set_next_block(p); + p->set_prev_block(b); + b = p; + } + } + + LayoutRawBlock* last = new LayoutRawBlock(LayoutRawBlock::EMPTY, INT_MAX); + last->set_offset(b->offset() + b->size()); + assert(last->offset() > 0, "Sanity check"); + b->set_next_block(last); + last->set_prev_block(b); + _last = last; +} + +LayoutRawBlock* FieldLayout::insert(LayoutRawBlock* slot, LayoutRawBlock* block) { + assert(slot->kind() == LayoutRawBlock::EMPTY, "Blocks can only be inserted in empty blocks"); + assert(slot->offset() % block->alignment() == 0, "Incompatible alignment"); + block->set_offset(slot->offset()); + slot->set_offset(slot->offset() + block->size()); + assert((slot->size() - block->size()) < slot->size(), "underflow checking"); + assert(slot->size() - block->size() >= 0, "no negative size allowed"); + slot->set_size(slot->size() - block->size()); + block->set_prev_block(slot->prev_block()); + block->set_next_block(slot); + slot->set_prev_block(block); + if (block->prev_block() != NULL) { + block->prev_block()->set_next_block(block); + } + if (_blocks == slot) { + _blocks = block; + } + return block; +} + +void FieldLayout::remove(LayoutRawBlock* block) { + assert(block != NULL, "Sanity check"); + assert(block != _last, "Sanity check"); + if (_blocks == block) { + _blocks = block->next_block(); + if (_blocks != NULL) { + _blocks->set_prev_block(NULL); + } + } else { + assert(block->prev_block() != NULL, "_prev should be set for non-head blocks"); + block->prev_block()->set_next_block(block->next_block()); + block->next_block()->set_prev_block(block->prev_block()); + } + if (block == _start) { + _start = block->prev_block(); + } +} + +void FieldLayout::print(outputStream* output, bool is_static, const InstanceKlass* super) { + ResourceMark rm; + LayoutRawBlock* b = _blocks; + while(b != _last) { + switch(b->kind()) { + case LayoutRawBlock::REGULAR: { + FieldInfo* fi = FieldInfo::from_field_array(_fields, b->field_index()); + output->print_cr(" @%d \"%s\" %s %d/%d %s", + b->offset(), + fi->name(_cp)->as_C_string(), + fi->signature(_cp)->as_C_string(), + b->size(), + b->alignment(), + "REGULAR"); + break; + } + case LayoutRawBlock::FLATTENED: { + FieldInfo* fi = FieldInfo::from_field_array(_fields, b->field_index()); + output->print_cr(" @%d \"%s\" %s %d/%d %s", + b->offset(), + fi->name(_cp)->as_C_string(), + fi->signature(_cp)->as_C_string(), + b->size(), + b->alignment(), + "FLATTENED"); + break; + } + case LayoutRawBlock::RESERVED: { + output->print_cr(" @%d %d/- %s", + b->offset(), + b->size(), + "RESERVED"); + break; + } + case LayoutRawBlock::INHERITED: { + assert(!is_static, "Static fields are not inherited in layouts"); + assert(super != NULL, "super klass must be provided to retrieve inherited fields info"); + bool found = false; + const InstanceKlass* ik = super; + while (!found && ik != NULL) { + for (AllFieldStream fs(ik->fields(), ik->constants()); !fs.done(); fs.next()) { + if (fs.offset() == b->offset()) { + output->print_cr(" @%d \"%s\" %s %d/%d %s", + b->offset(), + fs.name()->as_C_string(), + fs.signature()->as_C_string(), + b->size(), + b->size(), // so far, alignment constraint == size, will change with Valhalla + "INHERITED"); + found = true; + break; + } + } + ik = ik->java_super(); + } + break; + } + case LayoutRawBlock::EMPTY: + output->print_cr(" @%d %d/1 %s", + b->offset(), + b->size(), + "EMPTY"); + break; + case LayoutRawBlock::PADDING: + output->print_cr(" @%d %d/1 %s", + b->offset(), + b->size(), + "PADDING"); + break; + } + b = b->next_block(); + } +} + +FieldLayoutBuilder::FieldLayoutBuilder(const Symbol* classname, const InstanceKlass* super_klass, ConstantPool* constant_pool, + Array* fields, bool is_contended, FieldLayoutInfo* info) : + _classname(classname), + _super_klass(super_klass), + _constant_pool(constant_pool), + _fields(fields), + _info(info), + _root_group(NULL), + _contended_groups(GrowableArray(8)), + _static_fields(NULL), + _layout(NULL), + _static_layout(NULL), + _nonstatic_oopmap_count(0), + _alignment(-1), + _has_nonstatic_fields(false), + _is_contended(is_contended) {} + + +FieldGroup* FieldLayoutBuilder::get_or_create_contended_group(int g) { + assert(g > 0, "must only be called for named contended groups"); + FieldGroup* fg = NULL; + for (int i = 0; i < _contended_groups.length(); i++) { + fg = _contended_groups.at(i); + if (fg->contended_group() == g) return fg; + } + fg = new FieldGroup(g); + _contended_groups.append(fg); + return fg; +} + +void FieldLayoutBuilder::prologue() { + _layout = new FieldLayout(_fields, _constant_pool); + const InstanceKlass* super_klass = _super_klass; + _layout->initialize_instance_layout(super_klass); + if (super_klass != NULL) { + _has_nonstatic_fields = super_klass->has_nonstatic_fields(); + } + _static_layout = new FieldLayout(_fields, _constant_pool); + _static_layout->initialize_static_layout(); + _static_fields = new FieldGroup(); + _root_group = new FieldGroup(); +} + +// Field sorting for regular classes: +// - fields are sorted in static and non-static fields +// - non-static fields are also sorted according to their contention group +// (support of the @Contended annotation) +// - @Contended annotation is ignored for static fields +void FieldLayoutBuilder::regular_field_sorting() { + for (AllFieldStream fs(_fields, _constant_pool); !fs.done(); fs.next()) { + FieldGroup* group = NULL; + if (fs.access_flags().is_static()) { + group = _static_fields; + } else { + _has_nonstatic_fields = true; + if (fs.is_contended()) { + int g = fs.contended_group(); + if (g == 0) { + group = new FieldGroup(true); + _contended_groups.append(group); + } else { + group = get_or_create_contended_group(g); + } + } else { + group = _root_group; + } + } + assert(group != NULL, "invariant"); + BasicType type = Signature::basic_type(fs.signature()); + switch(type) { + case T_BYTE: + case T_CHAR: + case T_DOUBLE: + case T_FLOAT: + case T_INT: + case T_LONG: + case T_SHORT: + case T_BOOLEAN: + group->add_primitive_field(fs, type); + break; + case T_OBJECT: + case T_ARRAY: + if (group != _static_fields) _nonstatic_oopmap_count++; + group->add_oop_field(fs); + break; + default: + fatal("Something wrong?"); + } + } + _root_group->sort_by_size(); + _static_fields->sort_by_size(); + if (!_contended_groups.is_empty()) { + for (int i = 0; i < _contended_groups.length(); i++) { + _contended_groups.at(i)->sort_by_size(); + } + } +} + +void FieldLayoutBuilder::insert_contended_padding(LayoutRawBlock* slot) { + if (ContendedPaddingWidth > 0) { + LayoutRawBlock* padding = new LayoutRawBlock(LayoutRawBlock::PADDING, ContendedPaddingWidth); + _layout->insert(slot, padding); + } +} + +// Computation of regular classes layout is an evolution of the previous default layout +// (FieldAllocationStyle 1): +// - primitive fields are allocated first (from the biggest to the smallest) +// - then oop fields are allocated, either in existing gaps or at the end of +// the layout +void FieldLayoutBuilder::compute_regular_layout() { + bool need_tail_padding = false; + prologue(); + regular_field_sorting(); + + if (_is_contended) { + _layout->set_start(_layout->last_block()); + // insertion is currently easy because the current strategy doesn't try to fill holes + // in super classes layouts => the _start block is by consequence the _last_block + insert_contended_padding(_layout->start()); + need_tail_padding = true; + } + _layout->add(_root_group->primitive_fields()); + _layout->add(_root_group->oop_fields()); + + if (!_contended_groups.is_empty()) { + for (int i = 0; i < _contended_groups.length(); i++) { + FieldGroup* cg = _contended_groups.at(i); + LayoutRawBlock* start = _layout->last_block(); + insert_contended_padding(start); + _layout->add(cg->primitive_fields(), start); + _layout->add(cg->oop_fields(), start); + need_tail_padding = true; + } + } + + if (need_tail_padding) { + insert_contended_padding(_layout->last_block()); + } + + _static_layout->add_contiguously(this->_static_fields->oop_fields()); + _static_layout->add(this->_static_fields->primitive_fields()); + + epilogue(); +} + +// Compute layout of the java/lang/ref/Reference class according +// to the hard coded offsets of its fields +void FieldLayoutBuilder::compute_java_lang_ref_Reference_layout() { + prologue(); + regular_field_sorting(); + + assert(_contended_groups.is_empty(), "java.lang.Reference has no @Contended annotations"); + assert(_root_group->primitive_fields() == NULL, "java.lang.Reference has no nonstatic primitive fields"); + int field_count = 0; + int offset = -1; + for (int i = 0; i < _root_group->oop_fields()->length(); i++) { + LayoutRawBlock* b = _root_group->oop_fields()->at(i); + FieldInfo* fi = FieldInfo::from_field_array(_fields, b->field_index()); + if (fi->name(_constant_pool)->equals("referent")) { + offset = java_lang_ref_Reference::referent_offset; + } else if (fi->name(_constant_pool)->equals("queue")) { + offset = java_lang_ref_Reference::queue_offset; + } else if (fi->name(_constant_pool)->equals("next")) { + offset = java_lang_ref_Reference::next_offset; + } else if (fi->name(_constant_pool)->equals("discovered")) { + offset = java_lang_ref_Reference::discovered_offset; + } + assert(offset != -1, "Unknown field"); + _layout->add_field_at_offset(b, offset); + field_count++; + } + assert(field_count == 4, "Wrong number of fields in java.lang.ref.Reference"); + + _static_layout->add_contiguously(this->_static_fields->oop_fields()); + _static_layout->add(this->_static_fields->primitive_fields()); + + epilogue(); +} + +// Compute layout of the boxing class according +// to the hard coded offsets of their fields +void FieldLayoutBuilder::compute_boxing_class_layout() { + prologue(); + regular_field_sorting(); + + assert(_contended_groups.is_empty(), "Boxing classes have no @Contended annotations"); + assert(_root_group->oop_fields() == NULL, "Boxing classes have no nonstatic oops fields"); + int field_count = 0; + int offset = -1; + + for (int i = 0; i < _root_group->primitive_fields()->length(); i++) { + LayoutRawBlock* b = _root_group->primitive_fields()->at(i); + FieldInfo* fi = FieldInfo::from_field_array(_fields, b->field_index()); + assert(fi->name(_constant_pool)->equals("value"), "Boxing classes have a single nonstatic field named 'value'"); + BasicType type = Signature::basic_type(fi->signature(_constant_pool)); + offset = java_lang_boxing_object::value_offset_in_bytes(type); + assert(offset != -1, "Unknown field"); + _layout->add_field_at_offset(b, offset); + field_count++; + } + assert(field_count == 1, "Wrong number of fields for a boxing class"); + + _static_layout->add_contiguously(this->_static_fields->oop_fields()); + _static_layout->add(this->_static_fields->primitive_fields()); + + epilogue(); +} + +void FieldLayoutBuilder::epilogue() { + // Computing oopmaps + int super_oop_map_count = (_super_klass == NULL) ? 0 :_super_klass->nonstatic_oop_map_count(); + int max_oop_map_count = super_oop_map_count + _nonstatic_oopmap_count; + + OopMapBlocksBuilder* nonstatic_oop_maps = + new OopMapBlocksBuilder(max_oop_map_count); + if (super_oop_map_count > 0) { + nonstatic_oop_maps->initialize_inherited_blocks(_super_klass->start_of_nonstatic_oop_maps(), + _super_klass->nonstatic_oop_map_count()); + } + + if (_root_group->oop_fields() != NULL) { + for (int i = 0; i < _root_group->oop_fields()->length(); i++) { + LayoutRawBlock* b = _root_group->oop_fields()->at(i); + nonstatic_oop_maps->add(b->offset(), 1); + } + } + + if (!_contended_groups.is_empty()) { + for (int i = 0; i < _contended_groups.length(); i++) { + FieldGroup* cg = _contended_groups.at(i); + if (cg->oop_count() > 0) { + assert(cg->oop_fields() != NULL && cg->oop_fields()->at(0) != NULL, "oop_count > 0 but no oop fields found"); + nonstatic_oop_maps->add(cg->oop_fields()->at(0)->offset(), cg->oop_count()); + } + } + } + + nonstatic_oop_maps->compact(); + + int instance_end = align_up(_layout->last_block()->offset(), wordSize); + int static_fields_end = align_up(_static_layout->last_block()->offset(), wordSize); + int static_fields_size = (static_fields_end - + InstanceMirrorKlass::offset_of_static_fields()) / wordSize; + int nonstatic_field_end = align_up(_layout->last_block()->offset(), heapOopSize); + + // Pass back information needed for InstanceKlass creation + + _info->oop_map_blocks = nonstatic_oop_maps; + _info->_instance_size = align_object_size(instance_end / wordSize); + _info->_static_field_size = static_fields_size; + _info->_nonstatic_field_size = (nonstatic_field_end - instanceOopDesc::base_offset_in_bytes()) / heapOopSize; + _info->_has_nonstatic_fields = _has_nonstatic_fields; + + if (PrintFieldLayout) { + ResourceMark rm; + tty->print_cr("Layout of class %s", _classname->as_C_string()); + tty->print_cr("Instance fields:"); + _layout->print(tty, false, _super_klass); + tty->print_cr("Static fields:"); + _static_layout->print(tty, true, NULL); + tty->print_cr("Instance size = %d bytes", _info->_instance_size * wordSize); + tty->print_cr("---"); + } +} + +void FieldLayoutBuilder::build_layout() { + if (_classname == vmSymbols::java_lang_ref_Reference()) { + compute_java_lang_ref_Reference_layout(); + } else if (_classname == vmSymbols::java_lang_Boolean() || + _classname == vmSymbols::java_lang_Character() || + _classname == vmSymbols::java_lang_Float() || + _classname == vmSymbols::java_lang_Double() || + _classname == vmSymbols::java_lang_Byte() || + _classname == vmSymbols::java_lang_Short() || + _classname == vmSymbols::java_lang_Integer() || + _classname == vmSymbols::java_lang_Long()) { + compute_boxing_class_layout(); + } else { + compute_regular_layout(); + } +} + diff --git a/src/hotspot/share/classfile/fieldLayoutBuilder.hpp b/src/hotspot/share/classfile/fieldLayoutBuilder.hpp new file mode 100644 index 00000000000..f7c009e39e9 --- /dev/null +++ b/src/hotspot/share/classfile/fieldLayoutBuilder.hpp @@ -0,0 +1,267 @@ +/* + * Copyright (c) 2020, 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. + * + */ + +#ifndef SHARE_CLASSFILE_FIELDLAYOUTBUILDER_HPP +#define SHARE_CLASSFILE_FIELDLAYOUTBUILDER_HPP + +#include "classfile/classFileParser.hpp" +#include "classfile/classLoaderData.hpp" +#include "memory/allocation.hpp" +#include "oops/fieldStreams.hpp" +#include "utilities/growableArray.hpp" + +// Classes below are used to compute the field layout of classes. + + +// A LayoutRawBlock describes an element of a layout. +// Each field is represented by a LayoutRawBlock. +// LayoutRawBlocks can also represent elements injected by the JVM: +// padding, empty blocks, inherited fields, etc. +// All LayoutRawBlocks must have a size and an alignment. The size is the +// exact size of the field expressed in bytes. The alignment is +// the alignment constraint of the field (1 for byte, 2 for short, +// 4 for int, 8 for long, etc.) +// +// LayoutRawBlock are designed to be used in two data structures: +// - a linked list in a layout (using _next_block, _prev_block) +// - a GrowableArray in field group (the growable array contains pointers to LayoutRawBlocks) +// +// next/prev pointers are included in the LayoutRawBlock class to narrow +// the number of allocation required during the computation of a layout. +// +class LayoutRawBlock : public ResourceObj { + public: + // Some code relies on the order of values below. + enum Kind { + EMPTY, // empty slot, space is taken from this to allocate fields + RESERVED, // reserved for JVM usage (for instance object header) + PADDING, // padding (because of alignment constraints or @Contended) + REGULAR, // primitive or oop field (including non-flattened inline fields) + FLATTENED, // flattened field + INHERITED // field(s) inherited from super classes + }; + + private: + LayoutRawBlock* _next_block; + LayoutRawBlock* _prev_block; + Kind _kind; + int _offset; + int _alignment; + int _size; + int _field_index; + bool _is_reference; + + public: + LayoutRawBlock(Kind kind, int size); + LayoutRawBlock(int index, Kind kind, int size, int alignment, bool is_reference = false); + LayoutRawBlock* next_block() const { return _next_block; } + void set_next_block(LayoutRawBlock* next) { _next_block = next; } + LayoutRawBlock* prev_block() const { return _prev_block; } + void set_prev_block(LayoutRawBlock* prev) { _prev_block = prev; } + Kind kind() const { return _kind; } + int offset() const { + assert(_offset >= 0, "Must be initialized"); + return _offset; + } + void set_offset(int offset) { _offset = offset; } + int alignment() const { return _alignment; } + int size() const { return _size; } + void set_size(int size) { _size = size; } + int field_index() const { + assert(_field_index != -1, "Must be initialized"); + return _field_index; + } + bool is_reference() const { return _is_reference; } + + bool fit(int size, int alignment); + + static int compare_offset(LayoutRawBlock** x, LayoutRawBlock** y) { return (*x)->offset() - (*y)->offset(); } + // compare_size_inverted() returns the opposite of a regular compare method in order to + // sort fields in decreasing order. + // Note: with line types, the comparison should include alignment constraint if sizes are equals + static int compare_size_inverted(LayoutRawBlock** x, LayoutRawBlock** y) { +#ifdef _WINDOWS + // qsort() on Windows reverse the order of fields with the same size + // the extension of the comparison function below preserves this order + int diff = (*y)->size() - (*x)->size(); + if (diff == 0) { + diff = (*x)->field_index() - (*y)->field_index(); + } + return diff; +#else + return (*y)->size() - (*x)->size(); +#endif // _WINDOWS + } + +}; + +// A Field group represents a set of fields that have to be allocated together, +// this is the way the @Contended annotation is supported. +// Inside a FieldGroup, fields are sorted based on their kind: primitive, +// oop, or flattened. +// +class FieldGroup : public ResourceObj { + + private: + FieldGroup* _next; + GrowableArray* _primitive_fields; + GrowableArray* _oop_fields; + int _contended_group; + int _oop_count; + static const int INITIAL_LIST_SIZE = 16; + + public: + FieldGroup(int contended_group = -1); + + FieldGroup* next() const { return _next; } + void set_next(FieldGroup* next) { _next = next; } + GrowableArray* primitive_fields() const { return _primitive_fields; } + GrowableArray* oop_fields() const { return _oop_fields; } + int contended_group() const { return _contended_group; } + int oop_count() const { return _oop_count; } + + void add_primitive_field(AllFieldStream fs, BasicType type); + void add_oop_field(AllFieldStream fs); + void sort_by_size(); +}; + +// The FieldLayout class represents a set of fields organized +// in a layout. +// An instance of FieldLayout can either represent the layout +// of non-static fields (used in an instance object) or the +// layout of static fields (to be included in the class mirror). +// +// _block is a pointer to a list of LayoutRawBlock ordered by increasing +// offsets. +// _start points to the LayoutRawBlock with the first offset that can +// be used to allocate fields of the current class +// _last points to the last LayoutRawBlock of the list. In order to +// simplify the code, the LayoutRawBlock list always ends with an +// EMPTY block (the kind of LayoutRawBlock from which space is taken +// to allocate fields) with a size big enough to satisfy all +// field allocations. +// +class FieldLayout : public ResourceObj { + private: + Array* _fields; + ConstantPool* _cp; + LayoutRawBlock* _blocks; // the layout being computed + LayoutRawBlock* _start; // points to the first block where a field can be inserted + LayoutRawBlock* _last; // points to the last block of the layout (big empty block) + + public: + FieldLayout(Array* fields, ConstantPool* cp); + void initialize_static_layout(); + void initialize_instance_layout(const InstanceKlass* ik); + + LayoutRawBlock* first_empty_block() { + LayoutRawBlock* block = _start; + while (block->kind() != LayoutRawBlock::EMPTY) { + block = block->next_block(); + } + return block; + } + + LayoutRawBlock* start() { return _start; } + void set_start(LayoutRawBlock* start) { _start = start; } + LayoutRawBlock* last_block() { return _last; } + + LayoutRawBlock* first_field_block(); + void add(GrowableArray* list, LayoutRawBlock* start = NULL); + void add_field_at_offset(LayoutRawBlock* blocks, int offset, LayoutRawBlock* start = NULL); + void add_contiguously(GrowableArray* list, LayoutRawBlock* start = NULL); + LayoutRawBlock* insert_field_block(LayoutRawBlock* slot, LayoutRawBlock* block); + void reconstruct_layout(const InstanceKlass* ik); + void fill_holes(const InstanceKlass* ik); + LayoutRawBlock* insert(LayoutRawBlock* slot, LayoutRawBlock* block); + void remove(LayoutRawBlock* block); + void print(outputStream* output, bool is_static, const InstanceKlass* super); +}; + + +// FieldLayoutBuilder is the main entry point for layout computation. +// This class has three methods to generate layout: one for regular classes +// and two for classes with hard coded offsets (java,lang.ref.Reference +// and the boxing classes). The rationale for having multiple methods +// is that each kind of class has a different set goals regarding +// its layout, so instead of mixing several layout strategies into a +// single method, each kind has its own method (see comments below +// for more details about the allocation strategies). +// +// Computing the layout of a class always goes through 4 steps: +// 1 - Prologue: preparation of data structure and gathering of +// layout information inherited from super classes +// 2 - Field sorting: fields are sorted according to their +// kind (oop, primitive, inline class) and their contention +// annotation (if any) +// 3 - Layout is computed from the set of lists generated during +// step 2 +// 4 - Epilogue: oopmaps are generated, layout information is +// prepared so other VM components can use it (instance size, +// static field size, non-static field size, etc.) +// +// Steps 1 and 4 are common to all layout computations. Step 2 and 3 +// can vary with the allocation strategy. +// +class FieldLayoutBuilder : public ResourceObj { + private: + + const Symbol* _classname; + const InstanceKlass* _super_klass; + ConstantPool* _constant_pool; + Array* _fields; + FieldLayoutInfo* _info; + FieldGroup* _root_group; + GrowableArray _contended_groups; + FieldGroup* _static_fields; + FieldLayout* _layout; + FieldLayout* _static_layout; + int _nonstatic_oopmap_count; + int _alignment; + bool _has_nonstatic_fields; + bool _is_contended; // is a contended class? + + public: + FieldLayoutBuilder(const Symbol* classname, const InstanceKlass* super_klass, ConstantPool* constant_pool, + Array* fields, bool is_contended, FieldLayoutInfo* info); + + int get_alignment() { + assert(_alignment != -1, "Uninitialized"); + return _alignment; + } + + void build_layout(); + void compute_regular_layout(); + void compute_java_lang_ref_Reference_layout(); + void compute_boxing_class_layout(); + void insert_contended_padding(LayoutRawBlock* slot); + + private: + void prologue(); + void epilogue(); + void regular_field_sorting(); + FieldGroup* get_or_create_contended_group(int g); +}; + +#endif // SHARE_CLASSFILE_FIELDLAYOUTBUILDER_HPP diff --git a/src/hotspot/share/jvmci/vmStructs_jvmci.cpp b/src/hotspot/share/jvmci/vmStructs_jvmci.cpp index 809a093e183..fa1b67f7ec5 100644 --- a/src/hotspot/share/jvmci/vmStructs_jvmci.cpp +++ b/src/hotspot/share/jvmci/vmStructs_jvmci.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2020, 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 @@ -157,7 +157,7 @@ nonstatic_field(InstanceKlass, _constants, ConstantPool*) \ nonstatic_field(InstanceKlass, _source_file_name_index, u2) \ nonstatic_field(InstanceKlass, _init_state, u1) \ - nonstatic_field(InstanceKlass, _misc_flags, u2) \ + nonstatic_field(InstanceKlass, _misc_flags, u4) \ nonstatic_field(InstanceKlass, _annotations, Annotations*) \ \ volatile_nonstatic_field(JavaFrameAnchor, _last_Java_sp, intptr_t*) \ diff --git a/src/hotspot/share/oops/fieldStreams.hpp b/src/hotspot/share/oops/fieldStreams.hpp index 23a3ad3b6c8..e36427acf52 100644 --- a/src/hotspot/share/oops/fieldStreams.hpp +++ b/src/hotspot/share/oops/fieldStreams.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2020, 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 @@ -47,7 +47,6 @@ class FieldStreamBase : public StackObj { fieldDescriptor _fd_buf; FieldInfo* field() const { return FieldInfo::from_field_array(_fields, _index); } - InstanceKlass* field_holder() const { return _constants->pool_holder(); } int init_generic_signature_start_slot() { int length = _fields->length(); @@ -87,6 +86,7 @@ class FieldStreamBase : public StackObj { // accessors int index() const { return _index; } + InstanceKlass* field_holder() const { return _constants->pool_holder(); } void next() { if (access_flags().field_has_generic_signature()) { diff --git a/src/hotspot/share/oops/instanceKlass.cpp b/src/hotspot/share/oops/instanceKlass.cpp index 5271a5f28b6..1127d7c07cd 100644 --- a/src/hotspot/share/oops/instanceKlass.cpp +++ b/src/hotspot/share/oops/instanceKlass.cpp @@ -1399,6 +1399,10 @@ void InstanceKlass::mask_for(const methodHandle& method, int bci, oop_map_cache->lookup(method, bci, entry_for); } +bool InstanceKlass::contains_field_offset(int offset) { + fieldDescriptor fd; + return find_field_from_offset(offset, false, &fd); +} bool InstanceKlass::find_local_field(Symbol* name, Symbol* sig, fieldDescriptor* fd) const { for (JavaFieldStream fs(this); !fs.done(); fs.next()) { diff --git a/src/hotspot/share/oops/instanceKlass.hpp b/src/hotspot/share/oops/instanceKlass.hpp index bfb6e6ac471..4584dc43f2c 100644 --- a/src/hotspot/share/oops/instanceKlass.hpp +++ b/src/hotspot/share/oops/instanceKlass.hpp @@ -103,12 +103,28 @@ class OopMapBlock { uint count() const { return _count; } void set_count(uint count) { _count = count; } + void increment_count(int diff) { _count += diff; } + + int offset_span() const { return _count * heapOopSize; } + + int end_offset() const { + return offset() + offset_span(); + } + + bool is_contiguous(int another_offset) const { + return another_offset == end_offset(); + } + // sizeof(OopMapBlock) in words. static const int size_in_words() { return align_up((int)sizeof(OopMapBlock), wordSize) >> LogBytesPerWord; } + static int compare_offset(const OopMapBlock* a, const OopMapBlock* b) { + return a->offset() - b->offset(); + } + private: int _offset; uint _count; @@ -212,7 +228,6 @@ class InstanceKlass: public Klass { // _is_marked_dependent can be set concurrently, thus cannot be part of the // _misc_flags. bool _is_marked_dependent; // used for marking during flushing and deoptimization - bool _is_being_redefined; // used for locking redefinition // The low two bits of _misc_flags contains the kind field. // This can be used to quickly discriminate among the four kinds of @@ -243,12 +258,14 @@ class InstanceKlass: public Klass { _misc_is_shared_boot_class = 1 << 12, // defining class loader is boot class loader _misc_is_shared_platform_class = 1 << 13, // defining class loader is platform class loader _misc_is_shared_app_class = 1 << 14, // defining class loader is app class loader - _misc_has_resolved_methods = 1 << 15 // resolved methods table entries added for this class + _misc_has_resolved_methods = 1 << 15, // resolved methods table entries added for this class + _misc_is_being_redefined = 1 << 16, // used for locking redefinition + _misc_has_contended_annotations = 1 << 17 // has @Contended annotation }; u2 loader_type_bits() { return _misc_is_shared_boot_class|_misc_is_shared_platform_class|_misc_is_shared_app_class; } - u2 _misc_flags; + u4 _misc_flags; u2 _minor_version; // minor version number of class file u2 _major_version; // major version number of class file Thread* _init_thread; // Pointer to current thread doing initialization (to handle recursive initialization) @@ -571,9 +588,7 @@ public: Klass* find_field(Symbol* name, Symbol* sig, bool is_static, fieldDescriptor* fd) const; // find a non-static or static field given its offset within the class. - bool contains_field_offset(int offset) { - return instanceOopDesc::contains_field_offset(offset, nonstatic_field_size()); - } + bool contains_field_offset(int offset); bool find_local_field_from_offset(int offset, bool is_static, fieldDescriptor* fd) const; bool find_field_from_offset(int offset, bool is_static, fieldDescriptor* fd) const; @@ -735,10 +750,29 @@ public: _nonstatic_oop_map_size = words; } + bool has_contended_annotations() const { + return ((_misc_flags & _misc_has_contended_annotations) != 0); + } + void set_has_contended_annotations(bool value) { + if (value) { + _misc_flags |= _misc_has_contended_annotations; + } else { + _misc_flags &= ~_misc_has_contended_annotations; + } + } + #if INCLUDE_JVMTI // Redefinition locking. Class can only be redefined by one thread at a time. - bool is_being_redefined() const { return _is_being_redefined; } - void set_is_being_redefined(bool value) { _is_being_redefined = value; } + bool is_being_redefined() const { + return ((_misc_flags & _misc_is_being_redefined) != 0); + } + void set_is_being_redefined(bool value) { + if (value) { + _misc_flags |= _misc_is_being_redefined; + } else { + _misc_flags &= ~_misc_is_being_redefined; + } + } // RedefineClasses() support for previous versions: void add_previous_version(InstanceKlass* ik, int emcp_method_count); diff --git a/src/hotspot/share/oops/instanceOop.hpp b/src/hotspot/share/oops/instanceOop.hpp index 5a7d5fe05c3..a6bf15d2b4b 100644 --- a/src/hotspot/share/oops/instanceOop.hpp +++ b/src/hotspot/share/oops/instanceOop.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2020, 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 @@ -43,12 +43,6 @@ class instanceOopDesc : public oopDesc { klass_gap_offset_in_bytes() : sizeof(instanceOopDesc); } - - static bool contains_field_offset(int offset, int nonstatic_field_size) { - int base_in_bytes = base_offset_in_bytes(); - return (offset >= base_in_bytes && - (offset-base_in_bytes) < nonstatic_field_size * heapOopSize); - } }; #endif // SHARE_OOPS_INSTANCEOOP_HPP diff --git a/src/hotspot/share/runtime/arguments.cpp b/src/hotspot/share/runtime/arguments.cpp index f4be585d118..302c8ba581e 100644 --- a/src/hotspot/share/runtime/arguments.cpp +++ b/src/hotspot/share/runtime/arguments.cpp @@ -522,6 +522,7 @@ static SpecialFlag const special_jvm_flags[] = { { "AllowRedefinitionToAddDeleteMethods", JDK_Version::jdk(13), JDK_Version::undefined(), JDK_Version::undefined() }, { "FlightRecorder", JDK_Version::jdk(13), JDK_Version::undefined(), JDK_Version::undefined() }, { "MonitorBound", JDK_Version::jdk(14), JDK_Version::jdk(15), JDK_Version::jdk(16) }, + { "UseNewFieldLayout", JDK_Version::jdk(15), JDK_Version::jdk(16), JDK_Version::jdk(17) }, // --- Deprecated alias flags (see also aliased_jvm_flags) - sorted by obsolete_in then expired_in: { "DefaultMaxRAMFraction", JDK_Version::jdk(8), JDK_Version::undefined(), JDK_Version::undefined() }, diff --git a/src/hotspot/share/runtime/deoptimization.cpp b/src/hotspot/share/runtime/deoptimization.cpp index f5862bf491a..862a8c5153a 100644 --- a/src/hotspot/share/runtime/deoptimization.cpp +++ b/src/hotspot/share/runtime/deoptimization.cpp @@ -1156,18 +1156,18 @@ int compare(ReassignedField* left, ReassignedField* right) { // Restore fields of an eliminated instance object using the same field order // returned by HotSpotResolvedObjectTypeImpl.getInstanceFields(true) static int reassign_fields_by_klass(InstanceKlass* klass, frame* fr, RegisterMap* reg_map, ObjectValue* sv, int svIndex, oop obj, bool skip_internal) { - if (klass->superklass() != NULL) { - svIndex = reassign_fields_by_klass(klass->superklass(), fr, reg_map, sv, svIndex, obj, skip_internal); - } - GrowableArray* fields = new GrowableArray(); - for (AllFieldStream fs(klass); !fs.done(); fs.next()) { - if (!fs.access_flags().is_static() && (!skip_internal || !fs.access_flags().is_internal())) { - ReassignedField field; - field._offset = fs.offset(); - field._type = Signature::basic_type(fs.signature()); - fields->append(field); + InstanceKlass* ik = klass; + while (ik != NULL) { + for (AllFieldStream fs(ik); !fs.done(); fs.next()) { + if (!fs.access_flags().is_static() && (!skip_internal || !fs.access_flags().is_internal())) { + ReassignedField field; + field._offset = fs.offset(); + field._type = Signature::basic_type(fs.signature()); + fields->append(field); + } } + ik = ik->superklass(); } fields->sort(compare); for (int i = 0; i < fields->length(); i++) { diff --git a/src/hotspot/share/runtime/globals.hpp b/src/hotspot/share/runtime/globals.hpp index 13d4313f524..2c0c3a1054c 100644 --- a/src/hotspot/share/runtime/globals.hpp +++ b/src/hotspot/share/runtime/globals.hpp @@ -2488,7 +2488,15 @@ const size_t minimumSymbolTableSize = 1024; "Start flight recording with options")) \ \ experimental(bool, UseFastUnorderedTimeStamps, false, \ - "Use platform unstable time where supported for timestamps only") + "Use platform unstable time where supported for timestamps only") \ + \ + product(bool, UseNewFieldLayout, true, \ + "(Deprecated) Use new algorithm to compute field layouts") \ + \ + product(bool, UseEmptySlotsInSupers, true, \ + "Allow allocating fields in empty slots of super-classes") \ + \ + // Interface macros #define DECLARE_PRODUCT_FLAG(type, name, value, doc) extern "C" type name; diff --git a/src/hotspot/share/runtime/vmStructs.cpp b/src/hotspot/share/runtime/vmStructs.cpp index 94b544824e9..76e33249d24 100644 --- a/src/hotspot/share/runtime/vmStructs.cpp +++ b/src/hotspot/share/runtime/vmStructs.cpp @@ -235,7 +235,7 @@ typedef HashtableEntry KlassHashtableEntry; nonstatic_field(InstanceKlass, _static_oop_field_count, u2) \ nonstatic_field(InstanceKlass, _nonstatic_oop_map_size, int) \ nonstatic_field(InstanceKlass, _is_marked_dependent, bool) \ - nonstatic_field(InstanceKlass, _misc_flags, u2) \ + nonstatic_field(InstanceKlass, _misc_flags, u4) \ nonstatic_field(InstanceKlass, _minor_version, u2) \ nonstatic_field(InstanceKlass, _major_version, u2) \ nonstatic_field(InstanceKlass, _init_state, u1) \ diff --git a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedObjectTypeImpl.java b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedObjectTypeImpl.java index 570e7082bce..f86f6e7633f 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedObjectTypeImpl.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedObjectTypeImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2020, 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 @@ -34,6 +34,8 @@ import java.lang.annotation.Annotation; import java.lang.reflect.Field; import java.lang.reflect.Modifier; import java.nio.ByteOrder; +import java.util.Arrays; +import java.util.Comparator; import java.util.HashMap; import jdk.vm.ci.common.JVMCIError; @@ -61,6 +63,7 @@ final class HotSpotResolvedObjectTypeImpl extends HotSpotResolvedJavaType implem private static final HotSpotResolvedJavaField[] NO_FIELDS = new HotSpotResolvedJavaField[0]; private static final int METHOD_CACHE_ARRAY_CAPACITY = 8; + private static final SortByOffset fieldSortingMethod = new SortByOffset(); /** * The Java class this type represents. @@ -708,6 +711,12 @@ final class HotSpotResolvedObjectTypeImpl extends HotSpotResolvedJavaType implem } } + static class SortByOffset implements Comparator { + public int compare(ResolvedJavaField a, ResolvedJavaField b) { + return a.getOffset() - b.getOffset(); + } + } + @Override public ResolvedJavaField[] getInstanceFields(boolean includeSuperclasses) { if (instanceFields == null) { @@ -727,8 +736,17 @@ final class HotSpotResolvedObjectTypeImpl extends HotSpotResolvedJavaType implem // This class does not have any instance fields of its own. return NO_FIELDS; } else if (superClassFieldCount != 0) { + // Fields of the current class can be interleaved with fields of its super-classes + // but the array of fields to be returned must be sorted by increasing offset + // This code populates the array, then applies the sorting function HotSpotResolvedJavaField[] result = new HotSpotResolvedJavaField[instanceFields.length - superClassFieldCount]; - System.arraycopy(instanceFields, superClassFieldCount, result, 0, result.length); + int i = 0; + for (HotSpotResolvedJavaField f : instanceFields) { + if (f.getDeclaringClass() == this) { + result[i++] = f; + } + } + Arrays.sort(result, fieldSortingMethod); return result; } else { // The super classes of this class do not have any instance fields. @@ -781,23 +799,19 @@ final class HotSpotResolvedObjectTypeImpl extends HotSpotResolvedJavaType implem System.arraycopy(prepend, 0, result, 0, prependLength); } + // Fields of the current class can be interleaved with fields of its super-classes + // but the array of fields to be returned must be sorted by increasing offset + // This code populates the array, then applies the sorting function int resultIndex = prependLength; for (int i = 0; i < index; ++i) { FieldInfo field = new FieldInfo(i); if (field.isStatic() == retrieveStaticFields) { int offset = field.getOffset(); HotSpotResolvedJavaField resolvedJavaField = createField(field.getType(), offset, field.getAccessFlags(), i); - - // Make sure the result is sorted by offset. - int j; - for (j = resultIndex - 1; j >= prependLength && result[j].getOffset() > offset; j--) { - result[j + 1] = result[j]; - } - result[j + 1] = resolvedJavaField; - resultIndex++; + result[resultIndex++] = resolvedJavaField; } } - + Arrays.sort(result, fieldSortingMethod); return result; } diff --git a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfig.java b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfig.java index d5bc20ad962..ec99418df3e 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfig.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfig.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2020, 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 @@ -101,7 +101,7 @@ class HotSpotVMConfig extends HotSpotVMConfigAccess { final int instanceKlassConstantsOffset = getFieldOffset("InstanceKlass::_constants", Integer.class, "ConstantPool*"); final int instanceKlassFieldsOffset = getFieldOffset("InstanceKlass::_fields", Integer.class, "Array*"); final int instanceKlassAnnotationsOffset = getFieldOffset("InstanceKlass::_annotations", Integer.class, "Annotations*"); - final int instanceKlassMiscFlagsOffset = getFieldOffset("InstanceKlass::_misc_flags", Integer.class, "u2"); + final int instanceKlassMiscFlagsOffset = getFieldOffset("InstanceKlass::_misc_flags", Integer.class, "u4"); final int klassVtableStartOffset = getFieldValue("CompilerToVM::Data::Klass_vtable_start_offset", Integer.class, "int"); final int klassVtableLengthOffset = getFieldValue("CompilerToVM::Data::Klass_vtable_length_offset", Integer.class, "int"); diff --git a/test/hotspot/jtreg/runtime/CommandLine/VMDeprecatedOptions.java b/test/hotspot/jtreg/runtime/CommandLine/VMDeprecatedOptions.java index b055a859f68..0fbeb99e8be 100644 --- a/test/hotspot/jtreg/runtime/CommandLine/VMDeprecatedOptions.java +++ b/test/hotspot/jtreg/runtime/CommandLine/VMDeprecatedOptions.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2020, 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 @@ -46,6 +46,7 @@ public class VMDeprecatedOptions { {"InitialRAMFraction", "64"}, {"TLABStats", "false"}, {"AllowRedefinitionToAddDeleteMethods", "true"}, + {"UseNewFieldLayout", "true"}, // deprecated alias flags (see also aliased_jvm_flags): {"DefaultMaxRAMFraction", "4"}, diff --git a/test/hotspot/jtreg/runtime/FieldLayout/FieldDensityTest.java b/test/hotspot/jtreg/runtime/FieldLayout/FieldDensityTest.java new file mode 100644 index 00000000000..5f4fb7a79c4 --- /dev/null +++ b/test/hotspot/jtreg/runtime/FieldLayout/FieldDensityTest.java @@ -0,0 +1,157 @@ +/* + * Copyright (c) 2020, 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 8237767 + * @summary Verify behaviour of field layout algorithm + * @library /test/lib + * @modules java.base/jdk.internal.misc + * java.management + * @run main/othervm FieldDensityTest + */ + +/* + * @test + * @requires vm.bits == "64" + * @library /test/lib + * @modules java.base/jdk.internal.misc + * java.management + * @run main/othervm -XX:+UseCompressedOops -XX:+UseCompressedClassPointers FieldDensityTest + * @run main/othervm -XX:+UseCompressedOops -XX:-UseCompressedClassPointers FieldDensityTest + */ + +import java.lang.reflect.Field; +import java.util.Arrays; +import java.util.Comparator; +import jdk.internal.misc.Unsafe; + +import jdk.test.lib.Asserts; + +public class FieldDensityTest { + + static int OOP_SIZE_IN_BYTES = 0; + + static { + if (System.getProperty("sun.arch.data.model").equals("64")) { + if (System.getProperty("java.vm.compressedOopsMode") == null) { + OOP_SIZE_IN_BYTES = 8; + } else { + OOP_SIZE_IN_BYTES = 4; + } + } else { + OOP_SIZE_IN_BYTES = 4; + } + } + + static class FieldInfo { + public Field field; + public long offset; + + FieldInfo(Field field, long offset) { + this.field = field; + this.offset = offset; + } + + static void checkFieldsContiguity(FieldInfo[] fieldInfo) { + Arrays.sort(fieldInfo, new SortByOffset()); + for (int i = 0 ; i < fieldInfo.length - 2; i++) { + int size = sizeInBytesFromType(fieldInfo[i].field.getType()); + Asserts.assertEquals((int)(fieldInfo[i].offset + size), (int)fieldInfo[i+1].offset, + "Empty slot between fields, should not happen"); + } + } + } + + static int sizeInBytesFromType(Class type) { + if (!type.isPrimitive()) { + return OOP_SIZE_IN_BYTES; + } + switch(type.getTypeName()) { + case "boolean": + case "byte": return 1; + case "char": + case "short": return 2; + case "int": + case "float": return 4; + case "long": + case "double": return 8; + default: + throw new RuntimeException("Unrecognized signature"); + } + } + + static class SortByOffset implements Comparator { + public int compare(FieldInfo a, FieldInfo b) + { + return (int)(a.offset - b.offset); + } + } + + static class E { + public byte b0; + } + + static class F extends E { + public byte b1; + } + + static class G extends F { + public byte b2; + } + + static class H extends G { + public byte b3; + } + + public static class A { + public int i; + public byte b; + public long l; + public Object o; + } + + public static class B extends A { + public byte b0, b1, b2; + } + + static void testFieldsContiguity(Class c) { + Unsafe unsafe = Unsafe.getUnsafe(); + Field[] fields = c.getFields(); + FieldInfo[] fieldsInfo = new FieldInfo[fields.length]; + int i = 0; + for (Field f : fields) { + long offset = unsafe.objectFieldOffset(f); + fieldsInfo[i] = new FieldInfo(f, offset); + i++; + } + FieldInfo.checkFieldsContiguity(fieldsInfo); + } + + public static void main(String[] args) { + H h = new H(); + testFieldsContiguity(h.getClass()); + B b = new B(); + testFieldsContiguity(b.getClass()); + } +} From 080c67f0960fb43b15a2c6b476cff8573d5778ac Mon Sep 17 00:00:00 2001 From: Gerard Ziemski Date: Mon, 10 Feb 2020 11:41:55 -0600 Subject: [PATCH 42/50] 8235962: os::current_thread_id() is not signal safe on macOS Use mach_thread_self instead of pthread_mach_thread_np Reviewed-by: dholmes, cjplummer --- src/hotspot/os/bsd/osThread_bsd.cpp | 27 +++++++++++++++---- src/hotspot/os/bsd/osThread_bsd.hpp | 6 ++--- src/hotspot/os/bsd/os_bsd.cpp | 42 ++++++++++------------------- 3 files changed, 38 insertions(+), 37 deletions(-) diff --git a/src/hotspot/os/bsd/osThread_bsd.cpp b/src/hotspot/os/bsd/osThread_bsd.cpp index c614f3825e3..9eba7288fbe 100644 --- a/src/hotspot/os/bsd/osThread_bsd.cpp +++ b/src/hotspot/os/bsd/osThread_bsd.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2020, 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 @@ -36,11 +36,12 @@ void OSThread::pd_initialize() { #else _thread_id = NULL; #endif + _unique_thread_id = 0; _pthread_id = NULL; - _siginfo = NULL; - _ucontext = NULL; - _expanding_stack = 0; - _alt_sig_stack = NULL; + _siginfo = NULL; + _ucontext = NULL; + _expanding_stack = 0; + _alt_sig_stack = NULL; sigemptyset(&_caller_sigmask); @@ -49,6 +50,22 @@ void OSThread::pd_initialize() { assert(_startThread_lock !=NULL, "check"); } +// Additional thread_id used to correlate threads in SA +void OSThread::set_unique_thread_id() { +#ifdef __APPLE__ + thread_identifier_info_data_t m_ident_info; + mach_msg_type_number_t count = THREAD_IDENTIFIER_INFO_COUNT; + + mach_port_t mach_thread_port = mach_thread_self(); + guarantee(mach_thread_port != 0, "just checking"); + thread_info(mach_thread_port, THREAD_IDENTIFIER_INFO, + (thread_info_t) &m_ident_info, &count); + mach_port_deallocate(mach_task_self(), mach_thread_port); + + _unique_thread_id = m_ident_info.thread_id; +#endif +} + void OSThread::pd_destroy() { delete _startThread_lock; } diff --git a/src/hotspot/os/bsd/osThread_bsd.hpp b/src/hotspot/os/bsd/osThread_bsd.hpp index 1b910a18181..8e7375d7145 100644 --- a/src/hotspot/os/bsd/osThread_bsd.hpp +++ b/src/hotspot/os/bsd/osThread_bsd.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2020, 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 @@ -82,9 +82,7 @@ _pthread_id = tid; } - void set_unique_thread_id(uint64_t id) { - _unique_thread_id = id; - } + void set_unique_thread_id(); // *************************************************************** // suspension support. diff --git a/src/hotspot/os/bsd/os_bsd.cpp b/src/hotspot/os/bsd/os_bsd.cpp index 5c6ddf4f117..314566cd241 100644 --- a/src/hotspot/os/bsd/os_bsd.cpp +++ b/src/hotspot/os/bsd/os_bsd.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2020, 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 @@ -634,19 +634,6 @@ extern "C" objc_registerThreadWithCollector_t objc_registerThreadWithCollectorFu objc_registerThreadWithCollector_t objc_registerThreadWithCollectorFunction = NULL; #endif -#ifdef __APPLE__ -static uint64_t locate_unique_thread_id(mach_port_t mach_thread_port) { - // Additional thread_id used to correlate threads in SA - thread_identifier_info_data_t m_ident_info; - mach_msg_type_number_t count = THREAD_IDENTIFIER_INFO_COUNT; - - thread_info(mach_thread_port, THREAD_IDENTIFIER_INFO, - (thread_info_t) &m_ident_info, &count); - - return m_ident_info.thread_id; -} -#endif - // Thread start routine for all newly created threads static void *thread_native_entry(Thread *thread) { @@ -672,10 +659,10 @@ static void *thread_native_entry(Thread *thread) { os::current_thread_id(), (uintx) pthread_self()); #ifdef __APPLE__ - uint64_t unique_thread_id = locate_unique_thread_id(osthread->thread_id()); - guarantee(unique_thread_id != 0, "unique thread id was not found"); - osthread->set_unique_thread_id(unique_thread_id); + // Store unique OS X thread id used by SA + osthread->set_unique_thread_id(); #endif + // initialize signal mask for this thread os::Bsd::hotspot_sigmask(thread); @@ -823,12 +810,12 @@ bool os::create_attached_thread(JavaThread* thread) { osthread->set_thread_id(os::Bsd::gettid()); - // Store pthread info into the OSThread #ifdef __APPLE__ - uint64_t unique_thread_id = locate_unique_thread_id(osthread->thread_id()); - guarantee(unique_thread_id != 0, "just checking"); - osthread->set_unique_thread_id(unique_thread_id); + // Store unique OS X thread id used by SA + osthread->set_unique_thread_id(); #endif + + // Store pthread info into the OSThread osthread->set_pthread_id(::pthread_self()); // initialize floating point control register @@ -1100,12 +1087,11 @@ void os::die() { pid_t os::Bsd::gettid() { int retval = -1; -#ifdef __APPLE__ //XNU kernel - // despite the fact mach port is actually not a thread id use it - // instead of syscall(SYS_thread_selfid) as it certainly fits to u4 - retval = ::pthread_mach_thread_np(::pthread_self()); - guarantee(retval != 0, "just checking"); - return retval; +#ifdef __APPLE__ // XNU kernel + mach_port_t port = mach_thread_self(); + guarantee(MACH_PORT_VALID(port), "just checking"); + mach_port_deallocate(mach_task_self(), port); + return (pid_t)port; #else #ifdef __FreeBSD__ @@ -1128,7 +1114,7 @@ pid_t os::Bsd::gettid() { intx os::current_thread_id() { #ifdef __APPLE__ - return (intx)::pthread_mach_thread_np(::pthread_self()); + return (intx)os::Bsd::gettid(); #else return (intx)::pthread_self(); #endif From f0cdbbe120950a296db30c38cf017f4ef0902f40 Mon Sep 17 00:00:00 2001 From: John Rose Date: Mon, 10 Feb 2020 15:08:51 -0500 Subject: [PATCH 43/50] 8238239: java.lang.Record spec clarifications Reviewed-by: psandoz --- .../share/classes/java/lang/Record.java | 58 +++++++++++++------ 1 file changed, 41 insertions(+), 17 deletions(-) diff --git a/src/java.base/share/classes/java/lang/Record.java b/src/java.base/share/classes/java/lang/Record.java index 21a109b377d..f57bbb65a2c 100644 --- a/src/java.base/share/classes/java/lang/Record.java +++ b/src/java.base/share/classes/java/lang/Record.java @@ -109,7 +109,7 @@ public abstract class Record { * @implSpec * The implicitly provided implementation returns {@code true} if * and only if the argument is an instance of the same record type - * as this object, and each component of this record is equal to + * as this record, and each component of this record is equal to * the corresponding component of the argument; otherwise, {@code * false} is returned. Equality of a component {@code c} is * determined as follows: @@ -130,46 +130,70 @@ public abstract class Record { * * * - * The implicitly provided implementation conforms to the - * semantics described above; the implementation may or may not - * accomplish this by using calls to the particular methods - * listed. + * Apart from the semantics described above, the precise algorithm + * used in the implicitly provided implementation is unspecified + * and is subject to change. The implementation may or may not use + * calls to the particular methods listed, and may or may not + * perform comparisons in the order of component declaration. * * @see java.util.Objects#equals(Object,Object) * * @param obj the reference object with which to compare. - * @return {@code true} if this object is equal to the + * @return {@code true} if this record is equal to the * argument; {@code false} otherwise. */ @Override public abstract boolean equals(Object obj); /** + * Returns a hash code value for the record. * Obeys the general contract of {@link Object#hashCode Object.hashCode}. + * For records, hashing behavior is constrained by the refined contract + * of {@link Record#equals Record.equals}, so that any two records + * created from the same components must have the same hash code. * * @implSpec * The implicitly provided implementation returns a hash code value derived - * by combining the hash code value for all the components, according to - * {@link Object#hashCode()} for components whose types are reference types, - * or the primitive wrapper hash code for components whose types are primitive - * types. + * by combining appropriate hashes from each component. + * The precise algorithm used in the implicitly provided implementation + * is unspecified and is subject to change within the above limits. + * The resulting integer need not remain consistent from one + * execution of an application to another execution of the same + * application, even if the hashes of the component values were to + * remain consistent in this way. Also, a component of primitive + * type may contribute its bits to the hash code differently than + * the {@code hashCode} of its primitive wrapper class. * * @see Object#hashCode() * - * @return a hash code value for this object. + * @return a hash code value for this record. */ @Override public abstract int hashCode(); /** - * Obeys the general contract of {@link Object#toString Object.toString}. + * Returns a string representation of the record. + * In accordance with the general contract of {@link Object#toString()}, + * the {@code toString} method returns a string that + * "textually represents" this record. The result should + * be a concise but informative representation that is easy for a + * person to read. + *

    + * In addition to this general contract, record classes must further + * participate in the invariant that any two records which are + * {@linkplain Record#equals(Object) equal} must produce equal + * strings. This invariant is necessarily relaxed in the rare + * case where corresponding equal component values might fail + * to produce equal strings for themselves. * * @implSpec - * The implicitly provided implementation returns a string that is derived - * from the name of the record class and the names and string representations - * of all the components, according to {@link Object#toString()} for components - * whose types are reference types, and the primitive wrapper {@code toString} - * method for components whose types are primitive types. + * The implicitly provided implementation returns a string which + * contains the name of the record class, the names of components + * of the record, and string representations of component values, + * so as to fulfill the contract of this method. + * The precise format produced by this implicitly provided implementation + * is subject to change, so the present syntax should not be parsed + * by applications to recover record component values. * * @see Object#toString() * From b83285faccfd8975e79fde3b058ae7936a369955 Mon Sep 17 00:00:00 2001 From: Jonathan Gibbons Date: Mon, 10 Feb 2020 13:29:03 -0800 Subject: [PATCH 44/50] 8238646: Cleanup signature and use of CommentHelper Reviewed-by: prappo --- .../html/AnnotationTypeWriterImpl.java | 2 +- .../doclets/formats/html/ClassWriterImpl.java | 2 +- .../formats/html/HtmlDocletWriter.java | 18 +- .../formats/html/HtmlSerialFieldWriter.java | 2 +- .../formats/html/ModuleWriterImpl.java | 12 +- .../formats/html/PackageWriterImpl.java | 2 +- .../formats/html/TagletWriterImpl.java | 16 +- .../builders/SerializedFormBuilder.java | 2 +- .../doclets/toolkit/taglets/ParamTaglet.java | 2 +- .../doclets/toolkit/taglets/ReturnTaglet.java | 4 +- .../doclets/toolkit/taglets/SeeTaglet.java | 2 +- .../doclets/toolkit/taglets/SimpleTaglet.java | 4 +- .../doclets/toolkit/taglets/ThrowsTaglet.java | 8 +- .../doclets/toolkit/taglets/ValueTaglet.java | 2 +- .../doclets/toolkit/util/CommentHelper.java | 174 +++++++++--------- .../internal/doclets/toolkit/util/Utils.java | 2 +- 16 files changed, 127 insertions(+), 127 deletions(-) diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeWriterImpl.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeWriterImpl.java index 9179aec2ab2..e2bb12feeda 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeWriterImpl.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeWriterImpl.java @@ -202,7 +202,7 @@ public class AnnotationTypeWriterImpl extends SubWriterHolderWriter Content div = HtmlTree.DIV(HtmlStyle.deprecationBlock, deprLabel); if (!deprs.isEmpty()) { - List commentTags = ch.getDescription(configuration, deprs.get(0)); + List commentTags = ch.getDescription(deprs.get(0)); if (!commentTags.isEmpty()) { addInlineDeprecatedComment(annotationType, deprs.get(0), div); } diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassWriterImpl.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassWriterImpl.java index a6e41915737..293ab0c4ad6 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassWriterImpl.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassWriterImpl.java @@ -495,7 +495,7 @@ public class ClassWriterImpl extends SubWriterHolderWriter implements ClassWrite if (!deprs.isEmpty()) { CommentHelper ch = utils.getCommentHelper(typeElement); DocTree dt = deprs.get(0); - List commentTags = ch.getBody(configuration, dt); + List commentTags = ch.getBody(dt); if (!commentTags.isEmpty()) { addInlineDeprecatedComment(typeElement, deprs.get(0), div); } diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java index 34062eba539..993b500526d 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java @@ -1038,14 +1038,14 @@ public class HtmlDocletWriter { return new RawHtml(seetext); } boolean isLinkPlain = kind == LINK_PLAIN; - Content label = plainOrCode(isLinkPlain, new RawHtml(ch.getLabel(configuration, see))); + Content label = plainOrCode(isLinkPlain, new RawHtml(ch.getLabel(see))); //The text from the @see tag. We will output this text when a label is not specified. Content text = plainOrCode(kind == LINK_PLAIN, new RawHtml(seetext)); - TypeElement refClass = ch.getReferencedClass(configuration, see); - String refClassName = ch.getReferencedClassName(configuration, see); - Element refMem = ch.getReferencedMember(configuration, see); + TypeElement refClass = ch.getReferencedClass(see); + String refClassName = ch.getReferencedClassName(see); + Element refMem = ch.getReferencedMember(see); String refMemName = ch.getReferencedMemberName(see); if (refMemName == null && refMem != null) { @@ -1053,7 +1053,7 @@ public class HtmlDocletWriter { } if (refClass == null) { //@see is not referencing an included class - PackageElement refPackage = ch.getReferencedPackage(configuration, see); + PackageElement refPackage = ch.getReferencedPackage(see); if (refPackage != null && utils.isIncluded(refPackage)) { //@see is referencing an included package if (label.isEmpty()) @@ -1169,7 +1169,7 @@ public class HtmlDocletWriter { */ public void addInlineComment(Element element, DocTree tag, Content htmltree) { CommentHelper ch = utils.getCommentHelper(element); - List description = ch.getDescription(configuration, tag); + List description = ch.getDescription(tag); addCommentTags(element, tag, description, false, false, false, htmltree); } @@ -1194,7 +1194,7 @@ public class HtmlDocletWriter { */ public void addInlineDeprecatedComment(Element e, DocTree tag, Content htmltree) { CommentHelper ch = utils.getCommentHelper(e); - addCommentTags(e, ch.getBody(configuration, tag), true, false, false, htmltree); + addCommentTags(e, ch.getBody(tag), true, false, false, htmltree); } /** @@ -1220,8 +1220,8 @@ public class HtmlDocletWriter { public void addSummaryDeprecatedComment(Element element, DocTree tag, Content htmltree) { CommentHelper ch = utils.getCommentHelper(element); - List body = ch.getBody(configuration, tag); - addCommentTags(element, ch.getFirstSentenceTrees(configuration, body), true, true, true, htmltree); + List body = ch.getBody(tag); + addCommentTags(element, ch.getFirstSentenceTrees(body), true, true, true, htmltree); } /** diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlSerialFieldWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlSerialFieldWriter.java index 3a74c12cf30..6e56f46b87e 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlSerialFieldWriter.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlSerialFieldWriter.java @@ -180,7 +180,7 @@ public class HtmlSerialFieldWriter extends FieldWriterImpl @Override public void addMemberDescription(VariableElement field, DocTree serialFieldTag, Content contentTree) { CommentHelper ch = utils.getCommentHelper(field); - List description = ch.getDescription(configuration, serialFieldTag); + List description = ch.getDescription(serialFieldTag); if (!description.isEmpty()) { Content serialFieldContent = new RawHtml(ch.getText(description)); Content div = HtmlTree.DIV(HtmlStyle.block, serialFieldContent); diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleWriterImpl.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleWriterImpl.java index e3287a310b5..c911ede00da 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleWriterImpl.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleWriterImpl.java @@ -375,16 +375,16 @@ public class ModuleWriterImpl extends HtmlDocletWriter implements ModuleSummaryW }); // Generate the map of all services listed using @provides, and the description. (utils.getBlockTags(mdle, DocTree.Kind.PROVIDES)).forEach((tree) -> { - TypeElement t = ch.getServiceType(configuration, tree); + TypeElement t = ch.getServiceType(tree); if (t != null) { - providesTrees.put(t, commentTagsToContent(tree, mdle, ch.getDescription(configuration, tree), false, true)); + providesTrees.put(t, commentTagsToContent(tree, mdle, ch.getDescription(tree), false, true)); } }); // Generate the map of all services listed using @uses, and the description. (utils.getBlockTags(mdle, DocTree.Kind.USES)).forEach((tree) -> { - TypeElement t = ch.getServiceType(configuration, tree); + TypeElement t = ch.getServiceType(tree); if (t != null) { - usesTrees.put(t, commentTagsToContent(tree, mdle, ch.getDescription(configuration, tree), false, true)); + usesTrees.put(t, commentTagsToContent(tree, mdle, ch.getDescription(tree), false, true)); } }); } @@ -827,7 +827,7 @@ public class ModuleWriterImpl extends HtmlDocletWriter implements ModuleSummaryW Content deprPhrase = HtmlTree.SPAN(HtmlStyle.deprecatedLabel, getDeprecatedPhrase(mdle)); deprDiv.add(deprPhrase); if (!deprs.isEmpty()) { - List commentTags = ch.getDescription(configuration, deprs.get(0)); + List commentTags = ch.getDescription(deprs.get(0)); if (!commentTags.isEmpty()) { addInlineDeprecatedComment(mdle, deprs.get(0), deprDiv); } @@ -892,7 +892,7 @@ public class ModuleWriterImpl extends HtmlDocletWriter implements ModuleSummaryW deprDiv.add(deprPhrase); if (!deprs.isEmpty()) { CommentHelper ch = utils.getCommentHelper(pkg); - List commentTags = ch.getDescription(configuration, deprs.get(0)); + List commentTags = ch.getDescription(deprs.get(0)); if (!commentTags.isEmpty()) { addInlineDeprecatedComment(pkg, deprs.get(0), deprDiv); } diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageWriterImpl.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageWriterImpl.java index 6bbbd8d2af9..3817179c2ea 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageWriterImpl.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageWriterImpl.java @@ -153,7 +153,7 @@ public class PackageWriterImpl extends HtmlDocletWriter Content deprPhrase = HtmlTree.SPAN(HtmlStyle.deprecatedLabel, getDeprecatedPhrase(packageElement)); deprDiv.add(deprPhrase); if (!deprs.isEmpty()) { - List commentTags = ch.getDescription(configuration, deprs.get(0)); + List commentTags = ch.getDescription(deprs.get(0)); if (!commentTags.isEmpty()) { addInlineDeprecatedComment(packageElement, deprs.get(0), deprDiv); } diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/TagletWriterImpl.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/TagletWriterImpl.java index 7d68239a8ed..f6195561f9c 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/TagletWriterImpl.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/TagletWriterImpl.java @@ -139,7 +139,7 @@ public class TagletWriterImpl extends TagletWriter { result.add(HtmlTree.SPAN(HtmlStyle.deprecatedLabel, htmlWriter.getDeprecatedPhrase(element))); if (!deprs.isEmpty()) { - List commentTags = ch.getDescription(configuration, deprs.get(0)); + List commentTags = ch.getDescription(deprs.get(0)); if (!commentTags.isEmpty()) { result.add(commentTagsToOutput(null, element, commentTags, false)); } @@ -150,7 +150,7 @@ public class TagletWriterImpl extends TagletWriter { result.add(HtmlTree.SPAN(HtmlStyle.deprecatedLabel, htmlWriter.getDeprecatedPhrase(element))); if (!deprs.isEmpty()) { - List bodyTags = ch.getBody(configuration, deprs.get(0)); + List bodyTags = ch.getBody(deprs.get(0)); Content body = commentTagsToOutput(null, element, bodyTags, false); if (!body.isEmpty()) result.add(HtmlTree.DIV(HtmlStyle.deprecationComment, body)); @@ -191,7 +191,7 @@ public class TagletWriterImpl extends TagletWriter { Content nameTree = new StringContent(paramName); body.add(HtmlTree.CODE(defineID ? HtmlTree.SPAN_ID("param-" + paramName, nameTree) : nameTree)); body.add(" - "); - List description = ch.getDescription(configuration, paramTag); + List description = ch.getDescription(paramTag); body.add(htmlWriter.commentTagsToContent(paramTag, element, description, false, inSummary)); return HtmlTree.DD(body); } @@ -215,7 +215,7 @@ public class TagletWriterImpl extends TagletWriter { result.add(HtmlTree.DT(HtmlTree.SPAN(HtmlStyle.returnLabel, new StringContent(resources.getText("doclet.Returns"))))); result.add(HtmlTree.DD(htmlWriter.commentTagsToContent( - returnTag, element, ch.getDescription(configuration, returnTag), false, inSummary))); + returnTag, element, ch.getDescription(returnTag), false, inSummary))); return result; } @@ -279,7 +279,7 @@ public class TagletWriterImpl extends TagletWriter { if (many) { body.add(", "); } - List bodyTags = ch.getBody(configuration, simpleTag); + List bodyTags = ch.getBody(simpleTag); body.add(htmlWriter.commentTagsToContent(simpleTag, element, bodyTags, false, inSummary)); many = true; } @@ -292,7 +292,7 @@ public class TagletWriterImpl extends TagletWriter { ContentBuilder result = new ContentBuilder(); result.add(HtmlTree.DT(HtmlTree.SPAN(HtmlStyle.simpleTagLabel, new RawHtml(header)))); CommentHelper ch = utils.getCommentHelper(element); - List description = ch.getDescription(configuration, simpleTag); + List description = ch.getDescription(simpleTag); Content body = htmlWriter.commentTagsToContent(simpleTag, element, description, false, inSummary); result.add(HtmlTree.DD(body)); return result; @@ -317,7 +317,7 @@ public class TagletWriterImpl extends TagletWriter { public Content throwsTagOutput(Element element, DocTree throwsTag, TypeMirror substituteType) { ContentBuilder body = new ContentBuilder(); CommentHelper ch = utils.getCommentHelper(element); - Element exception = ch.getException(configuration, throwsTag); + Element exception = ch.getException(throwsTag); Content excName; if (substituteType != null) { excName = htmlWriter.getLink(new LinkInfoImpl(configuration, LinkInfoImpl.Kind.MEMBER, @@ -333,7 +333,7 @@ public class TagletWriterImpl extends TagletWriter { excName = htmlWriter.getLink(link); } body.add(HtmlTree.CODE(excName)); - List description = ch.getDescription(configuration, throwsTag); + List description = ch.getDescription(throwsTag); Content desc = htmlWriter.commentTagsToContent(throwsTag, element, description, false, inSummary); if (desc != null && !desc.isEmpty()) { body.add(" - "); diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/SerializedFormBuilder.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/SerializedFormBuilder.java index 51552837ac9..a42613bdee2 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/SerializedFormBuilder.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/SerializedFormBuilder.java @@ -482,7 +482,7 @@ public class SerializedFormBuilder extends AbstractBuilder { if (tag.getName() == null || tag.getType() == null) // ignore malformed @serialField tags continue; Content fieldsContentTree = fieldWriter.getFieldsContentHeader(tag.equals(tags.last())); - TypeElement te = ch.getReferencedClass(configuration, tag); + TypeElement te = ch.getReferencedClass(tag); String fieldType = ch.getReferencedMemberName(tag); if (te != null && utils.isPrimitive(te.asType())) { fieldType = utils.getTypeName(te.asType(), false); diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/ParamTaglet.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/ParamTaglet.java index 69f099371ee..d3f19bebba5 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/ParamTaglet.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/ParamTaglet.java @@ -126,7 +126,7 @@ public class ParamTaglet extends BaseTaglet implements InheritableTaglet { if (rankMap.containsKey(paramName) && rankMap.get(paramName).equals((input.tagId))) { output.holder = input.element; output.holderTag = tag; - output.inlineTags = ch.getBody(utils.configuration, tag); + output.inlineTags = ch.getBody(tag); return; } } diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/ReturnTaglet.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/ReturnTaglet.java index 76f0775aba6..1f3f5cc63e3 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/ReturnTaglet.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/ReturnTaglet.java @@ -64,8 +64,8 @@ public class ReturnTaglet extends BaseTaglet implements InheritableTaglet { output.holder = input.element; output.holderTag = tags.get(0); output.inlineTags = input.isFirstSentence - ? ch.getFirstSentenceTrees(input.utils.configuration, output.holderTag) - : ch.getDescription(input.utils.configuration, output.holderTag); + ? ch.getFirstSentenceTrees(output.holderTag) + : ch.getDescription(output.holderTag); } } diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/SeeTaglet.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/SeeTaglet.java index a39340e3b13..076c704736a 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/SeeTaglet.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/SeeTaglet.java @@ -60,7 +60,7 @@ public class SeeTaglet extends BaseTaglet implements InheritableTaglet { output.holder = input.element; output.holderTag = tags.get(0); output.inlineTags = input.isFirstSentence - ? ch.getFirstSentenceTrees(input.utils.configuration, output.holderTag) + ? ch.getFirstSentenceTrees(output.holderTag) : ch.getReference(output.holderTag); } } diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/SimpleTaglet.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/SimpleTaglet.java index fd4b2a59979..bea3ad6964a 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/SimpleTaglet.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/SimpleTaglet.java @@ -173,8 +173,8 @@ public class SimpleTaglet extends BaseTaglet implements InheritableTaglet { output.holderTag = tags.get(0); CommentHelper ch = input.utils.getCommentHelper(output.holder); output.inlineTags = input.isFirstSentence - ? ch.getFirstSentenceTrees(input.utils.configuration, output.holderTag) - : ch.getTags(input.utils.configuration, output.holderTag); + ? ch.getFirstSentenceTrees(output.holderTag) + : ch.getTags(output.holderTag); } } diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/ThrowsTaglet.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/ThrowsTaglet.java index 4342cd30917..ebcb1b547d7 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/ThrowsTaglet.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/ThrowsTaglet.java @@ -72,7 +72,7 @@ public class ThrowsTaglet extends BaseTaglet Element exception; CommentHelper ch = utils.getCommentHelper(input.element); if (input.tagId == null) { - exception = ch.getException(utils.configuration, input.docTreeInfo.docTree); + exception = ch.getException(input.docTreeInfo.docTree); input.tagId = exception == null ? ch.getExceptionName(input.docTreeInfo.docTree).getSignature() : utils.getFullyQualifiedName(exception); @@ -81,12 +81,12 @@ public class ThrowsTaglet extends BaseTaglet } for (DocTree dt : input.utils.getThrowsTrees(input.element)) { - Element exc = ch.getException(utils.configuration, dt); + Element exc = ch.getException(dt); if (exc != null && (input.tagId.equals(utils.getSimpleName(exc)) || (input.tagId.equals(utils.getFullyQualifiedName(exc))))) { output.holder = input.element; output.holderTag = dt; - output.inlineTags = ch.getBody(input.utils.configuration, output.holderTag); + output.inlineTags = ch.getBody(output.holderTag); output.tagList.add(dt); } else if (exception != null && exc != null && utils.isTypeElement(exc) && utils.isTypeElement(exception) && @@ -193,7 +193,7 @@ public class ThrowsTaglet extends BaseTaglet CommentHelper ch = utils.getCommentHelper(entry.getValue()); Element e = entry.getValue(); for (DocTree dt : entry.getKey()) { - Element te = ch.getException(utils.configuration, dt); + Element te = ch.getException(dt); String excName = ch.getExceptionName(dt).toString(); TypeMirror substituteType = typeSubstitutions.get(excName); if ((!allowDuplicates) && diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/ValueTaglet.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/ValueTaglet.java index 04c2c4c0d75..0d362f7e902 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/ValueTaglet.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/ValueTaglet.java @@ -77,7 +77,7 @@ public class ValueTaglet extends BaseTaglet { Element e = signature == null ? holder - : ch.getReferencedMember(config, tag); + : ch.getReferencedMember(tag); return (e != null && config.utils.isVariableElement(e)) ? (VariableElement) e diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/CommentHelper.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/CommentHelper.java index d3647296c3f..515b33700fe 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/CommentHelper.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/CommentHelper.java @@ -28,11 +28,10 @@ package jdk.javadoc.internal.doclets.toolkit.util; import java.util.ArrayList; import java.util.Collections; import java.util.List; +import java.util.stream.Collectors; import javax.lang.model.element.Element; import javax.lang.model.element.ExecutableElement; -import javax.lang.model.element.ModuleElement; -import javax.lang.model.element.Name; import javax.lang.model.element.PackageElement; import javax.lang.model.element.TypeElement; import javax.lang.model.type.TypeMirror; @@ -84,18 +83,27 @@ import static com.sun.source.doctree.DocTree.Kind.*; * deletion without notice. */ public class CommentHelper { + private final BaseConfiguration configuration; public final TreePath path; - public final DocCommentTree dctree; + public final DocCommentTree dcTree; public final Element element; private Element overriddenElement; public static final String SPACER = " "; - public CommentHelper(BaseConfiguration configuration, Element element, TreePath path, DocCommentTree dctree) { - //this.configuration = configuration; + /** + * Creates a utility class to encapsulate the contextual information for a doc comment tree. + * + * @param configuration the configuration + * @param element the element for which this is a doc comment + * @param path the path for the element + * @param dcTree the doc comment + */ + public CommentHelper(BaseConfiguration configuration, Element element, TreePath path, DocCommentTree dcTree) { + this.configuration = configuration; this.element = element; this.path = path; - this.dctree = dctree; + this.dcTree = dcTree; } public void setOverrideElement(Element ove) { @@ -144,17 +152,18 @@ public class CommentHelper { } } - Element getElement(BaseConfiguration c, ReferenceTree rtree) { + Element getElement(ReferenceTree rtree) { + Utils utils = configuration.utils; // likely a synthesized tree if (path == null) { // NOTE: this code path only supports module/package/type signatures // and not member signatures. For more complete support, // set a suitable path and avoid this branch. - TypeMirror symbol = c.utils.getSymbol(rtree.getSignature()); + TypeMirror symbol = utils.getSymbol(rtree.getSignature()); if (symbol == null) { return null; } - return c.docEnv.getTypeUtils().asElement(symbol); + return configuration.docEnv.getTypeUtils().asElement(symbol); } // case A: the element contains no comments associated and // the comments need to be copied from ancestor @@ -162,37 +171,37 @@ public class CommentHelper { // as appropriate has to be copied over. // Case A. - if (dctree == null && overriddenElement != null) { - CommentHelper ovch = c.utils.getCommentHelper(overriddenElement); - return ovch.getElement(c, rtree); + if (dcTree == null && overriddenElement != null) { + CommentHelper ovch = utils.getCommentHelper(overriddenElement); + return ovch.getElement(rtree); } - if (dctree == null) { + if (dcTree == null) { return null; } - DocTreePath docTreePath = DocTreePath.getPath(path, dctree, rtree); + DocTreePath docTreePath = DocTreePath.getPath(path, dcTree, rtree); if (docTreePath == null) { // Case B. if (overriddenElement != null) { - CommentHelper ovch = c.utils.getCommentHelper(overriddenElement); - return ovch.getElement(c, rtree); + CommentHelper ovch = utils.getCommentHelper(overriddenElement); + return ovch.getElement(rtree); } return null; } - DocTrees doctrees = c.docEnv.getDocTrees(); + DocTrees doctrees = configuration.docEnv.getDocTrees(); return doctrees.getElement(docTreePath); } - public Element getException(BaseConfiguration c, DocTree dtree) { + public Element getException(DocTree dtree) { if (dtree.getKind() == THROWS || dtree.getKind() == EXCEPTION) { ThrowsTree tt = (ThrowsTree)dtree; ReferenceTree exceptionName = tt.getExceptionName(); - return getElement(c, exceptionName); + return getElement(exceptionName); } return null; } - public List getDescription(BaseConfiguration c, DocTree dtree) { - return getTags(c, dtree); + public List getDescription(DocTree dtree) { + return getTags(dtree); } public String getText(List list) { @@ -224,16 +233,14 @@ public class CommentHelper { quote = "\""; break; case SINGLE: - quote = "\'"; + quote = "'"; break; default: quote = ""; break; } sb.append(quote); - node.getValue().stream().forEach((dt) -> { - dt.accept(this, null); - }); + node.getValue().forEach(dt -> dt.accept(this, null)); sb.append(quote); return null; } @@ -259,9 +266,7 @@ public class CommentHelper { } node.getReference().accept(this, null); - node.getLabel().stream().forEach((dt) -> { - dt.accept(this, null); - }); + node.getLabel().forEach(dt -> dt.accept(this, null) ); return null; } @@ -285,17 +290,13 @@ public class CommentHelper { @Override public Void visitSee(SeeTree node, Void p) { - node.getReference().stream().forEach((dt) -> { - dt.accept(this, null); - }); + node.getReference().forEach(dt -> dt.accept(this, null)); return null; } @Override public Void visitSerial(SerialTree node, Void p) { - node.getDescription().stream().forEach((dt) -> { - dt.accept(this, null); - }); + node.getDescription().forEach(dt -> dt.accept(this, null)); return null; } @@ -303,9 +304,7 @@ public class CommentHelper { public Void visitStartElement(StartElementTree node, Void p) { sb.append("<"); sb.append(node.getName()); - node.getAttributes().stream().forEach((dt) -> { - dt.accept(this, null); - }); + node.getAttributes().forEach(dt -> dt.accept(this, null)); sb.append((node.isSelfClosing() ? "/>" : ">")); return null; } @@ -318,9 +317,7 @@ public class CommentHelper { @Override public Void visitUnknownBlockTag(UnknownBlockTagTree node, Void p) { - node.getContent().stream().forEach((dt) -> { - dt.accept(this, null); - }); + node.getContent().forEach(dt -> dt.accept(this, null)); return null; } @@ -338,24 +335,22 @@ public class CommentHelper { return sb; } - public String getLabel(BaseConfiguration c, DocTree dtree) { + public String getLabel(DocTree dtree) { return new SimpleDocTreeVisitor() { @Override public String visitLink(LinkTree node, Void p) { - StringBuilder sb = new StringBuilder(); - node.getLabel().stream().forEach((dt) -> { - sb.append(getText(dt)); - }); - return sb.toString(); + return node.getLabel().stream() + .map(dt -> getText(dt)) + .collect(Collectors.joining()); } @Override public String visitSee(SeeTree node, Void p) { - StringBuilder sb = new StringBuilder(); - node.getReference().stream().filter((dt) -> (c.utils.isText(dt))).forEach((dt) -> { - sb.append(((TextTree)dt).getBody()); - }); - return sb.toString(); + Utils utils = configuration.utils; + return node.getReference().stream() + .filter(utils::isText) + .map(dt -> ((TextTree) dt).getBody()) + .collect(Collectors.joining()); } @Override @@ -365,22 +360,24 @@ public class CommentHelper { }.visit(dtree, null); } - public TypeElement getReferencedClass(BaseConfiguration c, DocTree dtree) { - Element e = getReferencedElement(c, dtree); + public TypeElement getReferencedClass(DocTree dtree) { + Utils utils = configuration.utils; + Element e = getReferencedElement(dtree); if (e == null) { return null; - } else if (c.utils.isTypeElement(e)) { + } else if (utils.isTypeElement(e)) { return (TypeElement) e; - } else if (!c.utils.isPackage(e)) { - return c.utils.getEnclosingTypeElement(e); + } else if (!utils.isPackage(e)) { + return utils.getEnclosingTypeElement(e); } return null; } - public String getReferencedClassName(BaseConfiguration c, DocTree dtree) { - Element e = getReferencedClass(c, dtree); + public String getReferencedClassName(DocTree dtree) { + Utils utils = configuration.utils; + Element e = getReferencedClass(dtree); if (e != null) { - return c.utils.isTypeElement(e) ? c.utils.getSimpleName(e) : null; + return utils.isTypeElement(e) ? utils.getSimpleName(e) : null; } String s = getReferencedSignature(dtree); if (s == null) { @@ -390,12 +387,13 @@ public class CommentHelper { return (n == -1) ? s : s.substring(0, n); } - public Element getReferencedMember(BaseConfiguration c, DocTree dtree) { - Element e = getReferencedElement(c, dtree); + public Element getReferencedMember(DocTree dtree) { + Utils utils = configuration.utils; + Element e = getReferencedElement(dtree); if (e == null) { return null; } - return (c.utils.isExecutableElement(e) || c.utils.isVariableElement(e)) ? e : null; + return (utils.isExecutableElement(e) || utils.isVariableElement(e)) ? e : null; } public String getReferencedMemberName(DocTree dtree) { @@ -407,33 +405,34 @@ public class CommentHelper { return (n == -1) ? null : s.substring(n + 1); } - public String getReferencedMemberName(BaseConfiguration c, Element e) { + public String getReferencedMemberName(Element e) { if (e == null) { return null; } - return c.utils.isExecutableElement(e) - ? c.utils.getSimpleName(e) + c.utils.makeSignature((ExecutableElement) e, true, true) - : c.utils.getSimpleName(e); + Utils utils = configuration.utils; + return utils.isExecutableElement(e) + ? utils.getSimpleName(e) + utils.makeSignature((ExecutableElement) e, true, true) + : utils.getSimpleName(e); } - public PackageElement getReferencedPackage(BaseConfiguration c, DocTree dtree) { - Element e = getReferencedElement(c, dtree); + public PackageElement getReferencedPackage(DocTree dtree) { + Element e = getReferencedElement(dtree); if (e != null) { - return c.utils.containingPackage(e); + Utils utils = configuration.utils; + return utils.containingPackage(e); } return null; } - public List getFirstSentenceTrees(BaseConfiguration c, List body) { - List firstSentence = c.docEnv.getDocTrees().getFirstSentence(body); - return firstSentence; + public List getFirstSentenceTrees(List body) { + return configuration.docEnv.getDocTrees().getFirstSentence(body); } - public List getFirstSentenceTrees(BaseConfiguration c, DocTree dtree) { - return getFirstSentenceTrees(c, getBody(c, dtree)); + public List getFirstSentenceTrees(DocTree dtree) { + return getFirstSentenceTrees(getBody(dtree)); } - private Element getReferencedElement(BaseConfiguration c, DocTree dtree) { + private Element getReferencedElement(DocTree dtree) { return new SimpleDocTreeVisitor() { @Override public Element visitSee(SeeTree node, Void p) { @@ -460,7 +459,7 @@ public class CommentHelper { @Override public Element visitReference(ReferenceTree node, Void p) { - return getElement(c, node); + return getElement(node); } @Override @@ -480,10 +479,11 @@ public class CommentHelper { }.visit(dtree, null); } - public TypeElement getServiceType(BaseConfiguration c, DocTree dtree) { - Element e = getReferencedElement(c, dtree); + public TypeElement getServiceType(DocTree dtree) { + Element e = getReferencedElement(dtree); if (e != null) { - return c.utils.isTypeElement(e) ? (TypeElement) e : null; + Utils utils = configuration.utils; + return utils.isTypeElement(e) ? (TypeElement) e : null; } return null; } @@ -546,11 +546,11 @@ public class CommentHelper { } } - public List getTags(BaseConfiguration c, DocTree dtree) { + public List getTags(DocTree dtree) { return new SimpleDocTreeVisitor, Void>() { List asList(String content) { List out = new ArrayList<>(); - out.add(c.cmtUtils.makeTextTree(content)); + out.add(configuration.cmtUtils.makeTextTree(content)); return out; } @@ -651,22 +651,22 @@ public class CommentHelper { }.visit(dtree, null); } - public List getBody(BaseConfiguration c, DocTree dtree) { - return getTags(c, dtree); + public List getBody(DocTree dtree) { + return getTags(dtree); } public ReferenceTree getType(DocTree dtree) { if (dtree.getKind() == SERIAL_FIELD) { - return ((SerialFieldTree)dtree).getType(); + return ((SerialFieldTree) dtree).getType(); } else { return null; } } public DocTreePath getDocTreePath(DocTree dtree) { - if (path == null || dctree == null || dtree == null) + if (path == null || dcTree == null || dtree == null) return null; - return DocTreePath.getPath(path, dctree, dtree); + return DocTreePath.getPath(path, dcTree, dtree); } public Element getOverriddenElement() { @@ -680,7 +680,7 @@ public class CommentHelper { */ @Override public String toString() { - StringBuilder sb = new StringBuilder("CommentHelper{" + "path=" + path + ", dctree=" + dctree); + StringBuilder sb = new StringBuilder("CommentHelper{" + "path=" + path + ", dcTree=" + dcTree); sb.append(", element="); sb.append(element.getEnclosingElement()); sb.append("::"); diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Utils.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Utils.java index a630be0b5f2..3f54fe76868 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Utils.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Utils.java @@ -3198,7 +3198,7 @@ public class Utils { public DocCommentTree getDocCommentTree(Element element) { CommentHelper ch = commentHelperCache.get(element); if (ch != null) { - return ch.dctree; + return ch.dcTree; } DocCommentTree dcTree = getDocCommentTree0(element); if (dcTree != null) { From 987be2bb6d34d05c74916ed16051afe046a2d40f Mon Sep 17 00:00:00 2001 From: Ivan Gerasimov Date: Mon, 10 Feb 2020 16:10:45 -0800 Subject: [PATCH 45/50] 8235812: Unicode linebreak with quantifier does not match valid input Reviewed-by: rriggs --- .../classes/java/util/regex/Pattern.java | 78 +++++++++++++++--- test/jdk/java/util/regex/RegExTest.java | 82 ++++++++++++++++++- 2 files changed, 148 insertions(+), 12 deletions(-) diff --git a/src/java.base/share/classes/java/util/regex/Pattern.java b/src/java.base/share/classes/java/util/regex/Pattern.java index b674a26d1d9..9e137e5b048 100644 --- a/src/java.base/share/classes/java/util/regex/Pattern.java +++ b/src/java.base/share/classes/java/util/regex/Pattern.java @@ -2064,7 +2064,7 @@ loop: for(int x=0, offset=0; x x == 0x0A || x == 0x0B || + x == 0x0C || x == 0x0D || x == 0x85 || x == 0x2028 || + x == 0x2029); + chClass.next = branchConn; + grHead.next = new Branch(slice, chClass, branchConn); + return groupWithClosure(closure(grHead), grHead, grTail, false); + } + /** * Processes repetition. If the next character peeked is a quantifier * then new nodes must be appended to handle the repetition. @@ -4723,8 +4778,8 @@ loop: for(int x=0, offset=0; x= atoms.length) { - Node[] tmp = new Node[atoms.length*2]; - System.arraycopy(atoms, 0, tmp, 0, atoms.length); - atoms = tmp; + int len = ArraysSupport.newLength(size, + 1, /* minimum growth */ + size /* preferred growth */); + atoms = Arrays.copyOf(atoms, len); } atoms[size++] = node; } diff --git a/test/jdk/java/util/regex/RegExTest.java b/test/jdk/java/util/regex/RegExTest.java index 38d201aa965..6a0c7a583b5 100644 --- a/test/jdk/java/util/regex/RegExTest.java +++ b/test/jdk/java/util/regex/RegExTest.java @@ -35,7 +35,7 @@ * 8027645 8035076 8039124 8035975 8074678 6854417 8143854 8147531 7071819 * 8151481 4867170 7080302 6728861 6995635 6736245 4916384 6328855 6192895 * 6345469 6988218 6693451 7006761 8140212 8143282 8158482 8176029 8184706 - * 8194667 8197462 8184692 8221431 8224789 8228352 8230829 8236034 + * 8194667 8197462 8184692 8221431 8224789 8228352 8230829 8236034 8235812 * * @library /test/lib * @library /lib/testlibrary/java/lang @@ -57,7 +57,9 @@ import java.nio.CharBuffer; import java.nio.file.Files; import java.util.ArrayList; import java.util.Arrays; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Random; import java.util.Scanner; import java.util.function.Function; @@ -186,6 +188,7 @@ public class RegExTest { invalidGroupName(); illegalRepetitionRange(); surrogatePairWithCanonEq(); + lineBreakWithQuantifier(); if (failure) { throw new @@ -5000,4 +5003,81 @@ public class RegExTest { } report("surrogatePairWithCanonEq"); } + + // This test is for 8235812 + private static void lineBreakWithQuantifier() { + // key: pattern + // value: lengths of input that must match the pattern + Map> cases = Map.ofEntries( + Map.entry("\\R?", List.of(0, 1)), + Map.entry("\\R*", List.of(0, 1, 2, 3)), + Map.entry("\\R+", List.of(1, 2, 3)), + Map.entry("\\R{0}", List.of(0)), + Map.entry("\\R{1}", List.of(1)), + Map.entry("\\R{2}", List.of(2)), + Map.entry("\\R{3}", List.of(3)), + Map.entry("\\R{0,}", List.of(0, 1, 2, 3)), + Map.entry("\\R{1,}", List.of(1, 2, 3)), + Map.entry("\\R{2,}", List.of(2, 3)), + Map.entry("\\R{3,}", List.of(3)), + Map.entry("\\R{0,0}", List.of(0)), + Map.entry("\\R{0,1}", List.of(0, 1)), + Map.entry("\\R{0,2}", List.of(0, 1, 2)), + Map.entry("\\R{0,3}", List.of(0, 1, 2, 3)), + Map.entry("\\R{1,1}", List.of(1)), + Map.entry("\\R{1,2}", List.of(1, 2)), + Map.entry("\\R{1,3}", List.of(1, 2, 3)), + Map.entry("\\R{2,2}", List.of(2)), + Map.entry("\\R{2,3}", List.of(2, 3)), + Map.entry("\\R{3,3}", List.of(3)), + Map.entry("\\R", List.of(1)), + Map.entry("\\R\\R", List.of(2)), + Map.entry("\\R\\R\\R", List.of(3)) + ); + + // key: length of input + // value: all possible inputs of given length + Map> inputs = new HashMap<>(); + String[] Rs = { "\r\n", "\r", "\n", + "\u000B", "\u000C", "\u0085", "\u2028", "\u2029" }; + StringBuilder sb = new StringBuilder(); + for (int len = 0; len <= 3; ++len) { + int[] idx = new int[len + 1]; + do { + sb.setLength(0); + for (int j = 0; j < len; ++j) + sb.append(Rs[idx[j]]); + inputs.computeIfAbsent(len, ArrayList::new).add(sb.toString()); + idx[0]++; + for (int j = 0; j < len; ++j) { + if (idx[j] < Rs.length) + break; + idx[j] = 0; + idx[j+1]++; + } + } while (idx[len] == 0); + } + + // exhaustive testing + for (String patStr : cases.keySet()) { + Pattern[] pats = patStr.endsWith("R") + ? new Pattern[] { Pattern.compile(patStr) } // no quantifiers + : new Pattern[] { Pattern.compile(patStr), // greedy + Pattern.compile(patStr + "?") }; // reluctant + Matcher m = pats[0].matcher(""); + for (Pattern p : pats) { + m.usePattern(p); + for (int len : cases.get(patStr)) { + for (String in : inputs.get(len)) { + if (!m.reset(in).matches()) { + failCount++; + System.err.println("Expected to match '" + + in + "' =~ /" + p + "/"); + } + } + } + } + } + report("lineBreakWithQuantifier"); + } } From fbca3fa710d8068e39eee574813c35f1d60fabe5 Mon Sep 17 00:00:00 2001 From: John Jiang Date: Tue, 11 Feb 2020 08:36:02 +0800 Subject: [PATCH 46/50] 8238677: java/net/httpclient/ssltest/CertificateTest.java should not specify TLS version Reviewed-by: dfuchs --- .../jdk/java/net/httpclient/ssltest/Cert.java | 231 ++++++++++++++++++ .../httpclient/ssltest/CertificateTest.java | 80 +++--- .../java/net/httpclient/ssltest/Server.java | 34 +-- .../java/net/httpclient/ssltest/bad.keystore | Bin 2329 -> 0 bytes .../java/net/httpclient/ssltest/gen-certs.sh | 53 ++++ .../java/net/httpclient/ssltest/good.keystore | Bin 2321 -> 0 bytes .../net/httpclient/ssltest/loopback.keystore | Bin 2343 -> 0 bytes 7 files changed, 337 insertions(+), 61 deletions(-) create mode 100644 test/jdk/java/net/httpclient/ssltest/Cert.java delete mode 100644 test/jdk/java/net/httpclient/ssltest/bad.keystore create mode 100644 test/jdk/java/net/httpclient/ssltest/gen-certs.sh delete mode 100644 test/jdk/java/net/httpclient/ssltest/good.keystore delete mode 100644 test/jdk/java/net/httpclient/ssltest/loopback.keystore diff --git a/test/jdk/java/net/httpclient/ssltest/Cert.java b/test/jdk/java/net/httpclient/ssltest/Cert.java new file mode 100644 index 00000000000..dc3d1c9a4fa --- /dev/null +++ b/test/jdk/java/net/httpclient/ssltest/Cert.java @@ -0,0 +1,231 @@ +/* + * Copyright (c) 2020, 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. + */ + +/* + * The certificates used by this test. + * They are generated by script gen-certs.sh. + */ +public enum Cert { + + /* + * Version: 3 (0x2) + * Serial Number: + * 65:24:13:3c:7a:98:0c:16:a2:91:9c:8e:42:84:cf:be:be:d2:f1:42 + * Signature Algorithm: sha256WithRSAEncryption + * Issuer: CN = evil + * Validity + * Not Before: Feb 8 03:59:27 2020 GMT + * Not After : Feb 5 03:59:27 2030 GMT + * Subject: CN = evil + * X509v3 extensions: + * X509v3 Subject Key Identifier: + * 09:D0:E8:51:6C:0F:88:59:47:D1:FD:05:C2:00:10:D6:A4:80:04:07 + * X509v3 Authority Key Identifier: + * keyid:09:D0:E8:51:6C:0F:88:59:47:D1:FD:05:C2:00:10:D6:A4:80:04:07 + */ + BAD_CERT( + "RSA", + "-----BEGIN CERTIFICATE-----\n" + + "MIIC7jCCAdagAwIBAgIUZSQTPHqYDBaikZyOQoTPvr7S8UIwDQYJKoZIhvcNAQEL\n" + + "BQAwDzENMAsGA1UEAwwEZXZpbDAeFw0yMDAyMDgwMzU5MjdaFw0zMDAyMDUwMzU5\n" + + "MjdaMA8xDTALBgNVBAMMBGV2aWwwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEK\n" + + "AoIBAQCmirsTOW1G+LoI/Aj59lMk3KLywAbXASeTdnBoWkchuJ0QJWO/5b5kgf6Q\n" + + "VFfe9lXof9psGIKaCGq6KsI0uqj7+7y++//l+E6GB8UshVB8MXc1SLFe8AxPYhWC\n" + + "TXaKWyWGl7PXvugzbByFrf4IwE9+6phYkvl/zHvaMKqdwnkpXuyuBgT3BiYTSNsx\n" + + "k1Ma+s5rqiwsOODSzwhadwmU9T4z11KypYb/DixJgHvUET4gTB+i3ll+PllVdQtX\n" + + "zBLpEuj5HadK0PsqlOIok3eoSU+MpRqsz0gFEQ95y+Les3MlBeQ7fVKBz8GbrFDB\n" + + "Atzca+iknEh8fkLIUUuCjTjUtLvfAgMBAAGjQjBAMB0GA1UdDgQWBBQJ0OhRbA+I\n" + + "WUfR/QXCABDWpIAEBzAfBgNVHSMEGDAWgBQJ0OhRbA+IWUfR/QXCABDWpIAEBzAN\n" + + "BgkqhkiG9w0BAQsFAAOCAQEAQMfPfYfVSSdsiEUOlVg6M5D90HRONzqlg/v0RqQI\n" + + "fb3uufXJs20dg8iamVORXIIeUpGv1OQ2Rx4ndnV3bRLK6ep3gswIkOnD8z/CeNgl\n" + + "odZPvWyklHTMenGqU2TR3ceFep/DvQkrP4aZWyr3e2fjatKR/s4pXgBwHs/hR76O\n" + + "vDYLRDyCG/+MtUClFsc9HLedbU4Wp8JyaafFZ63/VjaIcvdHoDGNILRu5AIN/JVM\n" + + "Sgz4blkWJxS1dlqBYwxvbpJWrHUcktsa3Bzw2zWOkTVGQJi3pMvzRBkgliNaXPi3\n" + + "qcPViqgzVoB4QdOQBnvDtQ9+8Nt/dQY1VJFSBLxZQIefiQ==\n" + + "-----END CERTIFICATE-----", + "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCmirsTOW1G+LoI\n" + + "/Aj59lMk3KLywAbXASeTdnBoWkchuJ0QJWO/5b5kgf6QVFfe9lXof9psGIKaCGq6\n" + + "KsI0uqj7+7y++//l+E6GB8UshVB8MXc1SLFe8AxPYhWCTXaKWyWGl7PXvugzbByF\n" + + "rf4IwE9+6phYkvl/zHvaMKqdwnkpXuyuBgT3BiYTSNsxk1Ma+s5rqiwsOODSzwha\n" + + "dwmU9T4z11KypYb/DixJgHvUET4gTB+i3ll+PllVdQtXzBLpEuj5HadK0PsqlOIo\n" + + "k3eoSU+MpRqsz0gFEQ95y+Les3MlBeQ7fVKBz8GbrFDBAtzca+iknEh8fkLIUUuC\n" + + "jTjUtLvfAgMBAAECggEATyu2QS5Un5+QOMMvtTx/TA/DOulElyNKYBS23TTFiedM\n" + + "ayeLIuehuf/+NziRSUILlupouGhyda04p2W6SvzNZnTGxnffr8B5+8dn2YFKwK93\n" + + "PxJel4ZAI+C53ubaSm2IClLFwPNVSVTEvlv3XsulPu1hHQJJr5JS8meeRD72AE8G\n" + + "brKbLlq6OGey6u9teao0m4Wo05MzaEoOx4fztPP4BiJJobuPYrdthUwfXJ2mQYeg\n" + + "fJKl+JeLUnAXmq8e+6Zs88NzGK8Gmd2TvGnUahxSDtXHuRkB2lOrGFrEJKkAXDBx\n" + + "2q8r3vvcay6+k95fS2HOvggFDALS37BGckWg4+HYuQKBgQDXkxw0u2G7rCYbF691\n" + + "jil++DLNUzejZonAvA/cceVHShfAMlWCBf58cLNsY33rkRsFazhrdDoDAFqKxejB\n" + + "xWM8U7UHiHZSznuXTL0YbUombfz+0lp/KwXcirnB7O3AdIW4lfMo/ozeMMIuEzsL\n" + + "G/MDvbNSdawEso/qtxFvz87ctQKBgQDFxcCSyWb/SQVr3RkZkO3BW2efuANxNeUh\n" + + "35L4inWTa8ml8UL4SrTrkfUHzu5TnBGbSb2n8CdkPnInA81dKagX6LXuONeLkX/e\n" + + "RXyWIwWRiBkpYSaw2OGApl49DRvk2kCzwoVRWwh8qfhpC0P6AClFRaVAovYcTxm3\n" + + "vhCJL3jmwwKBgGMLvTbhLStMEgn6nOwXECu9H6JE7NhPgVUjUupHDj/t4/GzbqQZ\n" + + "2u4T3ewb3jwAZHjd5YNBWHIOlIsUGTgGV+zczN0ULsEnC5Pddzgk5p+3gzkVLu0k\n" + + "uEG3H1fhYu882j+P7bPVGKXxoxYGUedtxP7gBucJF6rk28jMqd9EjFfNAoGBAKcc\n" + + "ASwGodDzknEh0SOZIkxPP6/lfIMcVw/YKgd4dwCqAykEQuIpvdWO7sw6PYbISNg9\n" + + "5tMQSTiayznMLKqbmD0blR5FSVvVBYZ6kFsMHJhrt1cPj/G+UEy0RsyvVvJ4uFMr\n" + + "+hpUIUe1FwErU7TajgTKZGfJSsuAyupG3xIL2syhAoGALv+ulZAY/gUKH8NigsXo\n" + + "pFPTpiXMyTD/O4RUH/5LcxDELVZ8cnV2q3qEX+ep24y0AtNiBx4oHpZ/vIxtwBCR\n" + + "JKU2xmIGC6NyQMRSzfmNgi0X450rgKbTAxn/LAU8syXmNpBUrFZ8+02pQvWzxqfU\n" + + "zGaMEK3+f1sq8Byzau/qhKU="), + + /* + * Version: 3 (0x2) + * Serial Number: + * 70:41:2f:71:43:d1:67:b5:29:c6:3e:ce:62:ba:d5:aa:4a:f1:f7:f0 + * Signature Algorithm: sha256WithRSAEncryption + * Issuer: CN = localhost + * Validity + * Not Before: Feb 8 03:59:18 2020 GMT + * Not After : Feb 5 03:59:18 2030 GMT + * Subject: CN = localhost + * X509v3 extensions: + * X509v3 Subject Key Identifier: + * 12:65:C7:4B:D8:77:D8:55:6E:2D:AF:C4:F8:09:FE:08:F4:22:EA:D5 + * X509v3 Authority Key Identifier: + * keyid:12:65:C7:4B:D8:77:D8:55:6E:2D:AF:C4:F8:09:FE:08:F4:22:EA:D5 + */ + GOOD_CERT( + "RSA", + "-----BEGIN CERTIFICATE-----\n" + + "MIIC+DCCAeCgAwIBAgIUcEEvcUPRZ7Upxj7OYrrVqkrx9/AwDQYJKoZIhvcNAQEL\n" + + "BQAwFDESMBAGA1UEAwwJbG9jYWxob3N0MB4XDTIwMDIwODAzNTkxOFoXDTMwMDIw\n" + + "NTAzNTkxOFowFDESMBAGA1UEAwwJbG9jYWxob3N0MIIBIjANBgkqhkiG9w0BAQEF\n" + + "AAOCAQ8AMIIBCgKCAQEAtSOmfkF0zjPeZ4DDsJZO3OaDq+XHtPLB+xvri1iuL9b+\n" + + "dZDXOqPZ5+koWM9NzDR6Um+IN46oTU+8eJw+hYcZaE9tzS9kH+6qOBk/827yEyVa\n" + + "jh9Wqw164xj16QPyQJuHEeeDJ7elNfaOQXRu2UqZB9suKbolqsHe42hbg0/tbln7\n" + + "C8C6qEJOpnEaapFHi3/3AeoQQ57zywqrzopeiiuUDWmBhXY30ve33RrJl/OIM1sB\n" + + "QSoVCPcaF0mXaDwUTYIksxelon1K9PJa76p9ybGnsxkYfCAGZ8O+fTjJfQONU+Gu\n" + + "zOmcyXL5D5O/nI8lxN8hbZwVIAYXLYRUonECIOJ/iQIDAQABo0IwQDAdBgNVHQ4E\n" + + "FgQUEmXHS9h32FVuLa/E+An+CPQi6tUwHwYDVR0jBBgwFoAUEmXHS9h32FVuLa/E\n" + + "+An+CPQi6tUwDQYJKoZIhvcNAQELBQADggEBAFatzXsT9YZ0TF66G6apSbbs6mH9\n" + + "PMVE9IuE4yv2zyKofSMmDHFdmfNdkMHWkIxcZKuiL00IPFL76LAb9DWNQVy4otq6\n" + + "3+n0CCi808gDNUMYMQLlXVooZsByXuMuokyg29F5mWEH4rswU6ru33lAB7CT7BuN\n" + + "z5/eUhxTcXcJV6pLgcEM68NIc755PULevmqmd8SrVgcFjkxAFOsYd9L86wYLdiPO\n" + + "uXfN/EjLMGHG2gpEqHEzQpEEAA/IsCJ1HQ8vvGkeggUIXPrwlIMbQcz/8WBSDel5\n" + + "hvVRmADJCLf/0IwxKsSOMWZ4OMmcXMjxnae3lWPQomlzWHMZlFraG2rE/Vo=\n" + + "-----END CERTIFICATE-----", + "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC1I6Z+QXTOM95n\n" + + "gMOwlk7c5oOr5ce08sH7G+uLWK4v1v51kNc6o9nn6ShYz03MNHpSb4g3jqhNT7x4\n" + + "nD6FhxloT23NL2Qf7qo4GT/zbvITJVqOH1arDXrjGPXpA/JAm4cR54Mnt6U19o5B\n" + + "dG7ZSpkH2y4puiWqwd7jaFuDT+1uWfsLwLqoQk6mcRpqkUeLf/cB6hBDnvPLCqvO\n" + + "il6KK5QNaYGFdjfS97fdGsmX84gzWwFBKhUI9xoXSZdoPBRNgiSzF6WifUr08lrv\n" + + "qn3JsaezGRh8IAZnw759OMl9A41T4a7M6ZzJcvkPk7+cjyXE3yFtnBUgBhcthFSi\n" + + "cQIg4n+JAgMBAAECggEAD2O4AYIOKna9ro2CEr6ydJIhHbmn/feiA3Obz3r5UZcy\n" + + "h0qG/rRtDwcAJot2UKMkwVw4dn/oTKk5mgWsSivwPKyC56vfFddxHtMGW+hRKM9D\n" + + "ok+HTYEXr7OvMNzk+Bg+oYbJ3dX8c1k/PNBnmo578e7tPR5TlO5jwW5cWAuyYG2f\n" + + "+YUCqMNe02yZvvlvK1kOSSgqlNH0S14/hVZTYkyxXMCCrkxPFXh5j8w6ZUzVipXg\n" + + "99EYcRdq7dA3XVBSgQQ4m5772FIIzlBn8LdIIfw3VQrtZ9HapowLk6QdcHSHBKMK\n" + + "0rqb1PlG2ynD2n8hKn4MssJ+tkzvbGrQcLjL/+XHAQKBgQDmiOIke90T8puq3FkN\n" + + "NlgdBA9Zem5U2t3TvtQa36cuO/paYrLaVK5U0ucNZ9d4i6avdyp8TyKJrUHDcazi\n" + + "QkDpjxb0KBhisutDZ4o1JFW4ZtB3zwIGIYWBBIE1kRIc0ucYoAurSdOmAsKq6XJQ\n" + + "B0CQYBJPrTHq5niCl0tKPtrISwKBgQDJJfNcKSz46zdnqsNZAmL+q+cMQf4txiCS\n" + + "v0JefOeKKlwNcYWxRgf1yTNENamKKh8wyqOhc/OkxXjglRo9BFMt6BFFARzDddWE\n" + + "Wo18cyLc2WvTTv2FCZ0J/eF1jPTGJsTpCU6Prbt4XPjZpzSTF2cQR7CxLp15FsJm\n" + + "2LMcQ8ma+wKBgQC72So8hFme2X+S+D3wECo4aoh/Zs3kgvtigQqgY0H84I6de/M1\n" + + "CO+M2tW/DLB8336RV87cwDbqbK07rrMrIsV2C0yu4sUMF7Kwl/v8VYEr40tXdOy3\n" + + "RjVc7ejDV1Sk/A2m+TLI/j1h9rndPqARKfeoLUB+gCg+ulHUR6fn9dOchQKBgByx\n" + + "uj6qbQzxWQ0D0iwvZ/nWgfZAr8bN3bWxbQFXphwSoOEWEbFRQS9xzUtssEvSaHKo\n" + + "ZaFRji8yMGUxP/X2WPtSgKwsVXMYqyXfWRGoxw9kQLp7KTVCQtG7Et+XBRADVdG8\n" + + "jyV17ilkcedyr9BP5VbwMyeDc9ljQsYzIZHlpavjAoGAct8Wktj0hegCoTxSukU1\n" + + "SkJ7t4376sSfxVbbUrH86Y1Z55le1O+VkGtqETmk+Q8qf5Ymnal3W9zZ0O9mOE04\n" + + "otFbiB3ifUbpBAipyxS06SIFwMctmSk2EqBcXa3nZ9eUGqx0JhoQahfyDkFzfwJY\n" + + "hiBTWnlMjCiJ40yRYAWDzZg="), + + /* + * Version: 3 (0x2) + * Serial Number: + * 3f:62:91:39:7e:02:e9:77:20:61:ce:7e:a2:3c:c0:6c:3f:2e:08:49 + * Signature Algorithm: sha256WithRSAEncryption + * Issuer: CN = UNKOWN + * Validity + * Not Before: Feb 8 04:00:04 2020 GMT + * Not After : Feb 5 04:00:04 2030 GMT + * Subject: CN = unknown + * X509v3 extensions: + * X509v3 Subject Key Identifier: + * F7:D7:AE:80:DF:EC:7A:60:5A:E8:62:60:70:03:B6:BD:23:05:19:62 + * X509v3 Authority Key Identifier: + * keyid:F7:D7:AE:80:DF:EC:7A:60:5A:E8:62:60:70:03:B6:BD:23:05:19:62 + * X509v3 Subject Alternative Name: + * IP Address:127.0.0.1 + */ + LOOPBACK_CERT( + "RSA", + "-----BEGIN CERTIFICATE-----\n" + + "MIIDBTCCAe2gAwIBAgIUP2KROX4C6XcgYc5+ojzAbD8uCEkwDQYJKoZIhvcNAQEL\n" + + "BQAwEjEQMA4GA1UEAwwHdW5rbm93bjAeFw0yMDAyMDgwNDAwMDRaFw0zMDAyMDUw\n" + + "NDAwMDRaMBIxEDAOBgNVBAMMB3Vua25vd24wggEiMA0GCSqGSIb3DQEBAQUAA4IB\n" + + "DwAwggEKAoIBAQC8dBwc+nhzuGOcqmeQkcms6JrUPDPcvq6gEEH3dxorzngfxrsl\n" + + "lfM6SPJBV4A7HVEcsGhcMoPzzpFVISi3XyLkGuw2WnEW6nKcB2QgaS0Ub8PoDZ7P\n" + + "erWGOIjHF1slKxX40tZBiEp1oJANDq7CzSGWiyTorCjbX6OiWZCbhQkw+SpXrAdD\n" + + "fzjEAr3y8cgsC7qqTxoz/T9C1+UMmzc88kpAqih7jj2L/i6387dBmV+zrMsNyO0Q\n" + + "UPGACzMiSZV3tiwYA6cvDY3WS3fCwLSYUWdHi1orerHQuGOHLK4eyPVDcvuQdUJ/\n" + + "T0+jbNZa51scqrBUT/aDlCMCxFUY3vquz2xfAgMBAAGjUzBRMB0GA1UdDgQWBBT3\n" + + "166A3+x6YFroYmBwA7a9IwUZYjAfBgNVHSMEGDAWgBT3166A3+x6YFroYmBwA7a9\n" + + "IwUZYjAPBgNVHREECDAGhwR/AAABMA0GCSqGSIb3DQEBCwUAA4IBAQBcfcv2J73T\n" + + "nHFsCPU3WM6UW2uE8BIM/s/VbjkV1nalFyHi/TU6CN01sDymTABhzIlx5N6PW0HP\n" + + "Z0q1C7l1nsoQHwmJO+avOHu3ZjDrLMpU6wTQLEemTd3R5HTyA3/I/FUVFHeuLwJg\n" + + "L7OLNc8ouT1hkiIZD+xKwfCEdT3o+ldB+9L4WYRJPt2W3bf3W/yM8JmwW8uf6+U3\n" + + "V46xiE5GoOKoIkeAkBAaIbepsZH9rPb7alBSgYgwQYDft9wuGMeNcvPvgVsXjA7I\n" + + "RafJVdxVinVMEaOjckIZ5WlrR5667aIJapZH1r7/tiSQCRaJcILx7pL4x8C+x34z\n" + + "dPHbbyP/Rdq9\n" + + "-----END CERTIFICATE-----", + "MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQC8dBwc+nhzuGOc\n" + + "qmeQkcms6JrUPDPcvq6gEEH3dxorzngfxrsllfM6SPJBV4A7HVEcsGhcMoPzzpFV\n" + + "ISi3XyLkGuw2WnEW6nKcB2QgaS0Ub8PoDZ7PerWGOIjHF1slKxX40tZBiEp1oJAN\n" + + "Dq7CzSGWiyTorCjbX6OiWZCbhQkw+SpXrAdDfzjEAr3y8cgsC7qqTxoz/T9C1+UM\n" + + "mzc88kpAqih7jj2L/i6387dBmV+zrMsNyO0QUPGACzMiSZV3tiwYA6cvDY3WS3fC\n" + + "wLSYUWdHi1orerHQuGOHLK4eyPVDcvuQdUJ/T0+jbNZa51scqrBUT/aDlCMCxFUY\n" + + "3vquz2xfAgMBAAECggEAEcYNpLoGxDs+wdbcf6kQUUt61st6xLYDODtwTUuhX0JQ\n" + + "2AZhPjE/SF764ijDgk/Ih6EnppJpGYSA9ntzIKBLZSIY5yNuiQ/BkW+tBNWGl+fW\n" + + "nTszoDPdjPQmCkjsorvGjbos1O9qvl9PVrvsxZidM1qaN4uNKuuBPl2eItzQOhsM\n" + + "YFbmw1nqSX31gukv9a6yM2VgDUiGMlEGwkOphutbqt+wTO+9hEopGZHB7mNc5NO9\n" + + "foWVVI1rzS2yR2d85lsG4YBqBMDp2s2cBofIAe/SSSpBYPR4RfEBDpSaVceR4+cL\n" + + "Lq52DhLVe/zgVj7LEGdyTZTQxw414sRBIz8KXcRIkQKBgQDon26R0/vToZcxgnpr\n" + + "ososGh+iTov883DCxX30sntl/GbyUhg50q7Tq5mXGyzodoFHGTL+bOcU3g5O4MOV\n" + + "6HlTFe1dUjyC7M0ah6NaCSsl4SPTxtWjeHMBMhNisInDAO+ju4MJAhgoHuYL6p39\n" + + "NDmKSDtpaegFz1Q64C1Ea9fsFwKBgQDPZFvQNjSCm06ObsfXLZKS6IEqgGbihMfM\n" + + "cv/HjIpAKXNp/Y6Y/YmdFBpdHDkOJ9BXwJqTuMuM69BuldvNXkkY7zrhPFPawWyF\n" + + "O/N1aMNCT89AreBwXMYmgG9yLm1EF1FOuz2oAnWWpcUHBups+cZQikYSQxcOSqrL\n" + + "bNTEWffG+QKBgDTk+8lhAGQQ3EY/uwJ6k6oPjp3jamVsHXnMWmWnp/N6vxXeoO+U\n" + + "/nfXDyeS4FVDjQXTrwq3TJwsGejJpu+RWvUPiVes+WFz4vdjXDt+1jbYyMLA9Zck\n" + + "LlJZRpssNUcIEXWTj6oetct5qymOgbovg93zqr6/fCjGCgsRKnniY8ilAoGAcWGH\n" + + "hGQt/v1TTDEqVexXRrOP8iFyngJDjPWN+pVN+9ftfhOeAuwRcOvNofvNAX0ovODS\n" + + "YVJVDfzZ3atWGIekZNpdEUg++8hlQM3OwvB8V2N0hgLJQgSmW+Q5iW3yVJh+3hEl\n" + + "mxWFHdAQ0E+ql9tR3TRLLK67CxgtGbus8o/RE1kCgYAuf9o6Q++l8H0vNZTnzBNu\n" + + "bt0QnLxyh7RuViYuCkzLK+jGftgadVfsRgnOKvxQkMzcXfBgpV5JcVKXtaxDhPxM\n" + + "xHwblgOEGlrD4tAwvtPw3GLhmD4Shy8zcT0Lwto81fquskA5yyDGJxbq9CMzWk3w\n" + + "dSOT2C7lwW+hkycUio/fTQ=="); + + public final String keyAlgo; + public final String certStr; + public final String keyStr; + + private Cert(String keyAlgo, String certStr, String keyStr) { + this.keyAlgo = keyAlgo; + this.certStr = certStr; + this.keyStr = keyStr; + } +} diff --git a/test/jdk/java/net/httpclient/ssltest/CertificateTest.java b/test/jdk/java/net/httpclient/ssltest/CertificateTest.java index a269dd071a5..96ba5c05ed3 100644 --- a/test/jdk/java/net/httpclient/ssltest/CertificateTest.java +++ b/test/jdk/java/net/httpclient/ssltest/CertificateTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2020, 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 @@ -21,36 +21,41 @@ * questions. */ -import java.io.File; +import static java.net.http.HttpClient.Builder.NO_PROXY; + import java.io.IOException; import java.net.URI; import java.net.http.HttpClient; -import java.net.http.HttpResponse.BodyHandlers; import java.net.http.HttpRequest; import java.net.http.HttpResponse; +import java.net.http.HttpResponse.BodyHandlers; + import javax.net.ssl.SSLContext; import javax.net.ssl.SSLException; -import javax.net.ssl.SSLParameters; -import static java.net.http.HttpClient.Builder.NO_PROXY; + +import jdk.test.lib.security.KeyEntry; +import jdk.test.lib.security.KeyStoreUtils; +import jdk.test.lib.security.SSLContextBuilder; /* * @test + * @library /test/lib * @build Server CertificateTest - * @run main/othervm CertificateTest good.keystore expectSuccess - * @run main/othervm CertificateTest bad.keystore expectFailure + * @run main/othervm CertificateTest GOOD_CERT expectSuccess + * @run main/othervm CertificateTest BAD_CERT expectFailure * @run main/othervm * -Djdk.internal.httpclient.disableHostnameVerification - * CertificateTest bad.keystore expectSuccess + * CertificateTest BAD_CERT expectSuccess * @run main/othervm * -Djdk.internal.httpclient.disableHostnameVerification=true - * CertificateTest bad.keystore expectSuccess + * CertificateTest BAD_CERT expectSuccess * @run main/othervm * -Djdk.internal.httpclient.disableHostnameVerification=false - * CertificateTest bad.keystore expectFailure + * CertificateTest BAD_CERT expectFailure * @run main/othervm * -Djdk.internal.httpclient.disableHostnameVerification=xxyyzz - * CertificateTest bad.keystore expectFailure - * @run main/othervm CertificateTest loopback.keystore expectSuccess + * CertificateTest BAD_CERT expectFailure + * @run main/othervm CertificateTest LOOPBACK_CERT expectSuccess */ /** @@ -59,25 +64,24 @@ import static java.net.http.HttpClient.Builder.NO_PROXY; * by the server for its own identity. Two servers on two different ports are used * on the remote end. * - * For the "good" run the cert contains the correct hostname of the target server + * The GOOD_CERT cert contains the correct hostname of the target server * and therefore should be accepted by the cert checking code in the client. - * For the "bad" run, the cert contains an invalid hostname, and should be rejected. + * The BAD_CERT cert contains an invalid hostname, and should be rejected. + * The LOOPBACK_CERT cert contains an invalid hostname, but it also contains a + * subject alternative name for IP address 127.0.0.1, so it should be accepted + * for this address. */ public class CertificateTest { - static SSLContext ctx; - static SSLParameters params; + + private static Cert cert; static boolean expectSuccess; - static String trustStoreProp; static Server server; static int port; - static String TESTSRC = System.getProperty("test.src"); public static void main(String[] args) throws Exception { try { - String keystore = args[0]; - trustStoreProp = TESTSRC + File.separatorChar + keystore; - + String certName = args[0]; String passOrFail = args[1]; if (passOrFail.equals("expectSuccess")) { @@ -85,38 +89,44 @@ public class CertificateTest { } else { expectSuccess = false; } - server = new Server(trustStoreProp); + + cert = Cert.valueOf(certName); + server = new Server(getSSLContext(cert)); port = server.getPort(); - System.setProperty("javax.net.ssl.trustStore", trustStoreProp); - System.setProperty("javax.net.ssl.trustStorePassword", "passphrase"); - init(); - test(args); + test(cert); } finally { - server.stop(); + if (server != null) { + server.stop(); + } } } - static void init() throws Exception - { - ctx = SSLContext.getDefault(); - params = ctx.getDefaultSSLParameters(); - //params.setProtocols(new String[] { "TLSv1.2" }); + private static SSLContext getSSLContext(Cert cert) throws Exception { + SSLContextBuilder builder = SSLContextBuilder.builder(); + builder.trustStore( + KeyStoreUtils.createTrustStore(new String[] { cert.certStr })); + builder.keyStore(KeyStoreUtils.createKeyStore( + new KeyEntry[] { new KeyEntry(cert.keyAlgo, + cert.keyStr, new String[] { cert.certStr }) })); + return builder.build(); } - static void test(String[] args) throws Exception + static void test(Cert cert) throws Exception { String uri_s; - if (args[0].equals("loopback.keystore")) + if (cert == Cert.LOOPBACK_CERT) uri_s = "https://127.0.0.1:" + Integer.toString(port) + "/foo"; else uri_s = "https://localhost:" + Integer.toString(port) + "/foo"; String error = null; Exception exception = null; System.out.println("Making request to " + uri_s); + + SSLContext ctx = getSSLContext(cert); HttpClient client = HttpClient.newBuilder() .proxy(NO_PROXY) .sslContext(ctx) - .sslParameters(params) + .sslParameters(ctx.getDefaultSSLParameters()) .build(); HttpRequest request = HttpRequest.newBuilder(new URI(uri_s)) diff --git a/test/jdk/java/net/httpclient/ssltest/Server.java b/test/jdk/java/net/httpclient/ssltest/Server.java index 6d841be9015..fc954016991 100644 --- a/test/jdk/java/net/httpclient/ssltest/Server.java +++ b/test/jdk/java/net/httpclient/ssltest/Server.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2020, 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 @@ -22,12 +22,10 @@ */ import com.sun.net.httpserver.*; + import java.io.*; import java.net.InetAddress; import java.net.InetSocketAddress; -import java.net.URI; -import java.security.*; -import java.util.*; import java.util.logging.*; import java.util.concurrent.Executors; import java.util.concurrent.ExecutorService; @@ -44,17 +42,17 @@ public class Server { // assuming the TLS handshake succeeds, the server returns a 200 OK // response with a short text string. - public Server(String certfile) throws Exception { + public Server(SSLContext ctx) throws Exception { initLogger(); - SSLContext ctx = getContext("TLSv1.2", certfile); Configurator cfg = new Configurator(ctx); - InetSocketAddress addr = new InetSocketAddress(InetAddress.getLoopbackAddress(),0); + InetSocketAddress addr = new InetSocketAddress( + InetAddress.getLoopbackAddress(), 0); server = HttpsServer.create(addr, 10); server.setHttpsConfigurator(cfg); server.createContext("/", new MyHandler()); - server.setExecutor((exec=Executors.newCachedThreadPool())); + server.setExecutor((exec = Executors.newCachedThreadPool())); port = server.getAddress().getPort(); - System.out.println ("Listening on port " + port); + System.out.println("Listening on port " + port); server.start(); } @@ -67,22 +65,6 @@ public class Server { exec.shutdownNow(); } - SSLContext getContext(String protocol, String certfile) throws Exception { - char[] passphrase = "passphrase".toCharArray(); - KeyStore ks = KeyStore.getInstance("JKS"); - ks.load(new FileInputStream(certfile), passphrase); - - KeyManagerFactory kmf = KeyManagerFactory.getInstance("SunX509"); - kmf.init(ks, passphrase); - - TrustManagerFactory tmf = TrustManagerFactory.getInstance("SunX509"); - tmf.init(ks); - - SSLContext ssl = SSLContext.getInstance(protocol); - ssl.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null); - return ssl; - } - Logger logger; void initLogger() { @@ -120,7 +102,7 @@ public class Server { SSLParameters p = getSSLContext().getDefaultSSLParameters(); for (String cipher : p.getCipherSuites()) System.out.println("Cipher: " + cipher); - System.err.println("PArams = " + p); + System.err.println("Params = " + p); params.setSSLParameters(p); } } diff --git a/test/jdk/java/net/httpclient/ssltest/bad.keystore b/test/jdk/java/net/httpclient/ssltest/bad.keystore deleted file mode 100644 index acbb7517ec93dcd3239a032b23cc1497e9295917..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2329 zcmY+Gc{CIX8^&kG%$Tu^C8Nw#w&XIF8B1hKmh8%sAxqY5Q6ywZGhMO^VX}^8B-tV~ zmI!5^Y@;w#2qV{}G>XCXedqh`J@=3IyyyI$_kI3)pL1R;5sm}_Ij}?+4GNcyGmhKl z1#$w(L|6xy2x~pW%~&D__rD|%8%zZK#1cVUhqVFa{@)f47Z5}yg7OYw4ps)r^?!V5 zjs^=os$Z{UM50yr>5jId^1m%!ibNTJH~`(34!wM2QLeJ7uRph95*w}92V0QUz444@ z;WNBg{_Cid{c;qIjxhzpbN&H03Ue8I^J*tWX(A|ctA)#>&lp2g)W;OzqWRfi8~)=n zA3!JWjGY=>Qw+H^_H$lUah1SjV7W0T*JooPWz?z>P*IVp`j}a(z>pL8a}p9*dCKA7 zEH^EsX$sa7GIO3~C{^h zbA2M!o(}TFS0@W6;i=SY9~w;_FO3X^xm`wnh0n zi4ne*KI5RzcI^dj0t~l({Q$-jjk6?~`gy}?OJT<#X=a{)!msK3N{~|0{(OaV;e(~h z%}=9xPa`!H7jE8U<|dS53v(&OO0Cb_+d{PzG5jqLFDx)HAH@BKd~XhC=LwAW24k2< zM@G}=Rd|ZUCp7W7Uz>-?+aD{2PsQ~YWNSw&86|7B8!)Vl1lk>(-)WcP5Eh^9>iRRd z*T!P?cw_Wq%KGLdir()*(s<0Re|C@gD{FuM9x{lYwJ% zB6ME(A7yFwb#XM42T{X8{$c;kz&#@5l9TO%2jl8_>9CCKy(T@wA{$Zhx%ZsX%x;zG z%eA~-lAG>7S>`TR+B?tijhOo3*D`8_x@p-OCQL7MyOy|g&m$Kq;f2xBl80TO6jc5& z2ql}EJYgx;`GH6;S)ORCyKvmX=fyVPtM}fY;-G2S+mu-5rTBB z3dO#KJk8mi2~bl{O@EP+K4Eb+r86;NWk%UKX12@#gj=SWA(PJfQCst$+uLmRqjF}n zRvr{_DVcLtP+7}WU|dfFA&d)G-Z1U>6el6aGRD*E{j22E7u^0Q=Iaw5s zHony4KhCT$3yCf5j^okxta>&`Wu&ukphRD2?vah2$?IMgkDBLBS9ps`j720)FD@d| zhL~!aixTnj21j1Bq;Y&e8DCQNYj#(}wx2Q5HH%&*t8* z{Md;<9;o0*>4I!pqsXjCt^T_Z>voMBh?P8Zr5v@LgqIiPQb*$ToHsMQ-RE!tnncHq zSJWs|H0!8SCAYI5*M2mxx1D-fm&;J{*eitLmm+0O7Qomz7|gS?k%^XFnHJ?d79<)I7GWH9c?Da8*L*;diq%2QplF|rZ) z{WZ57d!U)-^*-8lJ9qoMhADC$APP(WSH=+;x`PV)jlA#KLLhr3mq#q&YTZ?*7+LU> z>0fxk?1XRO=Xj%1x1()~b_o$fySc4H4zCTln-XC#8Xw-~N)#l5*mvKqm z;3~$(FYc--Q(%ZYPnxd4XZOz5xE@yp*#02E+qUV6ZZZps!AOjUN^Md}NTx5}e5sM# z@cpB3ezR@oIbiVRt&=C|w-ZWXQoKGaQA;)1jIM|4O=Y$^q|_FX=e4P;p`7Ti*@}CM zuBaK8qf=9<-;;Eu(gjy=U+)y!fW} z>+;0OSj$P|>@w;r_Mim6Lc8ye_HnHChRj1VTB)i(@go;Ug`@ZbHbQa+EY3W zf*0bDjlKv=oijZ?uAbFGKMHeyH~|XQ-%F;!`XwA=Gl{%JPBvk6;vGo1=2Pun#mriJ zpuN5O5+g6pW#p>rjlk#iz$Z7{T^vrd=^qnNKX{K}jKsokOJWkgQr{b`Agx4qyR^L= zSXtH%BSCfI&aqr<)hT`ZUzejAAv+r2Dah-_Gy^YI;`q$+xn57`y^h>T1wu^Pl>AF( z{-B1p9-)zkZa3OBw8Rp%s?e$PX$&tdu-4CHcS`fk@otO0F||u?l6qBEeJ#o`bjf{Q zY?Bd<2qM86Lg**_??@cmyIRxE6V-vSU)Xvx} zc1+XmOAi2*r@h)F7PTXslyj`b*Co@^oo{7RusT?AEF22KAUHrM2;lGoSxWy@^p openssl.conf +echo "distinguished_name = dn" >> openssl.conf +echo "x509_extensions = v3_ext" >> openssl.conf +echo "[dn]" >> openssl.conf +echo "[v3_ext]" >> openssl.conf +echo "subjectKeyIdentifier = hash" >> openssl.conf +echo "authorityKeyIdentifier = keyid" >> openssl.conf +echo "basicConstraints = critical,CA:FALSE" >> openssl.conf + +# Generate X.509 version 3 extension file +echo "subjectKeyIdentifier = hash" > v3.ext +echo "authorityKeyIdentifier = keyid,issuer" >> v3.ext + +# Generate good cert +openssl genpkey -algorithm rsa -pkeyopt rsa_keygen_bits:2048 -pkeyopt rsa_keygen_pubexp:65537 -out good.key +openssl req -config openssl.conf -new -key good.key -subj "/CN=localhost" -sha256 -out good.csr +openssl x509 -extfile v3.ext -req -CAcreateserial -days 3650 -in good.csr -sha256 -signkey good.key -out good.cer + +# Generate bad cert +openssl genpkey -algorithm rsa -pkeyopt rsa_keygen_bits:2048 -pkeyopt rsa_keygen_pubexp:65537 -out bad.key +openssl req -config openssl.conf -new -key bad.key -subj "/CN=evil" -sha256 -out bad.csr +openssl x509 -extfile v3.ext -req -CAcreateserial -days 3650 -in bad.csr -sha256 -signkey bad.key -out bad.cer + +# Generate loopback cert with subject alternative name +echo "subjectAltName = @alt_names" >> v3.ext +echo "[alt_names]" >> v3.ext +echo "IP.1 = 127.0.0.1" >> v3.ext + +openssl genpkey -algorithm rsa -pkeyopt rsa_keygen_bits:2048 -pkeyopt rsa_keygen_pubexp:65537 -out loopback.key +openssl req -config openssl.conf -new -key loopback.key -subj "/CN=unknown" -sha256 -out loopback.csr +openssl x509 -extfile v3.ext -req -CAcreateserial -days 3650 -in loopback.csr -sha256 -signkey loopback.key -out loopback.cer diff --git a/test/jdk/java/net/httpclient/ssltest/good.keystore b/test/jdk/java/net/httpclient/ssltest/good.keystore deleted file mode 100644 index 02988c752af315257b78ee4d6adacfc796f26eef..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2321 zcmY+Dc{CIX8^&jkWH88*CE1x6j6t$y8Of3@6|xK?jWpI!%2->FB_m4)Gu9MFL)K); zEf?A5UMeNgF!p`FzVCeBz32Y%p7)&J^S;kt&x0aya)W?i6p5n?#;FvKjo;t~9syEF z9CZ*92mKJgLXp5+|B^tv5E5t;MFOoJ&LWKKe_zLr0zniKDCZE8QHrpm|Hp^sCm;gy zm9997Ml-F-n{+vz9-~`K!+r#T0qwSjUcQA4zJ0?-SLTOq(}{1?Gwd!jZuYlDCkN(W z`}%n^6`zHI=mrFUYz;Rf-l^;Eo){i(PWUXhD2bT+ZK=^ER7|I6oHza&`^`aFPL0qo zDdAEpJtezSB4+pG5Xsgm;%#8OEp$8E11~1OxRmP49l0vo%-2Up_hgJN7ug>rLU|_| ze)*L9Q@zy1Sxmm-_3ZINL(y<1fA_|BvbS~ej9ezM4T$WD9mF#yG0}dXvu@b28hxy0bK}R!}$kM)-iF@vv{)bgGXV!&TuJmW|Zl zcH51+w^Af+CoA4J;JhoQplmKbHJ0Mod#Z0Un0@?y$mKlK+f^vI`A+nQR}SzOc8eiB zse$KZg!E27Bp>t0nnoC0VBFoZoHiP*hK!-^~hKFK&bGjZmM5 z)-qdlWq?My2XV>&?ZAB!6k8u$IkhO*{xUeL6iWQDIknS!vr&>N>rbX@r5V7BYnwz;-3ngVzOK%%eTT5-u zMo`7pVNVh{1TgXvygptB@}oQ&UxX(1C0+t0)1G#|Owrt!D>o;4H8R)@D1I;8PFM{_ zm*w%jaZPd`#(4Se6}1fB80&MprK=z=f#1x1tS7LCdpnKAerhGM>veK;1^AR)yy0?} ztMKaHSi4Gjof2d&-F#?9>gJa+vKH}CRcH{l&BTpd*^-xs$E6PaDr3~gO4pj4Vr1PcHKz+oPQecQC0?-T;(}Xwqjxc&x@yqnyia$XeN&&X@&hW=OENMz@Q_2su=X`rDpb2~6 zGbA11SbLd8M}h}WD9LSJ{xHPBiip;+dRs-QvP&YVI{9=GdqX_KaaqO20iPswrU(yz zjx4a6ic{2HPa+~}s@9D27l4Y))Q{jL(5Zs)2SIzC7y`dX)@ay^Z6WE1oUf)pzJ6f+h92%{@fTI>c{;w86TrM}vek9hk}vB{V&Bi_6KO)U2BP)V)p%n^uu+D=^Y&80Ju@7R z@qSpN)6#ifaMLw$xsPK|sv!OTqmkc4)I9o*9H)=e?-pk0{M4LY7JQ$2-Sf3J6){{m z+s~DzjW3P?cUVU0RL9_RrZYKO)I)dzsMkt$E8SGljxy{9l6;?lxQ(cOvb&4bwdfGl zNU1^;%~q}Koq}M3@BW?Q_SK!Sh_iM|Q%p}-)vSVe@W7(AbvCnm#dF*6VxmM`E3Qt6 z?%_oKF+h`B8&)*HALU z)Cqz~Zzpfd>3R(gIHYJ4+OGNu7j+412)gR|Q!H<}dtW`@v^~0|qatFr+ig&YoGkeg zeg6I}JtQ&1id$TIHO((iA8*&~v@5k^9jo#gV5!l=%TJu!LR4cGn2hp{mDI2Ci@EqB zQ&o|7&6taW^sM97VF(06X{$F&&-(F$UHB-?h>%qTc&<5y)Kfi&y>epcTC#x^qKV69 zAdI=@Y$TzRU@MyFeBZPQ6J^|z9oLWkqd&%+ovz_mhaipCgz?`^Yw|_DM(a&+eQKSl zNavx*x?(=f7faM^5>B@oM7lkiVM@Igl=b-j*nP+64oL_>m~_YkA}`@CL3_wQn^Fea zG_wD|lK7X-YF?S1dnfPm4PO8ZJEL4;L?_g*v&6#Taw+J!O)0%6YiCOy@B3R&!WJ+t zEgVX)5-ysHeZqXM`*J>pwGwH}Q(ID&f4+Ak@=vdB?+g0+?{yzt2v67>@h@o)w|v&E z%z`wHau9@bWoFh!Lyvhu5ziV;8miFr#A~aaOEiCrYRm5!-0FZ7)FGmX4JnTZuyp=n zpiuCnt@*9AY)UWUSrYw)82_?%4+lNhJH4P^1(yV~t2ejb;3(nXygTB8+`cMzSP4 z5|JfYB1U6LLzwxYta;u$@BMz~cka38p7Z(M`~B;F5d>}pAb=A=;F^MPtHqng|KbN6 z0Z<8C{U8F@`$OD?AaHX3LjvxA2*95R0`SknUWM@f?~0EH0HhLt*@rL#p$g&oKRz^< z0*S_kfV(odAahuv(OJ=dy%r{!2GjsKIXdkRy}XU8oO>AQZ^6C%l5rj=Jg*=t@hb4m z&A2TlDGEh}i@Kss}&KHl&7 z@p$j6u`Yqe-xur1Mb=sS#vfz5f1}g?XyHq&(N*5O*Eo16s8 z-?skcjXcLS^nnPPzm?dSpTBI3v z?>DB^=1W#nh>2u?^jp%>e69IrnNe8{sDV8rNS_O~YwNYYE`t2L$LO8mmENdfKm7To z@KgF-vVrc`&w||2z(F%#>aKWu;0tlv`Y`?p>os#eB~;rdc238)@urP;=Sk>pn>+q< zDMjR3INs!w?c~wEUrC7SP5#p5m0u3zW!-+xo+^hzM;U9LGf)w7 zvJL5v#|7TD!78O%5ffA*kD1lT*N1O~yKl>CT#DK5J@L`4Ju$Vz2zF9>>CFxO#<)cV zhC#APbE2EFu_G~d7TZ`&li?EUX;oh|1HWT8-qAm@mMtH24~JRC2eL(HT!uzrBdbSt zBimBLXAE4fq&0s?3x|Qb4{eVqHmz6 z3gsEQuez3;+ABmrsnVjFA6Z6hn%F zgdKfuVdao0EiG+rErhnN78;EpfM5Q#bOb^rfQt`NJ`lihII{j$0RKn;p~u|8P%HsI z0Tn*2!roshlW|p!iaLcR-M%>1#2c)4p1?4xc_lSnuu{L_ z*iZ1FjhR}pg+%U2?OCB|MXAi<{H=7W>>J~r{rZ;hT3rW{IQK|&6cJjMhybq3$;CW} zpV70r4ZfStSF{lKeHLOD(yx2|ieMz?&AqI-oMSo8FoDAJ?Ix5o)OOi)^Ofy4J8>fY z;jFc?5WY}JKI}g0vEN~aw$prX-5G|uTM+cL)0 z^y%YV(=o549Z#lK-}BJZU*2t}n%cI>F7Qse4$6M8QD8+kHQyH>aQH2vX_NHME6`Rf zeA`J(9%U#W4FxO$UWckRv~od`U5#^n`${0j5?xelZ+pM0PeY7FO(beO4K;4JaeX$_ z*q<)<=snbH?{-HfbS4bVUy5x<$yuqBU;)Rll}M(>%TviT-S<%^xX#cgVW$d^xvle( z$~_%Ixi=_4B0`w^nQXPyDV)viMU`yirv&l` zHtYw#@6MX@Oj!xz4!BINJSt(gWc^1+rZ#>9jin6}w|BNh6eB~G*)s-~A z&l_Mnk%y^!V8#>sRa#Z=M`y63-KuDZMH3D7A{G&=ad~fv?6|NStkE>sgD1zdadRwZ zmA0v1{DV+t?lZ}n_EzU8r)eVk6Xp0QviYOo(M5%xthEh8jLkAHc$}Y#YhHy1*;5P? ze5kAsiFv*FhN@_?jJKSC|Fii_^%lCe{v;`FASqJZ@+$XRMh-T=c?l1{E=)j1__&0M zDLvpl+o>PHW*xzqdYnKA_O>Lk0XwMYOvGdVPePBwN_8stt2-j&i?>E+~>G&X1 z`cyB2K2B=frnXkKi?pl>Vq|2Yq)$E^0n&;<w6mYI&x>BOw#x=DhoK-$(Y=1vTo2m!Nq<%c8RW_yhMRQk)@0sx@+Ts%s|--9((g zAKTEB1ykd`lP2St1=(;P%B$cMll5v54T4Rv&%JnWdRa^)2 z(&p*OA-!(%%J2XI^_8ArANM8k2^A*$+$vX`h()F1P=IQeW{J@fmt>}J$v8iDBh=4k zA+nmp?mxNM(Q*3;=Fy&5c`;Avni4tvGUH5_=SPF`xGVzyPWEemBa~rj65Tynxy)su zY|wx(WtU&Z#EuY|%d|0;wGd*zt3>SJ;JfUm`sC@m(2#M8_@jy^iK*NA=yl-z@mrV+ zyS4@phKId!v4*=2OUSK>U1OlI)`=@yg`FAW+01I+n9e~j55gNbrJySrM`gx%ArYnq z_0&ljG|&Wc0^+Iv E1^`7*)&Kwi From 84c24a49ad6ce9a3562acc1273c5f73d9975df33 Mon Sep 17 00:00:00 2001 From: Alex Menkov Date: Mon, 10 Feb 2020 16:56:38 -0800 Subject: [PATCH 47/50] 8234935: JdwpListenTest.java and JdwpAttachTest.java getting bind failures on Windows 2016 hosts Reviewed-by: cjplummer, sspitsyn --- test/jdk/ProblemList.txt | 3 --- test/jdk/com/sun/jdi/JdwpAttachTest.java | 20 +++++++++++++++----- test/jdk/com/sun/jdi/JdwpListenTest.java | 23 +++++++++++++++++------ 3 files changed, 32 insertions(+), 14 deletions(-) diff --git a/test/jdk/ProblemList.txt b/test/jdk/ProblemList.txt index 3021ceb6802..0aa532b984f 100644 --- a/test/jdk/ProblemList.txt +++ b/test/jdk/ProblemList.txt @@ -894,9 +894,6 @@ com/sun/jdi/RepStep.java 8043571 generic- com/sun/jdi/NashornPopFrameTest.java 8225620 generic-all -com/sun/jdi/JdwpListenTest.java 8234935 windows-all -com/sun/jdi/JdwpAttachTest.java 8234935 windows-all - ############################################################################ # jdk_time diff --git a/test/jdk/com/sun/jdi/JdwpAttachTest.java b/test/jdk/com/sun/jdi/JdwpAttachTest.java index 8d134af027c..cabb0442e9e 100644 --- a/test/jdk/com/sun/jdi/JdwpAttachTest.java +++ b/test/jdk/com/sun/jdi/JdwpAttachTest.java @@ -25,6 +25,7 @@ import com.sun.jdi.Bootstrap; import com.sun.jdi.VirtualMachine; import com.sun.jdi.connect.Connector; import com.sun.jdi.connect.ListeningConnector; +import jdk.test.lib.Platform; import jdk.test.lib.apps.LingeredApp; import java.net.Inet4Address; @@ -33,7 +34,6 @@ import java.net.InetAddress; import java.net.NetworkInterface; import java.net.SocketException; import java.net.UnknownHostException; -import java.util.Arrays; import java.util.Enumeration; import java.util.Iterator; import java.util.LinkedList; @@ -54,8 +54,6 @@ import java.util.concurrent.Executors; */ public class JdwpAttachTest { - private static final boolean IsWindows = System.getProperty("os.name").toLowerCase().contains("windows"); - // Set to true to perform testing of attach from wrong address (expected to fail). // It's off by default as it caused significant test time increase\ // (tests * cases, each case fails by timeout). @@ -115,7 +113,7 @@ public class JdwpAttachTest { } log(" Listening port: " + port); - log(" Attaching from " + connectAddress); + log(" Attaching to " + connectAddress); try { ExecutorService executor = Executors.newSingleThreadExecutor(); executor.submit((Callable)() -> { @@ -155,6 +153,12 @@ public class JdwpAttachTest { list.add(addr); } + private static boolean isTeredo(Inet6Address addr) { + // Teredo prefix is 2001::/32 (i.e. first 4 bytes are 2001:0000) + byte[] bytes = addr.getAddress(); + return bytes[0] == 0x20 && bytes[1] == 0x01 && bytes[2] == 0x00 && bytes[3] == 0x00; + } + private static List getAddresses() { List result = new LinkedList<>(); try { @@ -173,6 +177,12 @@ public class JdwpAttachTest { // On other platforms test both symbolic and numeric scopes. if (addr instanceof Inet6Address) { Inet6Address addr6 = (Inet6Address)addr; + // Teredo clients cause intermittent errors on listen ("bind failed") + // and attach ("no route to host"). + // Teredo is supposed to be a temporary measure, but some test machines have it. + if (isTeredo(addr6)) { + continue; + } NetworkInterface scopeIface = addr6.getScopedInterface(); if (scopeIface != null && scopeIface.getName() != null) { // On some test machines VPN creates link local addresses @@ -190,7 +200,7 @@ public class JdwpAttachTest { throw new RuntimeException("Unexpected", e); } - if (IsWindows) { + if (Platform.isWindows()) { // don't add addresses with symbolic scope continue; } diff --git a/test/jdk/com/sun/jdi/JdwpListenTest.java b/test/jdk/com/sun/jdi/JdwpListenTest.java index 43820b00e2a..37c7132f2a0 100644 --- a/test/jdk/com/sun/jdi/JdwpListenTest.java +++ b/test/jdk/com/sun/jdi/JdwpListenTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2020, 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 @@ -26,6 +26,7 @@ import com.sun.jdi.VirtualMachine; import com.sun.jdi.connect.AttachingConnector; import com.sun.jdi.connect.Connector; import com.sun.jdi.connect.IllegalConnectorArgumentsException; +import jdk.test.lib.Platform; import lib.jdb.Debuggee; import java.io.IOException; @@ -52,8 +53,6 @@ import java.util.Map; */ public class JdwpListenTest { - private static final boolean IsWindows = System.getProperty("os.name").toLowerCase().contains("windows"); - // Set to true to allow testing of attach from wrong address (expected to fail). // It's off by default as it causes test time increase and test interference (see JDK-8231915). private static boolean allowNegativeTesting = false; @@ -89,7 +88,7 @@ public class JdwpListenTest { private static void listenTest(String listenAddress, String connectAddress, boolean expectedResult) throws IOException { - log("\nTest: listen at " + listenAddress + ", attaching from " + connectAddress + log("\nTest: listen at " + listenAddress + ", attaching to " + connectAddress + ", expected: " + (expectedResult ? "SUCCESS" : "FAILURE")); if (!expectedResult && !allowNegativeTesting) { log("SKIPPED: negative testing is disabled"); @@ -99,7 +98,7 @@ public class JdwpListenTest { log("Starting listening debuggee at " + listenAddress); try (Debuggee debuggee = Debuggee.launcher("HelloWorld").setAddress(listenAddress + ":0").launch()) { log("Debuggee is listening on " + listenAddress + ":" + debuggee.getAddress()); - log("Connecting from " + connectAddress + ", expected: " + (expectedResult ? "SUCCESS" : "FAILURE")); + log("Connecting to " + connectAddress + ", expected: " + (expectedResult ? "SUCCESS" : "FAILURE")); try { VirtualMachine vm = attach(connectAddress, debuggee.getAddress()); vm.dispose(); @@ -120,6 +119,12 @@ public class JdwpListenTest { list.add(addr); } + private static boolean isTeredo(Inet6Address addr) { + // Teredo prefix is 2001::/32 (i.e. first 4 bytes are 2001:0000) + byte[] bytes = addr.getAddress(); + return bytes[0] == 0x20 && bytes[1] == 0x01 && bytes[2] == 0x00 && bytes[3] == 0x00; + } + private static List getAddresses() { List result = new LinkedList<>(); try { @@ -138,6 +143,12 @@ public class JdwpListenTest { // On other platforms test both symbolic and numeric scopes. if (addr instanceof Inet6Address) { Inet6Address addr6 = (Inet6Address)addr; + // Teredo clients cause intermittent errors on listen ("bind failed") + // and attach ("no route to host"). + // Teredo is supposed to be a temporary measure, but some test machines have it. + if (isTeredo(addr6)) { + continue; + } NetworkInterface scopeIface = addr6.getScopedInterface(); if (scopeIface != null && scopeIface.getName() != null) { // On some test machines VPN creates link local addresses @@ -155,7 +166,7 @@ public class JdwpListenTest { throw new RuntimeException("Unexpected", e); } - if (IsWindows) { + if (Platform.isWindows()) { // don't add addresses with symbolic scope continue; } From 983fc23fd1bf5953fe522cc753284a9853274342 Mon Sep 17 00:00:00 2001 From: David Holmes Date: Mon, 10 Feb 2020 19:58:04 -0500 Subject: [PATCH 48/50] 8236844: Deprecate PrintVMQWaitTime to prepare for its removal Reviewed-by: rehn, coleenp, hseigel --- src/hotspot/share/runtime/arguments.cpp | 1 + src/hotspot/share/runtime/globals.hpp | 2 +- .../hotspot/jtreg/runtime/CommandLine/VMDeprecatedOptions.java | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/hotspot/share/runtime/arguments.cpp b/src/hotspot/share/runtime/arguments.cpp index 302c8ba581e..675821ad302 100644 --- a/src/hotspot/share/runtime/arguments.cpp +++ b/src/hotspot/share/runtime/arguments.cpp @@ -522,6 +522,7 @@ static SpecialFlag const special_jvm_flags[] = { { "AllowRedefinitionToAddDeleteMethods", JDK_Version::jdk(13), JDK_Version::undefined(), JDK_Version::undefined() }, { "FlightRecorder", JDK_Version::jdk(13), JDK_Version::undefined(), JDK_Version::undefined() }, { "MonitorBound", JDK_Version::jdk(14), JDK_Version::jdk(15), JDK_Version::jdk(16) }, + { "PrintVMQWaitTime", JDK_Version::jdk(15), JDK_Version::jdk(16), JDK_Version::jdk(17) }, { "UseNewFieldLayout", JDK_Version::jdk(15), JDK_Version::jdk(16), JDK_Version::jdk(17) }, // --- Deprecated alias flags (see also aliased_jvm_flags) - sorted by obsolete_in then expired_in: diff --git a/src/hotspot/share/runtime/globals.hpp b/src/hotspot/share/runtime/globals.hpp index 2c0c3a1054c..cbbcc9f2021 100644 --- a/src/hotspot/share/runtime/globals.hpp +++ b/src/hotspot/share/runtime/globals.hpp @@ -267,7 +267,7 @@ const size_t minimumSymbolTableSize = 1024; "compilation") \ \ product(bool, PrintVMQWaitTime, false, \ - "Print out the waiting time in VM operation queue") \ + "(Deprecated) Print out the waiting time in VM operation queue") \ \ product(bool, MethodFlushing, true, \ "Reclamation of zombie and not-entrant methods") \ diff --git a/test/hotspot/jtreg/runtime/CommandLine/VMDeprecatedOptions.java b/test/hotspot/jtreg/runtime/CommandLine/VMDeprecatedOptions.java index 0fbeb99e8be..e92db7b7475 100644 --- a/test/hotspot/jtreg/runtime/CommandLine/VMDeprecatedOptions.java +++ b/test/hotspot/jtreg/runtime/CommandLine/VMDeprecatedOptions.java @@ -46,7 +46,8 @@ public class VMDeprecatedOptions { {"InitialRAMFraction", "64"}, {"TLABStats", "false"}, {"AllowRedefinitionToAddDeleteMethods", "true"}, - {"UseNewFieldLayout", "true"}, + {"PrintVMQWaitTime", "true"}, + {"UseNewFieldLayout", "true"}, // deprecated alias flags (see also aliased_jvm_flags): {"DefaultMaxRAMFraction", "4"}, From aa3638a32d949b0e327c02189b116ad3b84b045c Mon Sep 17 00:00:00 2001 From: Weijun Wang Date: Tue, 11 Feb 2020 11:17:37 +0800 Subject: [PATCH 49/50] 8231508: Spec Clarification : KeyTab:exist() method does not specify about the fallback details Reviewed-by: mullan --- .../share/classes/javax/security/auth/kerberos/KeyTab.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/java.security.jgss/share/classes/javax/security/auth/kerberos/KeyTab.java b/src/java.security.jgss/share/classes/javax/security/auth/kerberos/KeyTab.java index 4084a4675e3..61447dfdda4 100644 --- a/src/java.security.jgss/share/classes/javax/security/auth/kerberos/KeyTab.java +++ b/src/java.security.jgss/share/classes/javax/security/auth/kerberos/KeyTab.java @@ -305,9 +305,7 @@ public final class KeyTab { * Checks if the keytab file exists. Implementation of this method * should make sure that the result matches the latest status of the * keytab file. - *

    - * The caller can use the result to determine if it should fallback to - * another mechanism to read the keys. + * * @return true if the keytab file exists; false otherwise. * @throws SecurityException if a security manager exists and the read * access to the keytab file is not permitted From a59e8a7f6fed2accd1034eebf16545ef78c3ea1b Mon Sep 17 00:00:00 2001 From: Patrick Zhang Date: Tue, 4 Feb 2020 21:27:10 +0800 Subject: [PATCH 50/50] 8238380: java.base/unix/native/libjava/childproc.c "multiple definition" link errors with GCC10 Reviewed-by: stuefe, clanger, rriggs --- src/java.base/unix/native/libjava/childproc.c | 3 ++- src/java.base/unix/native/libjava/childproc.h | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/java.base/unix/native/libjava/childproc.c b/src/java.base/unix/native/libjava/childproc.c index 811aaeac5fc..1044b8ee226 100644 --- a/src/java.base/unix/native/libjava/childproc.c +++ b/src/java.base/unix/native/libjava/childproc.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2020, 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 @@ -34,6 +34,7 @@ #include "childproc.h" +const char * const *parentPathv; ssize_t restartableWrite(int fd, const void *buf, size_t count) diff --git a/src/java.base/unix/native/libjava/childproc.h b/src/java.base/unix/native/libjava/childproc.h index 0911509302c..2190dd17923 100644 --- a/src/java.base/unix/native/libjava/childproc.h +++ b/src/java.base/unix/native/libjava/childproc.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2020, 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 @@ -126,7 +126,7 @@ typedef struct _SpawnInfo { * The cached and split version of the JDK's effective PATH. * (We don't support putenv("PATH=...") in native code) */ -const char * const *parentPathv; +extern const char * const *parentPathv; ssize_t restartableWrite(int fd, const void *buf, size_t count); int restartableDup2(int fd_from, int fd_to);

    Features in BaseRowSetFeatures in {@code BaseRowSet}
    Feature
    PropertiesProvides standard JavaBeans property manipulation - * mechanisms to allow applications to get and set RowSet command and - * property values. Refer to the documentation of the javax.sql.RowSet + * mechanisms to allow applications to get and set {@code RowSet} command and + * property values. Refer to the documentation of the {@code javax.sql.RowSet} * interface (available in the JDBC 3.0 specification) for more details on - * the standard RowSet properties.
    Event notificationProvides standard JavaBeans event notifications - * to registered event listeners. Refer to the documentation of javax.sql.RowSetEvent + * to registered event listeners. Refer to the documentation of {@code javax.sql.RowSetEvent} * interface (available in the JDBC 3.0 specification) for * more details on how to register and handle standard RowSet events generated * by compliant implementations.Modifier and TypeMethodDescriptionMODIFIER AND TYPEMETHODDESCRIPTIONMODIFIER AND TYPEMETHODDESCRIPTIONModifier and TypeMethodDescription