Compare commits

...

39 Commits

Author SHA1 Message Date
Chris Plummer
722b512c40 8308499: Test vmTestbase/nsk/jdi/MethodExitRequest/addClassExclusionFilter/filter001/TestDescription.java failed: VMDisconnectedException
Reviewed-by: kevinw, sspitsyn
Backport-of: 79ff72a776
2023-06-21 17:13:00 +00:00
Darragh Clarke
a4159ddaa2 8308336: Test java/net/HttpURLConnection/HttpURLConnectionExpectContinueTest.java failed: java.net.BindException: Address already in use
Reviewed-by: dfuchs
Backport-of: a48bcf3671
2023-06-21 15:10:45 +00:00
Jorn Vernee
3985a4d534 8310053: VarHandle and slice handle derived from layout are lacking alignment check
Reviewed-by: mcimadamore
Backport-of: e022e87654
2023-06-21 14:53:04 +00:00
Matthias Baesken
1fc60429a1 8310191: com/sun/tools/attach/warnings/DynamicLoadWarningTest.java second failure on AIX
Reviewed-by: alanb
Backport-of: 6a63badd8e
2023-06-21 09:02:06 +00:00
Per Minborg
ef0357f6cb 8309937: Add @sealedGraph for some Panama FFM interfaces
Reviewed-by: mcimadamore
Backport-of: b412fc79c3
2023-06-21 08:13:09 +00:00
Matthias Baesken
60cae33c46 8309549: com/sun/tools/attach/warnings/DynamicLoadWarningTest.java fails on AIX
Reviewed-by: lucy, alanb
Backport-of: 4d66d97745
2023-06-21 07:48:06 +00:00
Alexey Ivanov
beb0d9579b 8310054: ScrollPane insets are incorrect
Reviewed-by: honkar, prr
Backport-of: d6c2ee3448
2023-06-20 19:20:18 +00:00
Roger Riggs
e0cc40108a 8310019: MIPS builds are broken after JDK-8304913
Reviewed-by: shade
Backport-of: 33c6ec9d4e
2023-06-20 17:39:44 +00:00
Glavo
7e788939d3 8310105: LoongArch64 builds are broken after JDK-8304913
Reviewed-by: shade
Backport-of: 137a5f7c2c
2023-06-20 16:27:48 +00:00
David Holmes
fb6f5f1b82 8309228: Clarify EXPERIMENTAL flags comment in hotspot/share/runtime/globals.hpp
Reviewed-by: shade
Backport-of: 96a7db7b3c
2023-06-20 12:10:07 +00:00
Jim Laskey
7ca0f1460c 8309957: Rename JDK-8309595 test to conform
Reviewed-by: prappo
Backport-of: 1d1ed0d8f7
2023-06-20 12:02:35 +00:00
Jim Laskey
bfffd8b608 8309595: Allow javadoc to process unnamed classes
Reviewed-by: prappo
Backport-of: 0be39054a6
2023-06-20 11:40:09 +00:00
Jan Lahoda
ede16cd19e 8310314: Misplaced "unnamed classes are a preview feature and are disabled by default" error
Reviewed-by: jlaskey
Backport-of: 79069c5e74
2023-06-20 10:34:00 +00:00
Jaikiran Pai
08965e646e 8310259: Pin msys2/setup-msys2 github action to a specific commit
8309934: Update GitHub Actions to use JDK 17 for building jtreg

Reviewed-by: cstein, clanger
Backport-of: 959a61fdd4
2023-06-20 01:08:56 +00:00
Erik Gahlin
e0d3706f9e 8304835: jdk/jfr/event/oldobject/TestArrayInformation.java fails with "Could not find event with class ... as (leak) object"
Reviewed-by: mgronlun
Backport-of: 7d4b77ad9e
2023-06-19 15:29:05 +00:00
Erik Österlund
14c5091a9f 8310015: ZGC: Unbounded asynchronous unmapping can lead to running out of address space
Reviewed-by: stefank, aboldtch
Backport-of: 4229baf9b6
2023-06-19 14:53:11 +00:00
Erik Gahlin
36e3fe914c 8309928: JFR: View issues
Reviewed-by: mgronlun
Backport-of: 84d010a24b
2023-06-19 11:25:27 +00:00
Albert Mingkun Yang
4d81b8998a 8309960: ParallelGC young collections very slow in DelayInducer
Reviewed-by: tschatzl
2023-06-19 11:09:04 +00:00
Kim Barrett
ace56237d3 8308643: Incorrect value of 'used' jvmstat counter
Reviewed-by: tschatzl
Backport-of: 92167505b2
2023-06-19 08:41:55 +00:00
Phil Race
3698a022ff 8309756: Occasional crashes with pipewire screen capture on Wayland
Reviewed-by: azvegint
Backport-of: d3d0dbc363
2023-06-16 22:44:44 +00:00
Justin Lu
a1c1d97a4e 8309632: JDK 21 RDP1 L10n resource files update
Reviewed-by: naoto
Backport-of: 81bfd78901
2023-06-16 21:11:00 +00:00
Aggelos Biboudis
aced11446e 8310128: Switch with unnamed patterns erroneously non-exhaustive
Reviewed-by: jlahoda
Backport-of: 32243ef47d
2023-06-16 10:10:02 +00:00
Roberto Castañeda Lozano
39e98e7bbf 8303513: C2: LoadKlassNode::make fails with 'expecting TypeKlassPtr'
Reviewed-by: thartmann
Backport-of: 83d92672d4
2023-06-15 12:09:27 +00:00
Martin Doerr
07d20dc86a 8309613: [Windows] hs_err files sometimes miss information about the code containing the error
Reviewed-by: mbaesken
Backport-of: bd79db3930
2023-06-15 10:49:49 +00:00
Aleksey Shipilev
0ac92753dd 8309956: Shenandoah: Strengthen the mark word check in string dedup
Reviewed-by: rkennke
Backport-of: 57b8251241
2023-06-15 07:51:16 +00:00
Chen Liang
6711041f55 8307508: IndirectVarHandle.isAccessModeSupported throws NPE
Reviewed-by: mchung
Backport-of: 75dcc4ef94
2023-06-14 00:01:24 +00:00
Stuart Marks
f7cd0aec92 8309882: LinkedHashMap adds an errant serializable field
Reviewed-by: rriggs
Backport-of: e138685648
2023-06-13 21:09:38 +00:00
Raffaello Giulietti
e18993c006 8309955: Matcher uses @since {@inheritDoc}
Reviewed-by: bpb
Backport-of: bfef3c3e80
2023-06-13 19:06:24 +00:00
Mandy Chung
3363050f9e 8309303: jdk/internal/misc/VM/RuntimeArguments test ignores jdk/internal/vm/options
Reviewed-by: alanb
Backport-of: 679a6d8935
2023-06-13 16:48:42 +00:00
Markus Grönlund
ea4ab656b0 8309862: Unsafe list operations in JfrStringPool
Reviewed-by: egahlin
Backport-of: 05f896a153
2023-06-13 12:34:06 +00:00
Martin Doerr
08eff92b5e 8309462: [AIX] vmTestbase/nsk/jvmti/RunAgentThread/agentthr001/TestDescription.java crashing due to empty while loop
Reviewed-by: mbaesken
Backport-of: cf9e6353cc
2023-06-13 08:27:55 +00:00
Jan Lahoda
83ea293581 8309467: Pattern dominance should be adjusted
Reviewed-by: vromero
Backport-of: 408cadb351
2023-06-13 07:33:27 +00:00
Joe Darcy
b743405033 8309870: Using -proc:full should be considered requesting explicit annotation processing
Reviewed-by: jjg
Backport-of: 3ce1240ca1
2023-06-12 20:03:42 +00:00
Maurizio Cimadamore
20371fd918 8308645: Javadoc of FFM API needs to be refreshed
8309398: ValueLayout:: arrayElementVarHandle doesn't throws UnsupportedOperationException - if byteAlignment() > byteSize()
8308812: SequenceLayout::withElementCount(long elementCount) doesn't throw IllegalArgumentException - if elementCount < 0 for some cases

Reviewed-by: jvernee
2023-06-12 15:24:51 +00:00
Chris Hegarty
73a9f486ae 8309727: Assert privileges while reading the jdk.incubator.vector.VECTOR_ACCESS_OOB_CHECK system property
Reviewed-by: uschindler, rriggs
Backport-of: cee5724d09
2023-06-12 15:07:02 +00:00
Matthias Baesken
005006e7c4 8309703: AIX build fails after JDK-8280982
Reviewed-by: mdoerr
Backport-of: 3981297fd3
2023-06-12 14:41:57 +00:00
Daniel D. Daugherty
4bf6babda5 8309760: ProblemList serviceability/jvmti/vthread/FollowReferences/VThreadStackRefTest.java#default with ZGC
Reviewed-by: darcy
Backport-of: aace3dc28c
2023-06-10 16:36:39 +00:00
Daniel D. Daugherty
406ba341fe 8309702: Exclude java/lang/ScopedValue/StressStackOverflow.java from JTREG_TEST_THREAD_FACTORY=Virtual runs
Reviewed-by: darcy
Backport-of: 307085618d
2023-06-10 01:13:01 +00:00
Stefan Karlsson
430ffe7ae6 8309675: Generational ZGC: compiler/gcbarriers/UnsafeIntrinsicsTest.java fails in nmt_commit
Reviewed-by: dcubed
Backport-of: c4e6542514
2023-06-08 20:02:55 +00:00
153 changed files with 2220 additions and 1037 deletions

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2023, 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
@@ -57,7 +57,7 @@ runs:
- name: 'Build JTReg'
run: |
# Build JTReg and move files to the proper locations
bash make/build.sh --jdk "$JAVA_HOME_11_X64"
bash make/build.sh --jdk "$JAVA_HOME_17_X64"
mkdir ../installed
mv build/images/jtreg/* ../installed
working-directory: jtreg/src

View File

@@ -30,7 +30,8 @@ runs:
using: composite
steps:
- name: 'Install MSYS2'
uses: msys2/setup-msys2@v2
# use a specific release of msys2/setup-msys2 to prevent jtreg build failures on newer release
uses: msys2/setup-msys2@7efe20baefed56359985e327d329042cde2434ff
with:
install: 'autoconf tar unzip zip make'
path-type: minimal

View File

@@ -172,7 +172,7 @@ class os::Aix {
// Returns true if ok, false if error.
static bool get_meminfo(meminfo_t* pmi);
static bool platform_print_native_stack(outputStream* st, const void* context, char *buf, int buf_size);
static bool platform_print_native_stack(outputStream* st, const void* context, char *buf, int buf_size, address& lastpc);
static void* resolve_function_descriptor(void* p);
};

View File

@@ -48,7 +48,7 @@ class os::win32 {
static void print_uptime_info(outputStream* st);
static bool platform_print_native_stack(outputStream* st, const void* context,
char *buf, int buf_size);
char *buf, int buf_size, address& lastpc);
static bool register_code_area(char *low, char *high);

View File

@@ -516,7 +516,7 @@ int os::extra_bang_size_in_bytes() {
return 0;
}
bool os::Aix::platform_print_native_stack(outputStream* st, const void* context, char *buf, int buf_size) {
bool os::Aix::platform_print_native_stack(outputStream* st, const void* context, char *buf, int buf_size, address& lastpc) {
AixNativeCallstack::print_callstack_for_context(st, (const ucontext_t*)context, true, buf, (size_t) buf_size);
return true;
}

View File

@@ -30,8 +30,8 @@
#define HAVE_PLATFORM_PRINT_NATIVE_STACK 1
inline bool os::platform_print_native_stack(outputStream* st, const void* context,
char *buf, int buf_size) {
return os::Aix::platform_print_native_stack(st, context, buf, buf_size);
char *buf, int buf_size, address& lastpc) {
return os::Aix::platform_print_native_stack(st, context, buf, buf_size, lastpc);
}
#define HAVE_FUNCTION_DESCRIPTORS 1

View File

@@ -224,7 +224,7 @@ bool os::win32::register_code_area(char *low, char *high) {
* loop in vmError.cpp. We need to roll our own loop.
*/
bool os::win32::platform_print_native_stack(outputStream* st, const void* context,
char *buf, int buf_size)
char *buf, int buf_size, address& lastpc)
{
CONTEXT ctx;
if (context != nullptr) {
@@ -245,14 +245,14 @@ bool os::win32::platform_print_native_stack(outputStream* st, const void* contex
stk.AddrPC.Mode = AddrModeFlat;
int count = 0;
address lastpc = 0;
address lastpc_internal = 0;
while (count++ < StackPrintLimit) {
intptr_t* sp = (intptr_t*)stk.AddrStack.Offset;
intptr_t* fp = (intptr_t*)stk.AddrFrame.Offset; // NOT necessarily the same as ctx.Rbp!
address pc = (address)stk.AddrPC.Offset;
if (pc != nullptr) {
if (count == 2 && lastpc == pc) {
if (count == 2 && lastpc_internal == pc) {
// Skip it -- StackWalk64() may return the same PC
// (but different SP) on the first try.
} else {
@@ -268,12 +268,13 @@ bool os::win32::platform_print_native_stack(outputStream* st, const void* contex
}
st->cr();
}
lastpc = pc;
lastpc_internal = pc;
}
PVOID p = WindowsDbgHelp::symFunctionTableAccess64(GetCurrentProcess(), stk.AddrPC.Offset);
if (!p) {
// StackWalk64() can't handle this PC. Calling StackWalk64 again may cause crash.
lastpc = lastpc_internal;
break;
}

View File

@@ -31,8 +31,8 @@
#ifdef AMD64
#define HAVE_PLATFORM_PRINT_NATIVE_STACK 1
inline bool os::platform_print_native_stack(outputStream* st, const void* context,
char *buf, int buf_size) {
return os::win32::platform_print_native_stack(st, context, buf, buf_size);
char *buf, int buf_size, address& lastpc) {
return os::win32::platform_print_native_stack(st, context, buf, buf_size, lastpc);
}
#endif

View File

@@ -237,9 +237,14 @@ void PSPromotionManager::drain_stacks_depth(bool totally_drain) {
// Drain overflow stack first, so other threads can steal from
// claimed stack while we work.
while (tq->pop_overflow(task)) {
if (!tq->try_push_to_taskqueue(task)) {
process_popped_location_depth(task);
}
// In PSCardTable::scavenge_contents_parallel(), when work is distributed
// among different workers, an object is never split between multiple workers.
// Therefore, if a worker gets owned a large objArray, it may accumulate
// many tasks (corresponding to every element in this array) in its
// task queue. When there are too many overflow tasks, publishing them
// (via try_push_to_taskqueue()) can incur noticeable overhead in Young GC
// pause, so it is better to process them locally until large-objArray-splitting is implemented.
process_popped_location_depth(task);
}
while (tq->pop_local(task, threshold)) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2023, 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
@@ -33,9 +33,9 @@
#include "utilities/macros.hpp"
SpaceCounters::SpaceCounters(const char* name, int ordinal, size_t max_size,
MutableSpace* m, GenerationCounters* gc) :
_object_space(m) {
MutableSpace* m, GenerationCounters* gc)
: _last_used_in_bytes(0), _object_space(m)
{
if (UsePerfData) {
EXCEPTION_MARK;
ResourceMark rm;
@@ -55,13 +55,14 @@ SpaceCounters::SpaceCounters(const char* name, int ordinal, size_t max_size,
cname = PerfDataManager::counter_name(_name_space, "capacity");
_capacity = PerfDataManager::create_variable(SUN_GC, cname,
PerfData::U_Bytes,
_object_space->capacity_in_bytes(), CHECK);
PerfData::U_Bytes,
_object_space->capacity_in_bytes(),
CHECK);
cname = PerfDataManager::counter_name(_name_space, "used");
_used = PerfDataManager::create_variable(SUN_GC, cname, PerfData::U_Bytes,
new MutableSpaceUsedHelper(_object_space),
CHECK);
new UsedHelper(this),
CHECK);
cname = PerfDataManager::counter_name(_name_space, "initCapacity");
PerfDataManager::create_constant(SUN_GC, cname, PerfData::U_Bytes,
@@ -73,23 +74,22 @@ SpaceCounters::~SpaceCounters() {
FREE_C_HEAP_ARRAY(char, _name_space);
}
static volatile size_t last_used_in_bytes = 0;
void SpaceCounters::update_used() {
size_t new_used = _object_space->used_in_bytes();
Atomic::store(&last_used_in_bytes, new_used);
Atomic::store(&_last_used_in_bytes, new_used);
_used->set_value(new_used);
}
jlong MutableSpaceUsedHelper::take_sample() {
jlong SpaceCounters::UsedHelper::take_sample() {
// Sampling may occur during GC, possibly while GC is updating the space.
// The space can be in an inconsistent state during such an update. We
// don't want to block sampling for the duration of a GC. Instead, skip
// sampling in that case, using the last recorded value.
assert(!Heap_lock->owned_by_self(), "precondition");
if (Heap_lock->try_lock()) {
Atomic::store(&last_used_in_bytes, _m->used_in_bytes());
size_t new_used = _counters->_object_space->used_in_bytes();
Atomic::store(&_counters->_last_used_in_bytes, new_used);
Heap_lock->unlock();
}
return Atomic::load(&last_used_in_bytes);
return Atomic::load(&_counters->_last_used_in_bytes);
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2023, 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
@@ -39,6 +39,7 @@ class SpaceCounters: public CHeapObj<mtGC> {
private:
PerfVariable* _capacity;
PerfVariable* _used;
volatile size_t _last_used_in_bytes;
// Constant PerfData types don't need to retain a reference.
// However, it's a good idea to document them here.
@@ -47,6 +48,8 @@ class SpaceCounters: public CHeapObj<mtGC> {
MutableSpace* _object_space;
char* _name_space;
class UsedHelper;
public:
SpaceCounters(const char* name, int ordinal, size_t max_size,
@@ -68,14 +71,14 @@ class SpaceCounters: public CHeapObj<mtGC> {
const char* name_space() const { return _name_space; }
};
class MutableSpaceUsedHelper: public PerfLongSampleHelper {
private:
MutableSpace* _m;
class SpaceCounters::UsedHelper: public PerfLongSampleHelper {
private:
SpaceCounters* _counters;
public:
MutableSpaceUsedHelper(MutableSpace* m) : _m(m) { }
public:
UsedHelper(SpaceCounters* counters) : _counters(counters) { }
jlong take_sample() override;
jlong take_sample() override;
};
#endif // SHARE_GC_PARALLEL_SPACECOUNTERS_HPP

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2023, 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,9 +28,9 @@
#include "memory/resourceArea.hpp"
CSpaceCounters::CSpaceCounters(const char* name, int ordinal, size_t max_size,
ContiguousSpace* s, GenerationCounters* gc) :
_space(s) {
ContiguousSpace* s, GenerationCounters* gc)
: _last_used_in_bytes(0), _space(s)
{
if (UsePerfData) {
EXCEPTION_MARK;
ResourceMark rm;
@@ -45,18 +45,21 @@ CSpaceCounters::CSpaceCounters(const char* name, int ordinal, size_t max_size,
PerfDataManager::create_string_constant(SUN_GC, cname, name, CHECK);
cname = PerfDataManager::counter_name(_name_space, "maxCapacity");
_max_capacity = PerfDataManager::create_variable(SUN_GC, cname, PerfData::U_Bytes,
(jlong)max_size, CHECK);
_max_capacity = PerfDataManager::create_variable(SUN_GC, cname,
PerfData::U_Bytes,
(jlong)max_size,
CHECK);
cname = PerfDataManager::counter_name(_name_space, "capacity");
_capacity = PerfDataManager::create_variable(SUN_GC, cname,
PerfData::U_Bytes,
_space->capacity(), CHECK);
_space->capacity(),
CHECK);
cname = PerfDataManager::counter_name(_name_space, "used");
_used = PerfDataManager::create_variable(SUN_GC, cname, PerfData::U_Bytes,
new ContiguousSpaceUsedHelper(_space),
CHECK);
new UsedHelper(this),
CHECK);
cname = PerfDataManager::counter_name(_name_space, "initCapacity");
PerfDataManager::create_constant(SUN_GC, cname, PerfData::U_Bytes,
@@ -72,11 +75,9 @@ void CSpaceCounters::update_capacity() {
_capacity->set_value(_space->capacity());
}
static volatile size_t last_used_in_bytes = 0;
void CSpaceCounters::update_used() {
size_t new_used = _space->used();
Atomic::store(&last_used_in_bytes, new_used);
Atomic::store(&_last_used_in_bytes, new_used);
_used->set_value(new_used);
}
@@ -85,15 +86,16 @@ void CSpaceCounters::update_all() {
update_capacity();
}
jlong ContiguousSpaceUsedHelper::take_sample(){
jlong CSpaceCounters::UsedHelper::take_sample(){
// Sampling may occur during GC, possibly while GC is updating the space.
// The space can be in an inconsistent state during such an update. We
// don't want to block sampling for the duration of a GC. Instead, skip
// sampling in that case, using the last recorded value.
assert(!Heap_lock->owned_by_self(), "precondition");
if (Heap_lock->try_lock()) {
Atomic::store(&last_used_in_bytes, _space->used());
size_t new_used = _counters->_space->used();
Atomic::store(&_counters->_last_used_in_bytes, new_used);
Heap_lock->unlock();
}
return Atomic::load(&last_used_in_bytes);
return Atomic::load(&_counters->_last_used_in_bytes);
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2023, 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
@@ -39,6 +39,7 @@ class CSpaceCounters: public CHeapObj<mtGC> {
PerfVariable* _capacity;
PerfVariable* _used;
PerfVariable* _max_capacity;
volatile size_t _last_used_in_bytes;
// Constant PerfData types don't need to retain a reference.
// However, it's a good idea to document them here.
@@ -47,6 +48,8 @@ class CSpaceCounters: public CHeapObj<mtGC> {
ContiguousSpace* _space;
char* _name_space;
class UsedHelper;
public:
CSpaceCounters(const char* name, int ordinal, size_t max_size,
@@ -61,14 +64,14 @@ class CSpaceCounters: public CHeapObj<mtGC> {
const char* name_space() const { return _name_space; }
};
class ContiguousSpaceUsedHelper : public PerfLongSampleHelper {
private:
ContiguousSpace* _space;
class CSpaceCounters::UsedHelper : public PerfLongSampleHelper {
private:
CSpaceCounters* _counters;
public:
ContiguousSpaceUsedHelper(ContiguousSpace* space) : _space(space) { }
public:
UsedHelper(CSpaceCounters* counters) : _counters(counters) { }
jlong take_sample() override;
jlong take_sample() override;
};
#endif // SHARE_GC_SERIAL_CSPACECOUNTERS_HPP

View File

@@ -45,14 +45,15 @@ bool ShenandoahStringDedup::is_candidate(oop obj) {
return false;
}
if (StringDedup::is_below_threshold_age(obj->age())) {
const markWord mark = obj->mark();
// Having/had displaced header, too risk to deal with them, skip
if (mark == markWord::INFLATING() || mark.has_displaced_mark_helper()) {
return false;
}
const markWord mark = obj->mark();
// Increase string age and enqueue it when it rearches age threshold
// Having/had displaced header, too risky to deal with them, skip
if (mark == markWord::INFLATING() || mark.has_displaced_mark_helper()) {
return false;
}
if (StringDedup::is_below_threshold_age(mark.age())) {
// Increase string age and enqueue it when it reaches age threshold
markWord new_mark = mark.incr_age();
if (mark == obj->cas_set_mark(new_mark, mark)) {
return StringDedup::is_threshold_age(new_mark.age()) &&

View File

@@ -23,6 +23,7 @@
#include "precompiled.hpp"
#include "gc/shared/gc_globals.hpp"
#include "gc/shared/gcLogPrecious.hpp"
#include "gc/x/xList.inline.hpp"
#include "gc/x/xLock.inline.hpp"
#include "gc/x/xPage.inline.hpp"
@@ -35,6 +36,8 @@ XUnmapper::XUnmapper(XPageAllocator* page_allocator) :
_page_allocator(page_allocator),
_lock(),
_queue(),
_enqueued_bytes(0),
_warned_sync_unmapping(false),
_stop(false) {
set_name("XUnmapper");
create_and_start();
@@ -50,6 +53,7 @@ XPage* XUnmapper::dequeue() {
XPage* const page = _queue.remove_first();
if (page != nullptr) {
_enqueued_bytes -= page->size();
return page;
}
@@ -57,6 +61,42 @@ XPage* XUnmapper::dequeue() {
}
}
bool XUnmapper::try_enqueue(XPage* page) {
if (ZVerifyViews) {
// Asynchronous unmap and destroy is not supported with ZVerifyViews
return false;
}
// Enqueue for asynchronous unmap and destroy
XLocker<XConditionLock> locker(&_lock);
if (is_saturated()) {
// The unmapper thread is lagging behind and is unable to unmap memory fast enough
if (!_warned_sync_unmapping) {
_warned_sync_unmapping = true;
log_warning_p(gc)("WARNING: Encountered synchronous unmapping because asynchronous unmapping could not keep up");
}
log_debug(gc, unmap)("Synchronous unmapping " SIZE_FORMAT "M page", page->size() / M);
return false;
}
log_trace(gc, unmap)("Asynchronous unmapping " SIZE_FORMAT "M page (" SIZE_FORMAT "M / " SIZE_FORMAT "M enqueued)",
page->size() / M, _enqueued_bytes / M, queue_capacity() / M);
_queue.insert_last(page);
_enqueued_bytes += page->size();
_lock.notify_all();
return true;
}
size_t XUnmapper::queue_capacity() const {
return align_up<size_t>(_page_allocator->max_capacity() * ZAsyncUnmappingLimit / 100.0, XGranuleSize);
}
bool XUnmapper::is_saturated() const {
return _enqueued_bytes >= queue_capacity();
}
void XUnmapper::do_unmap_and_destroy_page(XPage* page) const {
EventZUnmap event;
const size_t unmapped = page->size();
@@ -70,15 +110,9 @@ void XUnmapper::do_unmap_and_destroy_page(XPage* page) const {
}
void XUnmapper::unmap_and_destroy_page(XPage* page) {
// Asynchronous unmap and destroy is not supported with ZVerifyViews
if (ZVerifyViews) {
// Immediately unmap and destroy
if (!try_enqueue(page)) {
// Synchronously unmap and destroy
do_unmap_and_destroy_page(page);
} else {
// Enqueue for asynchronous unmap and destroy
XLocker<XConditionLock> locker(&_lock);
_queue.insert_last(page);
_lock.notify_all();
}
}

View File

@@ -36,9 +36,14 @@ private:
XPageAllocator* const _page_allocator;
XConditionLock _lock;
XList<XPage> _queue;
size_t _enqueued_bytes;
bool _warned_sync_unmapping;
bool _stop;
XPage* dequeue();
bool try_enqueue(XPage* page);
size_t queue_capacity() const;
bool is_saturated() const;
void do_unmap_and_destroy_page(XPage* page) const;
protected:

View File

@@ -61,6 +61,13 @@
"Uncommit memory if it has been unused for the specified " \
"amount of time (in seconds)") \
\
product(double, ZAsyncUnmappingLimit, 100.0, DIAGNOSTIC, \
"Specify the max amount (percentage of max heap size) of async " \
"unmapping that can be in-flight before unmapping requests are " \
"temporarily forced to be synchronous instead. " \
"The default means after an amount of pages proportional to the " \
"max capacity is enqueued, we resort to synchronous unmapping.") \
\
product(uint, ZStatisticsInterval, 10, DIAGNOSTIC, \
"Time between statistics print outs (in seconds)") \
range(1, (uint)-1) \

View File

@@ -283,15 +283,15 @@ void ZPhysicalMemoryManager::nmt_commit(zoffset offset, size_t size) const {
// When this function is called we don't know where in the virtual memory
// this physical memory will be mapped. So we fake that the virtual memory
// address is the heap base + the given offset.
const zaddress addr = ZOffset::address(offset);
MemTracker::record_virtual_memory_commit((void*)untype(addr), size, CALLER_PC);
const uintptr_t addr = ZAddressHeapBase + untype(offset);
MemTracker::record_virtual_memory_commit((void*)addr, size, CALLER_PC);
}
void ZPhysicalMemoryManager::nmt_uncommit(zoffset offset, size_t size) const {
if (MemTracker::enabled()) {
const zaddress addr = ZOffset::address(offset);
const uintptr_t addr = ZAddressHeapBase + untype(offset);
Tracker tracker(Tracker::uncommit);
tracker.record((address)untype(addr), size);
tracker.record((address)addr, size);
}
}

View File

@@ -23,6 +23,7 @@
#include "precompiled.hpp"
#include "gc/shared/gc_globals.hpp"
#include "gc/shared/gcLogPrecious.hpp"
#include "gc/z/zList.inline.hpp"
#include "gc/z/zLock.inline.hpp"
#include "gc/z/zPage.inline.hpp"
@@ -35,6 +36,8 @@ ZUnmapper::ZUnmapper(ZPageAllocator* page_allocator)
: _page_allocator(page_allocator),
_lock(),
_queue(),
_enqueued_bytes(0),
_warned_sync_unmapping(false),
_stop(false) {
set_name("ZUnmapper");
create_and_start();
@@ -50,6 +53,7 @@ ZPage* ZUnmapper::dequeue() {
ZPage* const page = _queue.remove_first();
if (page != nullptr) {
_enqueued_bytes -= page->size();
return page;
}
@@ -57,6 +61,37 @@ ZPage* ZUnmapper::dequeue() {
}
}
bool ZUnmapper::try_enqueue(ZPage* page) {
// Enqueue for asynchronous unmap and destroy
ZLocker<ZConditionLock> locker(&_lock);
if (is_saturated()) {
// The unmapper thread is lagging behind and is unable to unmap memory fast enough
if (!_warned_sync_unmapping) {
_warned_sync_unmapping = true;
log_warning_p(gc)("WARNING: Encountered synchronous unmapping because asynchronous unmapping could not keep up");
}
log_debug(gc, unmap)("Synchronous unmapping " SIZE_FORMAT "M page", page->size() / M);
return false;
}
log_trace(gc, unmap)("Asynchronous unmapping " SIZE_FORMAT "M page (" SIZE_FORMAT "M / " SIZE_FORMAT "M enqueued)",
page->size() / M, _enqueued_bytes / M, queue_capacity() / M);
_queue.insert_last(page);
_enqueued_bytes += page->size();
_lock.notify_all();
return true;
}
size_t ZUnmapper::queue_capacity() const {
return align_up<size_t>(_page_allocator->max_capacity() * ZAsyncUnmappingLimit / 100.0, ZGranuleSize);
}
bool ZUnmapper::is_saturated() const {
return _enqueued_bytes >= queue_capacity();
}
void ZUnmapper::do_unmap_and_destroy_page(ZPage* page) const {
EventZUnmap event;
const size_t unmapped = page->size();
@@ -70,10 +105,10 @@ void ZUnmapper::do_unmap_and_destroy_page(ZPage* page) const {
}
void ZUnmapper::unmap_and_destroy_page(ZPage* page) {
// Enqueue for asynchronous unmap and destroy
ZLocker<ZConditionLock> locker(&_lock);
_queue.insert_last(page);
_lock.notify_all();
if (!try_enqueue(page)) {
// Synchronously unmap and destroy
do_unmap_and_destroy_page(page);
}
}
void ZUnmapper::run_thread() {

View File

@@ -36,9 +36,14 @@ private:
ZPageAllocator* const _page_allocator;
ZConditionLock _lock;
ZList<ZPage> _queue;
size_t _enqueued_bytes;
bool _warned_sync_unmapping;
bool _stop;
ZPage* dequeue();
bool try_enqueue(ZPage* page);
size_t queue_capacity() const;
bool is_saturated() const;
void do_unmap_and_destroy_page(ZPage* page) const;
protected:

View File

@@ -338,18 +338,20 @@ static size_t write_storage(JfrStorage& storage, JfrChunkWriter& chunkwriter) {
return invoke(fs);
}
typedef Content<JfrStringPool, &JfrStringPool::write> StringPool;
typedef WriteCheckpointEvent<StringPool> WriteStringPool;
typedef Content<JfrStringPool, &JfrStringPool::flush> FlushStringPoolFunctor;
typedef Content<JfrStringPool, &JfrStringPool::write> WriteStringPoolFunctor;
typedef WriteCheckpointEvent<FlushStringPoolFunctor> FlushStringPool;
typedef WriteCheckpointEvent<WriteStringPoolFunctor> WriteStringPool;
static u4 flush_stringpool(JfrStringPool& string_pool, JfrChunkWriter& chunkwriter) {
StringPool sp(string_pool);
WriteStringPool wsp(chunkwriter, sp, TYPE_STRING);
return invoke(wsp);
FlushStringPoolFunctor fspf(string_pool);
FlushStringPool fsp(chunkwriter, fspf, TYPE_STRING);
return invoke(fsp);
}
static u4 write_stringpool(JfrStringPool& string_pool, JfrChunkWriter& chunkwriter) {
StringPool sp(string_pool);
WriteStringPool wsp(chunkwriter, sp, TYPE_STRING);
WriteStringPoolFunctor wspf(string_pool);
WriteStringPool wsp(chunkwriter, wspf, TYPE_STRING);
return invoke(wsp);
}
@@ -461,7 +463,6 @@ void JfrRecorderService::clear() {
void JfrRecorderService::pre_safepoint_clear() {
clear_object_allocation_sampling();
_string_pool.clear();
_storage.clear();
JfrStackTraceRepository::clear();
}
@@ -475,7 +476,6 @@ void JfrRecorderService::invoke_safepoint_clear() {
void JfrRecorderService::safepoint_clear() {
assert(SafepointSynchronize::is_at_safepoint(), "invariant");
_checkpoint_manager.begin_epoch_shift();
_string_pool.clear();
_storage.clear();
_chunkwriter.set_time_stamp();
JfrStackTraceRepository::clear();
@@ -483,6 +483,7 @@ void JfrRecorderService::safepoint_clear() {
}
void JfrRecorderService::post_safepoint_clear() {
_string_pool.clear();
_checkpoint_manager.clear();
}
@@ -567,9 +568,6 @@ void JfrRecorderService::pre_safepoint_write() {
// The sampler is released (unlocked) later in post_safepoint_write.
ObjectSampleCheckpoint::on_rotation(ObjectSampler::acquire());
}
if (_string_pool.is_modified()) {
write_stringpool(_string_pool, _chunkwriter);
}
write_storage(_storage, _chunkwriter);
if (_stack_trace_repository.is_modified()) {
write_stacktrace(_stack_trace_repository, _chunkwriter, false);
@@ -587,9 +585,6 @@ void JfrRecorderService::safepoint_write() {
assert(SafepointSynchronize::is_at_safepoint(), "invariant");
_checkpoint_manager.begin_epoch_shift();
JfrStackTraceRepository::clear_leak_profiler();
if (_string_pool.is_modified()) {
write_stringpool(_string_pool, _chunkwriter);
}
_checkpoint_manager.on_rotation();
_storage.write_at_safepoint();
_chunkwriter.set_time_stamp();
@@ -603,6 +598,7 @@ void JfrRecorderService::post_safepoint_write() {
// Type tagging is epoch relative which entails we are able to write out the
// already tagged artifacts for the previous epoch. We can accomplish this concurrently
// with threads now tagging artifacts in relation to the new, now updated, epoch and remain outside of a safepoint.
write_stringpool(_string_pool, _chunkwriter);
_checkpoint_manager.write_type_set();
if (LeakProfiler::is_running()) {
// The object sampler instance was exclusively acquired and locked in pre_safepoint_write.

View File

@@ -208,4 +208,11 @@ class EpochDispatchOp {
size_t elements() const { return _elements; }
};
template <typename T>
class ReinitializationOp {
public:
typedef T Type;
bool process(Type* t);
};
#endif // SHARE_JFR_RECORDER_STORAGE_JFRSTORAGEUTILS_HPP

View File

@@ -175,4 +175,13 @@ size_t EpochDispatchOp<Operation>::dispatch(bool previous_epoch, const u1* eleme
return elements;
}
template <typename T>
bool ReinitializationOp<T>::process(T* t) {
assert(t != nullptr, "invariant");
assert(t->identity() != nullptr, "invariant");
t->reinitialize();
t->release();
return true;
}
#endif // SHARE_JFR_RECORDER_STORAGE_JFRSTORAGEUTILS_INLINE_HPP

View File

@@ -77,10 +77,17 @@ static const size_t string_pool_buffer_size = 512 * K;
bool JfrStringPool::initialize() {
assert(_mspace == nullptr, "invariant");
_mspace = create_mspace<JfrStringPoolMspace>(string_pool_buffer_size,
string_pool_cache_count, // cache limit
string_pool_cache_count, // cache preallocate count
false, // preallocate_to_free_list (== preallocate directly to live list)
0,
0, // cache preallocate count
false,
this);
// preallocate buffer count to each of the epoch live lists
for (size_t i = 0; i < string_pool_cache_count * 2; ++i) {
Buffer* const buffer = mspace_allocate(string_pool_buffer_size, _mspace);
_mspace->add_to_live_list(buffer, i % 2 == 0);
}
assert(_mspace->free_list_is_empty(), "invariant");
return _mspace != nullptr;
}
@@ -95,11 +102,7 @@ static void release(BufferPtr buffer, Thread* thread) {
assert(buffer->lease(), "invariant");
assert(buffer->acquired_by_self(), "invariant");
buffer->clear_lease();
if (buffer->transient()) {
buffer->set_retired();
} else {
buffer->release();
}
buffer->release();
}
BufferPtr JfrStringPool::flush(BufferPtr old, size_t used, size_t requested, Thread* thread) {
@@ -180,8 +183,10 @@ typedef StringPoolOp<UnBufferedWriteToChunk> WriteOperation;
typedef StringPoolOp<StringPoolDiscarderStub> DiscardOperation;
typedef ExclusiveOp<WriteOperation> ExclusiveWriteOperation;
typedef ExclusiveOp<DiscardOperation> ExclusiveDiscardOperation;
typedef ReinitializationOp<JfrStringPoolBuffer> ReinitializationOperation;
typedef ReleaseWithExcisionOp<JfrStringPoolMspace, JfrStringPoolMspace::LiveList> ReleaseOperation;
typedef CompositeOperation<ExclusiveWriteOperation, ReleaseOperation> WriteReleaseOperation;
typedef CompositeOperation<ExclusiveWriteOperation, ReinitializationOperation> WriteReinitializeOperation;
typedef CompositeOperation<ExclusiveDiscardOperation, ReleaseOperation> DiscardReleaseOperation;
size_t JfrStringPool::write() {
@@ -189,10 +194,22 @@ size_t JfrStringPool::write() {
WriteOperation wo(_chunkwriter, thread);
ExclusiveWriteOperation ewo(wo);
assert(_mspace->free_list_is_empty(), "invariant");
ReleaseOperation ro(_mspace, _mspace->live_list());
ReleaseOperation ro(_mspace, _mspace->live_list(true)); // previous epoch list
WriteReleaseOperation wro(&ewo, &ro);
assert(_mspace->live_list_is_nonempty(), "invariant");
process_live_list(wro, _mspace);
process_live_list(wro, _mspace, true); // previous epoch list
return wo.processed();
}
size_t JfrStringPool::flush() {
Thread* const thread = Thread::current();
WriteOperation wo(_chunkwriter, thread);
ExclusiveWriteOperation ewo(wo);
ReinitializationOperation rio;
WriteReinitializeOperation wro(&ewo, &rio);
assert(_mspace->free_list_is_empty(), "invariant");
assert(_mspace->live_list_is_nonempty(), "invariant");
process_live_list(wro, _mspace); // current epoch list
return wo.processed();
}
@@ -200,10 +217,10 @@ size_t JfrStringPool::clear() {
DiscardOperation discard_operation;
ExclusiveDiscardOperation edo(discard_operation);
assert(_mspace->free_list_is_empty(), "invariant");
ReleaseOperation ro(_mspace, _mspace->live_list());
ReleaseOperation ro(_mspace, _mspace->live_list(true)); // previous epoch list
DiscardReleaseOperation discard_op(&edo, &ro);
assert(_mspace->live_list_is_nonempty(), "invariant");
process_live_list(discard_op, _mspace);
process_live_list(discard_op, _mspace, true); // previous epoch list
return discard_operation.processed();
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2023, 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,7 +35,7 @@ class JavaThread;
class JfrChunkWriter;
class JfrStringPool;
typedef JfrMemorySpace<JfrStringPool, JfrMspaceRetrieval, JfrLinkedList<JfrStringPoolBuffer> > JfrStringPoolMspace;
typedef JfrMemorySpace<JfrStringPool, JfrMspaceRetrieval, JfrLinkedList<JfrStringPoolBuffer>, JfrLinkedList<JfrStringPoolBuffer>, true > JfrStringPoolMspace;
//
// Although called JfrStringPool, a more succinct description would be
@@ -45,8 +45,10 @@ typedef JfrMemorySpace<JfrStringPool, JfrMspaceRetrieval, JfrLinkedList<JfrStrin
//
class JfrStringPool : public JfrCHeapObj {
public:
size_t write();
size_t clear();
size_t flush();
size_t write();
static jboolean add(jlong id, jstring string, JavaThread* jt);
typedef JfrStringPoolMspace::Node Buffer;

View File

@@ -197,6 +197,7 @@ class outputStream;
LOG_TAG(tlab) \
LOG_TAG(tracking) \
LOG_TAG(unload) /* Trace unloading of classes */ \
LOG_TAG(unmap) \
LOG_TAG(unshareable) \
NOT_PRODUCT(LOG_TAG(upcall)) \
LOG_TAG(update) \

View File

@@ -167,6 +167,15 @@ bool SubTypeCheckNode::verify(PhaseGVN* phase) {
const TypeKlassPtr* subk = sub_t->isa_klassptr() ? sub_t->is_klassptr() : sub_t->is_oopptr()->as_klass_type();
if (super_t->singleton() && subk != nullptr) {
if (obj_or_subklass->bottom_type() == Type::TOP) {
// The bottom type of obj_or_subklass is TOP, despite its recorded type
// being an OOP or a klass pointer. This can happen for example in
// transient scenarios where obj_or_subklass is a projection of the TOP
// node. In such cases, skip verification to avoid violating the contract
// of LoadKlassNode::make(). This does not weaken the effect of verify(),
// as SubTypeCheck nodes with TOP obj_or_subklass inputs are dead anyway.
return true;
}
const Type* cached_t = Value(phase); // cache the type to validate consistency
switch (C->static_subtype_check(superk, subk)) {
case Compile::SSC_easy_test: {

View File

@@ -67,21 +67,22 @@
// option, you must first specify +UnlockDiagnosticVMOptions.
// (This master switch also affects the behavior of -Xprintflags.)
//
// EXPERIMENTAL flags are in support of features that are not
// part of the officially supported product, but are available
// EXPERIMENTAL flags are in support of features that may not be
// an officially supported part of a product, but may be available
// for experimenting with. They could, for example, be performance
// features that may not have undergone full or rigorous QA, but which may
// help performance in some cases and released for experimentation
// by the community of users and developers. This flag also allows one to
// be able to build a fully supported product that nonetheless also
// ships with some unsupported, lightly tested, experimental features.
// Refer to the documentation of any products using this code for details
// on support and fitness for production.
// Like the UnlockDiagnosticVMOptions flag above, there is a corresponding
// UnlockExperimentalVMOptions flag, which allows the control and
// modification of the experimental flags.
//
// Nota bene: neither diagnostic nor experimental options should be used casually,
// and they are not supported on production loads, except under explicit
// direction from support engineers.
// Refer to the documentation of any products using this code for details.
//
// MANAGEABLE flags are writeable external product flags.
// They are dynamically writeable through the JDK management interface

View File

@@ -1008,7 +1008,7 @@ class os: AllStatic {
public:
inline static bool platform_print_native_stack(outputStream* st, const void* context,
char *buf, int buf_size);
char *buf, int buf_size, address& lastpc);
// debugging support (mostly used by debug.cpp but also fatal error handler)
static bool find(address pc, outputStream* st = tty); // OS specific function to make sense out of an address

View File

@@ -35,7 +35,7 @@
#ifndef HAVE_PLATFORM_PRINT_NATIVE_STACK
inline bool os::platform_print_native_stack(outputStream* st, const void* context,
char *buf, int buf_size) {
char *buf, int buf_size, address& lastpc) {
return false;
}
#endif

View File

@@ -654,7 +654,8 @@ extern "C" JNIEXPORT void pns(void* sp, void* fp, void* pc) { // print native st
extern "C" JNIEXPORT void pns2() { // print native stack
Command c("pns2");
static char buf[O_BUFLEN];
if (os::platform_print_native_stack(tty, nullptr, buf, sizeof(buf))) {
address lastpc = nullptr;
if (os::platform_print_native_stack(tty, nullptr, buf, sizeof(buf), lastpc)) {
// We have printed the native stack in platform-specific code,
// so nothing else to do in this case.
} else {

View File

@@ -387,6 +387,27 @@ static bool print_code(outputStream* st, Thread* thread, address pc, bool is_cra
return false;
}
// Like above, but only try to figure out a short name. Return nullptr if not found.
static const char* find_code_name(address pc) {
if (Interpreter::contains(pc)) {
InterpreterCodelet* codelet = Interpreter::codelet_containing(pc);
if (codelet != nullptr) {
return codelet->description();
}
} else {
StubCodeDesc* desc = StubCodeDesc::desc_for(pc);
if (desc != nullptr) {
return desc->name();
} else {
CodeBlob* cb = CodeCache::find_blob(pc);
if (cb != nullptr) {
return cb->name();
}
}
}
return nullptr;
}
/**
* Gets the caller frame of `fr`.
*
@@ -675,6 +696,10 @@ void VMError::report(outputStream* st, bool _verbose) {
// don't allocate large buffer on stack
static char buf[O_BUFLEN];
// Native stack trace may get stuck. We try to handle the last pc if it
// belongs to VM generated code.
address lastpc = nullptr;
BEGIN
STEP("printing fatal error message")
@@ -963,9 +988,16 @@ void VMError::report(outputStream* st, bool _verbose) {
st->cr();
STEP_IF("printing native stack (with source info)", _verbose)
if (os::platform_print_native_stack(st, _context, buf, sizeof(buf))) {
if (os::platform_print_native_stack(st, _context, buf, sizeof(buf), lastpc)) {
// We have printed the native stack in platform-specific code
// Windows/x64 needs special handling.
// Stack walking may get stuck. Try to find the calling code.
if (lastpc != nullptr) {
const char* name = find_code_name(lastpc);
if (name != nullptr) {
st->print_cr("The last pc belongs to %s (printed below).", name);
}
}
} else {
frame fr = _context ? os::fetch_frame_from_context(_context)
: os::current_frame();
@@ -1070,6 +1102,13 @@ void VMError::report(outputStream* st, bool _verbose) {
// value outside the range.
int limit = MIN2(ErrorLogPrintCodeLimit, printed_capacity);
if (limit > 0) {
// Check if a pc was found by native stack trace above.
if (lastpc != nullptr) {
if (print_code(st, _thread, lastpc, true, printed, printed_capacity)) {
printed_len++;
}
}
// Scan the native stack
if (!_print_native_stack_used) {
// Only try to print code of the crashing frame since

View File

@@ -37,7 +37,7 @@ import java.util.Optional;
/**
* A value layout used to model the address of some region of memory. The carrier associated with an address layout is
* {@code MemorySegment.class}. The size and alignment of an address layout are platform dependent
* {@code MemorySegment.class}. The size and alignment of an address layout are platform-dependent
* (e.g. on a 64-bit platform, the size and alignment of an address layout are set to 8 bytes).
* <p>
* An address layout may optionally feature a {@linkplain #targetLayout() target layout}. An address layout with
@@ -113,9 +113,9 @@ public sealed interface AddressLayout extends ValueLayout permits ValueLayouts.O
/**
* Returns an address layout with the same carrier, alignment constraint, name and order as this address layout,
* but without any specified target layout.
* <p>
* This can be useful to compare two address layouts that have different target layouts, but are otherwise equal.
* but with no target layout.
*
* @apiNote This can be useful to compare two address layouts that have different target layouts, but are otherwise equal.
*
* @return an address layout with same characteristics as this layout, but with no target layout.
* @see #targetLayout()

View File

@@ -56,7 +56,7 @@ import java.lang.foreign.MemorySegment.Scope;
* Alternatively, clients can obtain an {@linkplain Arena#ofAuto() automatic arena}, that is an arena
* which features a <em>bounded lifetime</em> that is managed, automatically, by the garbage collector. As such, the regions
* of memory backing memory segments allocated with the automatic arena are deallocated at some unspecified time
* <em>after</em> the automatic arena (and all the segments allocated by it) become
* <em>after</em> the automatic arena (and all the segments allocated by it) becomes
* <a href="../../../java/lang/ref/package.html#reachability">unreachable</a>, as shown below:
* {@snippet lang = java:
* MemorySegment segment = Arena.ofAuto().allocate(100, 1); // @highlight regex='ofAuto()'
@@ -202,7 +202,7 @@ public interface Arena extends SegmentAllocator, AutoCloseable {
/**
* Creates a new arena that is managed, automatically, by the garbage collector.
* Segments obtained with the returned arena can be
* Segments allocated with the returned arena can be
* {@linkplain MemorySegment#isAccessibleBy(Thread) accessed} by any thread.
* Calling {@link #close()} on the returned arena will result in an {@link UnsupportedOperationException}.
*
@@ -213,7 +213,7 @@ public interface Arena extends SegmentAllocator, AutoCloseable {
}
/**
* Obtains the global arena. Segments obtained with the global arena can be
* Obtains the global arena. Segments allocated with the global arena can be
* {@linkplain MemorySegment#isAccessibleBy(Thread) accessed} by any thread.
* Calling {@link #close()} on the returned arena will result in an {@link UnsupportedOperationException}.
*
@@ -227,14 +227,17 @@ public interface Arena extends SegmentAllocator, AutoCloseable {
}
/**
* {@return a new confined arena, owned by the current thread}
* {@return a new confined arena} Segments allocated with the confined arena can be
* {@linkplain MemorySegment#isAccessibleBy(Thread) accessed} by the thread that created the arena,
* the arena's <em>owner thread</em>.
*/
static Arena ofConfined() {
return MemorySessionImpl.createConfined(Thread.currentThread()).asArena();
}
/**
* {@return a new shared arena}
* {@return a new shared arena} Segments allocated with the global arena can be
* {@linkplain MemorySegment#isAccessibleBy(Thread) accessed} by any thread.
*/
static Arena ofShared() {
return MemorySessionImpl.createShared().asArena();
@@ -244,7 +247,7 @@ public interface Arena extends SegmentAllocator, AutoCloseable {
* Returns a native memory segment with the given size (in bytes) and alignment constraint (in bytes).
* The returned segment is associated with this {@linkplain #scope() arena scope}.
* The segment's {@link MemorySegment#address() address} is the starting address of the
* allocated off-heap memory region backing the segment, and the address is
* allocated off-heap region of memory backing the segment, and the address is
* aligned according the provided alignment constraint.
*
* @implSpec
@@ -256,14 +259,14 @@ public interface Arena extends SegmentAllocator, AutoCloseable {
* S1.asOverlappingSlice(S2).isEmpty() == true
* }
*
* @param byteSize the size (in bytes) of the off-heap memory block backing the native memory segment.
* @param byteSize the size (in bytes) of the off-heap region of memory backing the native memory segment.
* @param byteAlignment the alignment constraint (in bytes) of the off-heap region of memory backing the native memory segment.
* @return a new native memory segment.
* @throws IllegalArgumentException if {@code bytesSize < 0}, {@code alignmentBytes <= 0}, or if {@code alignmentBytes}
* @throws IllegalArgumentException if {@code bytesSize < 0}, {@code byteAlignment <= 0}, or if {@code byteAlignment}
* is not a power of 2.
* @throws IllegalStateException if this arena has already been {@linkplain #close() closed}.
* @throws WrongThreadException if this arena is confined, and this method is called from a thread {@code T}
* other than the arena owner thread.
* @throws WrongThreadException if this arena is confined, and this method is called from a thread
* other than the arena's owner thread.
*/
@Override
default MemorySegment allocate(long byteSize, long byteAlignment) {
@@ -293,9 +296,9 @@ public interface Arena extends SegmentAllocator, AutoCloseable {
* @throws IllegalStateException if the arena has already been closed.
* @throws IllegalStateException if a segment associated with this arena is being accessed concurrently, e.g.
* by a {@linkplain Linker#downcallHandle(FunctionDescriptor, Linker.Option...) downcall method handle}.
* @throws WrongThreadException if this arena is confined, and this method is called from a thread {@code T}
* other than the arena owner thread.
* @throws UnsupportedOperationException if this arena does not support explicit closure.
* @throws WrongThreadException if this arena is confined, and this method is called from a thread
* other than the arena's owner thread.
* @throws UnsupportedOperationException if this arena cannot be closed explicitly.
*/
@Override
void close();

View File

@@ -34,9 +34,9 @@ import jdk.internal.foreign.FunctionDescriptorImpl;
import jdk.internal.javac.PreviewFeature;
/**
* A function descriptor models the signature of foreign functions. A function descriptor is made up of zero or more
* argument layouts and zero or one return layout. A function descriptor is typically used when creating
* {@linkplain Linker#downcallHandle(MemorySegment, FunctionDescriptor, Linker.Option...) downcall method handles} or
* A function descriptor models the signature of a foreign function. A function descriptor is made up of zero or more
* argument layouts, and zero or one return layout. A function descriptor is used to create
* {@linkplain Linker#downcallHandle(MemorySegment, FunctionDescriptor, Linker.Option...) downcall method handles} and
* {@linkplain Linker#upcallStub(MethodHandle, FunctionDescriptor, Arena, Linker.Option...) upcall stubs}.
*
* @implSpec
@@ -49,21 +49,21 @@ import jdk.internal.javac.PreviewFeature;
public sealed interface FunctionDescriptor permits FunctionDescriptorImpl {
/**
* {@return the return layout (if any) associated with this function descriptor}
* {@return the return layout (if any) of this function descriptor}
*/
Optional<MemoryLayout> returnLayout();
/**
* {@return the argument layouts associated with this function descriptor (as an immutable list)}.
* {@return the argument layouts of this function descriptor (as an unmodifiable list)}.
*/
List<MemoryLayout> argumentLayouts();
/**
* Returns a function descriptor with the given argument layouts appended to the argument layout array
* Returns a function descriptor with the given argument layouts appended to the argument layouts
* of this function descriptor.
* @param addedLayouts the argument layouts to append.
* @throws IllegalArgumentException if one of the layouts in {@code addedLayouts} is a padding layout.
* @return the new function descriptor.
* @return a new function descriptor, with the provided additional argument layouts.
*/
FunctionDescriptor appendArgumentLayouts(MemoryLayout... addedLayouts);
@@ -72,42 +72,38 @@ public sealed interface FunctionDescriptor permits FunctionDescriptorImpl {
* layout array of this function descriptor.
* @param index the index at which to insert the arguments
* @param addedLayouts the argument layouts to insert at given index.
* @return the new function descriptor.
* @return a new function descriptor, with the provided additional argument layouts.
* @throws IllegalArgumentException if one of the layouts in {@code addedLayouts} is a padding layout.
* @throws IllegalArgumentException if {@code index < 0 || index > argumentLayouts().size()}.
*/
FunctionDescriptor insertArgumentLayouts(int index, MemoryLayout... addedLayouts);
/**
* Returns a function descriptor with the given memory layout as the new return layout.
* Returns a function descriptor with the provided return layout.
* @param newReturn the new return layout.
* @throws IllegalArgumentException if {@code newReturn} is a padding layout.
* @return the new function descriptor.
* @return a new function descriptor, with the provided return layout.
*/
FunctionDescriptor changeReturnLayout(MemoryLayout newReturn);
/**
* Returns a function descriptor with the return layout dropped. This is useful to model functions
* which return no values.
* @return the new function descriptor.
* {@return a new function descriptor, with no return layout}
*/
FunctionDescriptor dropReturnLayout();
/**
* Returns the method type consisting of the carrier types of the layouts in this function descriptor.
* <p>
* The carrier type of a layout is determined as follows:
* The carrier type of a layout {@code L} is determined as follows:
* <ul>
* <li>If the layout is a {@link ValueLayout} the carrier type is determined through {@link ValueLayout#carrier()}.</li>
* <li>If the layout is a {@link GroupLayout} or a {@link SequenceLayout}, the carrier type is {@link MemorySegment}.</li>
* <li>If {@code L} is a {@link ValueLayout} the carrier type is determined through {@link ValueLayout#carrier()}.</li>
* <li>If {@code L} is a {@link GroupLayout} or a {@link SequenceLayout}, the carrier type is {@link MemorySegment}.</li>
* </ul>
*
* @apiNote A function descriptor cannot, by construction, contain any padding layouts. As such, it is not
* necessary to specify how padding layout should be mapped to carrier types.
*
* @return the method type consisting of the carrier types of the layouts in this function descriptor
* @throws IllegalArgumentException if one or more layouts in the function descriptor can not be mapped to carrier
* types (e.g. if they are sequence layouts or padding layouts).
* @return the method type consisting of the carrier types of the layouts in this function descriptor.
*/
MethodType toMethodType();
@@ -117,7 +113,7 @@ public sealed interface FunctionDescriptor permits FunctionDescriptorImpl {
* @param argLayouts the argument layouts.
* @throws IllegalArgumentException if {@code resLayout} is a padding layout.
* @throws IllegalArgumentException if one of the layouts in {@code argLayouts} is a padding layout.
* @return the new function descriptor.
* @return a new function descriptor with the provided return and argument layouts.
*/
static FunctionDescriptor of(MemoryLayout resLayout, MemoryLayout... argLayouts) {
Objects.requireNonNull(resLayout);
@@ -126,10 +122,11 @@ public sealed interface FunctionDescriptor permits FunctionDescriptorImpl {
}
/**
* Creates a function descriptor with the given argument layouts and no return layout.
* Creates a function descriptor with the given argument layouts and no return layout. This is useful to model functions
* that return no values.
* @param argLayouts the argument layouts.
* @throws IllegalArgumentException if one of the layouts in {@code argLayouts} is a padding layout.
* @return the new function descriptor.
* @return a new function descriptor with the provided argument layouts.
*/
static FunctionDescriptor ofVoid(MemoryLayout... argLayouts) {
// Null checks are implicit in List.of(argLayouts)

View File

@@ -29,27 +29,26 @@ import java.util.List;
import jdk.internal.javac.PreviewFeature;
/**
* A compound layout that aggregates multiple <em>member layouts</em>. There are two ways in which member layouts
* can be combined: if member layouts are laid out one after the other, the resulting group layout is said to be a <em>struct layout</em>
* (see {@link MemoryLayout#structLayout(MemoryLayout...)}); conversely, if all member layouts are laid out at the same starting offset,
* the resulting group layout is said to be a <em>union layout</em> (see {@link MemoryLayout#unionLayout(MemoryLayout...)}).
* A compound layout that is an aggregation of multiple, heterogeneous <em>member layouts</em>. There are two ways in which member layouts
* can be combined: if member layouts are laid out one after the other, the resulting group layout is a
* {@linkplain StructLayout struct layout}; conversely, if all member layouts are laid out at the same starting offset,
* the resulting group layout is a {@linkplain UnionLayout union layout}.
*
* @implSpec
* This class is immutable, thread-safe and <a href="{@docRoot}/java.base/java/lang/doc-files/ValueBased.html">value-based</a>.
*
* @sealedGraph
* @since 19
*/
@PreviewFeature(feature=PreviewFeature.Feature.FOREIGN)
public sealed interface GroupLayout extends MemoryLayout permits StructLayout, UnionLayout {
/**
* Returns the member layouts associated with this group.
* {@return the member layouts of this group layout}
*
* @apiNote the order in which member layouts are returned is the same order in which member layouts have
* been passed to one of the group layout factory methods (see {@link MemoryLayout#structLayout(MemoryLayout...)},
* {@link MemoryLayout#unionLayout(MemoryLayout...)}).
*
* @return the member layouts associated with this group.
*/
List<MemoryLayout> memberLayouts();

View File

@@ -197,16 +197,41 @@ import java.util.stream.Stream;
* </tbody>
* </table></blockquote>
* <p>
* All the native linker implementations limit the function descriptors that they support to those that contain
* only so-called <em>canonical</em> layouts. A canonical layout has the following characteristics:
* All native linker implementations operate on a subset of memory layouts. More formally, a layout {@code L}
* is supported by a native linker {@code NL} if:
* <ul>
* <li>{@code L} is a value layout {@code V} and {@code V.withoutName()} is {@linkplain MemoryLayout#equals(Object) equal}
* to one of the following layout constants:
* <ul>
* <li>{@link ValueLayout#JAVA_BOOLEAN}</li>
* <li>{@link ValueLayout#JAVA_BYTE}</li>
* <li>{@link ValueLayout#JAVA_CHAR}</li>
* <li>{@link ValueLayout#JAVA_SHORT}</li>
* <li>{@link ValueLayout#JAVA_INT}</li>
* <li>{@link ValueLayout#JAVA_LONG}</li>
* <li>{@link ValueLayout#JAVA_FLOAT}</li>
* <li>{@link ValueLayout#JAVA_DOUBLE}</li>
* </ul></li>
* <li>{@code L} is an address layout {@code A} and {@code A.withoutTargetLayout().withoutName()} is
* {@linkplain MemoryLayout#equals(Object) equal} to {@link ValueLayout#ADDRESS}</li>
* <li>{@code L} is a sequence layout {@code S} and all the following conditions hold:
* <ol>
* <li>Its alignment constraint is set to its <a href="MemoryLayout.html#layout-align">natural alignment</a></li>
* <li>If it is a {@linkplain ValueLayout value layout}, its {@linkplain ValueLayout#order() byte order} is
* the {@linkplain ByteOrder#nativeOrder() native byte order}.
* <li>If it is a {@linkplain GroupLayout group layout}, its size is a multiple of its alignment constraint, and</li>
* <li>It does not contain padding other than what is strictly required to align its non-padding layout elements,
* or to satisfy constraint 3</li>
* <li>the alignment constraint of {@code S} is set to its <a href="MemoryLayout.html#layout-align">natural alignment</a>, and</li>
* <li>{@code S.elementLayout()} is a layout supported by {@code NL}.</li>
* </ol>
* </li>
* <li>{@code L} is a group layout {@code G} and all the following conditions hold:
* <ol>
* <li>the alignment constraint of {@code G} is set to its <a href="MemoryLayout.html#layout-align">natural alignment</a>;</li>
* <li>the size of {@code G} is a multiple of its alignment constraint;</li>
* <li>each member layout in {@code G.memberLayouts()} is either a padding layout or a layout supported by {@code NL}, and</li>
* <li>{@code G} does not contain padding other than what is strictly required to align its non-padding layout elements, or to satisfy (2).</li>
* </ol>
* </li>
* </ul>
*
* A native linker only supports function descriptors whose argument/return layouts are layouts supported by that linker
* and are not sequence layouts.
*
* <h3 id="function-pointers">Function pointers</h3>
*
@@ -317,8 +342,8 @@ import java.util.stream.Stream;
* );
* }
*
* When interacting with a native functions returning a pointer (such as {@code malloc}), the Java runtime has no insight
* into the size or the lifetime of the returned pointer. Consider the following code:
* When a native function returning a pointer (such as {@code malloc}) is invoked using a downcall method handle,
* the Java runtime has no insight into the size or the lifetime of the returned pointer. Consider the following code:
*
* {@snippet lang = java:
* MemorySegment segment = (MemorySegment)malloc.invokeExact(100);
@@ -330,8 +355,8 @@ import java.util.stream.Stream;
* unsafely, resize the segment to the desired size (100, in this case). It might also be desirable to
* attach the segment to some existing {@linkplain Arena arena}, so that the lifetime of the region of memory
* backing the segment can be managed automatically, as for any other native segment created directly from Java code.
* Both these operations are accomplished using the restricted {@link MemorySegment#reinterpret(long, Arena, Consumer)}
* method, as follows:
* Both of these operations are accomplished using the restricted method {@link MemorySegment#reinterpret(long, Arena, Consumer)},
* as follows:
*
* {@snippet lang = java:
* MemorySegment allocateMemory(long byteSize, Arena arena) throws Throwable {
@@ -415,12 +440,12 @@ import java.util.stream.Stream;
* }
*
* To perform an equivalent call using a downcall method handle we must create a function descriptor which
* describes the specialized signature of the C function we want to call. This descriptor must include layouts for any
* additional variadic argument we intend to provide. In this case, the specialized signature of the C
* function is {@code (char*, int, int, int)} as the format string accepts three integer parameters. Then, we need to use
* a linker option to specify the position of the first variadic layout in the provided function descriptor (starting from 0).
* In this case, since the first parameter is the format string (a non-variadic argument), the first variadic index
* needs to be set to 1, as follows:
* describes the specialized signature of the C function we want to call. This descriptor must include an additional layout
* for each variadic argument we intend to provide. In this case, the specialized signature of the C
* function is {@code (char*, int, int, int)} as the format string accepts three integer parameters. We then need to use
* a {@linkplain Linker.Option#firstVariadicArg(int) linker option} to specify the position of the first variadic layout
* in the provided function descriptor (starting from 0). In this case, since the first parameter is the format string
* (a non-variadic argument), the first variadic index needs to be set to 1, as follows:
*
* {@snippet lang = java:
* Linker linker = Linker.nativeLinker();
@@ -447,10 +472,9 @@ import java.util.stream.Stream;
* through an invalid linkage request (e.g. by specifying a function descriptor featuring too many argument layouts),
* the result of such interaction is unspecified and can lead to JVM crashes.
* <p>
* When creating upcall stubs the linker runtime validates the type of the target method handle against the provided
* function descriptor and report an error if any mismatch is detected. As for downcalls, JVM crashes might occur,
* if the foreign code casts the function pointer associated with an upcall stub to a type
* that is incompatible with the provided function descriptor. Moreover, if the target method
* When an upcall stub is passed to a foreign function, a JVM crash might occur, if the foreign code casts the function pointer
* associated with the upcall stub to a type that is incompatible with the type of the upcall stub, and then attempts to
* invoke the function through the resulting function pointer. Moreover, if the method
* handle associated with an upcall stub returns a {@linkplain MemorySegment memory segment}, clients must ensure
* that this address cannot become invalid after the upcall completes. This can lead to unspecified behavior,
* and even JVM crashes, since an upcall is typically executed in the context of a downcall method handle invocation.
@@ -464,7 +488,7 @@ import java.util.stream.Stream;
public sealed interface Linker permits AbstractLinker {
/**
* Returns a linker for the ABI associated with the underlying native platform. The underlying native platform
* {@return a linker for the ABI associated with the underlying native platform} The underlying native platform
* is the combination of OS and processor where the Java runtime is currently executing.
*
* @apiNote It is not currently possible to obtain a linker for a different combination of OS and processor.
@@ -472,7 +496,6 @@ public sealed interface Linker permits AbstractLinker {
* linker are the native libraries loaded in the process where the Java runtime is currently executing. For example,
* on Linux, these libraries typically include {@code libc}, {@code libm} and {@code libdl}.
*
* @return a linker for the ABI associated with the underlying native platform.
* @throws UnsupportedOperationException if the underlying native platform is not supported.
*/
static Linker nativeLinker() {
@@ -492,17 +515,20 @@ public sealed interface Linker permits AbstractLinker {
* the JVM or, worse, silently result in memory corruption. Thus, clients should refrain from depending on
* restricted methods, and use safe and supported functionalities, where possible.
*
* @param symbol the address of the target function.
* @param function the function descriptor of the target function.
* @param options any linker options.
* @return a downcall method handle. The method handle type is <a href="Linker.html#downcall-method-handles"><em>inferred</em></a>
* @param address the native memory segment whose {@linkplain MemorySegment#address() base address} is the
* address of the target foreign function.
* @param function the function descriptor of the target foreign function.
* @param options the linker options associated with this linkage request.
* @return a downcall method handle.
* @throws IllegalArgumentException if the provided function descriptor is not supported by this linker.
* or if the symbol is {@link MemorySegment#NULL}
* @throws IllegalArgumentException if {@code !address.isNative()}, or if {@code address.equals(MemorySegment.NULL)}.
* @throws IllegalArgumentException if an invalid combination of linker options is given.
* @throws IllegalCallerException If the caller is in a module that does not have native access enabled.
*
* @see SymbolLookup
*/
@CallerSensitive
MethodHandle downcallHandle(MemorySegment symbol, FunctionDescriptor function, Option... options);
MethodHandle downcallHandle(MemorySegment address, FunctionDescriptor function, Option... options);
/**
* Creates a method handle which is used to call a foreign function with the given signature.
@@ -514,22 +540,22 @@ public sealed interface Linker permits AbstractLinker {
* downcall method handle accepts an additional leading parameter of type {@link SegmentAllocator}, which is used by
* the linker runtime to allocate the memory region associated with the struct returned by the downcall method handle.
* <p>
* Upon invoking a downcall method handle, the linker runtime will guarantee the following for any argument
* Upon invoking a downcall method handle, the linker provides the following guarantees for any argument
* {@code A} of type {@link MemorySegment} whose corresponding layout is an {@linkplain AddressLayout address layout}:
* <ul>
* <li>{@code A.scope().isAlive() == true}. Otherwise, the invocation throws {@link IllegalStateException};</li>
* <li>The invocation occurs in a thread {@code T} such that {@code A.isAccessibleBy(T) == true}.
* Otherwise, the invocation throws {@link WrongThreadException}; and</li>
* <li>{@code A} is kept alive during the invocation. For instance, if {@code A} has been obtained using a
* {@linkplain Arena#ofShared()} shared arena}, any attempt to {@linkplain Arena#close() close}
* the shared arena while the downcall method handle is executing will result in an {@link IllegalStateException}.</li>
* {@linkplain Arena#ofShared() shared arena}, any attempt to {@linkplain Arena#close() close}
* the arena while the downcall method handle is still executing will result in an {@link IllegalStateException}.</li>
*</ul>
* <p>
* Moreover, if the provided function descriptor's return layout is an {@linkplain AddressLayout address layout},
* invoking the returned method handle will return a native segment associated with
* a fresh scope that is always alive. Under normal conditions, the size of the returned segment is {@code 0}.
* However, if the function descriptor's return layout has a {@linkplain AddressLayout#targetLayout()} {@code T},
* then the size of the returned segment is set to {@code T.byteSize()}.
* However, if the function descriptor's return layout has a {@linkplain AddressLayout#targetLayout() target layout}
* {@code T}, then the size of the returned segment is set to {@code T.byteSize()}.
* <p>
* The returned method handle will throw an {@link IllegalArgumentException} if the {@link MemorySegment}
* representing the target address of the foreign function is the {@link MemorySegment#NULL} address.
@@ -540,10 +566,9 @@ public sealed interface Linker permits AbstractLinker {
* the JVM or, worse, silently result in memory corruption. Thus, clients should refrain from depending on
* restricted methods, and use safe and supported functionalities, where possible.
*
* @param function the function descriptor of the target function.
* @param options any linker options.
* @return a downcall method handle. The method handle type is <a href="Linker.html#downcall-method-handles"><em>inferred</em></a>
* from the provided function descriptor.
* @param function the function descriptor of the target foreign function.
* @param options the linker options associated with this linkage request.
* @return a downcall method handle.
* @throws IllegalArgumentException if the provided function descriptor is not supported by this linker.
* @throws IllegalArgumentException if an invalid combination of linker options is given.
* @throws IllegalCallerException If the caller is in a module that does not have native access enabled.
@@ -552,7 +577,7 @@ public sealed interface Linker permits AbstractLinker {
MethodHandle downcallHandle(FunctionDescriptor function, Option... options);
/**
* Creates a stub which can be passed to other foreign functions as a function pointer, associated with the given
* Creates an upcall stub which can be passed to other foreign functions as a function pointer, associated with the given
* arena. Calling such a function pointer from foreign code will result in the execution of the provided
* method handle.
* <p>
@@ -564,14 +589,14 @@ public sealed interface Linker permits AbstractLinker {
* An upcall stub argument whose corresponding layout is an {@linkplain AddressLayout address layout}
* is a native segment associated with a fresh scope that is always alive.
* Under normal conditions, the size of this segment argument is {@code 0}.
* However, if the address layout has a {@linkplain AddressLayout#targetLayout()} {@code T}, then the size of the
* However, if the address layout has a {@linkplain AddressLayout#targetLayout() target layout} {@code T}, then the size of the
* segment argument is set to {@code T.byteSize()}.
* <p>
* The target method handle should not throw any exceptions. If the target method handle does throw an exception,
* the VM will exit with a non-zero exit code. To avoid the VM aborting due to an uncaught exception, clients
* could wrap all code in the target method handle in a try/catch block that catches any {@link Throwable}, for
* instance by using the {@link java.lang.invoke.MethodHandles#catchException(MethodHandle, Class, MethodHandle)}
* method handle combinator, and handle exceptions as desired in the corresponding catch block.
* the JVM will terminate abruptly. To avoid this, clients should wrap the code in the target method handle in a
* try/catch block to catch any unexpected exceptions. This can be done using the
* {@link java.lang.invoke.MethodHandles#catchException(MethodHandle, Class, MethodHandle)} method handle combinator,
* and handle exceptions as desired in the corresponding catch block.
* <p>
* This method is <a href="package-summary.html#restricted"><em>restricted</em></a>.
* Restricted methods are unsafe, and, if used incorrectly, their use might crash
@@ -581,11 +606,12 @@ public sealed interface Linker permits AbstractLinker {
* @param target the target method handle.
* @param function the upcall stub function descriptor.
* @param arena the arena associated with the returned upcall stub segment.
* @param options any linker options.
* @param options the linker options associated with this linkage request.
* @return a zero-length segment whose address is the address of the upcall stub.
* @throws IllegalArgumentException if the provided function descriptor is not supported by this linker.
* @throws IllegalArgumentException if it is determined that the target method handle can throw an exception, or if the target method handle
* has a type that does not match the upcall stub <a href="Linker.html#upcall-stubs"><em>inferred type</em></a>.
* @throws IllegalArgumentException if the type of {@code target} is incompatible with the
* type {@linkplain FunctionDescriptor#toMethodType() derived} from {@code function}.
* @throws IllegalArgumentException if it is determined that the target method handle can throw an exception.
* @throws IllegalStateException if {@code arena.scope().isAlive() == false}
* @throws WrongThreadException if {@code arena} is a confined arena, and this method is called from a
* thread {@code T}, other than the arena's owner thread.
@@ -610,8 +636,7 @@ public sealed interface Linker permits AbstractLinker {
SymbolLookup defaultLookup();
/**
* A linker option is used to indicate additional linking requirements to the linker,
* besides what is described by a function descriptor.
* A linker option is used to provide additional parameters to a linkage request.
* @since 20
*/
@PreviewFeature(feature=PreviewFeature.Feature.FOREIGN)
@@ -619,9 +644,10 @@ public sealed interface Linker permits AbstractLinker {
permits LinkerOptions.LinkerOptionImpl {
/**
* {@return a linker option used to denote the index of the first variadic argument layout in a
* foreign function call}
* @param index the index of the first variadic argument in a downcall handle linkage request.
* {@return a linker option used to denote the index of the first variadic argument layout in the
* function descriptor associated with a downcall linkage request}
* @param index the index of the first variadic argument layout in the function descriptor associated
* with a downcall linkage request.
*/
static Option firstVariadicArg(int index) {
return new LinkerOptions.FirstVariadicArg(index);
@@ -637,11 +663,12 @@ public sealed interface Linker permits AbstractLinker {
* For this purpose, a downcall method handle linked with this
* option will feature an additional {@link MemorySegment} parameter directly
* following the target address, and optional {@link SegmentAllocator} parameters.
* This parameter, called the 'capture state segment', represents the native segment into which
* This parameter, the <em>capture state segment</em>, represents the native segment into which
* the captured state is written.
* <p>
* The capture state segment should have the layout returned by {@linkplain #captureStateLayout}.
* This layout is a struct layout which has a named field for each captured value.
* The capture state segment must have size and alignment compatible with the layout returned by
* {@linkplain #captureStateLayout}. This layout is a struct layout which has a named field for
* each captured value.
* <p>
* Captured state can be retrieved from the capture state segment by constructing var handles
* from the {@linkplain #captureStateLayout capture state layout}.
@@ -677,9 +704,9 @@ public sealed interface Linker permits AbstractLinker {
/**
* {@return a struct layout that represents the layout of the capture state segment that is passed
* to a downcall handle linked with {@link #captureCallState(String...)}}.
* to a downcall handle linked with {@link #captureCallState(String...)}}
* <p>
* The capture state layout is <em>platform dependent</em> but is guaranteed to be
* The capture state layout is <em>platform-dependent</em> but is guaranteed to be
* a {@linkplain StructLayout struct layout} containing only {@linkplain ValueLayout value layouts}
* and possibly {@linkplain PaddingLayout padding layouts}.
* As an example, on Windows, the returned layout might contain three value layouts named:
@@ -688,13 +715,13 @@ public sealed interface Linker permits AbstractLinker {
* <li>WSAGetLastError</li>
* <li>errno</li>
* </ul>
* The following snipet shows how to obtain the names of the supported captured value layouts:
* <p>
* Clients can obtain the names of the supported captured value layouts as follows:
* {@snippet lang = java:
* String capturedNames = Linker.Option.captureStateLayout().memberLayouts().stream()
* List<String> capturedNames = Linker.Option.captureStateLayout().memberLayouts().stream()
* .map(MemoryLayout::name)
* .flatMap(Optional::stream)
* .map(Objects::toString)
* .collect(Collectors.joining(", "));
* .toList();
* }
*
* @see #captureCallState(String...)

View File

@@ -33,7 +33,6 @@ import java.util.Objects;
import java.util.Optional;
import java.util.Set;
import java.util.function.Function;
import java.util.function.Supplier;
import java.util.stream.Stream;
import jdk.internal.foreign.LayoutPath;
@@ -48,14 +47,19 @@ import jdk.internal.javac.PreviewFeature;
/**
* A memory layout describes the contents of a memory segment.
* There are two leaves in the layout hierarchy, <em>value layouts</em>, which are used to represent values of given size and kind (see
* {@link ValueLayout}) and <em>padding layouts</em> which are used, as the name suggests, to represent a portion of a memory
* segment whose contents should be ignored, and which are primarily present for alignment reasons (see {@link MemoryLayout#paddingLayout(long)}).
* Some common value layout constants are defined in the {@link ValueLayout} class.
* <p>
* More complex layouts can be derived from simpler ones: a <em>sequence layout</em> denotes a repetition of one or more
* element layout (see {@link SequenceLayout}); a <em>group layout</em> denotes an aggregation of (typically) heterogeneous
* member layouts (see {@link GroupLayout}).
* There are two leaves in the layout hierarchy, {@linkplain ValueLayout value layouts}, which are used to represent values of given size and kind (see
* and {@linkplain PaddingLayout padding layouts} which are used, as the name suggests, to represent a portion of a memory
* segment whose contents should be ignored, and which are primarily present for alignment reasons.
* Some common value layout constants, such as {@link ValueLayout#JAVA_INT} and {@link ValueLayout#JAVA_FLOAT_UNALIGNED}
* are defined in the {@link ValueLayout} class. A special kind of value layout, namely an {@linkplain AddressLayout address layout},
* is used to model values that denote the address of a region of memory.
* <p>
* More complex layouts can be derived from simpler ones: a {@linkplain SequenceLayout sequence layout} denotes a
* homogeneous repetition of zero or more occurrences of an element layout; a {@linkplain GroupLayout group layout}
* denotes a heterogeneous aggregation of zero or more member layouts. Group layouts come in two
* flavors: {@linkplain StructLayout struct layouts}, where member layouts are laid out one after the other, and
* {@linkplain UnionLayout union layouts} where member layouts are laid out at the same starting offset.
* <p>
* Layouts can be optionally associated with a <em>name</em>. A layout name can be referred to when
* constructing <a href="MemoryLayout.html#layout-paths"><em>layout paths</em></a>.
@@ -81,47 +85,50 @@ import jdk.internal.javac.PreviewFeature;
* ).withName("TaggedValues");
* }
*
* <h2 id="layout-align">Size, alignment and byte order</h2>
* <h2 id="layout-align">Characteristics of memory layouts</h2>
*
* All layouts have a size; layout size for value and padding layouts is always explicitly denoted; this means that a layout description
* always has the same size in bytes, regardless of the platform in which it is used. For derived layouts, the size is computed
* as follows:
* All layouts have a <em>size</em> (expressed in bytes), which is defined as follows:
* <ul>
* <li>for a sequence layout <em>S</em> whose element layout is <em>E</em> and size is <em>L</em>,
* the size of <em>S</em> is that of <em>E</em>, multiplied by <em>L</em></li>
* <li>for a group layout <em>G</em> with member layouts <em>M1</em>, <em>M2</em>, ... <em>Mn</em> whose sizes are
* <em>S1</em>, <em>S2</em>, ... <em>Sn</em>, respectively, the size of <em>G</em> is either <em>S1 + S2 + ... + Sn</em> or
* <em>max(S1, S2, ... Sn)</em> depending on whether the group is a <em>struct</em> or an <em>union</em>, respectively</li>
* <li>The size of a value layout is determined by the {@linkplain ValueLayout#carrier()}
* associated with the value layout. That is, the constant {@link ValueLayout#JAVA_INT} has carrier {@code int}, and
* size of 4 bytes;</li>
* <li>The size of an address layout is platform-dependent. That is, the constant {@link ValueLayout#ADDRESS}
* has size of 8 bytes on a 64-bit platform;</li>
* <li>The size of a padding layout is always provided explicitly, on {@linkplain MemoryLayout#paddingLayout(long) construction};</li>
* <li>The size of a sequence layout whose element layout is <em>E</em> and element count is <em>L</em>,
* is the size of <em>E</em>, multiplied by <em>L</em>;</li>
* <li>The size of a struct layout with member layouts <em>M1</em>, <em>M2</em>, ... <em>Mn</em> whose sizes are
* <em>S1</em>, <em>S2</em>, ... <em>Sn</em>, respectively, is <em>S1 + S2 + ... + Sn</em>;</li>
* <li>The size of a union layout <em>U</em> with member layouts <em>M1</em>, <em>M2</em>, ... <em>Mn</em> whose sizes are
* <em>S1</em>, <em>S2</em>, ... <em>Sn</em>, respectively, is <em>max(S1, S2, ... Sn).</em></li>
* </ul>
* <p>
* Furthermore, all layouts feature a <em>natural alignment</em> which can be inferred as follows:
* Furthermore, all layouts have a <em>natural alignment</em> (expressed in bytes) which is defined as follows:
* <ul>
* <li>for a padding layout <em>L</em>, the natural alignment is 1, regardless of its size; that is, in the absence
* of an explicit alignment constraint, a padding layout should not affect the alignment constraint of the group
* layout it is nested into</li>
* <li>for a value layout <em>L</em> whose size is <em>N</em>, the natural alignment of <em>L</em> is <em>N</em></li>
* <li>for a sequence layout <em>S</em> whose element layout is <em>E</em>, the natural alignment of <em>S</em> is that of <em>E</em></li>
* <li>for a group layout <em>G</em> with member layouts <em>M1</em>, <em>M2</em>, ... <em>Mn</em> whose alignments are
* <em>A1</em>, <em>A2</em>, ... <em>An</em>, respectively, the natural alignment of <em>G</em> is <em>max(A1, A2 ... An)</em></li>
* <li>The natural alignment of a padding layout is 1;</li>
* <li>The natural alignment of a value layout whose size is <em>N</em> is <em>N</em>;</li>
* <li>The natural alignment of a sequence layout whose element layout is <em>E</em> is the alignment of <em>E</em>;</li>
* <li>The natural alignment of a group layout with member layouts <em>M1</em>, <em>M2</em>, ... <em>Mn</em> whose
* alignments are <em>A1</em>, <em>A2</em>, ... <em>An</em>, respectively, is <em>max(A1, A2 ... An)</em>.</li>
* </ul>
* A layout's natural alignment can be overridden if needed (see {@link MemoryLayout#withByteAlignment(long)}), which can be useful to describe
* hyper-aligned layouts.
* <p>
* All value layouts have an <em>explicit</em> byte order (see {@link java.nio.ByteOrder}) which is set when the layout is created.
* A layout's alignment can be overridden if needed (see {@link MemoryLayout#withByteAlignment(long)}), which can be useful to describe
* layouts with weaker or stronger alignment constraints.
*
* <h2 id="layout-paths">Layout paths</h2>
*
* A <em>layout path</em> originates from a <em>root</em> layout (typically a group or a sequence layout) and terminates
* at a layout nested within the root layout - this is the layout <em>selected</em> by the layout path.
* Layout paths are typically expressed as a sequence of one or more {@link PathElement} instances.
* A <em>layout path</em> is used to unambiguously select a layout that is nested in some other layout.
* Layout paths are typically expressed as a sequence of one or more {@linkplain PathElement path elements}.
* (A more formal definition of layout paths is provided <a href="#well-formedness">below</a>).
* <p>
* Layout paths are for example useful in order to obtain {@linkplain MemoryLayout#byteOffset(PathElement...) offsets} of
* arbitrarily nested layouts inside another layout, to quickly obtain a {@linkplain #varHandle(PathElement...) memory access handle}
* corresponding to the selected layout, or to {@linkplain #select(PathElement...) select} an arbitrarily nested layout inside
* another layout.
* Layout paths can be used to:
* <ul>
* <li>obtain {@linkplain MemoryLayout#byteOffset(PathElement...) offsets} of arbitrarily nested layouts;</li>
* <li>obtain a {@linkplain #varHandle(PathElement...) var handle} that can be used to access the value corresponding
* to the selected layout;</li>
* <li>{@linkplain #select(PathElement...) select} an arbitrarily nested layout.</li>
* </ul>
* <p>
* Such <em>layout paths</em> can be constructed programmatically using the methods in this class.
* For instance, given the {@code taggedValues} layout instance constructed as above, we can obtain the offset,
* For instance, given the {@code taggedValues} sequence layout constructed above, we can obtain the offset,
* in bytes, of the member layout named <code>value</code> in the <em>first</em> sequence element, as follows:
* {@snippet lang=java :
* long valueOffset = taggedValues.byteOffset(PathElement.sequenceElement(0),
@@ -134,27 +141,26 @@ import jdk.internal.javac.PreviewFeature;
* PathElement.groupElement("value"));
* }
*
* Layout paths can feature one or more <em>free dimensions</em>. For instance, a layout path traversing
* an unspecified sequence element (that is, where one of the path component was obtained with the
* {@link PathElement#sequenceElement()} method) features an additional free dimension, which will have to be bound at runtime.
* This is important when obtaining a {@linkplain MethodHandles#memorySegmentViewVarHandle(ValueLayout) memory segment view var handle}
* from layouts, as in the following code:
* <h3 id="open-path-elements">Open path elements</h3>
*
* Some layout path elements, said <em>open path elements</em>, can select multiple layouts at once. For instance,
* the open path elements {@link PathElement#sequenceElement()}, {@link PathElement#sequenceElement(long, long)} select
* an unspecified element in a sequence layout. A var handle derived from a layout path containing one or more
* open path element features additional coordinates of type {@code long}, which can be used by clients to <em>bind</em>
* the open elements in the path:
*
* {@snippet lang=java :
* VarHandle valueHandle = taggedValues.varHandle(PathElement.sequenceElement(),
* PathElement.groupElement("value"));
* MemorySegment valuesSegment = ...
* int val = (int) valueHandle.get(valuesSegment, 2); // reads the "value" field of the third struct in the array
* }
*
* Since the layout path constructed in the above example features exactly one free dimension (as it doesn't specify
* <em>which</em> member layout named {@code value} should be selected from the enclosing sequence layout),
* it follows that the var handle {@code valueHandle} will feature an <em>additional</em> {@code long}
* access coordinate.
*
* <p>A layout path with free dimensions can also be used to create an offset-computing method handle, using the
* {@link #byteOffset(PathElement...)} or {@link #byteOffsetHandle(PathElement...)} method. Again, free dimensions are
* translated into {@code long} parameters of the created method handle. The method handle can be used to compute the
* offsets of elements of a sequence at different indices, by supplying these indices when invoking the method handle.
* For instance:
* <p>
* Open path elements also affects the creation of
* {@linkplain #byteOffsetHandle(PathElement...) offset-computing method handles}. Each open path element becomes
* an additional {@code long} parameter in the obtained method handle. This parameter can be used to specify the index
* of the sequence element whose offset is to be computed:
*
* {@snippet lang=java :
* MethodHandle offsetHandle = taggedValues.byteOffsetHandle(PathElement.sequenceElement(),
@@ -163,6 +169,68 @@ import jdk.internal.javac.PreviewFeature;
* long offset2 = (long) offsetHandle.invokeExact(2L); // 16
* }
*
* <h3 id="deref-path-elements">Dereference path elements</h3>
*
* A special kind of path element, called <em>dereference path element</em>, allows var handles obtained from
* memory layouts to follow pointers. Consider the following layout:
*
* {@snippet lang=java :
* StructLayout RECTANGLE = MemoryLayout.structLayout(
* ValueLayout.ADDRESS.withTargetLayout(
* MemoryLayout.sequenceLayout(4,
* MemoryLayout.structLayout(
* ValueLayout.JAVA_INT.withName("x"),
* ValueLayout.JAVA_INT.withName("y")
* ).withName("point")
* )
* ).withName("points")
* );
* }
*
* This layout is a struct layout which describe a rectangle. It contains a single field, namely {@code points},
* an address layout whose {@linkplain AddressLayout#targetLayout() target layout} is a sequence layout of four
* struct layouts. Each struct layout describes a two-dimensional point, and is defined as a pair or
* {@link ValueLayout#JAVA_INT} coordinates, with names {@code x} and {@code y}, respectively.
* <p>
* With dereference path elements, we can obtain a var handle which accesses the {@code y} coordinate of one of the
* point in the rectangle, as follows:
*
* {@snippet lang=java :
* VarHandle rectPointYs = RECTANGLE.varHandle(
* PathElement.groupElement("points"),
* PathElement.dereferenceElement(),
* PathElement.sequenceElement(),
* PathElement.groupElement("y")
* );
*
* MemorySegment rect = ...
* int rect_y_4 = (int) rectPointYs.get(rect, 2); // rect.points[2]->y
* }
*
* <h3 id="well-formedness">Layout path well-formedness</h3>
*
* A layout path is applied to a layout {@code C_0}, also called the <em>initial layout</em>. Each path element in a
* layout path can be thought of as a function which updates the current layout {@code C_i-1} to some other layout
* {@code C_i}. That is, for each path element {@code E1, E2, ... En}, in a layout path {@code P}, we compute
* {@code C_i = f_i(C_i-1)}, where {@code f_i} is the selection function associated with the path element under consideration,
* denoted as {@code E_i}. The final layout {@code C_i} is also called the <em>selected layout</em>.
* <p>
* A layout path {@code P} is considered well-formed for an initial layout {@code C_0} if all its path elements
* {@code E1, E2, ... En} are well-formed for their corresponding input layouts {@code C_0, C_1, ... C_n-1}.
* A path element {@code E} is considered well-formed for a layout {@code L} if any of the following is true:
* <ul>
* <li>{@code L} is a sequence layout and {@code E} is a sequence path element (one of {@link PathElement#sequenceElement(long)},
* {@link PathElement#sequenceElement(long, long)} or {@link PathElement#sequenceElement()}). Moreover, if {@code E}
* contains one or more sequence indices, such indices have to be compatible with the sequence layout's element count;</li>
* <li>{@code L} is a group layout and {@code E} is a group path element (one of {@link PathElement#groupElement(String)}
* or {@link PathElement#groupElement(long)}). Moreover, the group path element must refer to a valid member layout in
* {@code L}, either by name, or index;</li>
* <li>{@code L} is an address layout and {@code E} is a {@linkplain PathElement#dereferenceElement() dereference path element}.
* Moreover, {@code L} must define some {@linkplain AddressLayout#targetLayout() target layout}.</li>
* </ul>
* Any attempt to provide a layout path {@code P} that is not well-formed for an initial layout {@code C_0} will result
* in an {@link IllegalArgumentException}.
*
* @implSpec
* Implementations of this interface are immutable, thread-safe and <a href="{@docRoot}/java.base/java/lang/doc-files/ValueBased.html">value-based</a>.
*
@@ -184,28 +252,23 @@ public sealed interface MemoryLayout permits SequenceLayout, GroupLayout, Paddin
Optional<String> name();
/**
* Returns a memory layout of the same type with the same size and alignment constraint as this layout,
* but with the specified name.
* {@return a memory layout with the same characteristics as this layout, but with the given name}
*
* @param name the layout name.
* @return a memory layout with the given name.
* @see MemoryLayout#name()
*/
MemoryLayout withName(String name);
/**
* Returns a memory layout of the same type with the same size and alignment constraint as this layout,
* but without a name.
* <p>
* This can be useful to compare two layouts that have different names, but are otherwise equal.
* {@return a memory layout with the same characteristics as this layout, but with no name}
*
* @return a memory layout without a name.
* @apiNote This can be useful to compare two layouts that have different names, but are otherwise equal.
* @see MemoryLayout#name()
*/
MemoryLayout withoutName();
/**
* Returns the alignment constraint associated with this layout, expressed in bytes. Layout alignment defines a power
* {@return the alignment constraint associated with this layout, expressed in bytes} Layout alignment defines a power
* of two {@code A} which is the byte-wise alignment of the layout, where {@code A} is the number of bytes that must be aligned
* for any pointer that correctly points to this layout. Thus:
*
@@ -217,36 +280,27 @@ public sealed interface MemoryLayout permits SequenceLayout, GroupLayout, Paddin
*
* If no explicit alignment constraint was set on this layout (see {@link #withByteAlignment(long)}),
* then this method returns the <a href="#layout-align">natural alignment</a> constraint (in bytes) associated with this layout.
*
* @return the layout alignment constraint, in bytes.
*/
long byteAlignment();
/**
* Returns a memory layout of the same type with the same size and name as this layout,
* but with the specified alignment constraint (in bytes).
* {@return a memory layout with the same characteristics as this layout, but with the given
* alignment constraint (in bytes)}
*
* @param byteAlignment the layout alignment constraint, expressed in bytes.
* @return a memory layout with the given alignment constraint.
* @throws IllegalArgumentException if {@code byteAlignment} is not a power of two, or if it's less than 1.
* @throws IllegalArgumentException if {@code byteAlignment} is not a power of two.
*/
MemoryLayout withByteAlignment(long byteAlignment);
/**
* Computes the offset, in bytes, of the layout selected by the given layout path, where the path is considered rooted in this
* layout.
* Computes the offset, in bytes, of the layout selected by the given layout path, where the initial layout in the
* path is this layout.
*
* @param elements the layout path elements.
* @return The offset, in bytes, of the layout selected by the layout path in {@code elements}.
* @throws IllegalArgumentException if the layout path does not select any layout nested in this layout, or if the
* layout path contains one or more path elements that select multiple sequence element indices
* (see {@link PathElement#sequenceElement()} and {@link PathElement#sequenceElement(long, long)}).
* @throws IllegalArgumentException if the layout path contains one or more dereference path elements
* (see {@link PathElement#dereferenceElement()}).
* @throws NullPointerException if either {@code elements == null}, or if any of the elements
* in {@code elements} is {@code null}.
* @throws IllegalArgumentException if the layout path is not <a href="#well-formedness">well-formed</a> for this layout.
* @throws IllegalArgumentException if the layout path contains one or more <a href=#open-path-elements>open path elements</a>.
* @throws IllegalArgumentException if the layout path contains one or more <a href=#deref-path-elements>dereference path elements</a>.
*/
default long byteOffset(PathElement... elements) {
return computePathOp(LayoutPath.rootPath(this), LayoutPath::offset,
@@ -254,19 +308,21 @@ public sealed interface MemoryLayout permits SequenceLayout, GroupLayout, Paddin
}
/**
* Creates a method handle that can be used to compute the offset, in bytes, of the layout selected
* by the given layout path, where the path is considered rooted in this layout.
*
* <p>The returned method handle has a return type of {@code long}, and features as many {@code long}
* parameter types as there are free dimensions in the provided layout path (see {@link PathElement#sequenceElement()}),
* where the order of the parameters corresponds to the order of the path elements.
* The returned method handle can be used to compute a layout offset similar to {@link #byteOffset(PathElement...)},
* but where some sequence indices are specified only when invoking the method handle.
*
* <p>The final offset returned by the method handle is computed as follows:
* Creates a method handle that computes the offset, in bytes, of the layout selected
* by the given layout path, where the initial layout in the path is this layout.
* <p>
* The returned method handle has the following characteristics:
* <ul>
* <li>its return type is {@code long};</li>
* <li>it has as zero or more parameters of type {@code long}, one for each <a href=#open-path-elements>open path element</a>
* in the provided layout path. The order of these parameters corresponds to the order in which the open path
* elements occur in the provided layout path.
* </ul>
* <p>
* The final offset returned by the method handle is computed as follows:
*
* <blockquote><pre>{@code
* byteOffset = c_1 + c_2 + ... + c_m + (x_1 * s_1) + (x_2 * s_2) + ... + (x_n * s_n)
* offset = c_1 + c_2 + ... + c_m + (x_1 * s_1) + (x_2 * s_2) + ... + (x_n * s_n)
* }</pre></blockquote>
*
* where {@code x_1}, {@code x_2}, ... {@code x_n} are <em>dynamic</em> values provided as {@code long}
@@ -274,22 +330,32 @@ public sealed interface MemoryLayout permits SequenceLayout, GroupLayout, Paddin
* and {@code s_0}, {@code s_1}, ... {@code s_n} are <em>static</em> stride constants which are derived from
* the layout path.
*
* @apiNote The returned method handle can be used to compute a layout offset, similarly to {@link #byteOffset(PathElement...)},
* but more flexibly, as some indices can be specified when invoking the method handle.
*
* @param elements the layout path elements.
* @return a method handle that can be used to compute the byte offset of the layout element
* specified by the given layout path elements, when supplied with the missing sequence element indices.
* @throws IllegalArgumentException if the layout path contains one or more path elements that select
* multiple sequence element indices (see {@link PathElement#sequenceElement(long, long)}).
* @throws IllegalArgumentException if the layout path contains one or more dereference path elements
* (see {@link PathElement#dereferenceElement()}).
* @return a method handle that computes the offset, in bytes, of the layout selected by the given layout path.
* @throws IllegalArgumentException if the layout path is not <a href="#well-formedness">well-formed</a> for this layout.
* @throws IllegalArgumentException if the layout path contains one or more <a href=#deref-path-elements>dereference path elements</a>.
*/
default MethodHandle byteOffsetHandle(PathElement... elements) {
return computePathOp(LayoutPath.rootPath(this), LayoutPath::offsetHandle,
EnumSet.of(PathKind.SEQUENCE_RANGE, PathKind.DEREF_ELEMENT), elements);
EnumSet.of(PathKind.DEREF_ELEMENT), elements);
}
/**
* Creates a var handle that can be used to access a memory segment at the layout selected by the given layout path,
* where the path is considered rooted in this layout.
* Creates a var handle that accesses a memory segment at the offset selected by the given layout path,
* where the initial layout in the path is this layout.
* <p>
* The returned var handle has the following characteristics:
* <ul>
* <li>its type is derived from the {@linkplain ValueLayout#carrier() carrier} of the
* selected value layout;</li>
* <li>it has as zero or more access coordinates of type {@code long}, one for each
* <a href=#open-path-elements>open path element</a> in the provided layout path. The order of these access
* coordinates corresponds to the order in which the open path elements occur in the provided
* layout path.
* </ul>
* <p>
* The final address accessed by the returned var handle can be computed as follows:
*
@@ -300,7 +366,7 @@ public sealed interface MemoryLayout permits SequenceLayout, GroupLayout, Paddin
* Where {@code base(segment)} denotes a function that returns the physical base address of the accessed
* memory segment. For native segments, this function just returns the native segment's
* {@linkplain MemorySegment#address() address}. For heap segments, this function is more complex, as the address
* of heap segments is virtualized. The {@code offset} coordinate can be expressed in the following form:
* of heap segments is virtualized. The {@code offset} value can be expressed in the following form:
*
* <blockquote><pre>{@code
* offset = c_1 + c_2 + ... + c_m + (x_1 * s_1) + (x_2 * s_2) + ... + (x_n * s_n)
@@ -311,14 +377,18 @@ public sealed interface MemoryLayout permits SequenceLayout, GroupLayout, Paddin
* and {@code s_1}, {@code s_2}, ... {@code s_n} are <em>static</em> stride constants which are derived from
* the layout path.
* <p>
* Additionally, the provided dynamic values must conform to some bound which is derived from the layout path, that is,
* Additionally, the provided dynamic values must conform to bounds which are derived from the layout path, that is,
* {@code 0 <= x_i < b_i}, where {@code 1 <= i <= n}, or {@link IndexOutOfBoundsException} is thrown.
* <p>
* Multiple paths can be chained, by using {@linkplain PathElement#dereferenceElement() dereference path elements}.
* A dereference path element allows to obtain a native memory segment whose base address is the address obtained
* by following the layout path elements immediately preceding the dereference path element. In other words,
* if a layout path contains one or more dereference path elements, the final address accessed by the returned
* var handle can be computed as follows:
* The base address must be <a href="MemorySegment.html#segment-alignment">aligned</a> according to the {@linkplain
* #byteAlignment() alignment constraint} of the root layout (this layout). Note that this can be more strict
* (but not less) than the alignment constraint of the selected value layout.
* <p>
* Multiple paths can be chained, with <a href=#deref-path-elements>dereference path elements</a>.
* A dereference path element constructs a fresh native memory segment whose base address is the address value
* read obtained by accessing a memory segment at the offset determined by the layout path elements immediately preceding
* the dereference path element. In other words, if a layout path contains one or more dereference path elements,
* the final address accessed by the returned var handle can be computed as follows:
*
* <blockquote><pre>{@code
* address_1 = base(segment) + offset_1
@@ -336,16 +406,13 @@ public sealed interface MemoryLayout permits SequenceLayout, GroupLayout, Paddin
* (e.g. those at addresses {@code address_1}, {@code address_2}, ..., {@code address_k-1} are performed using the
* {@link VarHandle.AccessMode#GET} access mode.
*
* @apiNote the resulting var handle will feature an additional {@code long} access coordinate for every
* unspecified sequence access component contained in this layout path. Moreover, the resulting var handle
* features certain <em>access mode restrictions</em>, which are common to all memory segment view handles.
* @apiNote The resulting var handle features certain <em>access mode restrictions</em>, which are common to all
* {@linkplain MethodHandles#memorySegmentViewVarHandle(ValueLayout) memory segment view handles}.
*
* @param elements the layout path elements.
* @return a var handle which can be used to access a memory segment at the (possibly nested) layout selected by the layout path in {@code elements}.
* @throws UnsupportedOperationException if the layout path has one or more elements with incompatible alignment constraint.
* @throws IllegalArgumentException if the layout path in {@code elements} does not select a value layout (see {@link ValueLayout}).
* @throws IllegalArgumentException if the layout path in {@code elements} contains a {@linkplain PathElement#dereferenceElement()
* dereference path element} for an address layout that has no {@linkplain AddressLayout#targetLayout() target layout}.
* @return a var handle that accesses a memory segment at the offset selected by the given layout path.
* @throws IllegalArgumentException if the layout path is not <a href="#well-formedness">well-formed</a> for this layout.
* @throws IllegalArgumentException if the layout selected by the provided path is not a {@linkplain ValueLayout value layout}.
* @see MethodHandles#memorySegmentViewVarHandle(ValueLayout)
*/
default VarHandle varHandle(PathElement... elements) {
@@ -355,54 +422,51 @@ public sealed interface MemoryLayout permits SequenceLayout, GroupLayout, Paddin
/**
* Creates a method handle which, given a memory segment, returns a {@linkplain MemorySegment#asSlice(long,long) slice}
* corresponding to the layout selected by the given layout path, where the path is considered rooted in this layout.
*
* <p>The returned method handle has a return type of {@code MemorySegment}, features a {@code MemorySegment}
* parameter as leading parameter representing the segment to be sliced, and features as many trailing {@code long}
* parameter types as there are free dimensions in the provided layout path (see {@link PathElement#sequenceElement()}),
* where the order of the parameters corresponds to the order of the path elements.
* The returned method handle can be used to create a slice similar to using {@link MemorySegment#asSlice(long, long)},
* but where the offset argument is dynamically compute based on indices specified when invoking the method handle.
*
* <p>The offset of the returned segment is computed as follows:
*
* <blockquote><pre>{@code
* byteOffset = c_1 + c_2 + ... + c_m + (x_1 * s_1) + (x_2 * s_2) + ... + (x_n * s_n)
* }</pre></blockquote>
*
* where {@code x_1}, {@code x_2}, ... {@code x_n} are <em>dynamic</em> values provided as {@code long}
* arguments, whereas {@code c_1}, {@code c_2}, ... {@code c_m} are <em>static</em> offset constants
* and {@code s_1}, {@code s_2}, ... {@code s_n} are <em>static</em> stride constants which are derived from
* the layout path.
*
* <p>After the offset is computed, the returned segment is created as if by calling:
* corresponding to the layout selected by the given layout path, where the initial layout in the path is this layout.
* <p>
* The returned method handle has the following characteristics:
* <ul>
* <li>its return type is {@code MemorySegment};</li>
* <li>it has a leading parameter of type {@code MemorySegment}, corresponding to the memory segment
* to be sliced;</li>
* <li>it has as zero or more parameters of type {@code long}, one for each <a href=#open-path-elements>open path element</a>
* in the provided layout path. The order of these parameters corresponds to the order in which the open path
* elements occur in the provided layout path.
* </ul>
* <p>
* The offset of the returned segment is computed as follows:
* {@snippet lang=java :
* segment.asSlice(offset, layout.byteSize());
* long offset = byteOffset(elements);
* long size = select(elements).byteSize();
* MemorySegment slice = segment.asSlice(offset, size);
* }
* <p>
* The segment to be sliced must be <a href="MemorySegment.html#segment-alignment">aligned</a> according to the
* {@linkplain #byteAlignment() alignment constraint} of the root layout (this layout). Note that this can be more
* strict (but not less) than the alignment constraint of the selected value layout.
*
* where {@code segment} is the segment to be sliced, and where {@code layout} is the layout selected by the given
* layout path, as per {@link MemoryLayout#select(PathElement...)}.
* @apiNote The returned method handle can be used to obtain a memory segment slice, similarly to {@link MemorySegment#asSlice(long, long)},
* but more flexibly, as some indices can be specified when invoking the method handle.
*
* @param elements the layout path elements.
* @return a method handle which can be used to create a slice of the selected layout element, given a segment.
* @throws IllegalArgumentException if the layout path contains one or more dereference path elements
* (see {@link PathElement#dereferenceElement()}).
* @return a method handle which is used to slice a memory segment at the offset selected by the given layout path.
* @throws IllegalArgumentException if the layout path is not <a href="#well-formedness">well-formed</a> for this layout.
* @throws IllegalArgumentException if the layout path contains one or more <a href=#deref-path-elements>dereference path elements</a>.
*/
default MethodHandle sliceHandle(PathElement... elements) {
return computePathOp(LayoutPath.rootPath(this), LayoutPath::sliceHandle,
Set.of(), elements);
Set.of(PathKind.DEREF_ELEMENT), elements);
}
/**
* Selects the layout from a path rooted in this layout.
* Returns the layout selected from the provided path, where the initial layout in the path is this layout.
*
* @param elements the layout path elements.
* @return the layout selected by the layout path in {@code elements}.
* @throws IllegalArgumentException if the layout path does not select any layout nested in this layout,
* or if the layout path contains one or more path elements that select one or more sequence element indices
* (see {@link PathElement#sequenceElement(long)} and {@link PathElement#sequenceElement(long, long)}).
* @throws IllegalArgumentException if the layout path contains one or more dereference path elements
* (see {@link PathElement#dereferenceElement()}).
* @throws IllegalArgumentException if the layout path is not <a href="#well-formedness">well-formed</a> for this layout.
* @throws IllegalArgumentException if the layout path contains one or more <a href=#deref-path-elements>dereference path elements</a>.
* @throws IllegalArgumentException if the layout path contains one or more path elements that select one or more
* sequence element indices, such as {@link PathElement#sequenceElement(long)} and {@link PathElement#sequenceElement(long, long)}).
*/
default MemoryLayout select(PathElement... elements) {
return computePathOp(LayoutPath.rootPath(this), LayoutPath::layout,
@@ -424,12 +488,15 @@ public sealed interface MemoryLayout permits SequenceLayout, GroupLayout, Paddin
/**
* An element in a <a href="MemoryLayout.html#layout-paths"><em>layout path</em></a>. There
* are two kinds of path elements: <em>group path elements</em> and <em>sequence path elements</em>. Group
* path elements are used to select a named member layout within a {@link GroupLayout}. Sequence
* path elements are used to select a sequence element layout within a {@link SequenceLayout}; selection
* of sequence element layout can be <em>explicit</em> (see {@link PathElement#sequenceElement(long)}) or
* <em>implicit</em> (see {@link PathElement#sequenceElement()}). When a path uses one or more implicit
* sequence path elements, it acquires additional <em>free dimensions</em>.
* are three kinds of path elements:
* <ul>
* <li><em>group path elements</em>, used to select a member layout within a {@link GroupLayout}, either by name or by index;</li>
* <li><em>sequence path elements</em>, used to select one or more sequence element layouts within a {@link SequenceLayout}; and</li>
* <li><em>dereference path elements</em>, used to <a href="MemoryLayout.html#deref-path-elements">dereference</a>
* an address layout as its target layout.</li>
* </ul>
* Sequence path elements selecting more than one sequence element layout are called
* <a href="MemoryLayout.html#open-path-elements">open path elements</a>.
*
* @implSpec
* Implementations of this interface are immutable, thread-safe and <a href="{@docRoot}/java.base/java/lang/doc-files/ValueBased.html">value-based</a>.
@@ -441,15 +508,13 @@ public sealed interface MemoryLayout permits SequenceLayout, GroupLayout, Paddin
/**
* Returns a path element which selects a member layout with the given name in a group layout.
* The path element returned by this method does not alter the number of free dimensions of any path
* that is combined with such element.
*
* @implSpec in case multiple group elements with a matching name exist, the path element returned by this
* method will select the first one; that is, the group element with the lowest offset from current path is selected.
* In such cases, using {@link #groupElement(long)} might be preferable.
*
* @param name the name of the group element to be selected.
* @return a path element which selects the group element with the given name.
* @param name the name of the member layout to be selected.
* @return a path element which selects the group member layout with the given name.
*/
static PathElement groupElement(String name) {
Objects.requireNonNull(name);
@@ -459,11 +524,9 @@ public sealed interface MemoryLayout permits SequenceLayout, GroupLayout, Paddin
/**
* Returns a path element which selects a member layout with the given index in a group layout.
* The path element returned by this method does not alter the number of free dimensions of any path
* that is combined with such element.
*
* @param index the index of the group element to be selected.
* @return a path element which selects the group element with the given index.
* @param index the index of the member layout element to be selected.
* @return a path element which selects the group member layout with the given index.
* @throws IllegalArgumentException if {@code index < 0}.
*/
static PathElement groupElement(long index) {
@@ -476,8 +539,6 @@ public sealed interface MemoryLayout permits SequenceLayout, GroupLayout, Paddin
/**
* Returns a path element which selects the element layout at the specified position in a sequence layout.
* The path element returned by this method does not alter the number of free dimensions of any path
* that is combined with such element.
*
* @param index the index of the sequence element to be selected.
* @return a path element which selects the sequence element layout with the given index.
@@ -492,24 +553,12 @@ public sealed interface MemoryLayout permits SequenceLayout, GroupLayout, Paddin
}
/**
* Returns a path element which selects the element layout in a <em>range</em> of positions in a sequence layout.
* The range is expressed as a pair of starting index (inclusive) {@code S} and step factor (which can also be negative)
* {@code F}.
* Returns an <a href="MemoryLayout.html#open-path-elements">open path element</a> which selects the element
* layout in a <em>range</em> of positions in a sequence layout. The range is expressed as a pair of starting
* index (inclusive) {@code S} and step factor (which can also be negative) {@code F}.
* <p>
* If a path with free dimensions {@code n} is combined with the path element returned by this method,
* the number of free dimensions of the resulting path will be {@code 1 + n}. If the free dimension associated
* with this path is bound by an index {@code I}, the resulting accessed offset can be obtained with the following
* formula:
*
* <blockquote><pre>{@code
* E * (S + I * F)
* }</pre></blockquote>
*
* where {@code E} is the size (in bytes) of the sequence element layout.
* <p>
* Additionally, if {@code C} is the sequence element count, it follows that {@code 0 <= I < B},
* where {@code B} is computed as follows:
*
* The exact sequence element selected by this layout is expressed as an index {@code I}. If {@code C} is the
* sequence element count, it follows that {@code 0 <= I < B}, where {@code B} is computed as follows:
* <ul>
* <li>if {@code F > 0}, then {@code B = ceilDiv(C - S, F)}</li>
* <li>if {@code F < 0}, then {@code B = ceilDiv(-(S + 1), -F)}</li>
@@ -532,20 +581,11 @@ public sealed interface MemoryLayout permits SequenceLayout, GroupLayout, Paddin
}
/**
* Returns a path element which selects an unspecified element layout in a sequence layout.
* Returns an <a href="MemoryLayout.html#open-path-elements">open path element</a> which selects an unspecified
* element layout in a sequence layout.
* <p>
* If a path with free dimensions {@code n} is combined with the path element returned by this method,
* the number of free dimensions of the resulting path will be {@code 1 + n}. If the free dimension associated
* with this path is bound by an index {@code I}, the resulting accessed offset can be obtained with the following
* formula:
*
* <blockquote><pre>{@code
* E * I
* }</pre></blockquote>
*
* where {@code E} is the size (in bytes) of the sequence element layout.
* <p>
* Additionally, if {@code C} is the sequence element count, it follows that {@code 0 <= I < C}.
* The exact sequence element selected by this layout is expressed as an index {@code I}. If {@code C} is the
* sequence element count, it follows that {@code 0 <= I < C}.
*
* @return a path element which selects an unspecified sequence element layout.
*/
@@ -557,10 +597,6 @@ public sealed interface MemoryLayout permits SequenceLayout, GroupLayout, Paddin
/**
* Returns a path element which dereferences an address layout as its
* {@linkplain AddressLayout#targetLayout() target layout} (where set).
* The path element returned by this method does not alter the number of free dimensions of any path
* that is combined with such element. Using this path layout to dereference an address layout
* that has no target layout results in an {@link IllegalArgumentException} (e.g. when
* a var handle is {@linkplain #varHandle(PathElement...) obtained}).
*
* @return a path element which dereferences an address layout.
*/
@@ -577,11 +613,12 @@ public sealed interface MemoryLayout permits SequenceLayout, GroupLayout, Paddin
* conditions must be satisfied:
* <ul>
* <li>two value layouts are considered equal if they have the same {@linkplain ValueLayout#order() order},
* and {@linkplain ValueLayout#carrier() carrier}</li>
* and {@linkplain ValueLayout#carrier() carrier}. Additionally, two address layouts are considered equal if they
* also have the same {@linkplain AddressLayout#targetLayout() target layout};</li>
* <li>two sequence layouts are considered equal if they have the same element count (see {@link SequenceLayout#elementCount()}), and
* if their element layouts (see {@link SequenceLayout#elementLayout()}) are also equal</li>
* if their element layouts (see {@link SequenceLayout#elementLayout()}) are also equal;</li>
* <li>two group layouts are considered equal if they are of the same type (see {@link StructLayout},
* {@link UnionLayout}) and if their member layouts (see {@link GroupLayout#memberLayouts()}) are also equal</li>
* {@link UnionLayout}) and if their member layouts (see {@link GroupLayout#memberLayouts()}) are also equal.</li>
* </ul>
*
* @param other the object to be compared for equality with this layout.
@@ -601,7 +638,10 @@ public sealed interface MemoryLayout permits SequenceLayout, GroupLayout, Paddin
String toString();
/**
* Creates a padding layout with the given byte size and a byte-alignment of one.
* Creates a padding layout with the given byte size. The alignment constraint of the returned layout
* is 1. As such, regardless of its size, in the absence of an {@linkplain #withByteAlignment(long) explicit}
* alignment constraint, a padding layout does not affect the natural alignment of the group or sequence layout
* it is nested into.
*
* @param byteSize the padding size (expressed in bytes).
* @return the new selector layout.
@@ -617,14 +657,15 @@ public sealed interface MemoryLayout permits SequenceLayout, GroupLayout, Paddin
* @param elementCount the sequence element count.
* @param elementLayout the sequence element layout.
* @return the new sequence layout with the given element layout and size.
* @throws IllegalArgumentException if {@code elementCount } is negative.
* @throws IllegalArgumentException if {@code elementCount} is negative.
* @throws IllegalArgumentException if {@code elementLayout.byteSize() * elementCount} overflows.
* @throws IllegalArgumentException if {@code elementLayout.byteSize() % elementLayout.byteAlignment() != 0}.
*/
static SequenceLayout sequenceLayout(long elementCount, MemoryLayout elementLayout) {
MemoryLayoutUtil.requireNonNegative(elementCount);
Objects.requireNonNull(elementLayout);
Utils.checkElementAlignment(elementLayout, "Element layout size is not multiple of alignment");
return wrapOverflow(() ->
return Utils.wrapOverflow(() ->
SequenceLayoutImpl.of(elementCount, elementLayout));
}
@@ -678,7 +719,7 @@ public sealed interface MemoryLayout permits SequenceLayout, GroupLayout, Paddin
*/
static StructLayout structLayout(MemoryLayout... elements) {
Objects.requireNonNull(elements);
return wrapOverflow(() ->
return Utils.wrapOverflow(() ->
StructLayoutImpl.of(Stream.of(elements)
.map(Objects::requireNonNull)
.toList()));
@@ -696,12 +737,4 @@ public sealed interface MemoryLayout permits SequenceLayout, GroupLayout, Paddin
.map(Objects::requireNonNull)
.toList());
}
private static <L extends MemoryLayout> L wrapOverflow(Supplier<L> layoutSupplier) {
try {
return layoutSupplier.get();
} catch (ArithmeticException ex) {
throw new IllegalArgumentException("Layout size exceeds Long.MAX_VALUE");
}
}
}

View File

@@ -108,7 +108,7 @@ import jdk.internal.vm.annotation.ForceInline;
* <p>
* Finally, access operations on a memory segment can be subject to additional thread-confinement checks.
* Heap segments can be accessed from any thread. Conversely, native segments can only be accessed compatibly with the
* <a href="ScopedArena.html#thread-confinement">confinement characteristics</a> of the arena used to obtain them.
* <a href="Arena.html#thread-confinement">confinement characteristics</a> of the arena used to obtain them.
*
* <h2 id="segment-deref">Accessing memory segments</h2>
*
@@ -141,7 +141,7 @@ import jdk.internal.vm.annotation.ForceInline;
* .findStatic(Math.class, "multiplyExact",
* MethodType.methodType(long.class, long.class, long.class));
* intHandle = MethodHandles.filterCoordinates(intHandle, 1,
* MethodHandles.insertArguments(multiplyExact, 0, 4L));
* MethodHandles.insertArguments(multiplyExact, 0, ValueLayout.JAVA_INT.byteSize()));
* int value = (int) intHandle.get(segment, 3L); // get int element at offset 3 * 4 = 12
* }
*
@@ -260,9 +260,10 @@ import jdk.internal.vm.annotation.ForceInline;
* (e.g. because of platform considerations and/or garbage collection behavior).
* <p>
* In practice, the Java runtime lays out arrays in memory so that each n-byte element occurs at an n-byte
* aligned physical address. The runtime preserves this invariant even if the array is relocated during garbage
* collection. Access operations rely on this invariant to determine if the specified offset in a heap segment refers
* to an aligned address in physical memory. For example:
* aligned physical address (except for {@code long[]} and {@code double[]}, where alignment is platform-dependent, as explained
* below). The runtime preserves this invariant even if the array is relocated during garbage collection.
* Access operations rely on this invariant to determine if the specified offset in a heap segment refers to an aligned
* address in physical memory. For example:
* <ul>
* <li>The starting physical address of a {@code short[]} array will be 2-byte aligned (e.g. 1006) so that successive
* short elements occur at 2-byte aligned addresses (e.g. 1006, 1008, 1010, 1012, etc). A heap segment backed by a
@@ -278,10 +279,10 @@ import jdk.internal.vm.annotation.ForceInline;
* constraint. In addition, the segment can be accessed at offsets 0, 4, 8, 12, etc under a 4-byte alignment constraint,
* because the target addresses (1000, 1004, 1008, 1012) are 4-byte aligned. And, the segment can be accessed at offsets
* 0, 2, 4, 6, etc under a 2-byte alignment constraint, because the target addresses (e.g. 1000, 1002, 1004, 1006) are 2-byte aligned.</li>
* <li>The starting physical address of a {@code long[]} array will be 4-byte aligned (e.g. 1000) on 32-bit platforms,
* <li>The starting physical address of a {@code long[]} array will be 4-byte aligned (e.g. 1004) on 32-bit platforms,
* so that successive long elements occur at 4-byte aligned addresses (e.g., 1004, 1008, 1012, 1016, etc.) On 32-bit
* platforms, a heap segment backed by a {@code long[]} array can be accessed at offsets 0, 4, 8, 12, etc under a 4-byte
* alignment constraint, because the target addresses (1000, 1004, 1008, 1012) are 4-byte aligned. And, the segment
* alignment constraint, because the target addresses (1004, 1008, 1012, 1016) are 4-byte aligned. And, the segment
* can be accessed at offsets 0, 2, 4, 6, etc under a 2-byte alignment constraint, because the target addresses
* (e.g. 1000, 1002, 1004, 1006) are 2-byte aligned.</li>
* </ul>
@@ -440,11 +441,17 @@ public sealed interface MemorySegment permits AbstractMemorySegmentImpl {
/**
* {@return the address of this memory segment}
*
* @apiNote When using this method to pass a segment address to some external operation (e.g. a JNI function),
* clients must ensure that the segment is kept <a href="../../../java/lang/ref/package.html#reachability">reachable</a>
* for the entire duration of the operation. A failure to do so might result in the premature deallocation of the
* region of memory backing the memory segment, in case the segment has been allocated with an
* {@linkplain Arena#ofAuto() automatic arena}.
*/
long address();
/**
* Returns the Java object stored in the on-heap memory region backing this memory segment, if any. For instance, if this
* Returns the Java object stored in the on-heap region of memory backing this memory segment, if any. For instance, if this
* memory segment is a heap segment created with the {@link #ofArray(byte[])} factory method, this method will return the
* {@code byte[]} object which was used to obtain the segment. This method returns an empty {@code Optional} value
* if either this segment is a {@linkplain #isNative() native} segment, or if this segment is {@linkplain #isReadOnly() read-only}.
@@ -515,7 +522,7 @@ public sealed interface MemorySegment permits AbstractMemorySegmentImpl {
* <p>
* Equivalent to the following code:
* {@snippet lang=java :
* asSlice(offset, layout.byteSize(), 1);
* asSlice(offset, newSize, 1);
* }
*
* @see #asSlice(long, long, long)
@@ -523,7 +530,8 @@ public sealed interface MemorySegment permits AbstractMemorySegmentImpl {
* @param offset The new segment base offset (relative to the address of this segment), specified in bytes.
* @param newSize The new segment size, specified in bytes.
* @return a slice of this memory segment.
* @throws IndexOutOfBoundsException if {@code offset < 0}, {@code offset > byteSize()}, {@code newSize < 0}, or {@code newSize > byteSize() - offset}
* @throws IndexOutOfBoundsException if {@code offset < 0}, {@code offset > byteSize()}, {@code newSize < 0},
* or {@code newSize > byteSize() - offset}
*/
MemorySegment asSlice(long offset, long newSize);
@@ -535,9 +543,11 @@ public sealed interface MemorySegment permits AbstractMemorySegmentImpl {
* @param newSize The new segment size, specified in bytes.
* @param byteAlignment The alignment constraint (in bytes) of the returned slice.
* @return a slice of this memory segment.
* @throws IndexOutOfBoundsException if {@code offset < 0}, {@code offset > byteSize()}, {@code newSize < 0}, or {@code newSize > byteSize() - offset}
* @throws IndexOutOfBoundsException if {@code offset < 0}, {@code offset > byteSize()}, {@code newSize < 0},
* or {@code newSize > byteSize() - offset}
* @throws IllegalArgumentException if this segment cannot be accessed at {@code offset} under
* the provided alignment constraint.
* @throws IllegalArgumentException if {@code byteAlignment <= 0}, or if {@code byteAlignment} is not a power of 2.
*/
MemorySegment asSlice(long offset, long newSize, long byteAlignment);
@@ -554,8 +564,8 @@ public sealed interface MemorySegment permits AbstractMemorySegmentImpl {
*
* @param offset The new segment base offset (relative to the address of this segment), specified in bytes.
* @param layout The layout of the segment slice.
* @throws IndexOutOfBoundsException if {@code offset < 0}, {@code offset > layout.byteSize()},
* {@code newSize < 0}, or {@code newSize > layout.byteSize() - offset}
* @throws IndexOutOfBoundsException if {@code offset < 0}, {@code offset > byteSize()},
* or {@code layout.byteSize() > byteSize() - offset}
* @throws IllegalArgumentException if this segment cannot be accessed at {@code offset} under
* the alignment constraint specified by {@code layout}.
* @return a slice of this memory segment.
@@ -612,7 +622,8 @@ public sealed interface MemorySegment permits AbstractMemorySegmentImpl {
* Clients can specify an optional cleanup action that should be executed when the provided scope becomes
* invalid. This cleanup action receives a fresh memory segment that is obtained from this segment as follows:
* {@snippet lang=java :
* MemorySegment cleanupSegment = MemorySegment.ofAddress(this.address());
* MemorySegment cleanupSegment = MemorySegment.ofAddress(this.address())
* .reinterpret(byteSize());
* }
* That is, the cleanup action receives a segment that is associated with a fresh scope that is always alive,
* and is accessible from any thread. The size of the segment accepted by the cleanup action is {@link #byteSize()}.
@@ -631,8 +642,7 @@ public sealed interface MemorySegment permits AbstractMemorySegmentImpl {
* @param arena the arena to be associated with the returned segment.
* @param cleanup the cleanup action that should be executed when the provided arena is closed (can be {@code null}).
* @return a new memory segment with unbounded size.
* @throws IllegalArgumentException if {@code newSize < 0}.
* @throws IllegalStateException if {@code scope.isAlive() == false}.
* @throws IllegalStateException if {@code arena.scope().isAlive() == false}.
* @throws UnsupportedOperationException if this segment is not a {@linkplain #isNative() native} segment.
* @throws IllegalCallerException If the caller is in a module that does not have native access enabled.
*/
@@ -651,7 +661,8 @@ public sealed interface MemorySegment permits AbstractMemorySegmentImpl {
* Clients can specify an optional cleanup action that should be executed when the provided scope becomes
* invalid. This cleanup action receives a fresh memory segment that is obtained from this segment as follows:
* {@snippet lang=java :
* MemorySegment cleanupSegment = MemorySegment.ofAddress(this.address());
* MemorySegment cleanupSegment = MemorySegment.ofAddress(this.address())
* .reinterpret(newSize);
* }
* That is, the cleanup action receives a segment that is associated with a fresh scope that is always alive,
* and is accessible from any thread. The size of the segment accepted by the cleanup action is {@code newSize}.
@@ -674,7 +685,7 @@ public sealed interface MemorySegment permits AbstractMemorySegmentImpl {
* that of the provided arena.
* @throws UnsupportedOperationException if this segment is not a {@linkplain #isNative() native} segment.
* @throws IllegalArgumentException if {@code newSize < 0}.
* @throws IllegalStateException if {@code scope.isAlive() == false}.
* @throws IllegalStateException if {@code arena.scope().isAlive() == false}.
* @throws IllegalCallerException If the caller is in a module that does not have native access enabled.
*/
@CallerSensitive
@@ -718,7 +729,7 @@ public sealed interface MemorySegment permits AbstractMemorySegmentImpl {
* at least two slices {@code L1} (from {@code S1}) and {@code L2} (from {@code S2}) that are backed by the
* same region of memory. As such, it is not possible for a
* {@linkplain #isNative() native} segment to overlap with a heap segment; in
* this case, or when no overlap occurs, {@code null} is returned.
* this case, or when no overlap occurs, an empty {@code Optional} is returned.
*
* @param other the segment to test for an overlap with this segment.
* @return a slice of this segment (where overlapping occurs).
@@ -735,7 +746,7 @@ public sealed interface MemorySegment permits AbstractMemorySegmentImpl {
* can be computed as follows:
*
* {@snippet lang=java :
* other.address() - segment.address()
* other.address() - address()
* }
*
* If the segments share the same address, {@code 0} is returned. If
@@ -744,37 +755,35 @@ public sealed interface MemorySegment permits AbstractMemorySegmentImpl {
*
* @param other the segment to retrieve an offset to.
* @throws UnsupportedOperationException if the two segments cannot be compared, e.g. because they are of
* a different kind, or because they are backed by different Java arrays.
* different kinds, or because they are backed by different Java arrays.
* @return the relative offset, in bytes, of the provided segment.
*/
long segmentOffset(MemorySegment other);
/**
* Fills a value into this memory segment.
* Fills the contents of this memory segment with the given value.
* <p>
* More specifically, the given value is filled into each address of this
* More specifically, the given value is written into each address of this
* segment. Equivalent to (but likely more efficient than) the following code:
*
* {@snippet lang=java :
* var byteHandle = MemoryLayout.sequenceLayout(ValueLayout.JAVA_BYTE)
* .varHandle(MemoryLayout.PathElement.sequenceElement());
* for (long l = 0; l < segment.byteSize(); l++) {
* byteHandle.set(segment.address(), l, value);
* for (long offset = 0; offset < segment.byteSize(); offset++) {
* byteHandle.set(ValueLayout.JAVA_BYTE, offset, value);
* }
* }
*
* without any regard or guarantees on the ordering of particular memory
* But without any regard or guarantees on the ordering of particular memory
* elements being set.
* <p>
* Fill can be useful to initialize or reset the memory of a segment.
* This method can be useful to initialize or reset the contents of a memory segment.
*
* @param value the value to fill into this segment
* @return this memory segment
* @param value the value to write into this segment.
* @return this memory segment.
* @throws IllegalStateException if the {@linkplain #scope() scope} associated with this segment is not
* {@linkplain Scope#isAlive() alive}.
* @throws WrongThreadException if this method is called from a thread {@code T},
* such that {@code isAccessibleBy(T) == false}.
* @throws UnsupportedOperationException if this segment is read-only (see {@link #isReadOnly()}).
* @throws UnsupportedOperationException if this segment is {@linkplain #isReadOnly() read-only}.
*/
MemorySegment fill(byte value);
@@ -797,7 +806,7 @@ public sealed interface MemorySegment permits AbstractMemorySegmentImpl {
* {@linkplain Scope#isAlive() alive}.
* @throws WrongThreadException if this method is called from a thread {@code T},
* such that {@code src.isAccessibleBy(T) == false}.
* @throws UnsupportedOperationException if this segment is read-only (see {@link #isReadOnly()}).
* @throws UnsupportedOperationException if this segment is {@linkplain #isReadOnly() read-only}.
* @return this segment.
*/
default MemorySegment copyFrom(MemorySegment src) {
@@ -820,9 +829,9 @@ public sealed interface MemorySegment permits AbstractMemorySegmentImpl {
* valid for the larger segment. Otherwise, there is no mismatch and {@code
* -1} is returned.
*
* @param other the segment to be tested for a mismatch with this segment
* @param other the segment to be tested for a mismatch with this segment.
* @return the relative offset, in bytes, of the first mismatch between this
* and the given other segment, otherwise -1 if no mismatch
* and the given other segment, otherwise -1 if no mismatch.
* @throws IllegalStateException if the {@linkplain #scope() scope} associated with this segment is not
* {@linkplain Scope#isAlive() alive}.
* @throws WrongThreadException if this method is called from a thread {@code T},
@@ -930,23 +939,24 @@ public sealed interface MemorySegment permits AbstractMemorySegmentImpl {
/**
* Wraps this segment in a {@link ByteBuffer}. Some properties of the returned buffer are linked to
* the properties of this segment. For instance, if this segment is <em>immutable</em>
* (e.g. the segment is a read-only segment, see {@link #isReadOnly()}), then the resulting buffer is <em>read-only</em>
* (see {@link ByteBuffer#isReadOnly()}). Additionally, if this is a native segment, the resulting buffer is
* <em>direct</em> (see {@link ByteBuffer#isDirect()}).
* the properties of this segment. More specifically, the resulting buffer has the following characteristics:
* <ul>
* <li>It is {@linkplain ByteBuffer#isReadOnly() read-only}, if this segment is a
* {@linkplain #isReadOnly() read-only segment};</li>
* <li>Its {@linkplain ByteBuffer#position() position} is set to zero;
* <li>Its {@linkplain ByteBuffer#capacity() capacity} and {@linkplain ByteBuffer#limit() limit}
* are both set to this segment' {@linkplain MemorySegment#byteSize() size}. For this reason, a byte buffer
* cannot be returned if this segment's size is greater than {@link Integer#MAX_VALUE};</li>
* <li>It is a {@linkplain ByteBuffer#isDirect() direct buffer}, if this is a native segment.</li>
* </ul>
* <p>
* The returned buffer's position (see {@link ByteBuffer#position()}) is initially set to zero, while
* the returned buffer's capacity and limit (see {@link ByteBuffer#capacity()} and {@link ByteBuffer#limit()}, respectively)
* are set to this segment' size (see {@link MemorySegment#byteSize()}). For this reason, a byte buffer cannot be
* returned if this segment' size is greater than {@link Integer#MAX_VALUE}.
* <p>
* The life-cycle of the returned buffer will be tied to that of this segment. That is, accessing the returned buffer
* The life-cycle of the returned buffer is tied to that of this segment. That is, accessing the returned buffer
* after the scope associated with this segment is no longer {@linkplain Scope#isAlive() alive}, will
* throw an {@link IllegalStateException}. Similarly, accessing the returned buffer from a thread {@code T}
* such that {@code isAccessible(T) == false} will throw a {@link WrongThreadException}.
* <p>
* If this segment is accessible from a single thread, calling read/write I/O
* operations on the resulting buffer might result in an unspecified exception being thrown. Examples of such problematic operations are
* If this segment is {@linkplain #isAccessibleBy(Thread) accessible} from a single thread, calling read/write I/O
* operations on the resulting buffer might result in unspecified exceptions being thrown. Examples of such problematic operations are
* {@link java.nio.channels.AsynchronousSocketChannel#read(ByteBuffer)} and
* {@link java.nio.channels.AsynchronousSocketChannel#write(ByteBuffer)}.
* <p>
@@ -955,7 +965,7 @@ public sealed interface MemorySegment permits AbstractMemorySegmentImpl {
*
* @return a {@link ByteBuffer} view of this memory segment.
* @throws UnsupportedOperationException if this segment cannot be mapped onto a {@link ByteBuffer} instance,
* e.g. because it models a heap-based segment that is not based on a {@code byte[]}), or if its size is greater
* e.g. if it is a heap segment backed by an array other than {@code byte[]}), or if its size is greater
* than {@link Integer#MAX_VALUE}.
*/
ByteBuffer asByteBuffer();
@@ -984,7 +994,7 @@ public sealed interface MemorySegment permits AbstractMemorySegmentImpl {
* @throws WrongThreadException if this method is called from a thread {@code T},
* such that {@code isAccessibleBy(T) == false}.
* @throws IllegalStateException if this segment's contents cannot be copied into a {@code short[]} instance,
* e.g. because {@code byteSize() % 2 != 0}, or {@code byteSize() / 2 > Integer#MAX_VALUE}
* e.g. because {@code byteSize() % 2 != 0}, or {@code byteSize() / 2 > Integer.MAX_VALUE}
*/
short[] toArray(ValueLayout.OfShort elementLayout);
@@ -998,7 +1008,7 @@ public sealed interface MemorySegment permits AbstractMemorySegmentImpl {
* @throws WrongThreadException if this method is called from a thread {@code T},
* such that {@code isAccessibleBy(T) == false}.
* @throws IllegalStateException if this segment's contents cannot be copied into a {@code char[]} instance,
* e.g. because {@code byteSize() % 2 != 0}, or {@code byteSize() / 2 > Integer#MAX_VALUE}.
* e.g. because {@code byteSize() % 2 != 0}, or {@code byteSize() / 2 > Integer.MAX_VALUE}.
*/
char[] toArray(ValueLayout.OfChar elementLayout);
@@ -1012,7 +1022,7 @@ public sealed interface MemorySegment permits AbstractMemorySegmentImpl {
* @throws WrongThreadException if this method is called from a thread {@code T},
* such that {@code isAccessibleBy(T) == false}.
* @throws IllegalStateException if this segment's contents cannot be copied into a {@code int[]} instance,
* e.g. because {@code byteSize() % 4 != 0}, or {@code byteSize() / 4 > Integer#MAX_VALUE}.
* e.g. because {@code byteSize() % 4 != 0}, or {@code byteSize() / 4 > Integer.MAX_VALUE}.
*/
int[] toArray(ValueLayout.OfInt elementLayout);
@@ -1026,7 +1036,7 @@ public sealed interface MemorySegment permits AbstractMemorySegmentImpl {
* @throws WrongThreadException if this method is called from a thread {@code T},
* such that {@code isAccessibleBy(T) == false}.
* @throws IllegalStateException if this segment's contents cannot be copied into a {@code float[]} instance,
* e.g. because {@code byteSize() % 4 != 0}, or {@code byteSize() / 4 > Integer#MAX_VALUE}.
* e.g. because {@code byteSize() % 4 != 0}, or {@code byteSize() / 4 > Integer.MAX_VALUE}.
*/
float[] toArray(ValueLayout.OfFloat elementLayout);
@@ -1040,7 +1050,7 @@ public sealed interface MemorySegment permits AbstractMemorySegmentImpl {
* @throws WrongThreadException if this method is called from a thread {@code T},
* such that {@code isAccessibleBy(T) == false}.
* @throws IllegalStateException if this segment's contents cannot be copied into a {@code long[]} instance,
* e.g. because {@code byteSize() % 8 != 0}, or {@code byteSize() / 8 > Integer#MAX_VALUE}.
* e.g. because {@code byteSize() % 8 != 0}, or {@code byteSize() / 8 > Integer.MAX_VALUE}.
*/
long[] toArray(ValueLayout.OfLong elementLayout);
@@ -1054,7 +1064,7 @@ public sealed interface MemorySegment permits AbstractMemorySegmentImpl {
* @throws WrongThreadException if this method is called from a thread {@code T},
* such that {@code isAccessibleBy(T) == false}.
* @throws IllegalStateException if this segment's contents cannot be copied into a {@code double[]} instance,
* e.g. because {@code byteSize() % 8 != 0}, or {@code byteSize() / 8 > Integer#MAX_VALUE}.
* e.g. because {@code byteSize() % 8 != 0}, or {@code byteSize() / 8 > Integer.MAX_VALUE}.
*/
double[] toArray(ValueLayout.OfDouble elementLayout);
@@ -1069,7 +1079,7 @@ public sealed interface MemorySegment permits AbstractMemorySegmentImpl {
* @return a Java string constructed from the bytes read from the given starting address up to (but not including)
* the first {@code '\0'} terminator character (assuming one is found).
* @throws IllegalArgumentException if the size of the UTF-8 string is greater than the largest string supported by the platform.
* @throws IndexOutOfBoundsException if {@code offset < 0} or {@code S + offset > byteSize()}, where {@code S} is the size of the UTF-8
* @throws IndexOutOfBoundsException if {@code offset < 0} or {@code offset > byteSize() - S}, where {@code S} is the size of the UTF-8
* string (including the terminator character).
* @throws IllegalStateException if the {@linkplain #scope() scope} associated with this segment is not
* {@linkplain Scope#isAlive() alive}.
@@ -1095,7 +1105,7 @@ public sealed interface MemorySegment permits AbstractMemorySegmentImpl {
* @param offset offset in bytes (relative to this segment address) at which this access operation will occur.
* the final address of this write operation can be expressed as {@code address() + offset}.
* @param str the Java string to be written into this segment.
* @throws IndexOutOfBoundsException if {@code offset < 0} or {@code str.getBytes().length() + offset >= byteSize()}.
* @throws IndexOutOfBoundsException if {@code offset < 0} or {@code offset > byteSize() - str.getBytes().length() + 1}.
* @throws IllegalStateException if the {@linkplain #scope() scope} associated with this segment is not
* {@linkplain Scope#isAlive() alive}.
* @throws WrongThreadException if this method is called from a thread {@code T},
@@ -1110,7 +1120,7 @@ public sealed interface MemorySegment permits AbstractMemorySegmentImpl {
* Creates a memory segment that is backed by the same region of memory that backs the given {@link Buffer} instance.
* The segment starts relative to the buffer's position (inclusive) and ends relative to the buffer's limit (exclusive).
* <p>
* If the buffer is {@linkplain Buffer#isReadOnly() read-only}, the resulting segment will also be
* If the buffer is {@linkplain Buffer#isReadOnly() read-only}, the resulting segment is also
* {@linkplain ByteBuffer#isReadOnly() read-only}. Moreover, if the buffer is a {@linkplain Buffer#isDirect() direct buffer},
* the returned segment is a native segment; otherwise the returned memory segment is a heap segment.
* <p>
@@ -1135,7 +1145,7 @@ public sealed interface MemorySegment permits AbstractMemorySegmentImpl {
/**
* Creates a heap segment backed by the on-heap region of memory that holds the given byte array.
* The scope of the returned segment is a fresh scope that is always alive, and keeps the given byte array reachable.
* The scope of the returned segment is a fresh scope that is always alive, and keeps the given array reachable.
* The returned segment is always accessible, from any thread. Its {@link #address()} is set to zero.
*
* @param byteArray the primitive array backing the heap memory segment.
@@ -1147,7 +1157,7 @@ public sealed interface MemorySegment permits AbstractMemorySegmentImpl {
/**
* Creates a heap segment backed by the on-heap region of memory that holds the given char array.
* The scope of the returned segment is a fresh scope that is always alive, and keeps the given byte array reachable.
* The scope of the returned segment is a fresh scope that is always alive, and keeps the given array reachable.
* The returned segment is always accessible, from any thread. Its {@link #address()} is set to zero.
*
* @param charArray the primitive array backing the heap segment.
@@ -1159,7 +1169,7 @@ public sealed interface MemorySegment permits AbstractMemorySegmentImpl {
/**
* Creates a heap segment backed by the on-heap region of memory that holds the given short array.
* The scope of the returned segment is a fresh scope that is always alive, and keeps the given byte array reachable.
* The scope of the returned segment is a fresh scope that is always alive, and keeps the given array reachable.
* The returned segment is always accessible, from any thread. Its {@link #address()} is set to zero.
*
* @param shortArray the primitive array backing the heap segment.
@@ -1171,7 +1181,7 @@ public sealed interface MemorySegment permits AbstractMemorySegmentImpl {
/**
* Creates a heap segment backed by the on-heap region of memory that holds the given int array.
* The scope of the returned segment is a fresh scope that is always alive, and keeps the given byte array reachable.
* The scope of the returned segment is a fresh scope that is always alive, and keeps the given array reachable.
* The returned segment is always accessible, from any thread. Its {@link #address()} is set to zero.
*
* @param intArray the primitive array backing the heap segment.
@@ -1183,7 +1193,7 @@ public sealed interface MemorySegment permits AbstractMemorySegmentImpl {
/**
* Creates a heap segment backed by the on-heap region of memory that holds the given float array.
* The scope of the returned segment is a fresh scope that is always alive, and keeps the given byte array reachable.
* The scope of the returned segment is a fresh scope that is always alive, and keeps the given array reachable.
* The returned segment is always accessible, from any thread. Its {@link #address()} is set to zero.
*
* @param floatArray the primitive array backing the heap segment.
@@ -1195,7 +1205,7 @@ public sealed interface MemorySegment permits AbstractMemorySegmentImpl {
/**
* Creates a heap segment backed by the on-heap region of memory that holds the given long array.
* The scope of the returned segment is a fresh scope that is always alive, and keeps the given byte array reachable.
* The scope of the returned segment is a fresh scope that is always alive, and keeps the given array reachable.
* The returned segment is always accessible, from any thread. Its {@link #address()} is set to zero.
*
* @param longArray the primitive array backing the heap segment.
@@ -1207,7 +1217,7 @@ public sealed interface MemorySegment permits AbstractMemorySegmentImpl {
/**
* Creates a heap segment backed by the on-heap region of memory that holds the given double array.
* The scope of the returned segment is a fresh scope that is always alive, and keeps the given byte array reachable.
* The scope of the returned segment is a fresh scope that is always alive, and keeps the given array reachable.
* The returned segment is always accessible, from any thread. Its {@link #address()} is set to zero.
*
* @param doubleArray the primitive array backing the heap segment.
@@ -1224,7 +1234,7 @@ public sealed interface MemorySegment permits AbstractMemorySegmentImpl {
/**
* Creates a zero-length native segment from the given {@linkplain #address() address value}.
* The returned segment is always accessible, from any thread.
* The returned segment is associated with a scope that is always alive, and is accessible from any thread.
* <p>
* On 32-bit platforms, the given address value will be normalized such that the
* highest-order ("leftmost") 32 bits of the {@link MemorySegment#address() address}
@@ -1268,10 +1278,10 @@ public sealed interface MemorySegment permits AbstractMemorySegmentImpl {
* {@linkplain Scope#isAlive() alive}.
* @throws WrongThreadException if this method is called from a thread {@code T},
* such that {@code dstSegment.isAccessibleBy(T) == false}.
* @throws IndexOutOfBoundsException if {@code srcOffset + bytes > srcSegment.byteSize()} or if
* {@code dstOffset + bytes > dstSegment.byteSize()}, or if either {@code srcOffset}, {@code dstOffset}
* @throws IndexOutOfBoundsException if {@code srcOffset > srcSegment.byteSize() - bytes} or if
* {@code dstOffset > dstSegment.byteSize() - bytes}, or if either {@code srcOffset}, {@code dstOffset}
* or {@code bytes} are {@code < 0}.
* @throws UnsupportedOperationException if the destination segment is read-only (see {@link #isReadOnly()}).
* @throws UnsupportedOperationException if {@code dstSegment} is {@linkplain #isReadOnly() read-only}.
*/
@ForceInline
static void copy(MemorySegment srcSegment, long srcOffset,
@@ -1316,10 +1326,10 @@ public sealed interface MemorySegment permits AbstractMemorySegmentImpl {
* {@linkplain Scope#isAlive() alive}.
* @throws WrongThreadException if this method is called from a thread {@code T},
* such that {@code dstSegment().isAccessibleBy(T) == false}.
* @throws IndexOutOfBoundsException if {@code srcOffset + (elementCount * S) > srcSegment.byteSize()} or if
* {@code dstOffset + (elementCount * S) > dstSegment.byteSize()}, where {@code S} is the byte size
* of the element layouts, or if either {@code srcOffset}, {@code dstOffset} or {@code elementCount} are {@code < 0}.
* @throws UnsupportedOperationException if the destination segment is read-only (see {@link #isReadOnly()}).
* @throws UnsupportedOperationException if {@code dstSegment} is {@linkplain #isReadOnly() read-only}.
* @throws IndexOutOfBoundsException if {@code elementCount * srcLayout.byteSize()} or {@code elementCount * dtsLayout.byteSize()} overflows.
* @throws IndexOutOfBoundsException if {@code dstOffset > dstSegment.byteSize() - (elementCount * dstLayout.byteSize())}.
* @throws IndexOutOfBoundsException if either {@code srcOffset}, {@code dstOffset} or {@code elementCount} are {@code < 0}.
*/
@ForceInline
static void copy(MemorySegment srcSegment, ValueLayout srcElementLayout, long srcOffset,
@@ -1344,8 +1354,7 @@ public sealed interface MemorySegment permits AbstractMemorySegmentImpl {
* such that {@code isAccessibleBy(T) == false}.
* @throws IllegalArgumentException if the access operation is
* <a href="MemorySegment.html#segment-alignment">incompatible with the alignment constraint</a> in the provided layout.
* @throws IndexOutOfBoundsException when the access operation falls outside the <em>spatial bounds</em> of the
* memory segment.
* @throws IndexOutOfBoundsException if {@code offset > byteSize() - layout.byteSize()}.
*/
@ForceInline
default byte get(ValueLayout.OfByte layout, long offset) {
@@ -1364,8 +1373,7 @@ public sealed interface MemorySegment permits AbstractMemorySegmentImpl {
* such that {@code isAccessibleBy(T) == false}.
* @throws IllegalArgumentException if the access operation is
* <a href="MemorySegment.html#segment-alignment">incompatible with the alignment constraint</a> in the provided layout.
* @throws IndexOutOfBoundsException when the access operation falls outside the <em>spatial bounds</em> of the
* memory segment.
* @throws IndexOutOfBoundsException if {@code offset > byteSize() - layout.byteSize()}.
* @throws UnsupportedOperationException if this segment is {@linkplain #isReadOnly() read-only}.
*/
@ForceInline
@@ -1385,8 +1393,7 @@ public sealed interface MemorySegment permits AbstractMemorySegmentImpl {
* such that {@code isAccessibleBy(T) == false}.
* @throws IllegalArgumentException if the access operation is
* <a href="MemorySegment.html#segment-alignment">incompatible with the alignment constraint</a> in the provided layout.
* @throws IndexOutOfBoundsException when the access operation falls outside the <em>spatial bounds</em> of the
* memory segment.
* @throws IndexOutOfBoundsException if {@code offset > byteSize() - layout.byteSize()}.
*/
@ForceInline
default boolean get(ValueLayout.OfBoolean layout, long offset) {
@@ -1405,8 +1412,7 @@ public sealed interface MemorySegment permits AbstractMemorySegmentImpl {
* such that {@code isAccessibleBy(T) == false}.
* @throws IllegalArgumentException if the access operation is
* <a href="MemorySegment.html#segment-alignment">incompatible with the alignment constraint</a> in the provided layout.
* @throws IndexOutOfBoundsException when the access operation falls outside the <em>spatial bounds</em> of the
* memory segment.
* @throws IndexOutOfBoundsException if {@code offset > byteSize() - layout.byteSize()}.
* @throws UnsupportedOperationException if this segment is {@linkplain #isReadOnly() read-only}.
*/
@ForceInline
@@ -1426,8 +1432,7 @@ public sealed interface MemorySegment permits AbstractMemorySegmentImpl {
* such that {@code isAccessibleBy(T) == false}.
* @throws IllegalArgumentException if the access operation is
* <a href="MemorySegment.html#segment-alignment">incompatible with the alignment constraint</a> in the provided layout.
* @throws IndexOutOfBoundsException when the access operation falls outside the <em>spatial bounds</em> of the
* memory segment.
* @throws IndexOutOfBoundsException if {@code offset > byteSize() - layout.byteSize()}.
*/
@ForceInline
default char get(ValueLayout.OfChar layout, long offset) {
@@ -1446,8 +1451,7 @@ public sealed interface MemorySegment permits AbstractMemorySegmentImpl {
* such that {@code isAccessibleBy(T) == false}.
* @throws IllegalArgumentException if the access operation is
* <a href="MemorySegment.html#segment-alignment">incompatible with the alignment constraint</a> in the provided layout.
* @throws IndexOutOfBoundsException when the access operation falls outside the <em>spatial bounds</em> of the
* memory segment.
* @throws IndexOutOfBoundsException if {@code offset > byteSize() - layout.byteSize()}.
* @throws UnsupportedOperationException if this segment is {@linkplain #isReadOnly() read-only}.
*/
@ForceInline
@@ -1467,8 +1471,7 @@ public sealed interface MemorySegment permits AbstractMemorySegmentImpl {
* such that {@code isAccessibleBy(T) == false}.
* @throws IllegalArgumentException if the access operation is
* <a href="MemorySegment.html#segment-alignment">incompatible with the alignment constraint</a> in the provided layout.
* @throws IndexOutOfBoundsException when the access operation falls outside the <em>spatial bounds</em> of the
* memory segment.
* @throws IndexOutOfBoundsException if {@code offset > byteSize() - layout.byteSize()}.
*/
@ForceInline
default short get(ValueLayout.OfShort layout, long offset) {
@@ -1487,8 +1490,7 @@ public sealed interface MemorySegment permits AbstractMemorySegmentImpl {
* such that {@code isAccessibleBy(T) == false}.
* @throws IllegalArgumentException if the access operation is
* <a href="MemorySegment.html#segment-alignment">incompatible with the alignment constraint</a> in the provided layout.
* @throws IndexOutOfBoundsException when the access operation falls outside the <em>spatial bounds</em> of the
* memory segment.
* @throws IndexOutOfBoundsException if {@code offset > byteSize() - layout.byteSize()}.
* @throws UnsupportedOperationException if this segment is {@linkplain #isReadOnly() read-only}.
*/
@ForceInline
@@ -1508,8 +1510,7 @@ public sealed interface MemorySegment permits AbstractMemorySegmentImpl {
* such that {@code isAccessibleBy(T) == false}.
* @throws IllegalArgumentException if the access operation is
* <a href="MemorySegment.html#segment-alignment">incompatible with the alignment constraint</a> in the provided layout.
* @throws IndexOutOfBoundsException when the access operation falls outside the <em>spatial bounds</em> of the
* memory segment.
* @throws IndexOutOfBoundsException if {@code offset > byteSize() - layout.byteSize()}.
*/
@ForceInline
default int get(ValueLayout.OfInt layout, long offset) {
@@ -1528,8 +1529,7 @@ public sealed interface MemorySegment permits AbstractMemorySegmentImpl {
* such that {@code isAccessibleBy(T) == false}.
* @throws IllegalArgumentException if the access operation is
* <a href="MemorySegment.html#segment-alignment">incompatible with the alignment constraint</a> in the provided layout.
* @throws IndexOutOfBoundsException when the access operation falls outside the <em>spatial bounds</em> of the
* memory segment.
* @throws IndexOutOfBoundsException if {@code offset > byteSize() - layout.byteSize()}.
* @throws UnsupportedOperationException if this segment is {@linkplain #isReadOnly() read-only}.
*/
@ForceInline
@@ -1549,8 +1549,7 @@ public sealed interface MemorySegment permits AbstractMemorySegmentImpl {
* such that {@code isAccessibleBy(T) == false}.
* @throws IllegalArgumentException if the access operation is
* <a href="MemorySegment.html#segment-alignment">incompatible with the alignment constraint</a> in the provided layout.
* @throws IndexOutOfBoundsException when the access operation falls outside the <em>spatial bounds</em> of the
* memory segment.
* @throws IndexOutOfBoundsException if {@code offset > byteSize() - layout.byteSize()}.
*/
@ForceInline
default float get(ValueLayout.OfFloat layout, long offset) {
@@ -1569,8 +1568,7 @@ public sealed interface MemorySegment permits AbstractMemorySegmentImpl {
* such that {@code isAccessibleBy(T) == false}.
* @throws IllegalArgumentException if the access operation is
* <a href="MemorySegment.html#segment-alignment">incompatible with the alignment constraint</a> in the provided layout.
* @throws IndexOutOfBoundsException when the access operation falls outside the <em>spatial bounds</em> of the
* memory segment.
* @throws IndexOutOfBoundsException if {@code offset > byteSize() - layout.byteSize()}.
* @throws UnsupportedOperationException if this segment is {@linkplain #isReadOnly() read-only}.
*/
@ForceInline
@@ -1590,8 +1588,7 @@ public sealed interface MemorySegment permits AbstractMemorySegmentImpl {
* such that {@code isAccessibleBy(T) == false}.
* @throws IllegalArgumentException if the access operation is
* <a href="MemorySegment.html#segment-alignment">incompatible with the alignment constraint</a> in the provided layout.
* @throws IndexOutOfBoundsException when the access operation falls outside the <em>spatial bounds</em> of the
* memory segment.
* @throws IndexOutOfBoundsException if {@code offset > byteSize() - layout.byteSize()}.
*/
@ForceInline
default long get(ValueLayout.OfLong layout, long offset) {
@@ -1610,8 +1607,7 @@ public sealed interface MemorySegment permits AbstractMemorySegmentImpl {
* such that {@code isAccessibleBy(T) == false}.
* @throws IllegalArgumentException if the access operation is
* <a href="MemorySegment.html#segment-alignment">incompatible with the alignment constraint</a> in the provided layout.
* @throws IndexOutOfBoundsException when the access operation falls outside the <em>spatial bounds</em> of the
* memory segment.
* @throws IndexOutOfBoundsException if {@code offset > byteSize() - layout.byteSize()}.
* @throws UnsupportedOperationException if this segment is {@linkplain #isReadOnly() read-only}.
*/
@ForceInline
@@ -1631,8 +1627,7 @@ public sealed interface MemorySegment permits AbstractMemorySegmentImpl {
* such that {@code isAccessibleBy(T) == false}.
* @throws IllegalArgumentException if the access operation is
* <a href="MemorySegment.html#segment-alignment">incompatible with the alignment constraint</a> in the provided layout.
* @throws IndexOutOfBoundsException when the access operation falls outside the <em>spatial bounds</em> of the
* memory segment.
* @throws IndexOutOfBoundsException if {@code offset > byteSize() - layout.byteSize()}.
*/
@ForceInline
default double get(ValueLayout.OfDouble layout, long offset) {
@@ -1651,8 +1646,7 @@ public sealed interface MemorySegment permits AbstractMemorySegmentImpl {
* such that {@code isAccessibleBy(T) == false}.
* @throws IllegalArgumentException if the access operation is
* <a href="MemorySegment.html#segment-alignment">incompatible with the alignment constraint</a> in the provided layout.
* @throws IndexOutOfBoundsException when the access operation falls outside the <em>spatial bounds</em> of the
* memory segment.
* @throws IndexOutOfBoundsException if {@code offset > byteSize() - layout.byteSize()}.
* @throws UnsupportedOperationException if this segment is {@linkplain #isReadOnly() read-only}.
*/
@ForceInline
@@ -1664,7 +1658,7 @@ public sealed interface MemorySegment permits AbstractMemorySegmentImpl {
* Reads an address from this segment at the given offset, with the given layout. The read address is wrapped in
* a native segment, associated with a fresh scope that is always alive. Under normal conditions,
* the size of the returned segment is {@code 0}. However, if the provided address layout has a
* {@linkplain AddressLayout#targetLayout()} {@code T}, then the size of the returned segment
* {@linkplain AddressLayout#targetLayout() target layout} {@code T}, then the size of the returned segment
* is set to {@code T.byteSize()}.
* @param layout the layout of the region of memory to be read.
* @param offset offset in bytes (relative to this segment address) at which this access operation will occur.
@@ -1678,8 +1672,7 @@ public sealed interface MemorySegment permits AbstractMemorySegmentImpl {
* @throws IllegalArgumentException if provided address layout has a {@linkplain AddressLayout#targetLayout() target layout}
* {@code T}, and the address of the returned segment
* <a href="MemorySegment.html#segment-alignment">incompatible with the alignment constraint</a> in {@code T}.
* @throws IndexOutOfBoundsException when the access operation falls outside the <em>spatial bounds</em> of the
* memory segment.
* @throws IndexOutOfBoundsException if {@code offset > byteSize() - layout.byteSize()}.
*/
@ForceInline
default MemorySegment get(AddressLayout layout, long offset) {
@@ -1698,8 +1691,7 @@ public sealed interface MemorySegment permits AbstractMemorySegmentImpl {
* such that {@code isAccessibleBy(T) == false}.
* @throws IllegalArgumentException if the access operation is
* <a href="MemorySegment.html#segment-alignment">incompatible with the alignment constraint</a> in the provided layout.
* @throws IndexOutOfBoundsException when the access operation falls outside the <em>spatial bounds</em> of the
* memory segment.
* @throws IndexOutOfBoundsException if {@code offset > byteSize() - layout.byteSize()}.
* @throws UnsupportedOperationException if this segment is {@linkplain #isReadOnly() read-only}.
* @throws UnsupportedOperationException if {@code value} is not a {@linkplain #isNative() native} segment.
*/
@@ -1722,8 +1714,8 @@ public sealed interface MemorySegment permits AbstractMemorySegmentImpl {
* @throws IllegalArgumentException if the access operation is
* <a href="MemorySegment.html#segment-alignment">incompatible with the alignment constraint</a> in the provided layout,
* or if the layout alignment is greater than its size.
* @throws IndexOutOfBoundsException when the access operation falls outside the <em>spatial bounds</em> of the
* memory segment.
* @throws IndexOutOfBoundsException if {@code index * byteSize()} overflows.
* @throws IndexOutOfBoundsException if {@code index * byteSize() > byteSize() - layout.byteSize()}.
*/
@ForceInline
default byte getAtIndex(ValueLayout.OfByte layout, long index) {
@@ -1746,8 +1738,8 @@ public sealed interface MemorySegment permits AbstractMemorySegmentImpl {
* @throws IllegalArgumentException if the access operation is
* <a href="MemorySegment.html#segment-alignment">incompatible with the alignment constraint</a> in the provided layout,
* or if the layout alignment is greater than its size.
* @throws IndexOutOfBoundsException when the access operation falls outside the <em>spatial bounds</em> of the
* memory segment.
* @throws IndexOutOfBoundsException if {@code index * byteSize()} overflows.
* @throws IndexOutOfBoundsException if {@code index * byteSize() > byteSize() - layout.byteSize()}.
*/
@ForceInline
default boolean getAtIndex(ValueLayout.OfBoolean layout, long index) {
@@ -1770,8 +1762,8 @@ public sealed interface MemorySegment permits AbstractMemorySegmentImpl {
* @throws IllegalArgumentException if the access operation is
* <a href="MemorySegment.html#segment-alignment">incompatible with the alignment constraint</a> in the provided layout,
* or if the layout alignment is greater than its size.
* @throws IndexOutOfBoundsException when the access operation falls outside the <em>spatial bounds</em> of the
* memory segment.
* @throws IndexOutOfBoundsException if {@code index * byteSize()} overflows.
* @throws IndexOutOfBoundsException if {@code index * byteSize() > byteSize() - layout.byteSize()}.
*/
@ForceInline
default char getAtIndex(ValueLayout.OfChar layout, long index) {
@@ -1794,8 +1786,8 @@ public sealed interface MemorySegment permits AbstractMemorySegmentImpl {
* @throws IllegalArgumentException if the access operation is
* <a href="MemorySegment.html#segment-alignment">incompatible with the alignment constraint</a> in the provided layout,
* or if the layout alignment is greater than its size.
* @throws IndexOutOfBoundsException when the access operation falls outside the <em>spatial bounds</em> of the
* memory segment.
* @throws IndexOutOfBoundsException if {@code index * byteSize()} overflows.
* @throws IndexOutOfBoundsException if {@code index * byteSize() > byteSize() - layout.byteSize()}.
* @throws UnsupportedOperationException if this segment is {@linkplain #isReadOnly() read-only}.
*/
@ForceInline
@@ -1819,8 +1811,8 @@ public sealed interface MemorySegment permits AbstractMemorySegmentImpl {
* @throws IllegalArgumentException if the access operation is
* <a href="MemorySegment.html#segment-alignment">incompatible with the alignment constraint</a> in the provided layout,
* or if the layout alignment is greater than its size.
* @throws IndexOutOfBoundsException when the access operation falls outside the <em>spatial bounds</em> of the
* memory segment.
* @throws IndexOutOfBoundsException if {@code index * byteSize()} overflows.
* @throws IndexOutOfBoundsException if {@code index * byteSize() > byteSize() - layout.byteSize()}.
*/
@ForceInline
default short getAtIndex(ValueLayout.OfShort layout, long index) {
@@ -1843,8 +1835,8 @@ public sealed interface MemorySegment permits AbstractMemorySegmentImpl {
* @throws IllegalArgumentException if the access operation is
* <a href="MemorySegment.html#segment-alignment">incompatible with the alignment constraint</a> in the provided layout,
* or if the layout alignment is greater than its size.
* @throws IndexOutOfBoundsException when the access operation falls outside the <em>spatial bounds</em> of the
* memory segment.
* @throws IndexOutOfBoundsException if {@code index * byteSize()} overflows.
* @throws IndexOutOfBoundsException if {@code index * byteSize() > byteSize() - layout.byteSize()}.
* @throws UnsupportedOperationException if this segment is {@linkplain #isReadOnly() read-only}.
*/
@ForceInline
@@ -1869,8 +1861,8 @@ public sealed interface MemorySegment permits AbstractMemorySegmentImpl {
* @throws IllegalArgumentException if the access operation is
* <a href="MemorySegment.html#segment-alignment">incompatible with the alignment constraint</a> in the provided layout,
* or if the layout alignment is greater than its size.
* @throws IndexOutOfBoundsException when the access operation falls outside the <em>spatial bounds</em> of the
* memory segment.
* @throws IndexOutOfBoundsException if {@code index * byteSize()} overflows.
* @throws IndexOutOfBoundsException if {@code index * byteSize() > byteSize() - layout.byteSize()}.
* @throws UnsupportedOperationException if this segment is {@linkplain #isReadOnly() read-only}.
*/
@ForceInline
@@ -1894,8 +1886,8 @@ public sealed interface MemorySegment permits AbstractMemorySegmentImpl {
* @throws IllegalArgumentException if the access operation is
* <a href="MemorySegment.html#segment-alignment">incompatible with the alignment constraint</a> in the provided layout,
* or if the layout alignment is greater than its size.
* @throws IndexOutOfBoundsException when the access operation falls outside the <em>spatial bounds</em> of the
* memory segment.
* @throws IndexOutOfBoundsException if {@code index * byteSize()} overflows.
* @throws IndexOutOfBoundsException if {@code index * byteSize() > byteSize() - layout.byteSize()}.
* @throws UnsupportedOperationException if this segment is {@linkplain #isReadOnly() read-only}.
*/
@ForceInline
@@ -1919,8 +1911,8 @@ public sealed interface MemorySegment permits AbstractMemorySegmentImpl {
* @throws IllegalArgumentException if the access operation is
* <a href="MemorySegment.html#segment-alignment">incompatible with the alignment constraint</a> in the provided layout,
* or if the layout alignment is greater than its size.
* @throws IndexOutOfBoundsException when the access operation falls outside the <em>spatial bounds</em> of the
* memory segment.
* @throws IndexOutOfBoundsException if {@code index * byteSize()} overflows.
* @throws IndexOutOfBoundsException if {@code index * byteSize() > byteSize() - layout.byteSize()}.
*/
@ForceInline
default int getAtIndex(ValueLayout.OfInt layout, long index) {
@@ -1943,8 +1935,8 @@ public sealed interface MemorySegment permits AbstractMemorySegmentImpl {
* @throws IllegalArgumentException if the access operation is
* <a href="MemorySegment.html#segment-alignment">incompatible with the alignment constraint</a> in the provided layout,
* or if the layout alignment is greater than its size.
* @throws IndexOutOfBoundsException when the access operation falls outside the <em>spatial bounds</em> of the
* memory segment.
* @throws IndexOutOfBoundsException if {@code index * byteSize()} overflows.
* @throws IndexOutOfBoundsException if {@code index * byteSize() > byteSize() - layout.byteSize()}.
* @throws UnsupportedOperationException if this segment is {@linkplain #isReadOnly() read-only}.
*/
@ForceInline
@@ -1968,8 +1960,8 @@ public sealed interface MemorySegment permits AbstractMemorySegmentImpl {
* @throws IllegalArgumentException if the access operation is
* <a href="MemorySegment.html#segment-alignment">incompatible with the alignment constraint</a> in the provided layout,
* or if the layout alignment is greater than its size.
* @throws IndexOutOfBoundsException when the access operation falls outside the <em>spatial bounds</em> of the
* memory segment.
* @throws IndexOutOfBoundsException if {@code index * byteSize()} overflows.
* @throws IndexOutOfBoundsException if {@code index * byteSize() > byteSize() - layout.byteSize()}.
*/
@ForceInline
default float getAtIndex(ValueLayout.OfFloat layout, long index) {
@@ -1992,8 +1984,8 @@ public sealed interface MemorySegment permits AbstractMemorySegmentImpl {
* @throws IllegalArgumentException if the access operation is
* <a href="MemorySegment.html#segment-alignment">incompatible with the alignment constraint</a> in the provided layout,
* or if the layout alignment is greater than its size.
* @throws IndexOutOfBoundsException when the access operation falls outside the <em>spatial bounds</em> of the
* memory segment.
* @throws IndexOutOfBoundsException if {@code index * byteSize()} overflows.
* @throws IndexOutOfBoundsException if {@code index * byteSize() > byteSize() - layout.byteSize()}.
* @throws UnsupportedOperationException if this segment is {@linkplain #isReadOnly() read-only}.
*/
@ForceInline
@@ -2017,8 +2009,8 @@ public sealed interface MemorySegment permits AbstractMemorySegmentImpl {
* @throws IllegalArgumentException if the access operation is
* <a href="MemorySegment.html#segment-alignment">incompatible with the alignment constraint</a> in the provided layout,
* or if the layout alignment is greater than its size.
* @throws IndexOutOfBoundsException when the access operation falls outside the <em>spatial bounds</em> of the
* memory segment.
* @throws IndexOutOfBoundsException if {@code index * byteSize()} overflows.
* @throws IndexOutOfBoundsException if {@code index * byteSize() > byteSize() - layout.byteSize()}.
*/
@ForceInline
default long getAtIndex(ValueLayout.OfLong layout, long index) {
@@ -2041,8 +2033,8 @@ public sealed interface MemorySegment permits AbstractMemorySegmentImpl {
* @throws IllegalArgumentException if the access operation is
* <a href="MemorySegment.html#segment-alignment">incompatible with the alignment constraint</a> in the provided layout,
* or if the layout alignment is greater than its size.
* @throws IndexOutOfBoundsException when the access operation falls outside the <em>spatial bounds</em> of the
* memory segment.
* @throws IndexOutOfBoundsException if {@code index * byteSize()} overflows.
* @throws IndexOutOfBoundsException if {@code index * byteSize() > byteSize() - layout.byteSize()}.
* @throws UnsupportedOperationException if this segment is {@linkplain #isReadOnly() read-only}.
*/
@ForceInline
@@ -2066,8 +2058,8 @@ public sealed interface MemorySegment permits AbstractMemorySegmentImpl {
* @throws IllegalArgumentException if the access operation is
* <a href="MemorySegment.html#segment-alignment">incompatible with the alignment constraint</a> in the provided layout,
* or if the layout alignment is greater than its size.
* @throws IndexOutOfBoundsException when the access operation falls outside the <em>spatial bounds</em> of the
* memory segment.
* @throws IndexOutOfBoundsException if {@code index * byteSize()} overflows.
* @throws IndexOutOfBoundsException if {@code index * byteSize() > byteSize() - layout.byteSize()}.
*/
@ForceInline
default double getAtIndex(ValueLayout.OfDouble layout, long index) {
@@ -2090,8 +2082,8 @@ public sealed interface MemorySegment permits AbstractMemorySegmentImpl {
* @throws IllegalArgumentException if the access operation is
* <a href="MemorySegment.html#segment-alignment">incompatible with the alignment constraint</a> in the provided layout,
* or if the layout alignment is greater than its size.
* @throws IndexOutOfBoundsException when the access operation falls outside the <em>spatial bounds</em> of the
* memory segment.
* @throws IndexOutOfBoundsException if {@code index * byteSize()} overflows.
* @throws IndexOutOfBoundsException if {@code index * byteSize() > byteSize() - layout.byteSize()}.
* @throws UnsupportedOperationException if this segment is {@linkplain #isReadOnly() read-only}.
*/
@ForceInline
@@ -2105,7 +2097,7 @@ public sealed interface MemorySegment permits AbstractMemorySegmentImpl {
* Reads an address from this segment at the given at the given index, scaled by the given layout size. The read address is wrapped in
* a native segment, associated with a fresh scope that is always alive. Under normal conditions,
* the size of the returned segment is {@code 0}. However, if the provided address layout has a
* {@linkplain AddressLayout#targetLayout()} {@code T}, then the size of the returned segment
* {@linkplain AddressLayout#targetLayout() target layout} {@code T}, then the size of the returned segment
* is set to {@code T.byteSize()}.
* @param layout the layout of the region of memory to be read.
* @param index a logical index. The offset in bytes (relative to this segment address) at which the access operation
@@ -2121,8 +2113,8 @@ public sealed interface MemorySegment permits AbstractMemorySegmentImpl {
* @throws IllegalArgumentException if provided address layout has a {@linkplain AddressLayout#targetLayout() target layout}
* {@code T}, and the address of the returned segment
* <a href="MemorySegment.html#segment-alignment">incompatible with the alignment constraint</a> in {@code T}.
* @throws IndexOutOfBoundsException when the access operation falls outside the <em>spatial bounds</em> of the
* memory segment.
* @throws IndexOutOfBoundsException if {@code index * byteSize()} overflows.
* @throws IndexOutOfBoundsException if {@code index * byteSize() > byteSize() - layout.byteSize()}.
*/
@ForceInline
default MemorySegment getAtIndex(AddressLayout layout, long index) {
@@ -2145,8 +2137,8 @@ public sealed interface MemorySegment permits AbstractMemorySegmentImpl {
* @throws IllegalArgumentException if the access operation is
* <a href="MemorySegment.html#segment-alignment">incompatible with the alignment constraint</a> in the provided layout,
* or if the layout alignment is greater than its size.
* @throws IndexOutOfBoundsException when the access operation falls outside the <em>spatial bounds</em> of the
* memory segment.
* @throws IndexOutOfBoundsException if {@code index * byteSize()} overflows.
* @throws IndexOutOfBoundsException if {@code index * byteSize() > byteSize() - layout.byteSize()}.
* @throws UnsupportedOperationException if this segment is {@linkplain #isReadOnly() read-only}.
* @throws UnsupportedOperationException if {@code value} is not a {@linkplain #isNative() native} segment.
*/
@@ -2162,17 +2154,17 @@ public sealed interface MemorySegment permits AbstractMemorySegmentImpl {
* object is also a memory segment, and if the two segments refer to the same location, in some region of memory.
* More specifically, for two segments {@code s1} and {@code s2} to be considered equals, all the following must be true:
* <ul>
* <li>{@code s1.array().equals(s2.array())}, that is, the two segments must be of the same kind;
* <li>{@code s1.heapBase().equals(s2.heapBase())}, that is, the two segments must be of the same kind;
* either both are {@linkplain #isNative() native segments}, backed by off-heap memory, or both are backed by
* the same on-heap Java array;
* the same on-heap {@linkplain #heapBase() Java object};
* <li>{@code s1.address() == s2.address()}, that is, the address of the two segments should be the same.
* This means that the two segments either refer to the same location in some off-heap region, or they refer
* to the same position inside their associated Java array instance.</li>
* to the same offset inside their associated {@linkplain #heapBase() Java object}.</li>
* </ul>
* @apiNote This method does not perform a structural comparison of the contents of the two memory segments. Clients can
* compare memory segments structurally by using the {@link #mismatch(MemorySegment)} method instead. Note that this
* method does <em>not</em> compare the temporal and spatial bounds of two segments. As such it is suitable
* to perform address checks, such as checking if a native segment has the {@code NULL} address.
* to check whether two segments have the same address.
*
* @param that the object to be compared for equality with this memory segment.
* @return {@code true} if the specified object is equal to this memory segment.
@@ -2204,10 +2196,15 @@ public sealed interface MemorySegment permits AbstractMemorySegmentImpl {
* {@linkplain Scope#isAlive() alive}.
* @throws WrongThreadException if this method is called from a thread {@code T},
* such that {@code srcSegment().isAccessibleBy(T) == false}.
* @throws IllegalArgumentException if {@code dstArray} is not an array, or if it is an array but whose type is not supported,
* if the destination array component type does not match the carrier of the source element layout, if the source
* segment/offset are <a href="MemorySegment.html#segment-alignment">incompatible with the alignment constraint</a> in the source element layout,
* or if the destination element layout alignment is greater than its size.
* @throws IllegalArgumentException if {@code dstArray} is not an array, or if it is an array but whose type is not supported.
* @throws IllegalArgumentException if the destination array component type does not match {@code srcLayout.carrier()}.
* @throws IllegalArgumentException if {@code offset} is <a href="MemorySegment.html#segment-alignment">incompatible
* with the alignment constraint</a> in the source element layout.
* @throws IllegalArgumentException if {@code srcLayout.byteAlignment() > srcLayout.byteSize()}.
* @throws IndexOutOfBoundsException if {@code elementCount * srcLayout.byteSize()} overflows.
* @throws IndexOutOfBoundsException if {@code srcOffset > srcSegment.byteSize() - (elementCount * srcLayout.byteSize())}.
* @throws IndexOutOfBoundsException if {@code dstIndex > dstArray.length - elementCount}.
* @throws IndexOutOfBoundsException if either {@code srcOffset}, {@code dstIndex} or {@code elementCount} are {@code < 0}.
*/
@ForceInline
static void copy(
@@ -2238,10 +2235,16 @@ public sealed interface MemorySegment permits AbstractMemorySegmentImpl {
* {@linkplain Scope#isAlive() alive}.
* @throws WrongThreadException if this method is called from a thread {@code T},
* such that {@code dstSegment().isAccessibleBy(T) == false}.
* @throws IllegalArgumentException if {@code srcArray} is not an array, or if it is an array but whose type is not supported,
* if the source array component type does not match the carrier of the destination element layout, if the destination
* segment/offset are <a href="MemorySegment.html#segment-alignment">incompatible with the alignment constraint</a> in the destination element layout,
* or if the destination element layout alignment is greater than its size.
* @throws IllegalArgumentException if {@code srcArray} is not an array, or if it is an array but whose type is not supported.
* @throws IllegalArgumentException if the source array component type does not match {@code srcLayout.carrier()}.
* @throws IllegalArgumentException if {@code offset} is <a href="MemorySegment.html#segment-alignment">incompatible
* with the alignment constraint</a> in the source element layout.
* @throws IllegalArgumentException if {@code dstLayout.byteAlignment() > dstLayout.byteSize()}.
* @throws UnsupportedOperationException if {@code dstSegment} is {@linkplain #isReadOnly() read-only}.
* @throws IndexOutOfBoundsException if {@code elementCount * dstLayout.byteSize()} overflows.
* @throws IndexOutOfBoundsException if {@code dstOffset > dstSegment.byteSize() - (elementCount * dstLayout.byteSize())}.
* @throws IndexOutOfBoundsException if {@code srcIndex > srcArray.length - elementCount}.
* @throws IndexOutOfBoundsException if either {@code srcIndex}, {@code dstOffset} or {@code elementCount} are {@code < 0}.
*/
@ForceInline
static void copy(

View File

@@ -38,16 +38,21 @@ import jdk.internal.javac.PreviewFeature;
/**
* An object that may be used to allocate {@linkplain MemorySegment memory segments}. Clients implementing this interface
* must implement the {@link #allocate(long, long)} method. This interface defines several default methods
* must implement the {@link #allocate(long, long)} method. A segment allocator defines several methods
* which can be useful to create segments from several kinds of Java values such as primitives and arrays.
* This interface is a {@linkplain FunctionalInterface functional interface}: clients can easily obtain a new segment allocator
* by using either a lambda expression or a method reference.
* <p>
* This interface also defines factories for commonly used allocators:
* {@code SegmentAllocator} is a {@linkplain FunctionalInterface functional interface}. Clients can easily obtain a new
* segment allocator by using either a lambda expression or a method reference:
*
* {@snippet lang=java :
* SegmentAllocator autoAllocator = (byteSize, byteAlignment) -> Arena.ofAuto().allocate(byteSize, byteAlignment);
* }
* <p>
* This interface defines factories for commonly used allocators:
* <ul>
* <li>{@link #slicingAllocator(MemorySegment)} obtains an efficient slicing allocator, where memory
* is allocated by repeatedly slicing the provided memory segment;</li>
* <li>{@link #prefixAllocator(MemorySegment)} obtains an allocator which wraps a segment (either on-heap or off-heap)
* <li>{@link #prefixAllocator(MemorySegment)} obtains an allocator which wraps a segment
* and recycles its content upon each new allocation request.</li>
* </ul>
* <p>
@@ -55,7 +60,15 @@ import jdk.internal.javac.PreviewFeature;
* the results of a certain operation (performed by the API) should be stored, as a memory segment. For instance,
* {@linkplain Linker#downcallHandle(FunctionDescriptor, Linker.Option...) downcall method handles} can accept an additional
* {@link SegmentAllocator} parameter if the underlying foreign function is known to return a struct by-value. Effectively,
* the allocator parameter tells the linker runtime where to store the return value of the foreign function.
* the allocator parameter tells the linker where to store the return value of the foreign function.
*
* @apiNote Unless otherwise specified, the {@link #allocate(long, long)} method is not thread-safe.
* Furthermore, memory segments allocated by a segment allocator can be associated with different
* lifetimes, and can even be backed by overlapping regions of memory. For these reasons, clients should generally
* only interact with a segment allocator they own.
* <p>
* Clients should consider using an {@linkplain Arena arena} instead, which, provides strong thread-safety,
* lifetime and non-overlapping guarantees.
*/
@FunctionalInterface
@PreviewFeature(feature=PreviewFeature.Feature.FOREIGN)
@@ -311,6 +324,7 @@ public interface SegmentAllocator {
* @param elementLayout the array element layout.
* @param count the array element count.
* @return a segment for the newly allocated memory block.
* @throws IllegalArgumentException if {@code elementLayout.byteSize() * count} overflows.
* @throws IllegalArgumentException if {@code count < 0}.
*/
default MemorySegment allocateArray(MemoryLayout elementLayout, long count) {
@@ -338,7 +352,7 @@ public interface SegmentAllocator {
* @param byteAlignment the alignment (in bytes) of the block of memory to be allocated.
* @return a segment for the newly allocated memory block.
* @throws IllegalArgumentException if {@code byteSize < 0}, {@code byteAlignment <= 0},
* or if {@code alignmentBytes} is not a power of 2.
* or if {@code byteAlignment} is not a power of 2.
*/
MemorySegment allocate(long byteSize, long byteAlignment);
@@ -347,8 +361,9 @@ public interface SegmentAllocator {
* obtained from the provided segment. Each new allocation request will return a new slice starting at the
* current offset (modulo additional padding to satisfy alignment constraint), with given size.
* <p>
* When the returned allocator cannot satisfy an allocation request, e.g. because a slice of the provided
* segment with the requested size cannot be found, an {@link IndexOutOfBoundsException} is thrown.
* The returned allocator throws {@link IndexOutOfBoundsException} when a slice of the provided
* segment with the requested size and alignment cannot be found.
* @implNote A slicing allocator is not <em>thread-safe</em>.
*
* @param segment the segment which the returned allocator should slice from.
* @return a new slicing allocator
@@ -365,14 +380,15 @@ public interface SegmentAllocator {
* Equivalent to (but likely more efficient than) the following code:
* {@snippet lang=java :
* MemorySegment segment = ...
* SegmentAllocator prefixAllocator = (size, align) -> segment.asSlice(0, size);
* SegmentAllocator prefixAllocator = (size, align) -> segment.asSlice(0, size, align);
* }
* <p>
* This allocator can be useful to limit allocation requests in case a client
* The returned allocator throws {@link IndexOutOfBoundsException} when a slice of the provided
* segment with the requested size and alignment cannot be found.
*
* @apiNote A prefix allocator can be useful to limit allocation requests in case a client
* knows that they have fully processed the contents of the allocated segment before the subsequent allocation request
* takes place.
* <p>
* While the allocator returned by this method is <em>thread-safe</em>, concurrent access on the same recycling
* @implNote While a prefix allocator is <em>thread-safe</em>, concurrent access on the same recycling
* allocator might cause a thread to overwrite contents written to the underlying segment by a different thread.
*
* @param segment the memory segment to be recycled by the returned allocator.

View File

@@ -29,9 +29,9 @@ import jdk.internal.foreign.layout.SequenceLayoutImpl;
import jdk.internal.javac.PreviewFeature;
/**
* A compound layout that denotes a repetition of a given <em>element layout</em>.
* The repetition count is said to be the sequence layout's <em>element count</em>. A finite sequence can be thought of as a
* group layout where the sequence layout's element layout is repeated a number of times that is equal to the sequence
* A compound layout that denotes a homogeneous repetition of a given <em>element layout</em>.
* The repetition count is said to be the sequence layout's <em>element count</em>. A sequence layout can be thought of as a
* struct layout where the sequence layout's element layout is repeated a number of times that is equal to the sequence
* layout's element count. In other words this layout:
*
* {@snippet lang=java :
@@ -57,7 +57,7 @@ public sealed interface SequenceLayout extends MemoryLayout permits SequenceLayo
/**
* {@return the element layout associated with this sequence layout}
* {@return the element layout of this sequence layout}
*/
MemoryLayout elementLayout();
@@ -67,18 +67,17 @@ public sealed interface SequenceLayout extends MemoryLayout permits SequenceLayo
long elementCount();
/**
* Returns a sequence layout with the same element layout, alignment constraint and name as this sequence layout,
* but with the specified element count.
* {@return a sequence layout with the same characteristics of this layout, but with the given element count}
* @param elementCount the new element count.
* @return a sequence layout with the given element count.
* @throws IllegalArgumentException if {@code elementCount < 0}.
* @throws IllegalArgumentException if {@code elementCount} is negative.
* @throws IllegalArgumentException if {@code elementLayout.bitSize() * elementCount} overflows.
*/
SequenceLayout withElementCount(long elementCount);
/**
* Re-arrange the elements in this sequence layout into a multi-dimensional sequence layout.
* The resulting layout is a sequence layout where element layouts in the flattened projection of this
* sequence layout (see {@link #flatten()}) are re-arranged into one or more nested sequence layouts
* Rearranges the elements in this sequence layout into a multi-dimensional sequence layout.
* The resulting layout is a sequence layout where element layouts in the {@linkplain #flatten() flattened projection}
* of this sequence layout are rearranged into one or more nested sequence layouts
* according to the provided element counts. This transformation preserves the layout size;
* that is, multiplying the provided element counts must yield the same element count
* as the flattened projection of this sequence layout.
@@ -101,7 +100,7 @@ public sealed interface SequenceLayout extends MemoryLayout permits SequenceLayo
* var reshapeSeqImplicit2 = seq.reshape(2, -1);
* }
* @param elementCounts an array of element counts, of which at most one can be {@code -1}.
* @return a sequence layout where element layouts in the flattened projection of this
* @return a sequence layout where element layouts in the {@linkplain #flatten() flattened projection} of this
* sequence layout (see {@link #flatten()}) are re-arranged into one or more nested sequence layouts.
* @throws IllegalArgumentException if two or more element counts are set to {@code -1}, or if one
* or more element count is {@code <= 0} (but other than {@code -1}) or, if, after any required inference,
@@ -112,7 +111,16 @@ public sealed interface SequenceLayout extends MemoryLayout permits SequenceLayo
/**
* Returns a flattened sequence layout. The element layout of the returned sequence layout
* is the first non-sequence element layout found by recursively traversing the element layouts of this sequence layout.
* is the first non-sequence layout found by inspecting (recursively, if needed) the element layout of this sequence layout:
* {@snippet lang=java :
* MemoryLayout flatElementLayout(SequenceLayout sequenceLayout) {
* return switch (sequenceLayout.elementLayout()) {
* case SequenceLayout nestedSequenceLayout -> flatElementLayout(nestedSequenceLayout);
* case MemoryLayout layout -> layout;
* };
* }
* }
* <p>
* This transformation preserves the layout size; nested sequence layout in this sequence layout will
* be dropped and their element counts will be incorporated into that of the returned sequence layout.
* For instance, given a sequence layout of the kind:

View File

@@ -55,7 +55,7 @@ import java.util.function.BiFunction;
* <li>It can be passed to an existing {@linkplain Linker#downcallHandle(FunctionDescriptor, Linker.Option...) downcall method handle}, as an argument to the underlying foreign function.</li>
* <li>It can be {@linkplain MemorySegment#set(AddressLayout, long, MemorySegment) stored} inside another memory segment.</li>
* <li>It can be used to access the region of memory backing a global variable (this requires
* {@link MemorySegment#reinterpret(long)} () resizing} the segment first).</li>
* {@linkplain MemorySegment#reinterpret(long) resizing} the segment first).</li>
* </ul>
*
* <h2 id="obtaining">Obtaining a symbol lookup</h2>
@@ -65,7 +65,7 @@ import java.util.function.BiFunction;
* The library is loaded if not already loaded. The symbol lookup, which is known as a <em>library lookup</em>, and its
* lifetime is controlled by an {@linkplain Arena arena}. For instance, if the provided arena is a
* confined arena, the library associated with the symbol lookup is unloaded when the confined arena
* is {@linkplain Arena#close()}:
* is {@linkplain Arena#close() closed}:
*
* {@snippet lang = java:
* try (Arena arena = Arena.ofConfined()) {
@@ -210,15 +210,16 @@ public interface SymbolLookup {
* For instance, if the provided arena is a confined arena, the library
* associated with the returned lookup will be unloaded when the provided confined arena is
* {@linkplain Arena#close() closed}.
* @implNote The process of resolving a library name is OS-specific. For instance, in a POSIX-compliant OS,
* the library name is resolved according to the specification of the {@code dlopen} function for that OS.
* In Windows, the library name is resolved according to the specification of the {@code LoadLibrary} function.
* <p>
* This method is <a href="package-summary.html#restricted"><em>restricted</em></a>.
* Restricted methods are unsafe, and, if used incorrectly, their use might crash
* the JVM or, worse, silently result in memory corruption. Thus, clients should refrain from depending on
* restricted methods, and use safe and supported functionalities, where possible.
*
* @implNote The process of resolving a library name is OS-specific. For instance, in a POSIX-compliant OS,
* the library name is resolved according to the specification of the {@code dlopen} function for that OS.
* In Windows, the library name is resolved according to the specification of the {@code LoadLibrary} function.
*
* @param name the name of the library in which symbols should be looked up.
* @param arena the arena associated with symbols obtained from the returned lookup.
* @return a new symbol lookup suitable to find symbols in a library with the given name.

View File

@@ -42,9 +42,11 @@ import jdk.internal.javac.PreviewFeature;
* {@linkplain MemorySegment#get(OfInt, long) accessing} a region of memory using the value layout.
* <p>
* This class defines useful value layout constants for Java primitive types and addresses.
* The layout constants in this class make implicit alignment and byte-ordering assumption: all layout
* constants in this class are byte-aligned, and their byte order is set to the {@linkplain ByteOrder#nativeOrder() platform default},
* thus making it easy to work with other APIs, such as arrays and {@link java.nio.ByteBuffer}.
* @apiNote Some characteristics of the Java layout constants are platform-dependent. For instance, the byte order of
* these constants is set to the {@linkplain ByteOrder#nativeOrder() native byte order}, thus making it easy to work
* with other APIs, such as arrays and {@link java.nio.ByteBuffer}. Moreover, the alignment constraint of
* {@link ValueLayout#JAVA_LONG} and {@link ValueLayout#JAVA_DOUBLE} is set to 8 bytes on 64-bit platforms, but only to
* 4 bytes on 32-bit platforms.
*
* @implSpec implementing classes and subclasses are immutable, thread-safe and <a href="{@docRoot}/java.base/java/lang/doc-files/ValueBased.html">value-based</a>.
*
@@ -62,11 +64,9 @@ public sealed interface ValueLayout extends MemoryLayout permits
ByteOrder order();
/**
* Returns a value layout with the same carrier, alignment constraint and name as this value layout,
* but with the specified byte order.
* {@return a value layout with the same characteristics as this layout, but with the given byte order}
*
* @param order the desired byte order.
* @return a value layout with the given byte order.
*/
ValueLayout withOrder(ByteOrder order);
@@ -78,12 +78,10 @@ public sealed interface ValueLayout extends MemoryLayout permits
/**
* Creates a <em>strided</em> var handle that can be used to access a memory segment as multi-dimensional
* array. The layout of this array is a sequence layout with {@code shape.length} nested sequence layouts. The element
* layout of the sequence layout at depth {@code shape.length} is this value layout.
* As a result, if {@code shape.length == 0}, the array layout will feature only one dimension.
* <p>
* The resulting var handle will feature {@code sizes.length + 1} coordinates of type {@code long}, which are
* used as indices into a multi-dimensional array.
* array. This array has a notional sequence layout featuring {@code shape.length} nested sequence layouts. The element
* layout of the innermost sequence layout in the notional sequence layout is this value layout. The resulting var handle
* is obtained as if calling the {@link #varHandle(PathElement...)} method on the notional layout, with a layout
* path containing exactly {@code shape.length + 1} {@linkplain PathElement#sequenceElement() open sequence layout path elements}.
* <p>
* For instance, the following method call:
*
@@ -91,12 +89,14 @@ public sealed interface ValueLayout extends MemoryLayout permits
* VarHandle arrayHandle = ValueLayout.JAVA_INT.arrayElementVarHandle(10, 20);
* }
*
* Can be used to access a multi-dimensional array whose layout is as follows:
* Is equivalent to the following code:
*
* {@snippet lang = java:
* SequenceLayout arrayLayout = MemoryLayout.sequenceLayout(
* MemoryLayout.sequenceLayout(10,
* MemoryLayout.sequenceLayout(20, ValueLayout.JAVA_INT)));
* SequenceLayout notionalLayout = MemoryLayout.sequenceLayout(
* MemoryLayout.sequenceLayout(10, MemoryLayout.sequenceLayout(20, ValueLayout.JAVA_INT)));
* VarHandle arrayHandle = notionalLayout.varHandle(PathElement.sequenceElement(),
* PathElement.sequenceElement(),
* PathElement.sequenceElement());
*}
*
* The resulting var handle {@code arrayHandle} will feature 3 coordinates of type {@code long}; each coordinate
@@ -110,7 +110,7 @@ public sealed interface ValueLayout extends MemoryLayout permits
*
* Additionally, the values of {@code x}, {@code y} and {@code z} are constrained as follows:
* <ul>
* <li>{@code 0 <= x < arrayLayout.elementCount() }</li>
* <li>{@code 0 <= x < notionalLayout.elementCount() }</li>
* <li>{@code 0 <= y < 10 }</li>
* <li>{@code 0 <= z < 20 }</li>
* </ul>
@@ -448,7 +448,7 @@ public sealed interface ValueLayout extends MemoryLayout permits
}
/**
* A value layout constant whose size is the same as that of a machine address ({@code size_t}),
* An address layout constant whose size is the same as that of a machine address ({@code size_t}),
* byte alignment set to {@code sizeof(size_t)}, byte order set to {@link ByteOrder#nativeOrder()}.
*/
AddressLayout ADDRESS = ValueLayouts.OfAddressImpl.of(ByteOrder.nativeOrder());
@@ -504,7 +504,7 @@ public sealed interface ValueLayout extends MemoryLayout permits
OfDouble JAVA_DOUBLE = ValueLayouts.OfDoubleImpl.of(ByteOrder.nativeOrder());
/**
* An unaligned value layout constant whose size is the same as that of a machine address ({@code size_t}),
* An unaligned address layout constant whose size is the same as that of a machine address ({@code size_t}),
* and byte order set to {@link ByteOrder#nativeOrder()}.
* Equivalent to the following code:
* {@snippet lang=java :

View File

@@ -77,8 +77,8 @@
* <h2 id="ffa">Foreign function access</h2>
* The key abstractions introduced to support foreign function access are {@link java.lang.foreign.SymbolLookup},
* {@link java.lang.foreign.FunctionDescriptor} and {@link java.lang.foreign.Linker}. The first is used to look up symbols
* inside libraries; the second is used to model the signature of foreign functions, while the third provides
* linking capabilities which allows modelling foreign functions as {@link java.lang.invoke.MethodHandle} instances,
* inside libraries; the second is used to model the signature of foreign functions, while the third is used
* to link foreign functions as {@link java.lang.invoke.MethodHandle} instances,
* so that clients can perform foreign function calls directly in Java, without the need for intermediate layers of C/C++
* code (as is the case with the <a href="{@docRoot}/../specs/jni/index.html">Java Native Interface (JNI)</a>).
* <p>
@@ -116,7 +116,7 @@
* <h2 id="restricted">Restricted methods</h2>
* Some methods in this package are considered <em>restricted</em>. Restricted methods are typically used to bind native
* foreign data and/or functions to first-class Java API elements which can then be used directly by clients. For instance
* the restricted method {@link java.lang.foreign.MemorySegment#reinterpret(long)} ()}
* the restricted method {@link java.lang.foreign.MemorySegment#reinterpret(long)}
* can be used to create a fresh segment with the same address and temporal bounds,
* but with the provided size. This can be useful to resize memory segments obtained when interacting with native functions.
* <p>

View File

@@ -186,16 +186,16 @@ class Snippets {
}
}
FunctionDescriptor compareDesc = FunctionDescriptor.of(JAVA_INT,
FunctionDescriptor comparDesc = FunctionDescriptor.of(JAVA_INT,
ADDRESS.withTargetLayout(JAVA_INT),
ADDRESS.withTargetLayout(JAVA_INT));
MethodHandle compareHandle = MethodHandles.lookup()
MethodHandle comparHandle = MethodHandles.lookup()
.findStatic(Qsort.class, "qsortCompare",
compareDesc.toMethodType());
comparDesc.toMethodType());
try (Arena arena = Arena.ofConfined()) {
MemorySegment compareFunc = linker.upcallStub(compareHandle, compareDesc, arena);
MemorySegment compareFunc = linker.upcallStub(comparHandle, comparDesc, arena);
MemorySegment array = arena.allocateArray(JAVA_INT, 0, 9, 3, 4, 6, 5, 1, 8, 2, 7);
qsort.invokeExact(array, 10L, 4L, compareFunc);
int[] sorted = array.toArray(JAVA_INT); // [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ]
@@ -400,7 +400,7 @@ class Snippets {
.findStatic(Math.class, "multiplyExact",
MethodType.methodType(long.class, long.class, long.class));
intHandle = MethodHandles.filterCoordinates(intHandle, 1,
MethodHandles.insertArguments(multiplyExact, 0, 4L));
MethodHandles.insertArguments(multiplyExact, 0, ValueLayout.JAVA_INT.byteSize()));
int value = (int) intHandle.get(segment, 3L); // get int element at offset 3 * 4 = 12
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020, 2023, 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,7 @@
package java.lang.invoke;
import jdk.internal.vm.annotation.ForceInline;
import jdk.internal.vm.annotation.Stable;
import java.util.List;
import java.util.function.BiFunction;
/**
@@ -44,8 +42,6 @@ import java.util.function.BiFunction;
*/
/* package */ final class IndirectVarHandle extends VarHandle {
@Stable
private final MethodHandle[] handleMap = new MethodHandle[AccessMode.COUNT];
private final VarHandle directTarget; // cache, for performance reasons
private final VarHandle target;
private final BiFunction<AccessMode, MethodHandle, MethodHandle> handleFactory;
@@ -66,16 +62,6 @@ import java.util.function.BiFunction;
this.coordinates = coordinates;
}
@Override
public Class<?> varType() {
return value;
}
@Override
public List<Class<?>> coordinateTypes() {
return List.of(coordinates);
}
@Override
MethodType accessModeTypeUncached(AccessType at) {
return at.accessModeType(null, value, coordinates);
@@ -86,10 +72,6 @@ import java.util.function.BiFunction;
return directTarget;
}
VarHandle target() {
return target;
}
@Override
public VarHandle withInvokeExactBehavior() {
return hasInvokeExactBehavior()
@@ -97,6 +79,13 @@ import java.util.function.BiFunction;
: new IndirectVarHandle(target, value, coordinates, handleFactory, vform, true);
}
@Override
public VarHandle withInvokeBehavior() {
return !hasInvokeExactBehavior()
? this
: new IndirectVarHandle(target, value, coordinates, handleFactory, vform, false);
}
@ForceInline
boolean checkAccessModeThenIsDirect(VarHandle.AccessDescriptor ad) {
super.checkAccessModeThenIsDirect(ad);
@@ -105,21 +94,14 @@ import java.util.function.BiFunction;
}
@Override
public VarHandle withInvokeBehavior() {
return !hasInvokeExactBehavior()
? this
: new IndirectVarHandle(target, value, coordinates, handleFactory, vform, false);
public boolean isAccessModeSupported(AccessMode accessMode) {
return directTarget.isAccessModeSupported(accessMode);
}
@Override
@ForceInline
MethodHandle getMethodHandle(int mode) {
MethodHandle handle = handleMap[mode];
if (handle == null) {
MethodHandle targetHandle = target.getMethodHandle(mode); // might throw UOE of access mode is not supported, which is ok
handle = handleMap[mode] = handleFactory.apply(AccessMode.values()[mode], targetHandle);
}
return handle;
MethodHandle getMethodHandleUncached(int mode) {
MethodHandle targetHandle = target.getMethodHandle(mode); // might throw UOE of access mode is not supported, which is ok
return handleFactory.apply(AccessMode.values()[mode], targetHandle);
}
@Override

View File

@@ -7956,18 +7956,18 @@ assertEquals("boojum", (String) catTrace.invokeExact("boo", "jum"));
/**
* Creates a var handle object, which can be used to dereference a {@linkplain java.lang.foreign.MemorySegment memory segment}
* by viewing its contents as a sequence of the provided value layout.
* at a given byte offset, using the provided value layout.
*
* <p>The provided layout specifies the {@linkplain ValueLayout#carrier() carrier type},
* the {@linkplain ValueLayout#byteSize() byte size},
* the {@linkplain ValueLayout#byteAlignment() byte alignment} and the {@linkplain ValueLayout#order() byte order}
* associated with the returned var handle.
*
* <p>The returned var handle's type is {@code carrier} and the list of coordinate types is
* {@code (MemorySegment, long)}, where the {@code long} coordinate type corresponds to byte offset into
* a given memory segment. The returned var handle accesses bytes at an offset in a given
* memory segment, composing bytes to or from a value of the type {@code carrier} according to the given endianness;
* the alignment constraint (in bytes) for the resulting var handle is given by {@code alignmentBytes}.
* <p>The list of coordinate types associated with the returned var handle is {@code (MemorySegment, long)},
* where the {@code long} coordinate type corresponds to byte offset into the given memory segment coordinate.
* Thus, the returned var handle accesses bytes at an offset in a given memory segment, composing bytes to or from
* a value of the var handle type. Moreover, the access operation will honor the endianness and the
* alignment constraints expressed in the provided layout.
*
* <p>As an example, consider the memory layout expressed by a {@link GroupLayout} instance constructed as follows:
* {@snippet lang="java" :
@@ -8023,7 +8023,6 @@ assertEquals("boojum", (String) catTrace.invokeExact("boo", "jum"));
*
* @param layout the value layout for which a memory access handle is to be obtained.
* @return the new memory segment view var handle.
* @throws IllegalArgumentException if an illegal carrier type is used, or if {@code alignmentBytes} is not a power of two.
* @throws NullPointerException if {@code layout} is {@code null}.
* @see MemoryLayout#varHandle(MemoryLayout.PathElement...)
* @since 19

View File

@@ -526,8 +526,6 @@ public abstract sealed class VarHandle implements Constable
return this;
}
VarHandle target() { return null; }
/**
* Returns {@code true} if this VarHandle has <a href="#invoke-exact-behavior"><em>invoke-exact behavior</em></a>.
*
@@ -2120,7 +2118,7 @@ public abstract sealed class VarHandle implements Constable
* @return {@code true} if the given access mode is supported, otherwise
* {@code false}.
*/
public final boolean isAccessModeSupported(AccessMode accessMode) {
public boolean isAccessModeSupported(AccessMode accessMode) {
return vform.getMemberNameOrNull(accessMode.ordinal()) != null;
}
@@ -2176,7 +2174,7 @@ public abstract sealed class VarHandle implements Constable
MethodHandle[] methodHandleTable;
@ForceInline
MethodHandle getMethodHandle(int mode) {
final MethodHandle getMethodHandle(int mode) {
MethodHandle[] mhTable = methodHandleTable;
if (mhTable == null) {
mhTable = methodHandleTable = new MethodHandle[AccessMode.COUNT];
@@ -2188,7 +2186,7 @@ public abstract sealed class VarHandle implements Constable
return mh;
}
private final MethodHandle getMethodHandleUncached(int mode) {
MethodHandle getMethodHandleUncached(int mode) {
MethodType mt = accessModeType(AccessMode.values()[mode]).
insertParameterTypes(0, VarHandle.class);
MemberName mn = vform.getMemberName(mode);

View File

@@ -330,7 +330,7 @@ public class LinkedHashMap<K,V>
static final int PUT_NORM = 0;
static final int PUT_FIRST = 1;
static final int PUT_LAST = 2;
int putMode = PUT_NORM;
transient int putMode = PUT_NORM;
// Called after update, but not after insertion
void afterNodeAccess(Node<K,V> e) {

View File

@@ -1828,7 +1828,7 @@ public final class Matcher implements MatchResult {
*
* @return {@inheritDoc}
*
* @since {@inheritDoc}
* @since 20
*/
@Override
public Map<String, Integer> namedGroups() {
@@ -1843,7 +1843,7 @@ public final class Matcher implements MatchResult {
*
* @return {@inheritDoc}
*
* @since {@inheritDoc}
* @since 20
*/
@Override
public boolean hasMatch() {

View File

@@ -114,6 +114,8 @@ public abstract sealed class AbstractMemorySegmentImpl
@Override
public MemorySegment asSlice(long offset, long newSize, long byteAlignment) {
checkBounds(offset, newSize);
Utils.checkAlign(byteAlignment);
if (!isAlignedForElement(offset, byteAlignment)) {
throw new IllegalArgumentException("Target offset incompatible with alignment constraints");
}

View File

@@ -58,6 +58,8 @@ public class LayoutPath {
private static final MethodHandle MH_ADD_SCALED_OFFSET;
private static final MethodHandle MH_SLICE;
private static final MethodHandle MH_SLICE_LAYOUT;
private static final MethodHandle MH_CHECK_ALIGN;
private static final MethodHandle MH_SEGMENT_RESIZE;
static {
@@ -67,6 +69,10 @@ public class LayoutPath {
MethodType.methodType(long.class, long.class, long.class, long.class, long.class));
MH_SLICE = lookup.findVirtual(MemorySegment.class, "asSlice",
MethodType.methodType(MemorySegment.class, long.class, long.class));
MH_SLICE_LAYOUT = lookup.findVirtual(MemorySegment.class, "asSlice",
MethodType.methodType(MemorySegment.class, long.class, MemoryLayout.class));
MH_CHECK_ALIGN = lookup.findStatic(LayoutPath.class, "checkAlign",
MethodType.methodType(MemorySegment.class, MemorySegment.class, MemoryLayout.class));
MH_SEGMENT_RESIZE = lookup.findStatic(LayoutPath.class, "resizeSegment",
MethodType.methodType(MemorySegment.class, MemorySegment.class, MemoryLayout.class));
} catch (Throwable ex) {
@@ -193,17 +199,19 @@ public class LayoutPath {
throw new IllegalArgumentException("Path does not select a value layout");
}
VarHandle handle = Utils.makeSegmentViewVarHandle(valueLayout);
for (int i = strides.length - 1; i >= 0; i--) {
MethodHandle collector = MethodHandles.insertArguments(MH_ADD_SCALED_OFFSET, 2,
strides[i],
bounds[i]);
// (J, ...) -> J to (J, J, ...) -> J
// i.e. new coord is prefixed. Last coord will correspond to innermost layout
handle = MethodHandles.collectCoordinates(handle, 1, collector);
// If we have an enclosing layout, drop the alignment check for the accessed element,
// we check the root layout instead
ValueLayout accessedLayout = enclosing != null ? valueLayout.withByteAlignment(1) : valueLayout;
VarHandle handle = Utils.makeSegmentViewVarHandle(accessedLayout);
handle = MethodHandles.collectCoordinates(handle, 1, offsetHandle());
// we only have to check the alignment of the root layout for the first dereference we do,
// as each dereference checks the alignment of the target address when constructing its segment
// (see Utils::longToAddress)
if (derefAdapters.length == 0 && enclosing != null) {
MethodHandle checkHandle = MethodHandles.insertArguments(MH_CHECK_ALIGN, 1, rootLayout());
handle = MethodHandles.filterCoordinates(handle, 0, checkHandle);
}
handle = MethodHandles.insertCoordinates(handle, 1,
offset);
if (adapt) {
for (int i = derefAdapters.length; i > 0; i--) {
@@ -231,16 +239,37 @@ public class LayoutPath {
return mh;
}
public MethodHandle sliceHandle() {
MethodHandle offsetHandle = offsetHandle(); // byte offset
private MemoryLayout rootLayout() {
return enclosing != null ? enclosing.rootLayout() : this.layout;
}
MethodHandle sliceHandle = MH_SLICE; // (MS, long, long) -> MS
sliceHandle = MethodHandles.insertArguments(sliceHandle, 2, layout.byteSize()); // (MS, long) -> MS
sliceHandle = MethodHandles.collectArguments(sliceHandle, 1, offsetHandle); // (MS, ...) -> MS
public MethodHandle sliceHandle() {
MethodHandle sliceHandle;
if (enclosing != null) {
// drop the alignment check for the accessed element, we check the root layout instead
sliceHandle = MH_SLICE; // (MS, long, long) -> MS
sliceHandle = MethodHandles.insertArguments(sliceHandle, 2, layout.byteSize()); // (MS, long) -> MS
} else {
sliceHandle = MH_SLICE_LAYOUT; // (MS, long, MemoryLayout) -> MS
sliceHandle = MethodHandles.insertArguments(sliceHandle, 2, layout); // (MS, long) -> MS
}
sliceHandle = MethodHandles.collectArguments(sliceHandle, 1, offsetHandle()); // (MS, ...) -> MS
if (enclosing != null) {
MethodHandle checkHandle = MethodHandles.insertArguments(MH_CHECK_ALIGN, 1, rootLayout());
sliceHandle = MethodHandles.filterArguments(sliceHandle, 0, checkHandle);
}
return sliceHandle;
}
private static MemorySegment checkAlign(MemorySegment segment, MemoryLayout constraint) {
if (!((AbstractMemorySegmentImpl) segment).isAlignedForElement(0, constraint)) {
throw new IllegalArgumentException("Target offset incompatible with alignment constraints: " + constraint.byteAlignment());
}
return segment;
}
public MemoryLayout layout() {
return layout;
}

View File

@@ -40,6 +40,7 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.function.Supplier;
import jdk.internal.access.SharedSecrets;
import jdk.internal.foreign.abi.SharedUtils;
@@ -166,11 +167,16 @@ public final class Utils {
}
@ForceInline
public static void checkElementAlignment(ValueLayout layout, String msg) {
public static boolean isElementAligned(ValueLayout layout) {
// Fast-path: if both size and alignment are powers of two, we can just
// check if one is greater than the other.
assert isPowerOfTwo(layout.byteSize());
if (layout.byteAlignment() > layout.byteSize()) {
return layout.byteAlignment() <= layout.byteSize();
}
@ForceInline
public static void checkElementAlignment(ValueLayout layout, String msg) {
if (!isElementAligned(layout)) {
throw new IllegalArgumentException(msg);
}
}
@@ -200,6 +206,10 @@ public final class Utils {
throw new IllegalArgumentException("Invalid allocation size : " + byteSize);
}
checkAlign(byteAlignment);
}
public static void checkAlign(long byteAlignment) {
// alignment should be > 0, and power of two
if (byteAlignment <= 0 ||
((byteAlignment & (byteAlignment - 1)) != 0L)) {
@@ -252,6 +262,14 @@ public final class Utils {
return (value & (value - 1)) == 0L;
}
public static <L extends MemoryLayout> L wrapOverflow(Supplier<L> layoutSupplier) {
try {
return layoutSupplier.get();
} catch (ArithmeticException ex) {
throw new IllegalArgumentException("Layout size exceeds Long.MAX_VALUE");
}
}
public static boolean containsNullChars(String s) {
return s.indexOf('\u0000') >= 0;
}

View File

@@ -55,6 +55,7 @@ import java.lang.invoke.MethodType;
import java.util.List;
import java.nio.ByteOrder;
import java.util.Objects;
import java.util.Set;
public abstract sealed class AbstractLinker implements Linker permits LinuxAArch64Linker, MacOsAArch64Linker,
SysVx64Linker, WindowsAArch64Linker,
@@ -173,10 +174,10 @@ public abstract sealed class AbstractLinker implements Linker permits LinuxAArch
}
private void checkLayoutRecursive(MemoryLayout layout) {
checkHasNaturalAlignment(layout);
if (layout instanceof ValueLayout vl) {
checkByteOrder(vl);
checkSupported(vl);
} else if (layout instanceof StructLayout sl) {
checkHasNaturalAlignment(layout);
long offset = 0;
long lastUnpaddedOffset = 0;
for (MemoryLayout member : sl.memberLayouts()) {
@@ -192,6 +193,7 @@ public abstract sealed class AbstractLinker implements Linker permits LinuxAArch
}
checkGroupSize(sl, lastUnpaddedOffset);
} else if (layout instanceof UnionLayout ul) {
checkHasNaturalAlignment(layout);
long maxUnpaddedLayout = 0;
for (MemoryLayout member : ul.memberLayouts()) {
checkLayoutRecursive(member);
@@ -201,6 +203,7 @@ public abstract sealed class AbstractLinker implements Linker permits LinuxAArch
}
checkGroupSize(ul, maxUnpaddedLayout);
} else if (layout instanceof SequenceLayout sl) {
checkHasNaturalAlignment(layout);
checkLayoutRecursive(sl.elementLayout());
}
}
@@ -225,6 +228,16 @@ public abstract sealed class AbstractLinker implements Linker permits LinuxAArch
}
}
private static void checkSupported(ValueLayout valueLayout) {
valueLayout = valueLayout.withoutName();
if (valueLayout instanceof AddressLayout addressLayout) {
valueLayout = addressLayout.withoutTargetLayout();
}
if (!SUPPORTED_LAYOUTS.contains(valueLayout.withoutName())) {
throw new IllegalArgumentException("Unsupported layout: " + valueLayout);
}
}
private static void checkHasNaturalAlignment(MemoryLayout layout) {
if (!((AbstractLayout<?>) layout).hasNaturalAlignment()) {
throw new IllegalArgumentException("Layout alignment must be natural alignment: " + layout);
@@ -257,9 +270,15 @@ public abstract sealed class AbstractLinker implements Linker permits LinuxAArch
.orElseGet(() -> FunctionDescriptor.ofVoid(stripNames(function.argumentLayouts())));
}
private void checkByteOrder(ValueLayout vl) {
if (vl.order() != linkerByteOrder()) {
throw new IllegalArgumentException("Layout does not have the right byte order: " + vl);
}
}
private static final Set<MemoryLayout> SUPPORTED_LAYOUTS = Set.of(
ValueLayout.JAVA_BOOLEAN,
ValueLayout.JAVA_BYTE,
ValueLayout.JAVA_CHAR,
ValueLayout.JAVA_SHORT,
ValueLayout.JAVA_INT,
ValueLayout.JAVA_FLOAT,
ValueLayout.JAVA_LONG,
ValueLayout.JAVA_DOUBLE,
ValueLayout.ADDRESS
);
}

View File

@@ -25,6 +25,8 @@
*/
package jdk.internal.foreign.layout;
import jdk.internal.foreign.Utils;
import java.lang.foreign.MemoryLayout;
import java.lang.foreign.SequenceLayout;
import java.util.Objects;
@@ -68,7 +70,8 @@ public final class SequenceLayoutImpl extends AbstractLayout<SequenceLayoutImpl>
* @throws IllegalArgumentException if {@code elementCount < 0}.
*/
public SequenceLayout withElementCount(long elementCount) {
return new SequenceLayoutImpl(elementCount, elementLayout, byteAlignment(), name());
return Utils.wrapOverflow(() ->
new SequenceLayoutImpl(elementCount, elementLayout, byteAlignment(), name()));
}
/**

View File

@@ -117,6 +117,9 @@ public final class ValueLayouts {
public final VarHandle arrayElementVarHandle(int... shape) {
Objects.requireNonNull(shape);
if (!Utils.isElementAligned((ValueLayout) this)) {
throw new UnsupportedOperationException("Layout alignment greater than its size");
}
MemoryLayout layout = self();
List<MemoryLayout.PathElement> path = new ArrayList<>();
for (int i = shape.length; i > 0; i--) {

View File

@@ -39,8 +39,11 @@ public enum Architecture {
AARCH64,
ARM,
RISCV64,
LOONGARCH64,
S390,
PPC64,
MIPSEL,
MIPS64EL
;
private static Architecture CURRENT_ARCH = initArch(PlatformProps.CURRENT_ARCH_STRING);
@@ -69,6 +72,14 @@ public enum Architecture {
return PlatformProps.TARGET_ARCH_IS_RISCV64;
}
/**
* {@return {@code true} if the current architecture is LOONGARCH64}
*/
@ForceInline
public static boolean isLOONGARCH64() {
return PlatformProps.TARGET_ARCH_IS_LOONGARCH64;
}
/**
* {@return {@code true} if the current architecture is S390}
*/
@@ -102,6 +113,22 @@ public enum Architecture {
return PlatformProps.TARGET_ARCH_IS_AARCH64;
}
/**
* {@return {@code true} if the current architecture is MIPSEL}
*/
@ForceInline
public static boolean isMIPSEL() {
return PlatformProps.TARGET_ARCH_IS_MIPSEL;
}
/**
* {@return {@code true} if the current architecture is MIPS64EL}
*/
@ForceInline
public static boolean isMIPS64EL() {
return PlatformProps.TARGET_ARCH_IS_MIPS64EL;
}
/**
* {@return the current architecture}
*/

View File

@@ -55,6 +55,9 @@ class PlatformProps {
static final boolean TARGET_ARCH_IS_AARCH64 = "@@OPENJDK_TARGET_CPU@@" == "aarch64";
static final boolean TARGET_ARCH_IS_ARM = "@@OPENJDK_TARGET_CPU@@" == "arm";
static final boolean TARGET_ARCH_IS_RISCV64 = "@@OPENJDK_TARGET_CPU@@" == "riscv64";
static final boolean TARGET_ARCH_IS_LOONGARCH64 = "@@OPENJDK_TARGET_CPU@@" == "loongarch64";
static final boolean TARGET_ARCH_IS_S390 = "@@OPENJDK_TARGET_CPU@@" == "s390";
static final boolean TARGET_ARCH_IS_PPC64 = "@@OPENJDK_TARGET_CPU@@" == "ppc64";
static final boolean TARGET_ARCH_IS_MIPSEL = "@@OPENJDK_TARGET_CPU@@" == "mipsel";
static final boolean TARGET_ARCH_IS_MIPS64EL= "@@OPENJDK_TARGET_CPU@@" == "mips64el";
}

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2007, 2021, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2007, 2023, 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,8 @@ java.launcher.cls.error4=Fehler: Hauptmethode in Klasse {0} nicht gefunden. Defi
java.launcher.cls.error5=Fehler: Zum Ausf\u00FChren dieser Anwendung ben\u00F6tigte JavaFX-Runtime-Komponenten fehlen
java.launcher.cls.error6=Fehler: Beim Laden der Klasse {0} ist ein LinkageError aufgetreten\n\t{1}
java.launcher.cls.error7=Fehler: Hauptklasse {0} kann nicht initialisiert werden\nUrsache: {1}: {2}
java.launcher.cls.error8=Fehler: Kein nicht privater Null-Argument-Konstruktor in Klasse {0} gefunden\nEntfernen Sie die Eigenschaft "private" aus dem vorhandenen Konstruktor, oder definieren Sie ihn als:\n public {0}()
java.launcher.cls.error9=Fehler: Konstruktor mit nicht statischer innerer Klasse {0} kann nicht aufgerufen werden \nLegen Sie die innere Klasse als statisch fest, oder verschieben Sie sie in eine separate Quelldatei
java.launcher.jar.error1=Fehler: Beim Versuch, Datei {0} zu \u00F6ffnen, ist ein unerwarteter Fehler aufgetreten
java.launcher.jar.error2=Manifest in {0} nicht gefunden
java.launcher.jar.error3=kein Hauptmanifestattribut, in {0}

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2007, 2021, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2007, 2023, 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
@@ -49,6 +49,8 @@ java.launcher.cls.error4=\u30A8\u30E9\u30FC: \u30E1\u30A4\u30F3\u30FB\u30E1\u30B
java.launcher.cls.error5=\u30A8\u30E9\u30FC: JavaFX\u30E9\u30F3\u30BF\u30A4\u30E0\u30FB\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u304C\u4E0D\u8DB3\u3057\u3066\u304A\u308A\u3001\u3053\u306E\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u306E\u5B9F\u884C\u306B\u5FC5\u8981\u3067\u3059
java.launcher.cls.error6=\u30A8\u30E9\u30FC: \u30E1\u30A4\u30F3\u30FB\u30AF\u30E9\u30B9{0}\u306E\u30ED\u30FC\u30C9\u4E2D\u306BLinkageError\u304C\u767A\u751F\u3057\u307E\u3057\u305F\n\t{1}
java.launcher.cls.error7=\u30A8\u30E9\u30FC: \u30E1\u30A4\u30F3\u30FB\u30AF\u30E9\u30B9{0}\u3092\u521D\u671F\u5316\u3067\u304D\u307E\u305B\u3093\n\u539F\u56E0: {1}: {2}
java.launcher.cls.error8=\u30A8\u30E9\u30FC: \u975Eprivate\u306E\u30BC\u30ED\u5F15\u6570\u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\u30BF\u304C\u30AF\u30E9\u30B9{0}\u306B\u898B\u3064\u304B\u308A\u307E\u305B\u3093\n\u65E2\u5B58\u306E\u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\u30BF\u304B\u3089private\u3092\u524A\u9664\u3059\u308B\u304B\u3001\u6B21\u306E\u3088\u3046\u306B\u5B9A\u7FA9\u3057\u3066\u304F\u3060\u3055\u3044:\n public {0}()
java.launcher.cls.error9=\u30A8\u30E9\u30FC: static\u3067\u306A\u3044\u5185\u90E8\u30AF\u30E9\u30B9{0}\u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\u30BF\u3092\u8D77\u52D5\u3067\u304D\u307E\u305B\u3093 \n\u5185\u90E8\u30AF\u30E9\u30B9\u3092static\u306B\u3059\u308B\u304B\u3001\u5185\u90E8\u30AF\u30E9\u30B9\u3092\u5916\u90E8\u306B\u51FA\u3057\u3066\u30BD\u30FC\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u533A\u5225\u3057\u3066\u304F\u3060\u3055\u3044
java.launcher.jar.error1=\u30A8\u30E9\u30FC: \u30D5\u30A1\u30A4\u30EB{0}\u3092\u958B\u3053\u3046\u3068\u3057\u3066\u3044\u308B\u3068\u304D\u306B\u3001\u4E88\u671F\u3057\u306A\u3044\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F
java.launcher.jar.error2={0}\u306B\u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093
java.launcher.jar.error3={0}\u306B\u30E1\u30A4\u30F3\u30FB\u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u5C5E\u6027\u304C\u3042\u308A\u307E\u305B\u3093

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2007, 2021, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2007, 2023, 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,8 @@ java.launcher.cls.error4=\u9519\u8BEF: \u5728\u7C7B {0} \u4E2D\u627E\u4E0D\u5230
java.launcher.cls.error5=\u9519\u8BEF: \u7F3A\u5C11 JavaFX \u8FD0\u884C\u65F6\u7EC4\u4EF6, \u9700\u8981\u4F7F\u7528\u8BE5\u7EC4\u4EF6\u6765\u8FD0\u884C\u6B64\u5E94\u7528\u7A0B\u5E8F
java.launcher.cls.error6=\u9519\u8BEF: \u52A0\u8F7D\u4E3B\u7C7B {0} \u65F6\u51FA\u73B0 LinkageError\n\t{1}
java.launcher.cls.error7=\u9519\u8BEF: \u65E0\u6CD5\u521D\u59CB\u5316\u4E3B\u7C7B {0}\n\u539F\u56E0: {1}: {2}
java.launcher.cls.error8=\u9519\u8BEF\uFF1A\u5728\u7C7B {0} \u4E2D\u672A\u627E\u5230\u975E private \u96F6\u53C2\u6570\u6784\u9020\u5668\n\u8BF7\u4ECE\u73B0\u6709\u6784\u9020\u5668\u4E2D\u5220\u9664 private\uFF0C\u6216\u8005\u5B9A\u4E49\u4E3A\uFF1A\n public {0}()
java.launcher.cls.error9=\u9519\u8BEF\uFF1A\u65E0\u6CD5\u8C03\u7528\u975E\u9759\u6001\u5185\u90E8\u7C7B {0} \u6784\u9020\u5668\n\u8BF7\u5C06\u5185\u90E8\u7C7B\u8BBE\u4E3A\u9759\u6001\u6216\u5C06\u5185\u90E8\u7C7B\u79FB\u51FA\u5230\u5355\u72EC\u7684\u6E90\u6587\u4EF6
java.launcher.jar.error1=\u9519\u8BEF: \u5C1D\u8BD5\u6253\u5F00\u6587\u4EF6{0}\u65F6\u51FA\u73B0\u610F\u5916\u9519\u8BEF
java.launcher.jar.error2=\u5728{0}\u4E2D\u627E\u4E0D\u5230\u6E05\u5355
java.launcher.jar.error3={0}\u4E2D\u6CA1\u6709\u4E3B\u6E05\u5355\u5C5E\u6027

View File

@@ -72,7 +72,7 @@ public class Resources_zh_CN extends java.util.ListResourceBundle {
{"Generated.keysize.bit.keyAlgName.secret.key",
"\u5DF2\u751F\u6210 {0} \u4F4D{1}\u5BC6\u94A5"}, //-genseckey
{"key.algorithm.weak", "%1$s \u4F7F\u7528\u7684 %2$s \u7B97\u6CD5\u88AB\u89C6\u4E3A\u5B58\u5728\u5B89\u5168\u98CE\u9669\u3002"},
{"key.size.weak", "%1$s \u4F7F\u7528\u7684 %2$s \u88AB\u89C6\u4E3A\u5B58\u5728\u5B89\u5168\u98CE\u9669\u3002"},
{"key.size.weak", "%1$s \u4F7F\u7528\u7684 %2$s \u5B58\u5728\u5B89\u5168\u98CE\u9669\u3002"},
{"Imports.entries.from.a.JDK.1.1.x.style.identity.database",
"\u4ECE JDK 1.1.x \u6837\u5F0F\u7684\u8EAB\u4EFD\u6570\u636E\u5E93\u5BFC\u5165\u6761\u76EE"}, //-identitydb
{"Imports.a.certificate.or.a.certificate.chain",
@@ -484,7 +484,7 @@ public class Resources_zh_CN extends java.util.ListResourceBundle {
{"whose.sigalg.disabled", "%1$s \u4F7F\u7528\u7684 %2$s \u7B7E\u540D\u7B97\u6CD5\u88AB\u89C6\u4E3A\u5B58\u5728\u5B89\u5168\u98CE\u9669\u800C\u4E14\u88AB\u7981\u7528\u3002"},
{"whose.sigalg.usagesignedjar", "%1$s \u4F7F\u7528\u7684 %2$s \u7B7E\u540D\u7B97\u6CD5\u88AB\u89C6\u4E3A\u5B58\u5728\u5B89\u5168\u98CE\u9669\uFF0C\u65E0\u6CD5\u7528\u4E8E\u5728 %3$s \u540E\u5BF9 JAR \u8FDB\u884C\u7B7E\u540D\u3002"},
{"Unable.to.parse.denyAfter.string.in.exception.message", "\u65E0\u6CD5\u89E3\u6790\u5F02\u5E38\u9519\u8BEF\u6D88\u606F\u4E2D\u7684 denyAfter \u65E5\u671F\u5B57\u7B26\u4E32"},
{"whose.sigalg.weak", "%1$s \u4F7F\u7528\u7684 %2$s \u7B7E\u540D\u7B97\u6CD5\u88AB\u89C6\u4E3A\u5B58\u5728\u5B89\u5168\u98CE\u9669\u3002"},
{"whose.sigalg.weak", "%1$s \u4F7F\u7528\u7684 %2$s \u7B7E\u540D\u7B97\u6CD5\u5B58\u5728\u5B89\u5168\u98CE\u9669\u3002"},
{"whose.key.disabled", "%1$s \u4F7F\u7528\u7684 %2$s \u88AB\u89C6\u4E3A\u5B58\u5728\u5B89\u5168\u98CE\u9669\u800C\u4E14\u88AB\u7981\u7528\u3002"},
{"whose.key.weak", "%1$s \u4F7F\u7528\u7684 %2$s \u88AB\u89C6\u4E3A\u5B58\u5728\u5B89\u5168\u98CE\u9669\u3002\u6B64\u5BC6\u94A5\u5927\u5C0F\u5C06\u5728\u672A\u6765\u7684\u66F4\u65B0\u4E2D\u88AB\u7981\u7528\u3002"},
{"jks.storetype.warning", "%1$s \u5BC6\u94A5\u5E93\u4F7F\u7528\u4E13\u7528\u683C\u5F0F\u3002\u5EFA\u8BAE\u4F7F\u7528 \"keytool -importkeystore -srckeystore %2$s -destkeystore %2$s -deststoretype pkcs12\" \u8FC1\u79FB\u5230\u884C\u4E1A\u6807\u51C6\u683C\u5F0F PKCS12\u3002"},

View File

@@ -60,6 +60,7 @@ FileChooser.saveTitle.textAndMnemonic=Speichern
FileChooser.openTitle.textAndMnemonic=\u00D6ffnen
FileChooser.newFolderExistsError.textAndMnemonic=Dieser Name ist bereits vergeben
FileChooser.chooseButton.textAndMnemonic=Ausw\u00E4hlen
FileChooser.chooseButtonToolTip.textAndMnemonic=Ausgew\u00E4hlte Datei ausw\u00E4hlen
FileChooser.newFolderButton.textAndMnemonic=Neuer Ordner
FileChooser.newFolderTitle.textAndMnemonic=Neuer Ordner

View File

@@ -60,6 +60,7 @@ FileChooser.saveTitle.textAndMnemonic=\u4FDD\u5B58
FileChooser.openTitle.textAndMnemonic=\u958B\u304F
FileChooser.newFolderExistsError.textAndMnemonic=\u305D\u306E\u540D\u524D\u306F\u3059\u3067\u306B\u4F7F\u7528\u3055\u308C\u3066\u3044\u307E\u3059
FileChooser.chooseButton.textAndMnemonic=\u9078\u629E
FileChooser.chooseButtonToolTip.textAndMnemonic=\u9078\u629E\u3055\u308C\u3066\u3044\u308B\u30D5\u30A1\u30A4\u30EB\u3092\u9078\u629E\u3057\u307E\u3059
FileChooser.newFolderButton.textAndMnemonic=\u65B0\u898F\u30D5\u30A9\u30EB\u30C0
FileChooser.newFolderTitle.textAndMnemonic=\u65B0\u898F\u30D5\u30A9\u30EB\u30C0

View File

@@ -60,6 +60,7 @@ FileChooser.saveTitle.textAndMnemonic=\u4FDD\u5B58
FileChooser.openTitle.textAndMnemonic=\u6253\u5F00
FileChooser.newFolderExistsError.textAndMnemonic=\u8BE5\u540D\u79F0\u5DF2\u88AB\u4F7F\u7528
FileChooser.chooseButton.textAndMnemonic=\u9009\u62E9
FileChooser.chooseButtonToolTip.textAndMnemonic=\u9009\u62E9\u6240\u9009\u6587\u4EF6
FileChooser.newFolderButton.textAndMnemonic=\u65B0\u5EFA\u6587\u4EF6\u5939
FileChooser.newFolderTitle.textAndMnemonic=\u65B0\u5EFA\u6587\u4EF6\u5939

View File

@@ -60,8 +60,8 @@ FileChooser.newFolderNoDirectoryError.textAndMnemonic=Fehler beim Erstellen von
FileChooser.deleteFileButton.textAndMnemonic=Datei &l\u00F6schen
FileChooser.renameFileButton.textAndMnemonic=Datei &umbenennen
FileChooser.cancelButton.textAndMnemonic=Abbrechen
FileChooser.saveButton.textAndMnemonic=OK
FileChooser.openButton.textAndMnemonic=OK
FileChooser.saveButton.textAndMnemonic=Speichern
FileChooser.openButton.textAndMnemonic=\u00D6ffnen
FileChooser.saveDialogTitle.textAndMnemonic=Speichern
FileChooser.openDialogTitle.textAndMnemonic=\u00D6ffnen
FileChooser.pathLabel.textAndMnemonic=Aus&wahl:

View File

@@ -60,8 +60,8 @@ FileChooser.newFolderNoDirectoryError.textAndMnemonic=\u30C7\u30A3\u30EC\u30AF\u
FileChooser.deleteFileButton.textAndMnemonic=\u30D5\u30A1\u30A4\u30EB\u306E\u524A\u9664(&L)
FileChooser.renameFileButton.textAndMnemonic=\u30D5\u30A1\u30A4\u30EB\u306E\u540D\u524D\u5909\u66F4(&R)
FileChooser.cancelButton.textAndMnemonic=\u53D6\u6D88
FileChooser.saveButton.textAndMnemonic=OK
FileChooser.openButton.textAndMnemonic=OK
FileChooser.saveButton.textAndMnemonic=\u4FDD\u5B58
FileChooser.openButton.textAndMnemonic=\u958B\u304F
FileChooser.saveDialogTitle.textAndMnemonic=\u4FDD\u5B58
FileChooser.openDialogTitle.textAndMnemonic=\u958B\u304F
FileChooser.pathLabel.textAndMnemonic=\u9078\u629E(&S):

View File

@@ -60,8 +60,8 @@ FileChooser.newFolderNoDirectoryError.textAndMnemonic=\u521B\u5EFA\u76EE\u5F55 "
FileChooser.deleteFileButton.textAndMnemonic=\u5220\u9664\u6587\u4EF6(&L)
FileChooser.renameFileButton.textAndMnemonic=\u91CD\u547D\u540D\u6587\u4EF6(&R)
FileChooser.cancelButton.textAndMnemonic=\u53D6\u6D88
FileChooser.saveButton.textAndMnemonic=\u786E\u5B9A
FileChooser.openButton.textAndMnemonic=\u786E\u5B9A
FileChooser.saveButton.textAndMnemonic=\u4FDD\u5B58
FileChooser.openButton.textAndMnemonic=\u6253\u5F00
FileChooser.saveDialogTitle.textAndMnemonic=\u4FDD\u5B58
FileChooser.openDialogTitle.textAndMnemonic=\u6253\u5F00
FileChooser.pathLabel.textAndMnemonic=\u9009\u5B9A\u5185\u5BB9(&S):

View File

@@ -49,6 +49,11 @@ static struct PwLoopData pw = {0};
jclass tokenStorageClass = NULL;
jmethodID storeTokenMethodID = NULL;
#if defined(AIX) && defined(__open_xl_version__) && __open_xl_version__ >= 17
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wformat-nonliteral"
#endif
inline void debug_screencast(
const char *__restrict fmt,
...
@@ -84,8 +89,10 @@ static void doCleanup() {
struct ScreenProps *screenProps = &screenSpace.screens[i];
if (screenProps->data) {
if (screenProps->data->stream) {
fp_pw_thread_loop_lock(pw.loop);
fp_pw_stream_disconnect(screenProps->data->stream);
fp_pw_stream_destroy(screenProps->data->stream);
fp_pw_thread_loop_unlock(pw.loop);
screenProps->data->stream = NULL;
}
free(screenProps->data);
@@ -887,8 +894,10 @@ JNIEXPORT jint JNICALL Java_sun_awt_screencast_ScreencastHelper_getRGBPixelsImpl
screenProps->captureData = NULL;
screenProps->shouldCapture = FALSE;
fp_pw_thread_loop_lock(pw.loop);
fp_pw_stream_set_active(screenProps->data->stream, FALSE);
fp_pw_stream_disconnect(screenProps->data->stream);
fp_pw_thread_loop_unlock(pw.loop);
}
}
doCleanup();

View File

@@ -11,10 +11,16 @@ extern "C" {
#include <stdint.h>
#if !defined(__FreeBSD__) && !defined(__MidnightBSD__)
#if !defined(__FreeBSD__) && !defined(__MidnightBSD__) && !defined(AIX)
#include <endian.h>
#endif
#if defined(AIX)
#include <sys/machine.h>
#define __BIG_ENDIAN BIG_ENDIAN
#define __BYTE_ORDER BIG_ENDIAN
#endif
/**
* \addtogroup spa_param
* \{

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 1996, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2023, 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,7 +24,13 @@
*/
package sun.awt.windows;
import java.awt.*;
import java.awt.Adjustable;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Insets;
import java.awt.Point;
import java.awt.ScrollPane;
import java.awt.ScrollPaneAdjustable;
import java.awt.event.AdjustmentEvent;
import java.awt.peer.ScrollPanePeer;
@@ -105,7 +111,6 @@ final class WScrollPanePeer extends WPanelPeer implements ScrollPanePeer {
ScrollPane sp = (ScrollPane)target;
Dimension vs = sp.getSize();
setSpans(vs.width, vs.height, width, height);
setInsets();
}
synchronized native void setSpans(int viewWidth, int viewHeight,

View File

@@ -525,6 +525,7 @@ void AwtScrollPane::_SetSpans(void *param)
parentWidth, parentHeight, childWidth, childHeight);
s->RecalcSizes(parentWidth, parentHeight, childWidth, childHeight);
s->VerifyState();
s->SetInsets(env);
}
ret:
env->DeleteGlobalRef(self);
@@ -718,7 +719,7 @@ Java_sun_awt_windows_WScrollPanePeer_setInsets(JNIEnv *env, jobject self)
{
TRY
AwtToolkit::GetInstance().SyncCall(AwtScrollPane::_SetInsets,
AwtToolkit::GetInstance().InvokeFunction(AwtScrollPane::_SetInsets,
env->NewGlobalRef(self));
// global ref is deleted in _SetInsets()

View File

@@ -4695,7 +4695,8 @@ public class Check {
//the current label is potentially dominated by the existing (test) label, check:
boolean dominated = false;
if (label instanceof JCConstantCaseLabel) {
dominated |= !(testCaseLabel instanceof JCConstantCaseLabel);
dominated |= !(testCaseLabel instanceof JCConstantCaseLabel) &&
TreeInfo.unguardedCase(testCase);
} else if (label instanceof JCPatternCaseLabel patternCL &&
testCaseLabel instanceof JCPatternCaseLabel testPatternCaseLabel &&
TreeInfo.unguardedCase(testCase)) {

View File

@@ -3501,9 +3501,7 @@ public class Flow {
}
return new RecordPattern(record.type, componentTypes, nestedDescriptions);
} else if (pattern instanceof JCAnyPattern) {
Type type = types.isSubtype(selectorType, syms.objectType)
? selectorType : syms.objectType;
return new BindingPattern(type);
return new BindingPattern(selectorType);
} else {
throw Assert.error();
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2023, 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
@@ -1288,7 +1288,10 @@ public class JavaCompiler {
options.isSet(PROCESSOR_PATH) ||
options.isSet(PROCESSOR_MODULE_PATH) ||
options.isSet(PROC, "only") ||
options.isSet(PROC, "full") ||
options.isSet(A) ||
options.isSet(XPRINT);
// Skipping -XprintRounds and -XprintProcessorInfo
}
public void setDeferredDiagnosticHandler(Log.DeferredDiagnosticHandler deferredDiagnosticHandler) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2006, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2006, 2023, 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
@@ -83,6 +83,11 @@ import static com.sun.tools.javac.main.Option.OptionKind.*;
* {@code handleOption} then calls {@link #process process} providing a suitable
* {@link OptionHelper} to provide access the compiler state.
*
*
* <p>Maintenance note: when adding new annotation processing related
* options, the list of options regarded as requesting explicit
* annotation processing in JavaCompiler should be updated.
*
* <p><b>This is NOT part of any supported API.
* If you write code that depends on this, you do so at your own
* risk. This code and its internal interfaces are subject to change

View File

@@ -3995,6 +3995,7 @@ public class JavacParser implements Parser {
}
if (isTopLevelMethodOrField) {
checkSourceLevel(token.pos, Feature.UNNAMED_CLASSES);
defs.appendList(topLevelMethodOrFieldDeclaration(mods));
isUnnamedClass = true;
} else {
@@ -4025,8 +4026,6 @@ public class JavacParser implements Parser {
// Restructure top level to be an unnamed class.
private List<JCTree> constructUnnamedClass(List<JCTree> origDefs) {
checkSourceLevel(Feature.UNNAMED_CLASSES);
ListBuffer<JCTree> topDefs = new ListBuffer<>();
ListBuffer<JCTree> defs = new ListBuffer<>();

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 1999, 2022, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 1999, 2023, 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
@@ -136,6 +136,9 @@ compiler.err.annotation.value.not.allowable.type=Annotationswert hat keinen zul\
compiler.err.expression.not.allowable.as.annotation.value=Ausdruck ist als Annotationswert nicht zul\u00E4ssig
# 0: type, 1: name
compiler.err.annotation.unrecognized.attribute.name=Annotation @{0} weist das unbekannte Attribut "{1}" auf
compiler.err.anon.class.impl.intf.no.args=Anonyme Klasse implementiert Schnittstelle. Argumente sind nicht m\u00F6glich
compiler.err.anon.class.impl.intf.no.typeargs=Anonyme Klasse implementiert Schnittstelle. Typargumente sind nicht m\u00F6glich
@@ -186,6 +189,9 @@ compiler.err.switch.expression.no.result.expressions=Switch-Ausdruck enth\u00E4l
# 0: name
compiler.err.call.must.be.first.stmt.in.ctor=Aufruf von {0} muss die erste Anweisung im Konstruktor sein
# 0: symbol kind, 1: name, 2: symbol kind, 3: type, 4: message segment
compiler.err.cant.apply.symbol.noargs={0} {1} in {2} {3} kann nicht auf die angegebenen Typen angewendet werden.\nGrund: {4}
# 0: symbol kind, 1: name, 2: list of type or message segment, 3: list of type or message segment, 4: symbol kind, 5: type, 6: message segment
compiler.err.cant.apply.symbol={0} {1} in {4} {5} kann nicht auf die angegebenen Typen angewendet werden.\nErforderlich: {2}\nErmittelt: {3}\nGrund: {6}
@@ -195,6 +201,9 @@ compiler.err.cant.apply.symbols={0} f\u00FCr {1}({2}) nicht geeignet
# 0: symbol kind, 1: name, 2: list of type or message segment, 3: list of type or message segment, 4: symbol kind, 5: type, 6: message segment
compiler.misc.cant.apply.symbol={0} {1} in {4} {5} kann nicht auf die angegebenen Typen angewendet werden\nErforderlich: {2}\nErmittelt: {3}\nGrund: {6}
# 0: list of type or message segment, 1: list of type or message segment, 2: message segment
compiler.misc.cant.apply.array.ctor=Array kann nicht aus angegebenen Typen erstellt werden\nErforderlich: {0}\nErmittelt: {1}\nGrund: {2}
# 0: symbol kind, 1: name, 2: list of type
compiler.misc.cant.apply.symbols={0} f\u00FCr {1}({2}) nicht geeignet
@@ -247,8 +256,8 @@ compiler.misc.invalid.mref=Ung\u00FCltige {0}-Referenz\n{1}
compiler.misc.static.mref.with.targs=Parametrisierter Qualifier f\u00FCr statische Methodenreferenz
# 0: symbol
compiler.err.cant.assign.val.to.final.var=Der finalen Variable {0} kann kein Wert zugewiesen werden
# 0: set of flag or string, 1: symbol
compiler.err.cant.assign.val.to.var=Der {0}-Variablen {1} kann kein Wert zugewiesen werden
compiler.err.cant.assign.val.to.this=Zuweisen zu "this" nicht m\u00F6glich
@@ -294,6 +303,8 @@ compiler.err.class.not.allowed=Klassen-, Schnittstellen- oder Enum-Deklaration h
compiler.err.const.expr.req=Konstantenausdruck erforderlich
compiler.err.pattern.or.enum.req=Muster oder Enum-Konstante erforderlich
compiler.err.cont.outside.loop=Fortsetzung au\u00DFerhalb Schleife
# 0: symbol or type
@@ -367,6 +378,13 @@ compiler.err.invalid.repeatable.annotation.not.applicable.in.context=Container {
# 0: name
compiler.err.duplicate.class=Doppelte Klasse: {0}
# 0: string
compiler.err.bad.file.name=Ung\u00FCltiger Dateiname: {0}
compiler.err.unnamed.class.should.not.have.package.declaration=Unbenannte Klasse darf keine Packagedeklaration aufweisen
compiler.err.unnamed.class.does.not.have.main.method=Unbenannte Klasse weist keine Hauptmethode im Format "void main()" oder "void main(String[] args)" auf
# 0: name, 1: name
compiler.err.same.binary.name=Klassen {0} und {1} haben denselben bin\u00E4ren Namen
@@ -380,8 +398,13 @@ compiler.err.duplicate.unconditional.pattern=Doppeltes nicht bedingtes Muster
compiler.err.unconditional.pattern.and.default=Switch umfasst sowohl ein nicht bedingtes Muster als auch ein Standardlabel
compiler.err.guard.not.allowed=Guards sind nur f\u00FCr CASE-Anweisungen mit einem Muster zul\u00E4ssig
compiler.err.guard.has.constant.expression.false=Dieses CASE-Label hat einen Guard, der ein konstanter Ausdruck mit dem Wert ''false'' ist
# 0: symbol
compiler.err.cannot.assign.not.declared.guard=Zuweisen zu {0} nicht m\u00F6glich, da das Element nicht im Guard deklariert wurde
# 0: type, 1: type
compiler.err.constant.label.not.compatible=Konstantes Label des Typs {0} ist nicht mit Switch-Selektortyp {1} kompatibel
@@ -408,6 +431,8 @@ compiler.err.enum.cant.be.instantiated=Enum-Klassen d\u00FCrfen nicht instanziie
compiler.err.enum.label.must.be.unqualified.enum=Das CASE-Label eines Enum-Switches muss der unqualifizierte Name einer Enumerationskonstante sein
compiler.err.enum.label.must.be.enum.constant=Das CASE-Label einer Enum-Switch-Konstanten muss eine Enumerationskonstante sein
compiler.err.enum.no.subclassing=Klassen k\u00F6nnen java.lang.Enum nicht direkt erweitern
compiler.err.enum.types.not.extensible=Enum-Klassen sind nicht erweiterbar
@@ -442,9 +467,6 @@ compiler.err.finally.without.try="finally" ohne "try"
# 0: type, 1: message segment
compiler.err.foreach.not.applicable.to.type=for-each nicht auf Ausdruckstyp anwendbar\nErforderlich: {1}\nErmittelt: {0}
# 0: type, 1: type
compiler.err.foreach.not.exhaustive.on.type=Muster {0} ist nicht vollst\u00E4ndig auf {1}
compiler.err.fp.number.too.large=Gleitkommazahl zu gro\u00DF
compiler.err.fp.number.too.small=Gleitkommazahl zu klein
@@ -477,6 +499,10 @@ compiler.err.not.in.profile={0} ist in Profil "{1}" nicht verf\u00FCgbar
# 0: symbol
compiler.warn.forward.ref=Referenz zu Variable "{0}", bevor sie initialisiert wurde
compiler.warn.possible.this.escape=M\u00F6gliches "this"-Escape vor vollst\u00E4ndiger Initialisierung der Unterklasse
compiler.warn.possible.this.escape.location=Vorheriges m\u00F6gliches "This"-Escape erfolgt hier per Aufruf
compiler.err.illegal.self.ref=Selbstreferenz in Initializer
# 0: symbol
@@ -927,6 +953,18 @@ compiler.err.unclosed.str.lit=Nicht geschlossenes Zeichenfolgenliteral
compiler.err.unclosed.text.block=Nicht geschlossener Textblock
compiler.err.string.template.is.not.well.formed=Zeichenfolgenvorlage ist nicht wohlgeformt
compiler.err.text.block.template.is.not.well.formed=Textblockvorlage ist nicht wohlgeformt
compiler.err.processor.missing.from.string.template.expression=Prozessor fehlt in Zeichenfolgenvorlagen-Ausdruck
# 0: symbol
compiler.err.processor.type.cannot.be.a.raw.type=Prozessortyp kann kein Raw-Typ sein: {0}
# 0: symbol
compiler.err.not.a.processor.type=Kein Prozessortyp: {0}
# 0: string
compiler.err.unsupported.encoding=Nicht unterst\u00FCtzte Codierung: {0}
@@ -1039,9 +1077,6 @@ compiler.misc.varargs.trustme.on.reifiable.varargs=Varargs-Elementtyp {0} ist re
# 0: type, 1: type
compiler.err.instanceof.reifiable.not.safe={0} kann nicht sicher in {1} konvertiert werden
# 0: type, 1: type
compiler.err.instanceof.pattern.no.subtype=Ausdruckstyp {0} ist ein Subtyp des Mustertyps {1}
# 0: symbol
compiler.misc.varargs.trustme.on.non.varargs.meth=Methode {0} ist keine varargs-Methode.
@@ -1143,6 +1178,9 @@ compiler.misc.x.print.rounds=Runde {0}:\n\tEingabedateien: {1}\n\tAnnotationen:
# 0: file name
compiler.warn.file.from.future=\u00C4nderungsdatum liegt in der Zukunft f\u00FCr Datei {0}
# 0: path
compiler.warn.output.file.clash=Ausgabedatei mehrmals geschrieben: {0}
#####
## The following string will appear before all messages keyed as:
@@ -1449,6 +1487,9 @@ compiler.warn.position.overflow=Positionscodierungs\u00FCberlauf bei Zeile {0}
# 0: file name, 1: number, 2: number
compiler.warn.big.major.version={0}: Hauptversion {1} ist neuer als {2}, die h\u00F6chste Hauptversion, die von diesem Compiler unterst\u00FCtzt wird.\nEs wird empfohlen, dass Sie den Compiler upgraden.
# 0: file name, 1: fragment
compiler.warn.invalid.utf8.in.classfile={0}: Klassendatei enth\u00E4lt ung\u00FCltige UTF-8-Codierung: {1}
# 0: kind name, 1: symbol
compiler.warn.static.not.qualified.by.type=Statische {0} muss mit Typname {1} anstelle eines Ausdrucks qualifiziert werden
@@ -1679,6 +1720,10 @@ compiler.err.enum.constant.expected=Hier wird eine Enum-Konstante erwartet
compiler.err.enum.constant.not.expected=Hier wird keine Enum-Konstante erwartet
compiler.err.extraneous.semicolon=\u00DCberfl\u00FCssiges Semikolon
compiler.warn.extraneous.semicolon=\u00DCberfl\u00FCssiges Semikolon
## The following are related in form, but do not easily fit the above paradigm.
compiler.err.expected.module.or.open="module" oder "open" erwartet
@@ -1738,8 +1783,14 @@ compiler.misc.bad.const.pool.tag=Ung\u00FCltiges Konstantenpooltag: {0}
compiler.misc.bad.const.pool.tag.at=Ung\u00FCltiges Konstantenpooltag {0} bei {1}
# 0: number
compiler.misc.bad.utf8.byte.sequence.at=Ung\u00FCltige UTF-8-Bytesequenz bei {0}
compiler.misc.unexpected.const.pool.tag.at=Unerwartetes Konstantenpooltag {0} bei {1}
# 0: number
compiler.misc.bad.class.truncated.at.offset=Klassendatei abgeschnitten bei Offset {0}
compiler.misc.bad.signature=Ung\u00FCltige Signatur: {0}
compiler.misc.bad.type.annotation.value=Ung\u00FCltiger Typ f\u00FCr Annotationszielwert: {0}
@@ -1796,6 +1847,8 @@ compiler.misc.malformed.vararg.method=Klassendatei enth\u00E4lt nicht wohlgeform
compiler.misc.wrong.version=Klassendatei hat die falsche Version {0}.{1}. Sie muss {2}.{3} lauten
compiler.misc.illegal.flag.combo=Klassendatei enth\u00E4lt unzul\u00E4ssige Kennzeichenkombination {0} f\u00FCr {1} {2}
#####
# 0: type, 1: type or symbol
@@ -2187,6 +2240,8 @@ compiler.misc.feature.reifiable.types.instanceof=Reifizierbare Typen in instance
compiler.misc.feature.deconstruction.patterns=Dekonstruktionsmuster
compiler.misc.feature.unnamed.variables=Unbenannte Variablen
compiler.misc.feature.records=Datens\u00E4tze
compiler.misc.feature.sealed.classes=Verschl\u00FCsselte Klassen
@@ -2195,13 +2250,19 @@ compiler.misc.feature.case.null=Null in Switch Cases
compiler.misc.feature.pattern.switch=Muster in Switch-Anweisungen
compiler.misc.feature.string.templates=Zeichenfolgenvorlagen
compiler.misc.feature.unconditional.patterns.in.instanceof=Nicht bedingte Muster in instanceof
compiler.misc.feature.unnamed.classes=Unbenannte Klassen
compiler.warn.underscore.as.identifier=Ab Release 9 ist "_" ein Schl\u00FCsselwort und kann nicht als ID verwendet werden
compiler.err.underscore.as.identifier=Ab Release 9 ist "_" ein Schl\u00FCsselwort und kann nicht als ID verwendet werden
compiler.err.underscore.as.identifier.in.lambda="_" als ID verwendet\n("_" darf nicht als ID f\u00FCr Lambda-Parameter verwendet werden)
compiler.err.use.of.underscore.not.allowed=Ab Release 21 ist nur das Unterstrichschl\u00FCsselwort "_" zul\u00E4ssig, um\nunbenannte Muster, lokale Variablen, Ausnahmeparameter oder Lambda-Parameter zu deklarieren
compiler.err.use.of.underscore.not.allowed.with.brackets=Auf das Unterstrichschl\u00FCsselwort "_" d\u00FCrfen keine Klammern folgen
compiler.err.enum.as.identifier=Ab Release 5 ist "enum" ein Schl\u00FCsselwort und kann nicht als ID verwendet werden
@@ -2693,6 +2754,8 @@ compiler.err.instance.initializer.not.allowed.in.records=Instanz-Initializer in
compiler.err.static.declaration.not.allowed.in.inner.classes=Statische Deklarationen in inneren Klassen nicht zul\u00E4ssig
compiler.err.record.patterns.annotations.not.allowed=Annotationen in Datensatzmustern nicht zul\u00E4ssig
############################################
# messages previously at javac.properties
@@ -2787,6 +2850,8 @@ compiler.err.preview.without.source.or.release=--enable-preview muss mit -source
# 0: symbol
compiler.err.deconstruction.pattern.only.records=Dekonstruktionsmuster k\u00F6nnen nur auf Datens\u00E4tze angewendet werden. {0} ist kein Datensatz
compiler.err.deconstruction.pattern.var.not.allowed=Dekonstruktionsmuster k\u00F6nnen nur auf Datens\u00E4tze angewendet werden, "var" ist nicht zul\u00E4ssig
# 0: list of type, 1: list of type
compiler.err.incorrect.number.of.nested.patterns=Falsche Anzahl verschachtelter Muster\nErforderlich: {0}\nGefunden: {1}

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 1999, 2022, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 1999, 2023, 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
@@ -136,6 +136,9 @@ compiler.err.annotation.value.not.allowable.type=\u4F7F\u7528\u3067\u304D\u306A\
compiler.err.expression.not.allowable.as.annotation.value=\u5F0F\u304C\u6CE8\u91C8\u306E\u5024\u3068\u3057\u3066\u8A31\u53EF\u3055\u308C\u307E\u305B\u3093
# 0: type, 1: name
compiler.err.annotation.unrecognized.attribute.name=\u6CE8\u91C8@{0}\u306B''{1}''\u3068\u3044\u3046\u540D\u524D\u306E\u4E0D\u660E\u306A\u5C5E\u6027\u304C\u3042\u308A\u307E\u3059
compiler.err.anon.class.impl.intf.no.args=\u540D\u524D\u306E\u306A\u3044\u30AF\u30E9\u30B9\u304C\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u3092\u5B9F\u88C5\u3057\u3066\u3044\u307E\u3059\u3002\u5F15\u6570\u3092\u6301\u3064\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093
compiler.err.anon.class.impl.intf.no.typeargs=\u540D\u524D\u306E\u306A\u3044\u30AF\u30E9\u30B9\u304C\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u3092\u5B9F\u88C5\u3057\u3066\u3044\u307E\u3059\u3002\u578B\u5F15\u6570\u3092\u6301\u3064\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093
@@ -186,6 +189,9 @@ compiler.err.switch.expression.no.result.expressions=switch\u5F0F\u306B\u7D50\u6
# 0: name
compiler.err.call.must.be.first.stmt.in.ctor={0}\u306E\u547C\u51FA\u3057\u306F\u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\u30BF\u306E\u5148\u982D\u6587\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059
# 0: symbol kind, 1: name, 2: symbol kind, 3: type, 4: message segment
compiler.err.cant.apply.symbol.noargs={2} {3}\u306E{0} {1}\u306F\u6307\u5B9A\u3055\u308C\u305F\u578B\u306B\u9069\u7528\u3067\u304D\u307E\u305B\u3093\u3002\n\u7406\u7531: {4}
# 0: symbol kind, 1: name, 2: list of type or message segment, 3: list of type or message segment, 4: symbol kind, 5: type, 6: message segment
compiler.err.cant.apply.symbol={4} {5}\u306E{0} {1}\u306F\u6307\u5B9A\u3055\u308C\u305F\u578B\u306B\u9069\u7528\u3067\u304D\u307E\u305B\u3093\u3002\n\u671F\u5F85\u5024: {2}\n\u691C\u51FA\u5024: {3}\n\u7406\u7531: {6}
@@ -195,6 +201,9 @@ compiler.err.cant.apply.symbols={1}\u306B\u9069\u5207\u306A{0}\u304C\u898B\u3064
# 0: symbol kind, 1: name, 2: list of type or message segment, 3: list of type or message segment, 4: symbol kind, 5: type, 6: message segment
compiler.misc.cant.apply.symbol={4} {5}\u306E{0} {1}\u306F\u6307\u5B9A\u3055\u308C\u305F\u578B\u306B\u9069\u7528\u3067\u304D\u307E\u305B\u3093\n\u671F\u5F85\u5024: {2}\n\u691C\u51FA\u5024: {3}\n\u7406\u7531: {6}
# 0: list of type or message segment, 1: list of type or message segment, 2: message segment
compiler.misc.cant.apply.array.ctor=\u6307\u5B9A\u3055\u308C\u305F\u578B\u304B\u3089\u914D\u5217\u3092\u4F5C\u6210\u3067\u304D\u307E\u305B\u3093\n\u671F\u5F85\u5024: {0}\n\u691C\u51FA\u5024: {1}\n\u7406\u7531: {2}
# 0: symbol kind, 1: name, 2: list of type
compiler.misc.cant.apply.symbols={1}\u306B\u9069\u5207\u306A{0}\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093({2})
@@ -247,8 +256,8 @@ compiler.misc.invalid.mref={0}\u53C2\u7167\u304C\u7121\u52B9\u3067\u3059\n{1}
compiler.misc.static.mref.with.targs=static\u30E1\u30BD\u30C3\u30C9\u53C2\u7167\u306E\u30D1\u30E9\u30E1\u30FC\u30BF\u5316\u3055\u308C\u305F\u4FEE\u98FE\u5B50
# 0: symbol
compiler.err.cant.assign.val.to.final.var=final\u5909\u6570{0}\u306B\u5024\u3092\u4EE3\u5165\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093
# 0: set of flag or string, 1: symbol
compiler.err.cant.assign.val.to.var={0}\u5909\u6570{1}\u306B\u5024\u3092\u5272\u308A\u5F53\u3066\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093
compiler.err.cant.assign.val.to.this=''\u3053\u308C''\u306B\u5272\u308A\u5F53\u3066\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093
@@ -294,6 +303,8 @@ compiler.err.class.not.allowed=\u30AF\u30E9\u30B9\u3001\u30A4\u30F3\u30BF\u30D5\
compiler.err.const.expr.req=\u5B9A\u6570\u5F0F\u304C\u5FC5\u8981\u3067\u3059
compiler.err.pattern.or.enum.req=\u30D1\u30BF\u30FC\u30F3\u307E\u305F\u306F\u5217\u6319\u578B\u306E\u5B9A\u6570\u304C\u5FC5\u8981\u3067\u3059
compiler.err.cont.outside.loop=continue\u304C\u30EB\u30FC\u30D7\u306E\u5916\u306B\u3042\u308A\u307E\u3059
# 0: symbol or type
@@ -367,6 +378,13 @@ compiler.err.invalid.repeatable.annotation.not.applicable.in.context=\u30B3\u30F
# 0: name
compiler.err.duplicate.class=\u30AF\u30E9\u30B9{0}\u304C\u91CD\u8907\u3057\u3066\u3044\u307E\u3059
# 0: string
compiler.err.bad.file.name=\u4E0D\u6B63\u306A\u30D5\u30A1\u30A4\u30EB\u540D: {0}
compiler.err.unnamed.class.should.not.have.package.declaration=\u7121\u540D\u30AF\u30E9\u30B9\u306B\u30D1\u30C3\u30B1\u30FC\u30B8\u5BA3\u8A00\u3092\u542B\u3081\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093
compiler.err.unnamed.class.does.not.have.main.method=\u7121\u540D\u30AF\u30E9\u30B9\u306Bvoid main()\u307E\u305F\u306Fvoid main(String[] args)\u3068\u3044\u3046\u5F62\u5F0F\u306Emain\u30E1\u30BD\u30C3\u30C9\u304C\u3042\u308A\u307E\u305B\u3093
# 0: name, 1: name
compiler.err.same.binary.name=\u30AF\u30E9\u30B9: {0}\u3068{1}\u306E\u30D0\u30A4\u30CA\u30EA\u540D\u304C\u540C\u3058\u3067\u3059
@@ -380,8 +398,13 @@ compiler.err.duplicate.unconditional.pattern=\u7121\u6761\u4EF6\u30D1\u30BF\u30F
compiler.err.unconditional.pattern.and.default=switch\u306B\u7121\u6761\u4EF6\u30D1\u30BF\u30FC\u30F3\u3068default\u30E9\u30D9\u30EB\u306E\u4E21\u65B9\u304C\u3042\u308A\u307E\u3059
compiler.err.guard.not.allowed=\u30AC\u30FC\u30C9\u306F\u30D1\u30BF\u30FC\u30F3\u306E\u3042\u308Bcase\u3067\u306E\u307F\u8A31\u53EF\u3055\u308C\u307E\u3059
compiler.err.guard.has.constant.expression.false=\u3053\u306Ecase\u30E9\u30D9\u30EB\u306B\u306F\u3001\u5024\u304C''false''\u306E\u5B9A\u6570\u5F0F\u3067\u3042\u308B\u30AC\u30FC\u30C9\u304C\u3042\u308A\u307E\u3059
# 0: symbol
compiler.err.cannot.assign.not.declared.guard=\u30AC\u30FC\u30C9\u5185\u3067\u5BA3\u8A00\u3055\u308C\u3066\u3044\u306A\u3044\u305F\u3081\u3001{0}\u306B\u5272\u308A\u5F53\u3066\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093
# 0: type, 1: type
compiler.err.constant.label.not.compatible=\u30BF\u30A4\u30D7{0}\u306E\u5B9A\u6570\u30E9\u30D9\u30EB\u304Cswitch\u30BB\u30EC\u30AF\u30BF\u30FB\u30BF\u30A4\u30D7{1}\u3068\u4E92\u63DB\u6027\u304C\u3042\u308A\u307E\u305B\u3093
@@ -408,6 +431,8 @@ compiler.err.enum.cant.be.instantiated=\u5217\u6319\u30AF\u30E9\u30B9\u306F\u30A
compiler.err.enum.label.must.be.unqualified.enum=\u5217\u6319\u578B\u306Eswitch case\u30E9\u30D9\u30EB\u306F\u5217\u6319\u578B\u5B9A\u6570\u306E\u975E\u4FEE\u98FE\u540D\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059
compiler.err.enum.label.must.be.enum.constant=\u5217\u6319\u578B\u306Eswitch constant case\u30E9\u30D9\u30EB\u306F\u5217\u6319\u578B\u5B9A\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059
compiler.err.enum.no.subclassing=\u30AF\u30E9\u30B9\u306F\u76F4\u63A5java.lang.Enum\u3092\u62E1\u5F35\u3067\u304D\u307E\u305B\u3093
compiler.err.enum.types.not.extensible=\u5217\u6319\u30AF\u30E9\u30B9\u306F\u62E1\u5F35\u53EF\u80FD\u3067\u306F\u3042\u308A\u307E\u305B\u3093
@@ -442,9 +467,6 @@ compiler.err.finally.without.try=''finally''\u3078\u306E''try''\u304C\u3042\u308
# 0: type, 1: message segment
compiler.err.foreach.not.applicable.to.type=for-each\u306F\u5F0F\u306E\u30BF\u30A4\u30D7\u306B\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093\n\u671F\u5F85\u5024: {1}\n\u691C\u51FA\u5024: {0}
# 0: type, 1: type
compiler.err.foreach.not.exhaustive.on.type=\u30D1\u30BF\u30FC\u30F3{0}\u306F{1}\u306B\u95A2\u3057\u3066\u5B8C\u5168\u3067\u306F\u3042\u308A\u307E\u305B\u3093
compiler.err.fp.number.too.large=\u6D6E\u52D5\u5C0F\u6570\u70B9\u6570\u304C\u5927\u304D\u3059\u304E\u307E\u3059
compiler.err.fp.number.too.small=\u6D6E\u52D5\u5C0F\u6570\u70B9\u6570\u304C\u5C0F\u3055\u3059\u304E\u307E\u3059
@@ -477,6 +499,10 @@ compiler.err.not.in.profile={0}\u306F\u30D7\u30ED\u30D5\u30A1\u30A4\u30EB''{1}''
# 0: symbol
compiler.warn.forward.ref=\u521D\u671F\u5316\u3055\u308C\u308B\u524D\u306E\u5909\u6570''{0}''\u3092\u53C2\u7167\u3057\u3088\u3046\u3068\u3057\u307E\u3057\u305F
compiler.warn.possible.this.escape=\u30B5\u30D6\u30AF\u30E9\u30B9\u304C\u521D\u671F\u5316\u3055\u308C\u308B\u524D\u306E''this''\u30A8\u30B9\u30B1\u30FC\u30D7\u306E\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059
compiler.warn.possible.this.escape.location=\u4E8B\u524D\u306E''this''\u30A8\u30B9\u30B1\u30FC\u30D7\u306F\u3053\u306E\u547C\u3073\u51FA\u3057\u3067\u51FA\u73FE\u3057\u307E\u3059
compiler.err.illegal.self.ref=\u521D\u671F\u5316\u5B50\u5185\u306E\u81EA\u5DF1\u53C2\u7167
# 0: symbol
@@ -927,6 +953,18 @@ compiler.err.unclosed.str.lit=\u6587\u5B57\u5217\u30EA\u30C6\u30E9\u30EB\u304C\u
compiler.err.unclosed.text.block=\u9589\u3058\u3089\u308C\u3066\u3044\u306A\u3044\u30C6\u30AD\u30B9\u30C8\u30FB\u30D6\u30ED\u30C3\u30AF
compiler.err.string.template.is.not.well.formed=\u6587\u5B57\u5217\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u304C\u9069\u683C\u3067\u306F\u3042\u308A\u307E\u305B\u3093
compiler.err.text.block.template.is.not.well.formed=\u30C6\u30AD\u30B9\u30C8\u30FB\u30D6\u30ED\u30C3\u30AF\u30FB\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u304C\u9069\u683C\u3067\u306F\u3042\u308A\u307E\u305B\u3093
compiler.err.processor.missing.from.string.template.expression=\u30D7\u30ED\u30BB\u30C3\u30B5\u304C\u6587\u5B57\u5217\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u5F0F\u306B\u3042\u308A\u307E\u305B\u3093
# 0: symbol
compiler.err.processor.type.cannot.be.a.raw.type=\u30D7\u30ED\u30BB\u30C3\u30B5\u30FB\u30BF\u30A4\u30D7\u306Fraw\u578B\u306B\u3067\u304D\u307E\u305B\u3093: {0}
# 0: symbol
compiler.err.not.a.processor.type=\u30D7\u30ED\u30BB\u30C3\u30B5\u30FB\u30BF\u30A4\u30D7\u3067\u306F\u3042\u308A\u307E\u305B\u3093: {0}
# 0: string
compiler.err.unsupported.encoding=\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u306A\u3044\u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0\u3067\u3059: {0}
@@ -1039,9 +1077,6 @@ compiler.misc.varargs.trustme.on.reifiable.varargs=\u53EF\u5909\u5F15\u6570\u898
# 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: type, 1: type
compiler.err.instanceof.pattern.no.subtype=\u5F0F\u30BF\u30A4\u30D7{0}\u306F\u30D1\u30BF\u30FC\u30F3\u30FB\u30BF\u30A4\u30D7{1}\u306E\u30B5\u30D6\u30BF\u30A4\u30D7\u3067\u3059
# 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
@@ -1143,6 +1178,9 @@ compiler.misc.x.print.rounds=\u5F80\u5FA9{0}:\n\t\u5165\u529B\u30D5\u30A1\u30A4\
# 0: file name
compiler.warn.file.from.future=\u30D5\u30A1\u30A4\u30EB{0}\u306E\u5909\u66F4\u65E5\u304C\u5C06\u6765\u306E\u65E5\u4ED8\u3067\u3059
# 0: path
compiler.warn.output.file.clash=\u51FA\u529B\u30D5\u30A1\u30A4\u30EB\u3078\u306E\u66F8\u8FBC\u307F\u304C\u8907\u6570\u56DE\u3042\u308A\u307E\u3057\u305F: {0}
#####
## The following string will appear before all messages keyed as:
@@ -1449,6 +1487,9 @@ compiler.warn.position.overflow=\u4F4D\u7F6E\u30A8\u30F3\u30B3\u30FC\u30C7\u30A3
# 0: file name, 1: number, 2: number
compiler.warn.big.major.version={0}: \u30E1\u30B8\u30E3\u30FC\u30FB\u30D0\u30FC\u30B8\u30E7\u30F3{1}\u306F\u3001\u3053\u306E\u30B3\u30F3\u30D1\u30A4\u30E9\u3067\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u308B\u6700\u65B0\u306E\u30E1\u30B8\u30E3\u30FC\u30FB\u30D0\u30FC\u30B8\u30E7\u30F3{2}\u3088\u308A\u65B0\u3057\u3044\u3067\u3059\u3002\n\u30B3\u30F3\u30D1\u30A4\u30E9\u306E\u30A2\u30C3\u30D7\u30B0\u30EC\u30FC\u30C9\u3092\u304A\u85A6\u3081\u3057\u307E\u3059\u3002
# 0: file name, 1: fragment
compiler.warn.invalid.utf8.in.classfile={0}: \u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u306B\u7121\u52B9\u306AUTF-8\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u3059: {1}
# 0: kind name, 1: symbol
compiler.warn.static.not.qualified.by.type=static {0}\u306F\u5F0F\u3067\u306F\u306A\u304F\u578B\u540D{1}\u3067\u4FEE\u98FE\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059
@@ -1679,6 +1720,10 @@ compiler.err.enum.constant.expected=\u3053\u3053\u306B\u5217\u6319\u578B\u5B9A\u
compiler.err.enum.constant.not.expected=\u3053\u3053\u306B\u5217\u6319\u578B\u5B9A\u6570\u306F\u5FC5\u8981\u3042\u308A\u307E\u305B\u3093
compiler.err.extraneous.semicolon=\u4F59\u5206\u306A\u30BB\u30DF\u30B3\u30ED\u30F3
compiler.warn.extraneous.semicolon=\u4F59\u5206\u306A\u30BB\u30DF\u30B3\u30ED\u30F3
## The following are related in form, but do not easily fit the above paradigm.
compiler.err.expected.module.or.open=''\u30E2\u30B8\u30E5\u30FC\u30EB''\u307E\u305F\u306F''\u30AA\u30FC\u30D7\u30F3''\u304C\u5FC5\u8981\u3067\u3059
@@ -1738,8 +1783,14 @@ compiler.misc.bad.const.pool.tag=\u5B9A\u6570\u30D7\u30FC\u30EB\u30FB\u30BF\u30B
compiler.misc.bad.const.pool.tag.at=\u5B9A\u6570\u30D7\u30FC\u30EB\u30FB\u30BF\u30B0{1}\u3067\u306E{0}\u304C\u4E0D\u6B63\u3067\u3059
# 0: number
compiler.misc.bad.utf8.byte.sequence.at={0}\u3067\u306EUTF-8\u30D0\u30A4\u30C8\u30FB\u30B7\u30FC\u30B1\u30F3\u30B9\u304C\u4E0D\u6B63\u3067\u3059
compiler.misc.unexpected.const.pool.tag.at=\u4E88\u671F\u3057\u306A\u3044\u5B9A\u6570\u30D7\u30FC\u30EB\u30FB\u30BF\u30B0: {0}\u304C{1}\u306B\u3042\u308A\u307E\u3059
# 0: number
compiler.misc.bad.class.truncated.at.offset=\u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u304C\u30AA\u30D5\u30BB\u30C3\u30C8{0}\u3067\u5207\u308A\u6368\u3066\u3089\u308C\u307E\u3057\u305F
compiler.misc.bad.signature=\u30B7\u30B0\u30CB\u30C1\u30E3{0}\u304C\u4E0D\u6B63\u3067\u3059
compiler.misc.bad.type.annotation.value=\u6CE8\u91C8\u30BF\u30FC\u30B2\u30C3\u30C8\u578B\u306E\u5024\u306E\u578B\u304C\u4E0D\u6B63\u3067\u3059: {0}
@@ -1796,6 +1847,8 @@ compiler.misc.malformed.vararg.method=\u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4
compiler.misc.wrong.version=\u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u306E\u30D0\u30FC\u30B8\u30E7\u30F3{0}.{1}\u306F\u4E0D\u6B63\u3067\u3059\u3002{2}.{3}\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059
compiler.misc.illegal.flag.combo=\u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u306B{1} {2}\u306E\u4E0D\u6B63\u306A\u30D5\u30E9\u30B0\u306E\u7D44\u5408\u305B{0}\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u3059
#####
# 0: type, 1: type or symbol
@@ -2187,6 +2240,8 @@ compiler.misc.feature.reifiable.types.instanceof=instanceof\u3067\u306Ereifiable
compiler.misc.feature.deconstruction.patterns=\u30C7\u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\u30B7\u30E7\u30F3\u30FB\u30D1\u30BF\u30FC\u30F3
compiler.misc.feature.unnamed.variables=\u7121\u540D\u5909\u6570
compiler.misc.feature.records=\u30EC\u30B3\u30FC\u30C9
compiler.misc.feature.sealed.classes=\u30B7\u30FC\u30EB\u30FB\u30AF\u30E9\u30B9
@@ -2195,13 +2250,19 @@ compiler.misc.feature.case.null=switch case\u306Enull
compiler.misc.feature.pattern.switch=switch\u6587\u306E\u30D1\u30BF\u30FC\u30F3
compiler.misc.feature.string.templates=\u6587\u5B57\u5217\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8
compiler.misc.feature.unconditional.patterns.in.instanceof=instanceof\u3067\u306E\u7121\u6761\u4EF6\u30D1\u30BF\u30FC\u30F3
compiler.misc.feature.unnamed.classes=\u7121\u540D\u30AF\u30E9\u30B9
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
compiler.err.underscore.as.identifier.in.lambda=''_''\u304C\u8B58\u5225\u5B50\u3068\u3057\u3066\u4F7F\u7528\u3055\u308C\u3066\u3044\u307E\u3059\n(\u30E9\u30E0\u30C0\u30FB\u30D1\u30E9\u30E1\u30FC\u30BF\u3067\u306F''_''\u3092\u8B58\u5225\u5B50\u3068\u3057\u3066\u4F7F\u7528\u3059\u308B\u3053\u3068\u306F\u7981\u6B62\u3055\u308C\u3066\u3044\u307E\u3059)
compiler.err.use.of.underscore.not.allowed=\u30EA\u30EA\u30FC\u30B921\u304B\u3089\u3001\u30A2\u30F3\u30C0\u30FC\u30B9\u30B3\u30A2\u30FB\u30AD\u30FC\u30EF\u30FC\u30C9''_''\u306F\u3001\n\u7121\u540D\u30D1\u30BF\u30FC\u30F3\u3001\u30ED\u30FC\u30AB\u30EB\u5909\u6570\u3001\u4F8B\u5916\u30D1\u30E9\u30E1\u30FC\u30BF\u307E\u305F\u306F\u30E9\u30E0\u30C0\u30FB\u30D1\u30E9\u30E1\u30FC\u30BF\u3092\u5BA3\u8A00\u3059\u308B\u5834\u5408\u306B\u306E\u307F\u8A31\u53EF\u3055\u308C\u307E\u3059
compiler.err.use.of.underscore.not.allowed.with.brackets=\u30A2\u30F3\u30C0\u30FC\u30B9\u30B3\u30A2\u30FB\u30AD\u30FC\u30EF\u30FC\u30C9''_''\u306B\u5927\u30AB\u30C3\u30B3\u3092\u7D9A\u3051\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093
compiler.err.enum.as.identifier=\u30EA\u30EA\u30FC\u30B95\u304B\u3089''enum'\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
@@ -2374,7 +2435,7 @@ compiler.err.dc.missing.semicolon=\u30BB\u30DF\u30B3\u30ED\u30F3\u304C\u3042\u30
compiler.err.dc.no.content=\u30B3\u30F3\u30C6\u30F3\u30C4\u306A\u3057
compiler.err.dc.no.tag.name='@'\u306E\u5F8C\u306B\u30BF\u30B0\u540D\u304C\u3042\u308A\u307E\u305B\u3093
compiler.err.dc.no.tag.name=''@''\u306E\u5F8C\u306B\u30BF\u30B0\u540D\u304C\u3042\u308A\u307E\u305B\u3093
compiler.err.dc.no.url=URL\u304C\u3042\u308A\u307E\u305B\u3093
@@ -2693,6 +2754,8 @@ compiler.err.instance.initializer.not.allowed.in.records=\u30A4\u30F3\u30B9\u30B
compiler.err.static.declaration.not.allowed.in.inner.classes=\u9759\u7684\u5BA3\u8A00\u306F\u5185\u90E8\u30AF\u30E9\u30B9\u3067\u306F\u8A31\u53EF\u3055\u308C\u307E\u305B\u3093
compiler.err.record.patterns.annotations.not.allowed=\u6CE8\u91C8\u306F\u30EC\u30B3\u30FC\u30C9\u30FB\u30D1\u30BF\u30FC\u30F3\u3067\u306F\u8A31\u53EF\u3055\u308C\u307E\u305B\u3093
############################################
# messages previously at javac.properties
@@ -2787,6 +2850,8 @@ compiler.err.preview.without.source.or.release=--enable-preview\u306F-source\u30
# 0: symbol
compiler.err.deconstruction.pattern.only.records=\u30C7\u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\u30B7\u30E7\u30F3\u30FB\u30D1\u30BF\u30FC\u30F3\u306F\u30EC\u30B3\u30FC\u30C9\u306B\u306E\u307F\u9069\u7528\u3067\u304D\u307E\u3059\u3002{0}\u306F\u30EC\u30B3\u30FC\u30C9\u3067\u306F\u3042\u308A\u307E\u305B\u3093
compiler.err.deconstruction.pattern.var.not.allowed=\u30C7\u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\u30B7\u30E7\u30F3\u30FB\u30D1\u30BF\u30FC\u30F3\u306F\u30EC\u30B3\u30FC\u30C9\u306B\u306E\u307F\u9069\u7528\u3067\u304D\u307E\u3059\u3002var\u306F\u8A31\u53EF\u3055\u308C\u307E\u305B\u3093
# 0: list of type, 1: list of type
compiler.err.incorrect.number.of.nested.patterns=\u30CD\u30B9\u30C8\u30FB\u30D1\u30BF\u30FC\u30F3\u306E\u6570\u304C\u6B63\u3057\u304F\u3042\u308A\u307E\u305B\u3093\n\u671F\u5F85\u5024: {0}\n\u691C\u51FA\u5024: {1}

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 1999, 2022, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 1999, 2023, 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
@@ -136,6 +136,9 @@ compiler.err.annotation.value.not.allowable.type=\u6CE8\u91CA\u503C\u4E0D\u662F\
compiler.err.expression.not.allowable.as.annotation.value=\u8868\u8FBE\u5F0F\u4E0D\u5141\u8BB8\u7528\u4F5C\u6CE8\u91CA\u503C
# 0: type, 1: name
compiler.err.annotation.unrecognized.attribute.name=\u6CE8\u91CA @{0} \u5177\u6709\u540D\u4E3A ''{1}'' \u7684\u672A\u77E5\u5C5E\u6027
compiler.err.anon.class.impl.intf.no.args=\u533F\u540D\u7C7B\u5B9E\u73B0\u63A5\u53E3; \u4E0D\u80FD\u6709\u53C2\u6570
compiler.err.anon.class.impl.intf.no.typeargs=\u533F\u540D\u7C7B\u5B9E\u73B0\u63A5\u53E3; \u4E0D\u80FD\u5177\u6709\u7C7B\u578B\u53C2\u6570
@@ -186,6 +189,9 @@ compiler.err.switch.expression.no.result.expressions=switch \u8868\u8FBE\u5F0F\u
# 0: name
compiler.err.call.must.be.first.stmt.in.ctor=\u5BF9{0}\u7684\u8C03\u7528\u5FC5\u987B\u662F\u6784\u9020\u5668\u4E2D\u7684\u7B2C\u4E00\u4E2A\u8BED\u53E5
# 0: symbol kind, 1: name, 2: symbol kind, 3: type, 4: message segment
compiler.err.cant.apply.symbol.noargs=\u65E0\u6CD5\u5C06 {2} {3} \u4E2D\u7684 {0} {1} \u5E94\u7528\u4E8E\u7ED9\u5B9A\u7C7B\u578B\uFF1B\n\u539F\u56E0\uFF1A{4}
# 0: symbol kind, 1: name, 2: list of type or message segment, 3: list of type or message segment, 4: symbol kind, 5: type, 6: message segment
compiler.err.cant.apply.symbol=\u65E0\u6CD5\u5C06{4} {5}\u4E2D\u7684{0} {1}\u5E94\u7528\u5230\u7ED9\u5B9A\u7C7B\u578B;\n\u9700\u8981: {2}\n\u627E\u5230: {3}\n\u539F\u56E0: {6}
@@ -195,6 +201,9 @@ compiler.err.cant.apply.symbols=\u5BF9\u4E8E{1}({2}), \u627E\u4E0D\u5230\u5408\u
# 0: symbol kind, 1: name, 2: list of type or message segment, 3: list of type or message segment, 4: symbol kind, 5: type, 6: message segment
compiler.misc.cant.apply.symbol=\u65E0\u6CD5\u5C06 {4} {5}\u4E2D\u7684 {0} {1}\u5E94\u7528\u5230\u7ED9\u5B9A\u7C7B\u578B\n\u9700\u8981: {2}\n\u627E\u5230: {3}\n\u539F\u56E0: {6}
# 0: list of type or message segment, 1: list of type or message segment, 2: message segment
compiler.misc.cant.apply.array.ctor=\u65E0\u6CD5\u57FA\u4E8E\u7ED9\u5B9A\u7C7B\u578B\u521B\u5EFA\u6570\u7EC4\n\u9700\u8981\uFF1A{0}\n\u627E\u5230\uFF1A{1}\n\u539F\u56E0\uFF1A{2}
# 0: symbol kind, 1: name, 2: list of type
compiler.misc.cant.apply.symbols=\u5BF9\u4E8E{1}({2}), \u627E\u4E0D\u5230\u5408\u9002\u7684{0}
@@ -247,8 +256,8 @@ compiler.misc.invalid.mref={0}\u5F15\u7528\u65E0\u6548\n{1}
compiler.misc.static.mref.with.targs=\u6709\u5173\u9759\u6001\u65B9\u6CD5\u5F15\u7528\u7684\u53C2\u6570\u5316\u9650\u5B9A\u7B26
# 0: symbol
compiler.err.cant.assign.val.to.final.var=\u65E0\u6CD5\u4E3A\u6700\u7EC8\u53D8\u91CF{0}\u5206\u914D\u503C
# 0: set of flag or string, 1: symbol
compiler.err.cant.assign.val.to.var=\u65E0\u6CD5\u4E3A {0} \u53D8\u91CF {1} \u5206\u914D\u503C
compiler.err.cant.assign.val.to.this=\u65E0\u6CD5\u5206\u914D\u7ED9 ''this''
@@ -294,6 +303,8 @@ compiler.err.class.not.allowed=\u6B64\u5904\u4E0D\u5141\u8BB8\u4F7F\u7528\u7C7B,
compiler.err.const.expr.req=\u9700\u8981\u5E38\u91CF\u8868\u8FBE\u5F0F
compiler.err.pattern.or.enum.req=\u9700\u8981\u6A21\u5F0F\u6216\u679A\u4E3E\u5E38\u91CF
compiler.err.cont.outside.loop=continue \u5728 loop \u5916\u90E8
# 0: symbol or type
@@ -367,6 +378,13 @@ compiler.err.invalid.repeatable.annotation.not.applicable.in.context=\u5BB9\u566
# 0: name
compiler.err.duplicate.class=\u7C7B\u91CD\u590D: {0}
# 0: string
compiler.err.bad.file.name=\u6587\u4EF6\u540D\u9519\u8BEF\uFF1A{0}
compiler.err.unnamed.class.should.not.have.package.declaration=\u672A\u547D\u540D\u7C7B\u4E0D\u5E94\u6709\u7A0B\u5E8F\u5305\u58F0\u660E
compiler.err.unnamed.class.does.not.have.main.method=\u672A\u547D\u540D\u7C7B\u6CA1\u6709 void main() \u6216 void main(String[] args) \u5F62\u5F0F\u7684 main \u65B9\u6CD5
# 0: name, 1: name
compiler.err.same.binary.name=\u7C7B\uFF1A{0} \u548C {1} \u5177\u6709\u76F8\u540C\u7684\u4E8C\u8FDB\u5236\u540D\u79F0
@@ -380,8 +398,13 @@ compiler.err.duplicate.unconditional.pattern=\u65E0\u6761\u4EF6\u6A21\u5F0F\u91C
compiler.err.unconditional.pattern.and.default=switch \u6709\u4E00\u4E2A\u65E0\u6761\u4EF6\u6A21\u5F0F\u548C\u4E00\u4E2A default \u6807\u7B7E
compiler.err.guard.not.allowed=\u53EA\u6709\u5305\u542B\u6A21\u5F0F\u7684 case \u5141\u8BB8\u4F7F\u7528\u536B\u58EB
compiler.err.guard.has.constant.expression.false=\u6B64 case \u6807\u7B7E\u6709\u4E00\u4E2A\u536B\u58EB\uFF0C\u5B83\u662F\u503C\u4E3A ''false'' \u7684\u5E38\u91CF\u8868\u8FBE\u5F0F
# 0: symbol
compiler.err.cannot.assign.not.declared.guard=\u65E0\u6CD5\u5206\u914D\u7ED9 {0}\uFF0C\u56E0\u4E3A\u672A\u5728\u536B\u58EB\u5185\u58F0\u660E\u5B83
# 0: type, 1: type
compiler.err.constant.label.not.compatible={0} \u7C7B\u578B\u7684\u5E38\u91CF\u6807\u7B7E\u4E0E switch \u9009\u62E9\u5668\u7C7B\u578B {1} \u4E0D\u517C\u5BB9
@@ -408,6 +431,8 @@ compiler.err.enum.cant.be.instantiated=\u65E0\u6CD5\u5B9E\u4F8B\u5316\u679A\u4E3
compiler.err.enum.label.must.be.unqualified.enum=\u679A\u4E3E switch case \u6807\u7B7E\u5FC5\u987B\u4E3A\u679A\u4E3E\u5E38\u91CF\u7684\u975E\u9650\u5B9A\u540D\u79F0
compiler.err.enum.label.must.be.enum.constant=\u679A\u4E3E switch constant case \u6807\u7B7E\u5FC5\u987B\u4E3A\u679A\u4E3E\u5E38\u91CF
compiler.err.enum.no.subclassing=\u7C7B\u65E0\u6CD5\u76F4\u63A5\u6269\u5C55 java.lang.Enum
compiler.err.enum.types.not.extensible=\u679A\u4E3E\u7C7B\u4E0D\u53EF\u6269\u5C55
@@ -442,9 +467,6 @@ compiler.err.finally.without.try=\u6709 ''finally'', \u4F46\u662F\u6CA1\u6709 ''
# 0: type, 1: message segment
compiler.err.foreach.not.applicable.to.type=for-each \u4E0D\u9002\u7528\u4E8E\u8868\u8FBE\u5F0F\u7C7B\u578B\n\u8981\u6C42: {1}\n\u627E\u5230: {0}
# 0: type, 1: type
compiler.err.foreach.not.exhaustive.on.type={1} \u4E2D\u7684\u6A21\u5F0F {0} \u4E0D\u5168\u9762
compiler.err.fp.number.too.large=\u6D6E\u70B9\u6570\u592A\u5927
compiler.err.fp.number.too.small=\u6D6E\u70B9\u6570\u592A\u5C0F
@@ -477,6 +499,10 @@ compiler.err.not.in.profile={0}\u5728\u914D\u7F6E\u6587\u4EF6 ''{1}'' \u4E2D\u4E
# 0: symbol
compiler.warn.forward.ref=\u5148\u5F15\u7528\u53D8\u91CF ''{0}'', \u7136\u540E\u518D\u5BF9\u5176\u521D\u59CB\u5316
compiler.warn.possible.this.escape=\u53EF\u80FD\u5728\u5B8C\u5168\u521D\u59CB\u5316\u5B50\u7C7B\u4E4B\u524D\u8F6C\u4E49\u4E86 ''this''
compiler.warn.possible.this.escape.location=\u6B64\u5904\u4EE5\u524D\u53EF\u80FD\u901A\u8FC7\u8C03\u7528\u8F6C\u4E49\u4E86 ''this''
compiler.err.illegal.self.ref=\u521D\u59CB\u5316\u7A0B\u5E8F\u4E2D\u5B58\u5728\u81EA\u5F15\u7528
# 0: symbol
@@ -927,6 +953,18 @@ compiler.err.unclosed.str.lit=\u672A\u7ED3\u675F\u7684\u5B57\u7B26\u4E32\u6587\u
compiler.err.unclosed.text.block=\u6587\u672C\u5757\u672A\u95ED\u5408
compiler.err.string.template.is.not.well.formed=\u5B57\u7B26\u4E32\u6A21\u677F\u683C\u5F0F\u4E0D\u6B63\u786E
compiler.err.text.block.template.is.not.well.formed=\u6587\u672C\u5757\u6A21\u677F\u683C\u5F0F\u4E0D\u6B63\u786E
compiler.err.processor.missing.from.string.template.expression=\u5B57\u7B26\u4E32\u6A21\u677F\u8868\u8FBE\u5F0F\u7F3A\u5C11\u5904\u7406\u7A0B\u5E8F
# 0: symbol
compiler.err.processor.type.cannot.be.a.raw.type=\u5904\u7406\u7A0B\u5E8F\u7C7B\u578B\u4E0D\u80FD\u4E3A\u539F\u59CB\u7C7B\u578B\uFF1A{0}
# 0: symbol
compiler.err.not.a.processor.type=\u4E0D\u662F\u5904\u7406\u7A0B\u5E8F\u7C7B\u578B\uFF1A{0}
# 0: string
compiler.err.unsupported.encoding=\u4E0D\u652F\u6301\u7684\u7F16\u7801: {0}
@@ -1039,9 +1077,6 @@ compiler.misc.varargs.trustme.on.reifiable.varargs=Varargs \u5143\u7D20\u7C7B\u5
# 0: type, 1: type
compiler.err.instanceof.reifiable.not.safe={0} \u65E0\u6CD5\u5B89\u5168\u5730\u8F6C\u6362\u4E3A {1}
# 0: type, 1: type
compiler.err.instanceof.pattern.no.subtype=\u8868\u8FBE\u5F0F\u7C7B\u578B {0} \u662F\u6A21\u5F0F\u7C7B\u578B {1} \u7684\u5B50\u7C7B\u578B
# 0: symbol
compiler.misc.varargs.trustme.on.non.varargs.meth=\u65B9\u6CD5 {0} \u4E0D\u662F varargs \u65B9\u6CD5\u3002
@@ -1143,6 +1178,9 @@ compiler.misc.x.print.rounds=\u5FAA\u73AF {0}:\n\t\u8F93\u5165\u6587\u4EF6: {1}\
# 0: file name
compiler.warn.file.from.future=\u6587\u4EF6 {0} \u7684\u4FEE\u6539\u65E5\u671F\u662F\u672A\u6765\u7684\u65E5\u671F
# 0: path
compiler.warn.output.file.clash=\u591A\u6B21\u5199\u5165\u8F93\u51FA\u6587\u4EF6\uFF1A{0}
#####
## The following string will appear before all messages keyed as:
@@ -1449,6 +1487,9 @@ compiler.warn.position.overflow=\u884C {0} \u5904\u7684\u4F4D\u7F6E\u7F16\u7801\
# 0: file name, 1: number, 2: number
compiler.warn.big.major.version={0}: \u4E3B\u7248\u672C {1} \u6BD4 {2} \u65B0, \u6B64\u7F16\u8BD1\u5668\u652F\u6301\u6700\u65B0\u7684\u4E3B\u7248\u672C\u3002\n\u5EFA\u8BAE\u5347\u7EA7\u6B64\u7F16\u8BD1\u5668\u3002
# 0: file name, 1: fragment
compiler.warn.invalid.utf8.in.classfile={0}\uFF1A\u7C7B\u6587\u4EF6\u5305\u542B\u65E0\u6548 UTF-8\uFF1A{1}
# 0: kind name, 1: symbol
compiler.warn.static.not.qualified.by.type=static {0}\u5E94\u7531\u7C7B\u578B\u540D\u79F0{1}\u800C\u4E0D\u662F\u8868\u8FBE\u5F0F\u9650\u5B9A
@@ -1462,10 +1503,10 @@ compiler.warn.source.no.bootclasspath=\u672A\u4E0E -source {0} \u4E00\u8D77\u8BB
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
compiler.warn.option.obsolete.source=\u6E90\u503C {0} \u5DF2\u8FC7\u65F6\uFF0C\u5C06\u5728\u672A\u6765\u53D1\u884C\u7248\u4E2D\u5220\u9664
# 0: target
compiler.warn.option.obsolete.target=\u76EE\u6807\u503C{0}\u5DF2\u8FC7\u65F6, \u5C06\u5728\u672A\u6765\u6240\u6709\u53D1\u884C\u7248\u4E2D\u5220\u9664
compiler.warn.option.obsolete.target=\u76EE\u6807\u503C {0} \u5DF2\u8FC7\u65F6\uFF0C\u5C06\u5728\u672A\u6765\u53D1\u884C\u7248\u4E2D\u5220\u9664
# 0: string, 1: string
compiler.err.option.removed.source=\u4E0D\u518D\u652F\u6301\u6E90\u9009\u9879 {0}\u3002\u8BF7\u4F7F\u7528 {1} \u6216\u66F4\u9AD8\u7248\u672C\u3002
@@ -1679,6 +1720,10 @@ compiler.err.enum.constant.expected=\u6B64\u5904\u9700\u8981\u679A\u4E3E\u5E38\u
compiler.err.enum.constant.not.expected=\u6B64\u5904\u4E0D\u9700\u8981\u679A\u4E3E\u5E38\u91CF
compiler.err.extraneous.semicolon=\u591A\u4F59\u5206\u53F7
compiler.warn.extraneous.semicolon=\u591A\u4F59\u5206\u53F7
## The following are related in form, but do not easily fit the above paradigm.
compiler.err.expected.module.or.open=\u9700\u8981 ''module'' \u6216 ''open''
@@ -1738,8 +1783,14 @@ compiler.misc.bad.const.pool.tag=\u9519\u8BEF\u7684\u5E38\u91CF\u6C60\u6807\u8BB
compiler.misc.bad.const.pool.tag.at=\u9519\u8BEF\u7684\u5E38\u91CF\u6C60\u6807\u8BB0: {0}, \u4F4D\u4E8E{1}
# 0: number
compiler.misc.bad.utf8.byte.sequence.at=\u4F4D\u4E8E {0} \u7684 UTF-8 \u5B57\u8282\u5E8F\u5217\u9519\u8BEF
compiler.misc.unexpected.const.pool.tag.at=\u610F\u5916\u7684\u5E38\u91CF\u6C60\u6807\u8BB0\uFF1A{0}\uFF0C\u4F4D\u4E8E {1}
# 0: number
compiler.misc.bad.class.truncated.at.offset=\u7C7B\u6587\u4EF6\u5728\u504F\u79FB {0} \u5904\u622A\u65AD
compiler.misc.bad.signature=\u9519\u8BEF\u7684\u7B7E\u540D: {0}
compiler.misc.bad.type.annotation.value=\u9519\u8BEF\u7684\u7C7B\u578B\u6CE8\u91CA\u76EE\u6807\u7C7B\u578B\u503C: {0}
@@ -1796,6 +1847,8 @@ compiler.misc.malformed.vararg.method=\u7C7B\u6587\u4EF6\u5305\u542B\u683C\u5F0F
compiler.misc.wrong.version=\u7C7B\u6587\u4EF6\u5177\u6709\u9519\u8BEF\u7684\u7248\u672C {0}.{1}, \u5E94\u4E3A {2}.{3}
compiler.misc.illegal.flag.combo=\u7C7B\u6587\u4EF6\u5305\u542B {1} {2} \u7684\u975E\u6CD5\u6807\u8BB0\u7EC4\u5408 {0}
#####
# 0: type, 1: type or symbol
@@ -2187,6 +2240,8 @@ compiler.misc.feature.reifiable.types.instanceof=instanceof \u4E2D\u7684\u53EF\u
compiler.misc.feature.deconstruction.patterns=\u89E3\u6784\u6A21\u5F0F
compiler.misc.feature.unnamed.variables=\u672A\u547D\u540D\u53D8\u91CF
compiler.misc.feature.records=\u8BB0\u5F55
compiler.misc.feature.sealed.classes=\u5BC6\u5C01\u7C7B
@@ -2195,13 +2250,19 @@ compiler.misc.feature.case.null=switch case \u4E2D\u7684\u7A7A\u503C
compiler.misc.feature.pattern.switch=switch \u8BED\u53E5\u4E2D\u7684\u6A21\u5F0F
compiler.misc.feature.string.templates=\u5B57\u7B26\u4E32\u6A21\u677F
compiler.misc.feature.unconditional.patterns.in.instanceof=instanceof \u4E2D\u7684\u65E0\u6761\u4EF6\u6A21\u5F0F
compiler.misc.feature.unnamed.classes=\u672A\u547D\u540D\u7C7B
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
compiler.err.underscore.as.identifier.in.lambda=''_'' \u7528\u4F5C\u6807\u8BC6\u7B26\n(\u5BF9\u4E8E lambda \u53C2\u6570, \u7981\u6B62\u5C06 ''_'' \u7528\u4F5C\u6807\u8BC6\u7B26)
compiler.err.use.of.underscore.not.allowed=\u4ECE\u53D1\u884C\u7248 21 \u5F00\u59CB\uFF0C\u4E0B\u5212\u7EBF\u5173\u952E\u5B57 ''_'' \u53EA\u5141\u8BB8\u7528\u4E8E\u58F0\u660E\n\u672A\u547D\u540D\u6A21\u5F0F\u3001\u672C\u5730\u53D8\u91CF\u3001\u5F02\u5E38\u9519\u8BEF\u53C2\u6570\u6216 lambda \u53C2\u6570
compiler.err.use.of.underscore.not.allowed.with.brackets=\u4E0B\u5212\u7EBF\u5173\u952E\u5B57 ''_'' \u4E0D\u5141\u8BB8\u540E\u8DDF\u65B9\u62EC\u53F7
compiler.err.enum.as.identifier=\u4ECE\u53D1\u884C\u7248 5 \u5F00\u59CB, ''enum'' \u4E3A\u5173\u952E\u5B57, \u4E0D\u80FD\u7528\u4F5C\u6807\u8BC6\u7B26
@@ -2374,7 +2435,7 @@ compiler.err.dc.missing.semicolon=\u7F3A\u5C11\u5206\u53F7
compiler.err.dc.no.content=\u65E0\u5185\u5BB9
compiler.err.dc.no.tag.name='@' \u540E\u6CA1\u6709\u6807\u8BB0\u540D
compiler.err.dc.no.tag.name=''@'' \u540E\u9762\u6CA1\u6709\u6807\u8BB0\u540D\u79F0
compiler.err.dc.no.url=\u65E0 URL
@@ -2693,6 +2754,8 @@ compiler.err.instance.initializer.not.allowed.in.records=\u8BB0\u5F55\u4E2D\u4E0
compiler.err.static.declaration.not.allowed.in.inner.classes=\u5185\u90E8\u7C7B\u4E2D\u4E0D\u5141\u8BB8\u4F7F\u7528\u9759\u6001\u58F0\u660E
compiler.err.record.patterns.annotations.not.allowed=\u8BB0\u5F55\u6A21\u5F0F\u4E0D\u5141\u8BB8\u4F7F\u7528\u6CE8\u91CA
############################################
# messages previously at javac.properties
@@ -2787,6 +2850,8 @@ compiler.err.preview.without.source.or.release=--enable-preview \u5FC5\u987B\u4E
# 0: symbol
compiler.err.deconstruction.pattern.only.records=\u89E3\u6784\u6A21\u5F0F\u53EA\u80FD\u5E94\u7528\u4E8E\u8BB0\u5F55\uFF0C{0} \u4E0D\u662F\u8BB0\u5F55
compiler.err.deconstruction.pattern.var.not.allowed=\u89E3\u6784\u6A21\u5F0F\u53EA\u80FD\u5E94\u7528\u4E8E\u8BB0\u5F55\uFF0C\u4E0D\u5141\u8BB8\u4F7F\u7528 var
# 0: list of type, 1: list of type
compiler.err.incorrect.number.of.nested.patterns=\u5D4C\u5957\u6A21\u5F0F\u6570\u4E0D\u6B63\u786E\n\u9700\u8981\uFF1A{0}\n\u5DF2\u627E\u5230\uFF1A{1}

View File

@@ -47,7 +47,7 @@ javac.opt.endorseddirs=Setzt den Speicherort der unterst\u00FCtzten Standardpfad
javac.opt.extdirs=Setzt den Speicherort der installierten Erweiterungen au\u00DFer Kraft
javac.opt.processorpath=Gibt an, wo sich die Annotationsprozessoren befinden
javac.opt.processormodulepath=Gibt einen Modulpfad an, wo sich die Annotationsprozessoren befinden
javac.opt.processor=Namen der auszuf\u00FChrenden Annotationsprozessoren; Standard-Discovery-Prozess wird umgangen
javac.opt.processor=Namen der auszuf\u00FChrenden Annotationsprozessoren;\nStandard-Discovery-Prozess wird umgangen
javac.opt.parameters=Generiert Metadaten zur Reflexion auf Methodenparameter
javac.opt.proc.none.only=Steuert, wo die Verarbeitung von Annotationen und/oder die Kompilierung ausgef\u00FChrt wird
javac.opt.d=Gibt an, wo generierte Klassendateien abgelegt werden
@@ -56,12 +56,12 @@ javac.opt.headerDest=Gibt an, wo generierte native Headerdateien abgelegt werden
javac.opt.J=\u00DCbergibt <Flag> direkt an das Laufzeitsystem
javac.opt.encoding=Gibt die von den Quelldateien verwendete Zeichencodierung an
javac.opt.profile=Vergewissern Sie sich, dass die verwendete API im angegebenen Profil verf\u00FCgbar ist.\nDiese Option ist veraltet und wird in einem zuk\u00FCnftigen Release m\u00F6glicherweise entfernt.
javac.opt.target=Generiert Klassendateien, die sich f\u00FCr das angegebene Java SE-Release eignen. Unterst\u00FCtzte Releases: {0}
javac.opt.release=Kompiliert f\u00FCr das angegebene Java SE-Release. Unterst\u00FCtzte Releases: {0}
javac.opt.source=Liefert Quellkompatibilit\u00E4t mit dem angegebenen Release von Java SE. Unterst\u00FCtzte Releases: {0}
javac.opt.target=Generiert Klassendateien, die sich f\u00FCr das angegebene Java SE-Release eignen.\nUnterst\u00FCtzte Releases: \n {0}
javac.opt.release=Kompiliert f\u00FCr das angegebene Java SE-Release.\nUnterst\u00FCtzte Releases: \n {0}
javac.opt.source=Liefert Quellkompatibilit\u00E4t mit dem angegebenen Release von Java SE.\nUnterst\u00FCtzte Releases: \n {0}
javac.opt.Werror=Kompilierung beenden, wenn Warnungen auftreten
javac.opt.A=Optionen zur \u00DCbergabe an die Annotationsprozessoren
javac.opt.implicit=Gibt an, ob Klassendateien f\u00FCr implizit referenzierte Dateien generiert werden oder nicht
javac.opt.implicit=Gibt an, ob Klassendateien f\u00FCr implizit referenzierte Dateien generiert werden
javac.opt.pkginfo=Gibt an, wie package-info-Dateien behandelt werden sollen
javac.opt.multi-release=Gibt an, welches Release in Multi-Release-JAR-Dateien verwendet werden soll
javac.opt.arg.class=<Klasse>
@@ -133,6 +133,8 @@ javac.opt.Xlint.desc.opens=Warnt vor Problemen in Bezug auf Modul\u00F6ffnungen.
javac.opt.Xlint.desc.options=Warnt vor Problemen im Zusammenhang mit der Verwendung von Befehlszeilenoptionen.
javac.opt.Xlint.desc.output-file-clash=Warnt, wenn eine Ausgabedatei bei der Kompilierung \u00FCberschrieben wird. Dazu kann es beispielsweise\n bei Dateisystemen ohne Beachtung der Gro\u00DF-/Kleinschreibung kommen. Deckt Klassendateien, native Headerdateien und Quelldateien ab.
javac.opt.Xlint.desc.overloads=Warnt vor Problemen in Bezug auf Methoden\u00FCberladung.
javac.opt.Xlint.desc.overrides=Warnt vor Problemen in Bezug auf Methodenau\u00DFerkraftsetzung.
@@ -157,6 +159,8 @@ javac.opt.Xlint.desc.strictfp=Warnt vor unn\u00F6tiger Verwendung des strictfp-M
javac.opt.Xlint.desc.text-blocks=Warnt vor inkonsistenten Leerzeichen in Textblockeinr\u00FCckung.
javac.opt.Xlint.desc.this-escape=Warnt, wenn ein Konstruktor eine Methode aufruft, die in einer externen Unterklasse au\u00DFer Kraft gesetzt werden k\u00F6nnte.\n Diese Methoden werden ausgef\u00FChrt, bevor die Initialisierung des Unterklassenkonstruktors abgeschlossen wird.
javac.opt.Xlint.desc.try=Warnt vor Problemen im Zusammenhang mit try-Bl\u00F6cken (d.h. try-with-resources).
javac.opt.Xlint.desc.unchecked=Warnt vor deaktivierten Vorg\u00E4ngen.
@@ -173,11 +177,11 @@ javac.opt.Xdoclint.subopts = (all|none|[-]<Gruppe>)[/<Zugriff>]
# L10N: do not localize: accessibility html missing reference syntax
# L10N: do not localize: public protected package private
javac.opt.Xdoclint.custom=Aktiviert oder deaktiviert bestimmte Pr\u00FCfungen auf Probleme in javadoc-Kommentaren,\nwobei <Gruppe> f\u00FCr accessibility, html, missing, reference oder syntax\nund <Zugriff> f\u00FCr public, protected, package oder private steht.
javac.opt.Xdoclint.custom=Aktiviert oder deaktiviert bestimmte Pr\u00FCfungen auf Probleme in javadoc-Kommentaren,\nwobei <Gruppe> f\u00FCr "accessibility", "html", "missing", "reference" oder "syntax"\nund <Zugriff> f\u00FCr "public", "protected", "package" oder "private" steht.
javac.opt.Xdoclint.package.args = [-]<Packages>(,[-]<Package>)*
javac.opt.Xdoclint.package.desc=Aktiviert oder deaktiviert Pr\u00FCfungen in bestimmten Packages. Jedes <Package> ist entweder der\nqualifizierte Name eines Packages oder ein Namenspr\u00E4fix, gefolgt von ".*", und bezieht sich auf\nalle Subpackages des angegebenen Packages. Jedem Package kann <Package>\nvorangestellt werden, um Pr\u00FCfungen f\u00FCr die angegebenen Packages zu deaktivieren.
javac.opt.Xdoclint.package.desc=Aktiviert oder deaktiviert Pr\u00FCfungen in bestimmten Packages. Jedes <Package> ist entweder der\nqualifizierte Name eines Packages oder ein Packagenamenspr\u00E4fix, gefolgt von ".*",\ndas sich auf alle Subpackages des angegebenen Packages bezieht. Jedem <Package>\nkann "-" vorangestellt werden, um Pr\u00FCfungen f\u00FCr die angegebenen Packages zu deaktivieren.
javac.opt.Xstdout=Leitet die Standardausgabe um
javac.opt.X=Gibt Hilfe zu zus\u00E4tzlichen Optionen aus
@@ -186,26 +190,26 @@ javac.opt.help.lint=Gibt die unterst\u00FCtzten Schl\u00FCssel f\u00FCr -Xlint a
javac.opt.help.lint.header=Die unterst\u00FCtzten Schl\u00FCssel f\u00FCr -Xlint sind:
javac.opt.print=Gibt eine Textdarstellung der angegebenen Typen aus
javac.opt.printRounds=Gibt Informationen zu Durchl\u00E4ufen der Annotationsverarbeitung aus
javac.opt.printProcessorInfo=Gibt Informationen dazu aus, welche Annotationen ein Prozessor verarbeiten soll
javac.opt.printProcessorInfo=Gibt Informationen dazu aus, welche Annotationen ein Prozessor\nverarbeiten soll
javac.opt.userpathsfirst=Durchsucht classpath und sourcepath vor anstatt nach bootclasspath nach Klassen
javac.opt.prefer=Gibt an, welche Datei gelesen werden soll, wenn sowohl eine Quell- als auch eine Klassendatei f\u00FCr eine implizit kompilierte Klasse gefunden werden
javac.opt.preview=Aktiviert Vorschausprachfeatures. Wird in Verbindung mit -source oder --release verwendet.
javac.opt.preview=Aktiviert Vorschausprachfeatures.\nWird in Verbindung mit -source oder --release verwendet.
javac.opt.AT=Liest Optionen und Dateinamen aus Datei
javac.opt.diags=W\u00E4hlt einen Diagnosemodus aus
javac.opt.addExports=Gibt an, dass ein Package als aus seinem definierenden Modul in weitere Module oder, wenn\n<Anderes Modul> ALL-UNNAMED lautet, in alle unbenannten Module exportiert betrachtet werden soll.
javac.opt.addExports=Gibt an, dass ein Package als aus seinem definierenden Modul in\nweitere Module oder, wenn <Anderes Modul> ALL-UNNAMED lautet, in alle unbenannten Module\nexportiert betrachtet werden soll.
javac.opt.arg.addExports=<Modul>/<Package>=<Anderes Modul>(,<Anderes Modul>)*
javac.opt.addReads=Gibt weitere Module an, die als von einem gegebenen Modul angefordert betrachtet werden sollen.\n<Anderes Modul> kann ALL-UNNAMED lauten, um das unbenannte Modul anzufordern.
javac.opt.addReads=Gibt weitere Module an, die als von einem angegebenen Modul angefordert\nbetrachtet werden sollen. <Anderes Modul> kann ALL-UNNAMED lauten,\num das unbenannte Modul anzufordern.
javac.opt.arg.addReads=<Modul>=<Anderes Modul>(,<Anderes Modul>)*
javac.opt.patch=Setzt ein Modul au\u00DFer Kraft oder erweitert es mit Klassen und Ressourcen\nin JAR-Dateien oder Verzeichnissen
javac.opt.arg.patch=<Modul>=<Datei>(:<Datei>)*
javac.opt.addmods=Root-Module, die zus\u00E4tzlich zu den anf\u00E4nglichen Modulen aufgel\u00F6st werden sollen, oder alle Module\nim Modulpfad, wenn <Modul> ALL-MODULE-PATH lautet.
javac.opt.addmods=Root-Module, die zus\u00E4tzlich zu den anf\u00E4nglichen Modulen\naufgel\u00F6st werden sollen, oder alle Module im Modulpfad, wenn <Modul> ALL-MODULE-PATH lautet.
javac.opt.arg.addmods=<Modul>(,<Modul>)*
javac.opt.limitmods=Begrenzt die Gesamtzahl der beobachtbaren Module
javac.opt.arg.limitmods=<Modul>(,<Modul>)*
javac.opt.module.version=Gibt die Version der Module an, die kompiliert werden
javac.opt.arg.module.version=<Version>
javac.opt.inherit_runtime_environment=Vererbt Modulsystemkonfigurationsoptionen aus der Laufzeitumgebung.
javac.opt.default.module.for.created.files=Fallback-Zielmodul f\u00FCr Dateien, die von Annotationsprozessoren erstellt werden, falls keines angegeben ist oder abgeleitet werden kann.
javac.opt.default.module.for.created.files=Fallback-Zielmodul f\u00FCr Dateien, die von Annotationsprozessoren erstellt werden,\nfalls keines angegeben ist oder abgeleitet werden kann.
## messages

View File

@@ -56,9 +56,9 @@ javac.opt.headerDest=\u751F\u6210\u3055\u308C\u305F\u30CD\u30A4\u30C6\u30A3\u30D
javac.opt.J=<flag>\u3092\u5B9F\u884C\u30B7\u30B9\u30C6\u30E0\u306B\u76F4\u63A5\u6E21\u3059
javac.opt.encoding=\u30BD\u30FC\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u304C\u4F7F\u7528\u3059\u308B\u6587\u5B57\u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0\u3092\u6307\u5B9A\u3059\u308B
javac.opt.profile=\u4F7F\u7528\u3055\u308C\u3066\u3044\u308BAPI\u304C\u3001\u6307\u5B9A\u3057\u305F\u30D7\u30ED\u30D5\u30A1\u30A4\u30EB\u3067\u4F7F\u7528\u53EF\u80FD\u304B\u3069\u3046\u304B\u3092\u78BA\u8A8D\u3057\u307E\u3059\u3002\n\u3053\u306E\u30AA\u30D7\u30B7\u30E7\u30F3\u306F\u975E\u63A8\u5968\u3067\u3042\u308A\u3001\u4ECA\u5F8C\u306E\u30EA\u30EA\u30FC\u30B9\u3067\u524A\u9664\u3055\u308C\u308B\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059\u3002
javac.opt.target=\u6307\u5B9A\u3055\u308C\u305FJava SE\u30EA\u30EA\u30FC\u30B9\u306B\u9069\u3057\u305F\u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u751F\u6210\u3057\u307E\u3059\u3002\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u308B\u30EA\u30EA\u30FC\u30B9: {0}
javac.opt.release=\u6307\u5B9A\u3055\u308C\u305FJava SE\u30EA\u30EA\u30FC\u30B9\u306B\u5BFE\u3057\u3066\u30B3\u30F3\u30D1\u30A4\u30EB\u3057\u307E\u3059\u3002\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u308B\u30EA\u30EA\u30FC\u30B9: {0}
javac.opt.source=\u6307\u5B9A\u3055\u308C\u305FJava SE\u30EA\u30EA\u30FC\u30B9\u3068\u30BD\u30FC\u30B9\u306E\u4E92\u63DB\u6027\u3092\u4FDD\u6301\u3057\u307E\u3059\u3002\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u308B\u30EA\u30EA\u30FC\u30B9: {0}
javac.opt.target=\u6307\u5B9A\u3055\u308C\u305FJava SE\u30EA\u30EA\u30FC\u30B9\u306B\u9069\u3057\u305F\u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u751F\u6210\u3057\u307E\u3059\u3002\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u308B\u30EA\u30EA\u30FC\u30B9: \n {0}
javac.opt.release=\u6307\u5B9A\u3055\u308C\u305FJava SE\u30EA\u30EA\u30FC\u30B9\u306B\u5BFE\u3057\u3066\u30B3\u30F3\u30D1\u30A4\u30EB\u3057\u307E\u3059\u3002\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u308B\u30EA\u30EA\u30FC\u30B9: \n {0}
javac.opt.source=\u6307\u5B9A\u3055\u308C\u305FJava SE\u30EA\u30EA\u30FC\u30B9\u3068\u30BD\u30FC\u30B9\u306E\u4E92\u63DB\u6027\u3092\u4FDD\u6301\u3057\u307E\u3059\u3002\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u308B\u30EA\u30EA\u30FC\u30B9: \n {0}
javac.opt.Werror=\u8B66\u544A\u304C\u767A\u751F\u3057\u305F\u5834\u5408\u306B\u30B3\u30F3\u30D1\u30A4\u30EB\u3092\u7D42\u4E86\u3059\u308B
javac.opt.A=\u6CE8\u91C8\u30D7\u30ED\u30BB\u30C3\u30B5\u306B\u6E21\u3055\u308C\u308B\u30AA\u30D7\u30B7\u30E7\u30F3
javac.opt.implicit=\u6697\u9ED9\u7684\u306B\u53C2\u7167\u3055\u308C\u308B\u30D5\u30A1\u30A4\u30EB\u306B\u3064\u3044\u3066\u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u751F\u6210\u3059\u308B\u304B\u3069\u3046\u304B\u3092\u6307\u5B9A\u3059\u308B
@@ -133,6 +133,8 @@ javac.opt.Xlint.desc.opens=\u30E2\u30B8\u30E5\u30FC\u30EB\u306E\u30AA\u30FC\u30D
javac.opt.Xlint.desc.options=\u30B3\u30DE\u30F3\u30C9\u884C\u30AA\u30D7\u30B7\u30E7\u30F3\u306E\u4F7F\u7528\u306B\u95A2\u3059\u308B\u554F\u984C\u306B\u3064\u3044\u3066\u8B66\u544A\u3057\u307E\u3059\u3002
javac.opt.Xlint.desc.output-file-clash=\u51FA\u529B\u30D5\u30A1\u30A4\u30EB\u304C\u30B3\u30F3\u30D1\u30A4\u30EB\u4E2D\u306B\u4E0A\u66F8\u304D\u3055\u308C\u305F\u5834\u5408\u306B\u8B66\u544A\u3057\u307E\u3059\u3002\u3053\u308C\u306F\u5927/\u5C0F\u6587\u5B57\u304C\u533A\u5225\u3055\u308C\u306A\u3044\n \u30D5\u30A1\u30A4\u30EB\u30B7\u30B9\u30C6\u30E0\u306A\u3069\u3067\u767A\u751F\u3059\u308B\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059\u3002\u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u3001\u30CD\u30A4\u30C6\u30A3\u30D6\u30FB\u30D8\u30C3\u30C0\u30FC\u30FB\u30D5\u30A1\u30A4\u30EB\u304A\u3088\u3073\u30BD\u30FC\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u304C\u30AB\u30D0\u30FC\u3055\u308C\u307E\u3059\u3002
javac.opt.Xlint.desc.overloads=\u30E1\u30BD\u30C3\u30C9\u306E\u30AA\u30FC\u30D0\u30FC\u30ED\u30FC\u30C9\u306B\u95A2\u3059\u308B\u554F\u984C\u306B\u3064\u3044\u3066\u8B66\u544A\u3057\u307E\u3059\u3002
javac.opt.Xlint.desc.overrides=\u30E1\u30BD\u30C3\u30C9\u306E\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u306B\u95A2\u3059\u308B\u554F\u984C\u306B\u3064\u3044\u3066\u8B66\u544A\u3057\u307E\u3059\u3002
@@ -157,6 +159,8 @@ javac.opt.Xlint.desc.strictfp=strictfp\u4FEE\u98FE\u5B50\u306E\u4E0D\u8981\u306A
javac.opt.Xlint.desc.text-blocks=\u30C6\u30AD\u30B9\u30C8\u30FB\u30D6\u30ED\u30C3\u30AF\u30FB\u30A4\u30F3\u30C7\u30F3\u30C8\u5185\u306E\u4E00\u8CAB\u6027\u306E\u306A\u3044\u7A7A\u767D\u6587\u5B57\u306B\u3064\u3044\u3066\u8B66\u544A\u3057\u307E\u3059\u3002
javac.opt.Xlint.desc.this-escape=\u5916\u90E8\u30B5\u30D6\u30AF\u30E9\u30B9\u3067\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u3055\u308C\u308B\u53EF\u80FD\u6027\u306E\u3042\u308B\u30E1\u30BD\u30C3\u30C9\u3092\u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\u30BF\u304C\u547C\u3073\u51FA\u3057\u305F\u5834\u5408\u306B\u8B66\u544A\u3057\u307E\u3059\u3002\n \u3053\u306E\u3088\u3046\u306A\u30E1\u30BD\u30C3\u30C9\u306F\u3001\u30B5\u30D6\u30AF\u30E9\u30B9\u30FB\u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\u30BF\u304C\u305D\u306E\u521D\u671F\u5316\u3092\u5B8C\u4E86\u3059\u308B\u524D\u306B\u5B9F\u884C\u3055\u308C\u307E\u3059\u3002
javac.opt.Xlint.desc.try=try\u30D6\u30ED\u30C3\u30AF(try-with-resources\u306A\u3069)\u306E\u4F7F\u7528\u306B\u95A2\u3059\u308B\u554F\u984C\u306B\u3064\u3044\u3066\u8B66\u544A\u3057\u307E\u3059\u3002
javac.opt.Xlint.desc.unchecked=\u7121\u691C\u67FB\u64CD\u4F5C\u306B\u3064\u3044\u3066\u8B66\u544A\u3057\u307E\u3059\u3002
@@ -177,7 +181,7 @@ javac.opt.Xdoclint.custom=javadoc\u30B3\u30E1\u30F3\u30C8\u306E\u554F\u984C\u306
javac.opt.Xdoclint.package.args = [-]<packages>(,[-]<package>)*
javac.opt.Xdoclint.package.desc=\u7279\u5B9A\u306E\u30D1\u30C3\u30B1\u30FC\u30B8\u306E\u30C1\u30A7\u30C3\u30AF\u3092\u6709\u52B9\u307E\u305F\u306F\u7121\u52B9\u306B\u3057\u307E\u3059\u3002\u5404<package>\u306F\u3001\n\u30D1\u30C3\u30B1\u30FC\u30B8\u306E\u4FEE\u98FE\u3055\u308C\u305F\u540D\u524D\u3001\u307E\u305F\u306F\u30D1\u30C3\u30B1\u30FC\u30B8\u540D\u306E\u63A5\u982D\u8F9E\u306E\u5F8C\u306B''.*''\u3092\u6307\u5B9A\n(\u6307\u5B9A\u3057\u305F\u30D1\u30C3\u30B1\u30FC\u30B8\u306E\u3059\u3079\u3066\u306E\u30B5\u30D6\u30D1\u30C3\u30B1\u30FC\u30B8\u306B\u62E1\u5F35)\u3057\u305F\u3082\u306E\u3067\u3059\u3002\u5404<package>\u306E\u524D\u306B\n'-'\u3092\u6307\u5B9A\u3059\u308B\u3068\u3001\u6307\u5B9A\u3057\u305F1\u3064\u4EE5\u4E0A\u306E\u30D1\u30C3\u30B1\u30FC\u30B8\u306B\u95A2\u3059\u308B\u30C1\u30A7\u30C3\u30AF\u3092\u7121\u52B9\u306B\u3067\u304D\u307E\u3059\u3002
javac.opt.Xdoclint.package.desc=\u7279\u5B9A\u306E\u30D1\u30C3\u30B1\u30FC\u30B8\u306E\u30C1\u30A7\u30C3\u30AF\u3092\u6709\u52B9\u307E\u305F\u306F\u7121\u52B9\u306B\u3057\u307E\u3059\u3002\u5404<package>\u306F\u3001\n\u30D1\u30C3\u30B1\u30FC\u30B8\u306E\u4FEE\u98FE\u3055\u308C\u305F\u540D\u524D\u3001\u307E\u305F\u306F\u30D1\u30C3\u30B1\u30FC\u30B8\u540D\u306E\u63A5\u982D\u8F9E\u306E\u5F8C\u306B'.*'\u3092\n\u6307\u5B9A(\u6307\u5B9A\u3057\u305F\u30D1\u30C3\u30B1\u30FC\u30B8\u306E\u3059\u3079\u3066\u306E\u30B5\u30D6\u30D1\u30C3\u30B1\u30FC\u30B8\u306B\u62E1\u5F35)\u3057\u305F\u3082\u306E\u3067\u3059\u3002\u5404<package>\n\u306E\u524D\u306B'-'\u3092\u6307\u5B9A\u3059\u308B\u3068\u3001\u6307\u5B9A\u3057\u305F1\u3064\u4EE5\u4E0A\u306E\u30D1\u30C3\u30B1\u30FC\u30B8\u306B\u95A2\u3059\u308B\u30C1\u30A7\u30C3\u30AF\u3092\u7121\u52B9\u306B\u3067\u304D\u307E\u3059\u3002
javac.opt.Xstdout=\u6A19\u6E96\u51FA\u529B\u3092\u30EA\u30C0\u30A4\u30EC\u30AF\u30C8\u3059\u308B
javac.opt.X=\u8FFD\u52A0\u30AA\u30D7\u30B7\u30E7\u30F3\u306E\u30D8\u30EB\u30D7\u3092\u51FA\u529B\u3057\u307E\u3059
@@ -194,7 +198,7 @@ javac.opt.AT=\u30D5\u30A1\u30A4\u30EB\u304B\u3089\u306E\u8AAD\u53D6\u308A\u30AA\
javac.opt.diags=\u8A3A\u65AD\u30E2\u30FC\u30C9\u306E\u9078\u629E
javac.opt.addExports=<other-module>\u304CALL-UNNAMED\u3067\u3042\u308B\u5834\u5408\u3001\u305D\u306E\u5B9A\u7FA9\u30E2\u30B8\u30E5\u30FC\u30EB\u304B\u3089\u3001\u8FFD\u52A0\u30E2\u30B8\u30E5\u30FC\u30EB\u307E\u305F\u306F\n \u3059\u3079\u3066\u306E\u540D\u524D\u306E\u306A\u3044\u30E2\u30B8\u30E5\u30FC\u30EB\u306B\u30A8\u30AF\u30B9\u30DD\u30FC\u30C8\u6E08\u3068\u307F\u306A\u3055\u308C\u308B\u3088\u3046\u306B\u30D1\u30C3\u30B1\u30FC\u30B8\u3092\u6307\u5B9A\u3057\u307E\u3059\u3002
javac.opt.arg.addExports=<module>/<package>=<other-module>(,<other-module>)*
javac.opt.addReads=\u6307\u5B9A\u306E\u30E2\u30B8\u30E5\u30FC\u30EB\u3067\u5FC5\u9808\u3068\u307F\u306A\u3055\u308C\u308B\u3088\u3046\u306B\u8FFD\u52A0\u30E2\u30B8\u30E5\u30FC\u30EB\u3092\u6307\u5B9A\u3057\u307E\u3059\u3002\n \u540D\u524D\u306E\u306A\u3044\u30E2\u30B8\u30E5\u30FC\u30EB\u3092\u5FC5\u8981\u3068\u3059\u308B\u5834\u5408\u3001<other-module>\u306FALL-UNNAMED\u306B\u3057\u307E\u3059\u3002
javac.opt.addReads=\u6307\u5B9A\u306E\u30E2\u30B8\u30E5\u30FC\u30EB\u3067\u5FC5\u9808\u3068\u307F\u306A\u3055\u308C\u308B\u3088\u3046\u306B\u8FFD\u52A0\u30E2\u30B8\u30E5\u30FC\u30EB\u3092\u6307\u5B9A\u3057\u307E\u3059\u3002\n\u540D\u524D\u306E\u306A\u3044\u30E2\u30B8\u30E5\u30FC\u30EB\u3092\u5FC5\u8981\u3068\u3059\u308B\u5834\u5408\u3001<other-module>\u306F\nALL-UNNAMED\u306B\u3057\u307E\u3059\u3002
javac.opt.arg.addReads=<module>=<other-module>(,<other-module>)*
javac.opt.patch=JAR\u30D5\u30A1\u30A4\u30EB\u307E\u305F\u306F\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306E\u30AF\u30E9\u30B9\u304A\u3088\u3073\u30EA\u30BD\u30FC\u30B9\u3067\u30E2\u30B8\u30E5\u30FC\u30EB\u3092\n \u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u307E\u305F\u306F\u62E1\u5F35\u3057\u307E\u3059
javac.opt.arg.patch=<module>=<file>(:<file>)*

View File

@@ -47,7 +47,7 @@ javac.opt.endorseddirs=\u8986\u76D6\u7B7E\u540D\u7684\u6807\u51C6\u8DEF\u5F84\u7
javac.opt.extdirs=\u8986\u76D6\u6240\u5B89\u88C5\u6269\u5C55\u7684\u4F4D\u7F6E
javac.opt.processorpath=\u6307\u5B9A\u67E5\u627E\u6CE8\u91CA\u5904\u7406\u7A0B\u5E8F\u7684\u4F4D\u7F6E
javac.opt.processormodulepath=\u6307\u5B9A\u67E5\u627E\u6CE8\u91CA\u5904\u7406\u7A0B\u5E8F\u7684\u6A21\u5757\u8DEF\u5F84
javac.opt.processor=\u8981\u8FD0\u884C\u7684\u6CE8\u91CA\u5904\u7406\u7A0B\u5E8F\u7684\u540D\u79F0; \u7ED5\u8FC7\u9ED8\u8BA4\u7684\u641C\u7D22\u8FDB\u7A0B
javac.opt.processor=\u8981\u8FD0\u884C\u7684\u6CE8\u91CA\u5904\u7406\u7A0B\u5E8F\u7684\u540D\u79F0;\n\u7ED5\u8FC7\u9ED8\u8BA4\u7684\u641C\u7D22\u8FDB\u7A0B
javac.opt.parameters=\u751F\u6210\u5143\u6570\u636E\u4EE5\u7528\u4E8E\u65B9\u6CD5\u53C2\u6570\u7684\u53CD\u5C04
javac.opt.proc.none.only=\u63A7\u5236\u662F\u5426\u6267\u884C\u6CE8\u91CA\u5904\u7406\u548C/\u6216\u7F16\u8BD1\u3002
javac.opt.d=\u6307\u5B9A\u653E\u7F6E\u751F\u6210\u7684\u7C7B\u6587\u4EF6\u7684\u4F4D\u7F6E
@@ -133,6 +133,8 @@ javac.opt.Xlint.desc.opens=\u6709\u5173\u4E0E\u6A21\u5757\u6253\u5F00\u76F8\u517
javac.opt.Xlint.desc.options=\u6709\u5173\u4E0E\u4F7F\u7528\u547D\u4EE4\u884C\u9009\u9879\u76F8\u5173\u7684\u95EE\u9898\u7684\u8B66\u544A\u3002
javac.opt.Xlint.desc.output-file-clash=\u5728\u7F16\u8BD1\u671F\u95F4\u8986\u76D6\u8F93\u51FA\u6587\u4EF6\u65F6\u53D1\u51FA\u8B66\u544A\u3002\u5728\u67D0\u4E9B\u60C5\u51B5\u4E0B\uFF08\u4F8B\u5982\u5728\u4E0D\u533A\u5206\u5927\u5C0F\u5199\u7684\u6587\u4EF6\u7CFB\u7EDF\u4E2D\uFF09\n \u53EF\u80FD\u4F1A\u53D1\u751F\u8FD9\u79CD\u60C5\u51B5\u3002\u6D89\u53CA\u7C7B\u6587\u4EF6\u3001\u5934\u6587\u4EF6\u548C\u6E90\u6587\u4EF6\u3002
javac.opt.Xlint.desc.overloads=\u6709\u5173\u4E0E\u65B9\u6CD5\u91CD\u8F7D\u76F8\u5173\u7684\u95EE\u9898\u7684\u8B66\u544A\u3002
javac.opt.Xlint.desc.overrides=\u6709\u5173\u4E0E\u65B9\u6CD5\u8986\u76D6\u76F8\u5173\u7684\u95EE\u9898\u7684\u8B66\u544A\u3002
@@ -157,6 +159,8 @@ javac.opt.Xlint.desc.strictfp=\u6709\u5173\u4E0D\u5FC5\u8981\u5730\u4F7F\u7528\u
javac.opt.Xlint.desc.text-blocks=\u6709\u5173\u6587\u672C\u5757\u7F29\u8FDB\u4E2D\u7684\u7A7A\u683C\u5B57\u7B26\u4E0D\u4E00\u81F4\u7684\u8B66\u544A\u3002
javac.opt.Xlint.desc.this-escape=\u6784\u9020\u5668\u8C03\u7528\u7684\u65B9\u6CD5\u53EF\u80FD\u5728\u5916\u90E8\u5B50\u7C7B\u4E2D\u88AB\u8986\u76D6\u65F6\u53D1\u51FA\u8B66\u544A\u3002\n \u6B64\u7C7B\u65B9\u6CD5\u5C06\u5728\u5B50\u7C7B\u6784\u9020\u5668\u5B8C\u6210\u5176\u521D\u59CB\u5316\u4E4B\u524D\u6267\u884C\u3002
javac.opt.Xlint.desc.try=\u6709\u5173\u4E0E\u4F7F\u7528 try \u5757 (\u4F8B\u5982 try-with-resources) \u76F8\u5173\u7684\u95EE\u9898\u7684\u8B66\u544A\u3002
javac.opt.Xlint.desc.unchecked=\u6709\u5173\u672A\u68C0\u67E5\u64CD\u4F5C\u7684\u8B66\u544A\u3002
@@ -177,7 +181,7 @@ javac.opt.Xdoclint.custom=\u4E3A javadoc \u6CE8\u91CA\u4E2D\u7684\u95EE\u9898\u5
javac.opt.Xdoclint.package.args = [-]<\u7A0B\u5E8F\u5305>(,[-]<\u7A0B\u5E8F\u5305>)*
javac.opt.Xdoclint.package.desc=\u5728\u7279\u5B9A\u7684\u7A0B\u5E8F\u5305\u4E2D\u542F\u7528\u6216\u7981\u7528\u68C0\u67E5\u3002\u6BCF\u4E2A <\u7A0B\u5E8F\u5305> \u662F\n\u7A0B\u5E8F\u5305\u7684\u9650\u5B9A\u540D\u79F0, \u6216\u7A0B\u5E8F\u5305\u540D\u79F0\u524D\u7F00\u540E\u8DDF '.*', \n\u5B83\u6269\u5C55\u5230\u7ED9\u5B9A\u7A0B\u5E8F\u5305\u7684\u6240\u6709\u5B50\u7A0B\u5E8F\u5305\u3002\u5728\u6BCF\u4E2A <\u7A0B\u5E8F\u5305>\n\u524D\u9762\u52A0\u4E0A '-' \u53EF\u4EE5\u4E3A\u6307\u5B9A\u7A0B\u5E8F\u5305\u7981\u7528\u68C0\u67E5\u3002
javac.opt.Xdoclint.package.desc=\u5728\u7279\u5B9A\u7684\u7A0B\u5E8F\u5305\u4E2D\u542F\u7528\u6216\u7981\u7528\u68C0\u67E5\u3002\u6BCF\u4E2A <\u7A0B\u5E8F\u5305> \u662F\n\u7A0B\u5E8F\u5305\u7684\u9650\u5B9A\u540D\u79F0\uFF0C\u6216\u7A0B\u5E8F\u5305\u540D\u79F0\u524D\u7F00\u540E\u8DDF '.*'\n\uFF08\u8FD9\u5C06\u6269\u5C55\u5230\u7ED9\u5B9A\u7A0B\u5E8F\u5305\u7684\u6240\u6709\u5B50\u7A0B\u5E8F\u5305\uFF09\u3002\u5728\u6BCF\u4E2A <\u7A0B\u5E8F\u5305>\n\u524D\u9762\u52A0\u4E0A '-' \u53EF\u4EE5\u4E3A\u6307\u5B9A\u7A0B\u5E8F\u5305\u7981\u7528\u68C0\u67E5\u3002
javac.opt.Xstdout=\u91CD\u5B9A\u5411\u6807\u51C6\u8F93\u51FA
javac.opt.X=\u8F93\u51FA\u989D\u5916\u9009\u9879\u7684\u5E2E\u52A9
@@ -194,11 +198,11 @@ javac.opt.AT=\u4ECE\u6587\u4EF6\u8BFB\u53D6\u9009\u9879\u548C\u6587\u4EF6\u540D
javac.opt.diags=\u9009\u62E9\u8BCA\u65AD\u6A21\u5F0F
javac.opt.addExports=\u6307\u5B9A\u88AB\u89C6\u4E3A\u5DF2\u4ECE\u5176\u5B9A\u4E49\u6A21\u5757\u5BFC\u51FA\u5230\u5176\u4ED6\u6A21\u5757\u6216\u8005\u5BFC\u51FA\u5230\u6240\u6709\n \u672A\u547D\u540D\u6A21\u5757 (\u5982\u679C <other-module> \u4E3A ALL-UNNAMED) \u7684\u7A0B\u5E8F\u5305\u3002
javac.opt.arg.addExports=<\u6A21\u5757>/<\u7A0B\u5E8F\u5305>=<\u5176\u4ED6\u6A21\u5757>(,<\u5176\u4ED6\u6A21\u5757>)*
javac.opt.addReads=\u6307\u5B9A\u88AB\u89C6\u4E3A\u7ED9\u5B9A\u6A21\u5757\u9700\u8981\u7684\u5176\u4ED6\u6A21\u5757\u3002\n<other-module> \u53EF\u80FD\u9700\u8981\u4E3A ALL-UNNAMED, \u4EE5\u4FBF\u8981\u6C42\u672A\u547D\u540D\u6A21\u5757\u3002
javac.opt.addReads=\u6307\u5B9A\u88AB\u89C6\u4E3A\u7ED9\u5B9A\u6A21\u5757\u6240\u5FC5\u9700\u7684\u5176\u4ED6\u6A21\u5757\u3002\n<\u5176\u4ED6\u6A21\u5757> \u53EF\u4EE5\u4E3A ALL-UNNAMED \n\u4EE5\u4FBF\u8981\u6C42\u63D0\u4F9B\u672A\u547D\u540D\u6A21\u5757\u3002
javac.opt.arg.addReads=<\u6A21\u5757>=<\u5176\u4ED6\u6A21\u5757>(,<\u5176\u4ED6\u6A21\u5757>)*
javac.opt.patch=\u4F7F\u7528 JAR \u6587\u4EF6\u6216\u76EE\u5F55\u4E2D\u7684\u7C7B\u548C\u8D44\u6E90\u8986\u76D6\n \u6216\u589E\u5F3A\u6A21\u5757
javac.opt.arg.patch=<\u6A21\u5757>=<\u6587\u4EF6>(:<\u6587\u4EF6>)*
javac.opt.addmods=\u9664\u4E86\u521D\u59CB\u6A21\u5757\u4E4B\u5916\u8981\u89E3\u6790\u7684\u6839\u6A21\u5757; \u5982\u679C <module>\n \u4E3A ALL-MODULE-PATH, \u5219\u4E3A\u6A21\u5757\u8DEF\u5F84\u4E2D\u7684\u6240\u6709\u6A21\u5757\u3002
javac.opt.addmods=\u9664\u4E86\u521D\u59CB\u6A21\u5757\u4E4B\u5916\u8981\u89E3\u6790\u7684\u6839\u6A21\u5757; \u5982\u679C <module>\n \u4E3A ALL-MODULE-PATH,\n\u5219\u4E3A\u6A21\u5757\u8DEF\u5F84\u4E2D\u7684\u6240\u6709\u6A21\u5757\u3002
javac.opt.arg.addmods=<\u6A21\u5757>(,<\u6A21\u5757>)*
javac.opt.limitmods=\u9650\u5236\u53EF\u89C2\u5BDF\u6A21\u5757\u7684\u9886\u57DF
javac.opt.arg.limitmods=<\u6A21\u5757>(,<\u6A21\u5757>)*

View File

@@ -107,6 +107,12 @@ launcher.err.cant.find.main.method=Methode "main(String[])" nicht gefunden in Kl
# 0: string
launcher.err.cant.access.main.method=kein Zugriff auf Methode "main" in Klasse: {0}
# 0: string
launcher.err.cant.find.constructor=No-Argument-Konstruktor nicht gefunden in Klasse: {0}
# 0: string
launcher.err.cant.access.constructor=Kein Zugriff auf No-Argument-Konstruktor in Klasse: {0}
# 0: path, 1: object
launcher.err.cant.read.file=Fehler beim Lesen von Quelldatei {0}: {1}

View File

@@ -107,6 +107,12 @@ launcher.err.cant.find.main.method=\u30AF\u30E9\u30B9\u306Bmain(String[])\u30E1\
# 0: string
launcher.err.cant.access.main.method=\u30AF\u30E9\u30B9\u306E\u30E1\u30A4\u30F3\u30FB\u30E1\u30BD\u30C3\u30C9\u306B\u30A2\u30AF\u30BB\u30B9\u3067\u304D\u307E\u305B\u3093: {0}
# 0: string
launcher.err.cant.find.constructor=\u30AF\u30E9\u30B9\u306B\u5F15\u6570\u306A\u3057\u306E\u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\u30BF\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093: {0}
# 0: string
launcher.err.cant.access.constructor=\u30AF\u30E9\u30B9\u306E\u5F15\u6570\u306A\u3057\u306E\u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\u30BF\u306B\u30A2\u30AF\u30BB\u30B9\u3067\u304D\u307E\u305B\u3093: {0}
# 0: path, 1: object
launcher.err.cant.read.file=\u30BD\u30FC\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB{0}\u306E\u8AAD\u53D6\u308A\u30A8\u30E9\u30FC: {1}

View File

@@ -107,6 +107,12 @@ launcher.err.cant.find.main.method=\u5728\u7C7B {0} \u4E2D\u627E\u4E0D\u5230 mai
# 0: string
launcher.err.cant.access.main.method=\u65E0\u6CD5\u8BBF\u95EE\u7C7B {0} \u4E2D\u7684 main \u65B9\u6CD5
# 0: string
launcher.err.cant.find.constructor=\u5728\u7C7B {0} \u4E2D\u627E\u4E0D\u5230\u65E0\u53C2\u6570\u6784\u9020\u5668
# 0: string
launcher.err.cant.access.constructor=\u65E0\u6CD5\u8BBF\u95EE\u7C7B {0} \u4E2D\u7684\u65E0\u53C2\u6570\u6784\u9020\u5668
# 0: path, 1: object
launcher.err.cant.read.file=\u8BFB\u53D6\u6E90\u6587\u4EF6 {0} \u65F6\u51FA\u9519\uFF1A{1}

View File

@@ -26,10 +26,14 @@ package jdk.incubator.vector;
import jdk.internal.vm.annotation.ForceInline;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.util.Objects;
/*non-public*/ class VectorIntrinsics {
static final int VECTOR_ACCESS_OOB_CHECK = Integer.getInteger("jdk.incubator.vector.VECTOR_ACCESS_OOB_CHECK", 2);
@SuppressWarnings("removal")
static final int VECTOR_ACCESS_OOB_CHECK = AccessController.doPrivileged((PrivilegedAction<Integer>) () ->
Integer.getInteger("jdk.incubator.vector.VECTOR_ACCESS_OOB_CHECK", 2));
@ForceInline
static void requireLength(int haveLength, int length) {

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 1999, 2022, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 1999, 2023, 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
@@ -81,7 +81,8 @@ warn.validator.identical.entry=Warnung: Eintrag {0} enth\u00E4lt eine Klasse, di
warn.validator.resources.with.same.name=Warnung: Eintrag {0}, mehrere Ressourcen mit demselben Namen
warn.validator.concealed.public.class=Warnung: Eintrag {0} ist eine \u00F6ffentliche Klasse\nin einem verdeckten Package. Wenn Sie diese JAR-Datei in den Classpath einf\u00FCgen, kommt es\nzu nicht kompatiblen \u00F6ffentlichen Schnittstellen
warn.release.unexpected.versioned.entry=Unerwarteter versionierter Eintrag {0}
warn.flag.is.deprecated=Warnung: Die Option {0} ist veraltet, und ihre Entfernung in einem k\u00FCnftigen JDK-Release ist geplant\n
warn.index.is.ignored=Der JAR-Index (META-INF/INDEX.LIST) wird seit JDK 18 zur Laufzeit ignoriert
warn.flag.is.deprecated=Warnung: Die Option {0} ist veraltet und wird m\u00F6glicherweise ignoriert oder in einem zuk\u00FCnftigen Release entfernt\n
out.added.manifest=Manifest wurde hinzugef\u00FCgt
out.added.module-info=module-info hinzugef\u00FCgt: {0}
out.automodule=Kein Moduldeskriptor gefunden. Automatisches Modul wurde abgeleitet.
@@ -104,11 +105,11 @@ main.usage.summary.try=Verwenden Sie "jar --help", um weitere Informationen anzu
main.help.preopt=Verwendung: jar [OPTION...] [ [--release VERSION] [-C dir] files] ...\njar erstellt ein Archiv f\u00FCr Klassen und Ressourcen und kann individuelle\nKlassen oder Ressourcen aus einem Archiv bearbeiten oder wiederherstellen.\n\n Beispiele:\n # Ein Archiv namens classes.jar mit zwei Klassendateien erstellen:\n jar --create --file classes.jar Foo.class Bar.class\n # Ein Archiv mit einem vorhandenen Manifest mit allen Dateien in foo/ erstellen:\n jar --create --file classes.jar --manifest mymanifest -C foo/ .\n # Ein modulares JAR-Archiv erstellen, dessen Moduldeskriptor sich in\n # classes/module-info.class befindet:\n jar --create --file foo.jar --main-class com.foo.Main --module-version 1.0\n -C foo/ classes resources\n # Ein vorhandenes nicht modulares JAR-Archiv in ein modulares JAR-Archiv aktualisieren:\n jar --update --file foo.jar --main-class com.foo.Main --module-version 1.0\n -C foo/ module-info.class\n # Multi-Release-JAR-Datei erstellen, wobei einige Dateien im Verzeichnis META-INF/versions/9 gespeichert werden:\n jar --create --file mr.jar -C foo classes --release 9 -C foo9 classes\n\nUm den "jar"-Befehl zu k\u00FCrzen oder zu vereinfachen, k\u00F6nnen Sie Argumente in einer separaten\nTextdatei angeben und diese mit dem @-Zeichen als Pr\u00E4fix an den "jar"-Befehl \u00FCbergeben.\n\n Beispiele:\n # Zus\u00E4tzliche Optionen und Liste der Klassendateien aus der Datei classes.list lesen\n jar --create --file my.jar @classes.list\n
main.help.opt.main=\ Hauptvorgangsmodus:\n
main.help.opt.main.create=\ -c, --create Erstellt das Archiv. Wenn der mit\n -f oder --file angegebene Archivdateiname einen Pfad enth\u00E4lt, werden auch fehlende\n \u00FCbergeordnete Verzeichnisse erstellt
main.help.opt.main.generate-index=\ -i, --generate-index=FILE Indexinformationen f\u00FCr die angegebenen JAR-\n Archive generieren
main.help.opt.main.generate-index=\ -i, --generate-index=FILE Generiert Indexinformationen f\u00FCr die angegebenen\n JAR-Archive. Diese Option ist veraltet und wird m\u00F6glicherweise in \n einem zuk\u00FCnftigen Release entfernt.
main.help.opt.main.list=\ -t, --list Das Inhaltsverzeichnis f\u00FCr das Archiv auflisten
main.help.opt.main.update=\ -u, --update Ein vorhandenes JAR-Archiv aktualisieren
main.help.opt.main.extract=\ -x, --extract Benannte (oder alle) Dateien aus dem Archiv extrahieren
main.help.opt.main.describe-module=\ -d, --describe-module Gibt die Modulbeschreibung oder den automatischen Modulnamen aus
main.help.opt.main.describe-module=\ -d, --describe-module Gibt den Moduldeskriptor oder automatischen Modulnamen aus
main.help.opt.main.validate=\ --validate Validiert den Inhalt des JAR-Archivs. Diese Option\n validiert, dass die von einem Multi-Release-JAR-Archiv\n exportierte API \u00FCber die verschiedenen Releaseversionen\n hinweg konsistent ist.
main.help.opt.any=\ In jedem Modus g\u00FCltige Vorgangsmodifikatoren:\n\n -C DIR Zum angegebenen Verzeichnis wechseln und die folgende\n Datei aufnehmen
main.help.opt.any.file=\ -f, --file=FILE Der Name der Archivdatei. Wenn Sie dies auslassen, wird entweder stdin oder\n stdout verwendet, je nach Vorgang\n --release VERSION Speichert alle der folgenden Dateien in einem versionierten Verzeichnis\n der JAR-Datei (d.h. META-INF/versions/VERSION/)

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 1999, 2022, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 1999, 2023, 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
@@ -81,7 +81,8 @@ warn.validator.identical.entry=\u8B66\u544A : \u30A8\u30F3\u30C8\u30EA{0}\u306B\
warn.validator.resources.with.same.name=\u8B66\u544A : \u30A8\u30F3\u30C8\u30EA{0}\u3001\u540C\u3058\u540D\u524D\u3092\u6301\u3064\u8907\u6570\u306E\u30EA\u30BD\u30FC\u30B9
warn.validator.concealed.public.class=\u8B66\u544A : \u30A8\u30F3\u30C8\u30EA{0}\u306F\u3001\u96A0\u3057\u30D1\u30C3\u30B1\u30FC\u30B8\u5185\u306Epublic\u30AF\u30E9\u30B9\u3067\u3059\u3002\n\u30AF\u30E9\u30B9\u30D1\u30B9\u306B\u3053\u306Ejar\u3092\u914D\u7F6E\u3059\u308B\u3068\u3001\u4E92\u63DB\u6027\u306E\u306A\u3044\npublic\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u304C\u751F\u6210\u3055\u308C\u307E\u3059
warn.release.unexpected.versioned.entry=\u4E88\u671F\u3057\u306A\u3044\u30D0\u30FC\u30B8\u30E7\u30CB\u30F3\u30B0\u6E08\u30A8\u30F3\u30C8\u30EA{0}
warn.flag.is.deprecated=\u8B66\u544A: {0}\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\u3002\n
warn.index.is.ignored=JDK 18\u4EE5\u964D\u3001JAR\u7D22\u5F15(META-INF/INDEX.LIST)\u306F\u5B9F\u884C\u6642\u306B\u7121\u8996\u3055\u308C\u307E\u3059
warn.flag.is.deprecated=\u8B66\u544A: {0}\u30AA\u30D7\u30B7\u30E7\u30F3\u306F\u975E\u63A8\u5968\u3067\u3042\u308A\u3001\u4ECA\u5F8C\u306E\u30EA\u30EA\u30FC\u30B9\u3067\u7121\u8996\u307E\u305F\u306F\u524A\u9664\u3055\u308C\u308B\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059\n
out.added.manifest=\u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u304C\u8FFD\u52A0\u3055\u308C\u307E\u3057\u305F
out.added.module-info=module-info\u304C\u8FFD\u52A0\u3055\u308C\u307E\u3057\u305F: {0}
out.automodule=\u30E2\u30B8\u30E5\u30FC\u30EB\u30FB\u30C7\u30A3\u30B9\u30AF\u30EA\u30D7\u30BF\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002\u81EA\u52D5\u30E2\u30B8\u30E5\u30FC\u30EB\u304C\u5C0E\u51FA\u3055\u308C\u307E\u3057\u305F\u3002
@@ -104,7 +105,7 @@ main.usage.summary.try=\u8A73\u7D30\u306F\u3001`jar --help'\u3092\u5B9F\u884C\u3
main.help.preopt=\u4F7F\u7528\u65B9\u6CD5: jar [OPTION...] [ [--release VERSION] [-C dir] files] ...\njar\u306F\u30AF\u30E9\u30B9\u304A\u3088\u3073\u30EA\u30BD\u30FC\u30B9\u306E\u30A2\u30FC\u30AB\u30A4\u30D6\u3092\u4F5C\u6210\u3057\u3001\u30A2\u30FC\u30AB\u30A4\u30D6\u304B\u3089\u500B\u3005\u306E\u30AF\u30E9\u30B9\u307E\u305F\u306F\n\u30EA\u30BD\u30FC\u30B9\u3092\u64CD\u4F5C\u307E\u305F\u306F\u5FA9\u5143\u3067\u304D\u307E\u3059\u3002\n\n \u4F8B:\n # 2\u3064\u306E\u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u542B\u3080classes.jar\u3068\u3044\u3046\u30A2\u30FC\u30AB\u30A4\u30D6\u3092\u4F5C\u6210\u3059\u308B:\n jar --create --file classes.jar Foo.class Bar.class\n # foo/\u306E\u3059\u3079\u3066\u306E\u30D5\u30A1\u30A4\u30EB\u3092\u542B\u3080\u3001\u65E2\u5B58\u306E\u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u3092\u4F7F\u7528\u3057\u305F\u30A2\u30FC\u30AB\u30A4\u30D6\u3092\u4F5C\u6210\u3059\u308B:\n jar --create --file classes.jar --manifest mymanifest -C foo/ .\n # \u30E2\u30B8\u30E5\u30E9jar\u30A2\u30FC\u30AB\u30A4\u30D6\u3092\u4F5C\u6210\u3059\u308B\u3002\u30E2\u30B8\u30E5\u30FC\u30EB\u30FB\u30C7\u30A3\u30B9\u30AF\u30EA\u30D7\u30BF\u306Fclasses/module-info.class\u306B\n # \u3042\u308B:\n jar --create --file foo.jar --main-class com.foo.Main --module-version 1.0\n -C foo/ classes resources\n # \u65E2\u5B58\u306E\u975E\u30E2\u30B8\u30E5\u30E9jar\u3092\u30E2\u30B8\u30E5\u30E9jar\u306B\u66F4\u65B0\u3059\u308B:\n jar --update --file foo.jar --main-class com.foo.Main --module-version 1.0\n -C foo/ module-info.class\n # \u8907\u6570\u30EA\u30EA\u30FC\u30B9jar\u3092\u4F5C\u6210\u3057\u3001\u4E00\u90E8\u306E\u30D5\u30A1\u30A4\u30EB\u3092META-INF/versions/9\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306B\u914D\u7F6E\u3059\u308B:\n jar --create --file mr.jar -C foo classes --release 9 -C foo9 classes\n\njar\u30B3\u30DE\u30F3\u30C9\u3092\u77ED\u7E2E\u307E\u305F\u306F\u7C21\u7565\u5316\u3059\u308B\u306B\u306F\u3001\u500B\u5225\u306E\u30C6\u30AD\u30B9\u30C8\u30FB\u30D5\u30A1\u30A4\u30EB\u3067\u5F15\u6570\u3092\u6307\u5B9A\u3057\u3001\n\u8A18\u53F7(@)\u3092\u63A5\u982D\u8F9E\u3068\u3057\u3066\u4F7F\u7528\u3057\u3066jar\u30B3\u30DE\u30F3\u30C9\u306B\u6E21\u3057\u307E\u3059\u3002\n\n \u4F8B:\n # \u8FFD\u52A0\u30AA\u30D7\u30B7\u30E7\u30F3\u304A\u3088\u3073\u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u306E\u30EA\u30B9\u30C8\u3092\u30D5\u30A1\u30A4\u30EBclasses.list\u304B\u3089\u8AAD\u8FBC\u307F\u307E\u3059\n jar --create --file my.jar @classes.list\n
main.help.opt.main=\ \u30E1\u30A4\u30F3\u64CD\u4F5C\u30E2\u30FC\u30C9:\n
main.help.opt.main.create=\ -c\u3001--create \u30A2\u30FC\u30AB\u30A4\u30D6\u3092\u4F5C\u6210\u3057\u307E\u3059\u3002-f\u307E\u305F\u306F--file\u3067\u6307\u5B9A\u3055\u308C\u305F\n \u30A2\u30FC\u30AB\u30A4\u30D6\u30FB\u30D5\u30A1\u30A4\u30EB\u540D\u306B\u30D1\u30B9\u304C\u542B\u307E\u308C\u3066\u3044\u308B\u5834\u5408\u306F\u3001\n \u6B20\u843D\u3057\u3066\u3044\u308B\u89AA\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3082\u4F5C\u6210\u3055\u308C\u307E\u3059
main.help.opt.main.generate-index=\ -i,\u3001--generate-index=FILE \u6307\u5B9A\u306Ejar\u30A2\u30FC\u30AB\u30A4\u30D6\u306E\u7D22\u5F15\u60C5\u5831\u3092\n \u751F\u6210\u3057\u307E\u3059
main.help.opt.main.generate-index=\ -i, --generate-index=FILE \u6307\u5B9A\u3057\u305Fjar\u30A2\u30FC\u30AB\u30A4\u30D6\u306E\u7D22\u5F15\u60C5\u5831\u3092\u751F\u6210\u3057\u307E\u3059\u3002\n \u3053\u306E\u30AA\u30D7\u30B7\u30E7\u30F3\u306F\u975E\u63A8\u5968\u3067\u3042\u308A\u3001\u4ECA\u5F8C\u306E\u30EA\u30EA\u30FC\u30B9\u3067\n \u524A\u9664\u3055\u308C\u308B\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059\u3002
main.help.opt.main.list=\ -t\u3001--list \u30A2\u30FC\u30AB\u30A4\u30D6\u306E\u5185\u5BB9\u3092\u4E00\u89A7\u8868\u793A\u3057\u307E\u3059
main.help.opt.main.update=\ -u\u3001--update \u65E2\u5B58\u306Ejar\u30A2\u30FC\u30AB\u30A4\u30D6\u3092\u66F4\u65B0\u3057\u307E\u3059
main.help.opt.main.extract=\ -x\u3001--extract \u6307\u5B9A\u306E(\u307E\u305F\u306F\u3059\u3079\u3066\u306E)\u30D5\u30A1\u30A4\u30EB\u3092\u30A2\u30FC\u30AB\u30A4\u30D6\u304B\u3089\u62BD\u51FA\u3057\u307E\u3059

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 1999, 2022, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 1999, 2023, 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
@@ -81,7 +81,8 @@ warn.validator.identical.entry=\u8B66\u544A: \u6761\u76EE {0} \u5305\u542B\u4E0E
warn.validator.resources.with.same.name=\u8B66\u544A: \u6761\u76EE {0}, \u591A\u4E2A\u8D44\u6E90\u5177\u6709\u76F8\u540C\u540D\u79F0
warn.validator.concealed.public.class=\u8B66\u544A: \u6761\u76EE {0} \u662F\u5DF2\u9690\u85CF\u7A0B\u5E8F\u5305\u4E2D\u7684\n\u516C\u5171\u7C7B, \u5C06\u6B64 jar \u653E\u7F6E\u5728\u7C7B\u8DEF\u5F84\u4E2D\n\u5C06\u5BFC\u81F4\u516C\u5171\u63A5\u53E3\u4E0D\u517C\u5BB9
warn.release.unexpected.versioned.entry=\u610F\u5916\u7684\u7248\u672C\u5316\u6761\u76EE {0}
warn.flag.is.deprecated=\u8B66\u544A\uFF1A{0} \u9009\u9879\u5DF2\u8FC7\u65F6\uFF0C\u8BA1\u5212\u5728\u672A\u6765\u7684 JDK \u53D1\u884C\u7248\u4E2D\u5220\u9664\u3002\n
warn.index.is.ignored=\u81EA JDK 18 \u8D77\uFF0C\u5728\u8FD0\u884C\u65F6\u5FFD\u7565 JAR \u7D22\u5F15 (META-INF/INDEX.LIST)
warn.flag.is.deprecated=\u8B66\u544A\uFF1A{0} \u9009\u9879\u5DF2\u8FC7\u65F6\uFF0C\u53EF\u80FD\u4F1A\u5728\u672A\u6765\u53D1\u884C\u7248\u4E2D\u5FFD\u7565\u6216\u5220\u9664\u3002\n
out.added.manifest=\u5DF2\u6DFB\u52A0\u6E05\u5355
out.added.module-info=\u5DF2\u6DFB\u52A0 module-info: {0}
out.automodule=\u627E\u4E0D\u5230\u6A21\u5757\u63CF\u8FF0\u7B26\u3002\u5DF2\u6D3E\u751F\u81EA\u52A8\u6A21\u5757\u3002
@@ -104,7 +105,7 @@ main.usage.summary.try=\u5C1D\u8BD5\u4F7F\u7528 `jar --help' \u83B7\u53D6\u8BE6\
main.help.preopt=\u7528\u6CD5: jar [OPTION...] [ [--release VERSION] [-C dir] files] ...\njar \u521B\u5EFA\u7C7B\u548C\u8D44\u6E90\u7684\u6863\u6848, \u5E76\u4E14\u53EF\u4EE5\u5904\u7406\u6863\u6848\u4E2D\u7684\n\u5355\u4E2A\u7C7B\u6216\u8D44\u6E90\u6216\u8005\u4ECE\u6863\u6848\u4E2D\u8FD8\u539F\u5355\u4E2A\u7C7B\u6216\u8D44\u6E90\u3002\n\n \u793A\u4F8B:\n # \u521B\u5EFA\u5305\u542B\u4E24\u4E2A\u7C7B\u6587\u4EF6\u7684\u540D\u4E3A classes.jar \u7684\u6863\u6848:\n jar --create --file classes.jar Foo.class Bar.class\n # \u4F7F\u7528\u73B0\u6709\u7684\u6E05\u5355\u521B\u5EFA\u6863\u6848, \u5176\u4E2D\u5305\u542B foo/ \u4E2D\u7684\u6240\u6709\u6587\u4EF6:\n jar --create --file classes.jar --manifest mymanifest -C foo/ .\n # \u521B\u5EFA\u6A21\u5757\u5316 jar \u6863\u6848, \u5176\u4E2D\u6A21\u5757\u63CF\u8FF0\u7B26\u4F4D\u4E8E\n # classes/module-info.class:\n jar --create --file foo.jar --main-class com.foo.Main --module-version 1.0\n -C foo/ classes resources\n # \u5C06\u73B0\u6709\u7684\u975E\u6A21\u5757\u5316 jar \u66F4\u65B0\u4E3A\u6A21\u5757\u5316 jar:\n jar --update --file foo.jar --main-class com.foo.Main --module-version 1.0\n -C foo/ module-info.class\n # \u521B\u5EFA\u5305\u542B\u591A\u4E2A\u53D1\u884C\u7248\u7684 jar, \u5E76\u5C06\u4E00\u4E9B\u6587\u4EF6\u653E\u5728 META-INF/versions/9 \u76EE\u5F55\u4E2D:\n jar --create --file mr.jar -C foo classes --release 9 -C foo9 classes\n\n\u8981\u7F29\u77ED\u6216\u7B80\u5316 jar \u547D\u4EE4, \u53EF\u4EE5\u5728\u5355\u72EC\u7684\u6587\u672C\u6587\u4EF6\u4E2D\u6307\u5B9A\u53C2\u6570,\n\u5E76\u4F7F\u7528 @ \u7B26\u53F7\u4F5C\u4E3A\u524D\u7F00\u5C06\u6B64\u6587\u4EF6\u4F20\u9012\u7ED9 jar \u547D\u4EE4\u3002\n\n \u793A\u4F8B:\n # \u4ECE\u6587\u4EF6 classes.list \u8BFB\u53D6\u9644\u52A0\u9009\u9879\u548C\u7C7B\u6587\u4EF6\u5217\u8868\n jar --create --file my.jar @classes.list\n
main.help.opt.main=\ \u4E3B\u64CD\u4F5C\u6A21\u5F0F:\n
main.help.opt.main.create=\ -c, --create \u521B\u5EFA\u6863\u6848\u3002\u901A\u8FC7 -f \u6216 --file \u6307\u5B9A\u7684\u6863\u6848\u6587\u4EF6\u540D\n \u5305\u542B\u8DEF\u5F84\u65F6\uFF0C\u8FD8\u5C06\u521B\u5EFA\n \u7F3A\u5C11\u7684\u7236\u76EE\u5F55
main.help.opt.main.generate-index=\ -i, --generate-index=FILE \u4E3A\u6307\u5B9A\u7684 jar \u6863\u6848\u751F\u6210\n \u7D22\u5F15\u4FE1\u606F
main.help.opt.main.generate-index=\ -i, --generate-index=FILE \u751F\u6210\u6307\u5B9A jar \u6863\u6848\u7684\u7D22\u5F15\u4FE1\u606F\u3002\n \u6B64\u9009\u9879\u5DF2\u8FC7\u65F6\uFF0C\n \u53EF\u80FD\u4F1A\u5728\u672A\u6765\u53D1\u884C\u7248\u4E2D\u5220\u9664\u3002
main.help.opt.main.list=\ -t, --list \u5217\u51FA\u6863\u6848\u7684\u76EE\u5F55
main.help.opt.main.update=\ -u, --update \u66F4\u65B0\u73B0\u6709 jar \u6863\u6848
main.help.opt.main.extract=\ -x, --extract \u4ECE\u6863\u6848\u4E2D\u63D0\u53D6\u6307\u5B9A\u7684 (\u6216\u5168\u90E8) \u6587\u4EF6

View File

@@ -104,8 +104,9 @@ doclet.URL_error=Fehler beim Abrufen der URL: {0}
doclet.Resource_error=Fehler beim Lesen der Ressource: {0}
doclet.link.no_reference=Keine Referenz angegeben
doclet.link.see.no_label=fehlendes Referenzlabel
doclet.see.class_or_package_not_found=Tag {0}: Referenz nicht gefunden: {1}
doclet.see.class_or_package_not_accessible=Tag {0}: Referenz nicht zug\u00E4nglich: {1}
doclet.link.see.reference_invalid=Ung\u00FCltige Referenz
doclet.link.see.reference_not_found=Referenz nicht gefunden: {0}
doclet.link.see.reference_not_accessible=Referenz nicht zug\u00E4nglich: {0}
doclet.see.nested_link=Tag {0}: Verschachtelter Link
doclet.throws.reference_not_found=Ausnahmetyp nach Name nicht gefunden
doclet.throws.reference_bad_type=Kein Ausnahmetyp: {0}
@@ -163,6 +164,7 @@ doclet.Enclosing_Class=Umschlie\u00DFende Klasse:
doclet.Enclosing_Interface=Umschlie\u00DFende Schnittstelle:
doclet.Inheritance_Tree=Vererbungsbaum
doclet.ReferencedIn=Referenziert in
doclet.Section=Abschnitt
doclet.External_Specification=Externe Spezifikation
doclet.External_Specifications=Externe Spezifikationen
doclet.External_Specifications.All_Specifications=Alle Spezifikationen

View File

@@ -104,8 +104,9 @@ doclet.URL_error=URL\u53D6\u51FA\u3057\u30A8\u30E9\u30FC: {0}
doclet.Resource_error=\u30EA\u30BD\u30FC\u30B9\u8AAD\u53D6\u308A\u30A8\u30E9\u30FC: {0}
doclet.link.no_reference=\u53C2\u7167\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093
doclet.link.see.no_label=\u53C2\u7167\u30E9\u30D9\u30EB\u304C\u3042\u308A\u307E\u305B\u3093
doclet.see.class_or_package_not_found=\u30BF\u30B0{0}: \u53C2\u7167\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093: {1}
doclet.see.class_or_package_not_accessible=\u30BF\u30B0{0}: \u53C2\u7167\u306B\u30A2\u30AF\u30BB\u30B9\u3067\u304D\u307E\u305B\u3093: {1}
doclet.link.see.reference_invalid=\u7121\u52B9\u306A\u53C2\u7167\u3067\u3059
doclet.link.see.reference_not_found=\u53C2\u7167\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093: {0}
doclet.link.see.reference_not_accessible=\u53C2\u7167\u306B\u30A2\u30AF\u30BB\u30B9\u3067\u304D\u307E\u305B\u3093: {0}
doclet.see.nested_link=\u30BF\u30B0{0}: \u30EA\u30F3\u30AF\u304C\u30CD\u30B9\u30C8\u3055\u308C\u3066\u3044\u307E\u3059
doclet.throws.reference_not_found=\u540D\u524D\u3067\u4F8B\u5916\u30BF\u30A4\u30D7\u3092\u898B\u3064\u3051\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u305B\u3093
doclet.throws.reference_bad_type=\u6B21\u306E\u4F8B\u5916\u30BF\u30A4\u30D7\u3067\u306F\u3042\u308A\u307E\u305B\u3093: {0}
@@ -163,6 +164,7 @@ 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.Section=\u30BB\u30AF\u30B7\u30E7\u30F3
doclet.External_Specification=\u5916\u90E8\u4ED5\u69D8
doclet.External_Specifications=\u5916\u90E8\u4ED5\u69D8
doclet.External_Specifications.All_Specifications=\u3059\u3079\u3066\u306E\u4ED5\u69D8

View File

@@ -104,8 +104,9 @@ doclet.URL_error=\u83B7\u53D6 URL \u65F6\u51FA\u9519: {0}
doclet.Resource_error=\u8BFB\u53D6\u8D44\u6E90\u65F6\u51FA\u9519\uFF1A{0}
doclet.link.no_reference=\u672A\u63D0\u4F9B\u5F15\u7528
doclet.link.see.no_label=\u7F3A\u5C11\u5F15\u7528\u6807\u7B7E
doclet.see.class_or_package_not_found=\u6807\u8BB0{0}: \u627E\u4E0D\u5230\u5F15\u7528: {1}
doclet.see.class_or_package_not_accessible=\u6807\u8BB0{0}: \u65E0\u6CD5\u8BBF\u95EE\u5F15\u7528: {1}
doclet.link.see.reference_invalid=\u5F15\u7528\u65E0\u6548
doclet.link.see.reference_not_found=\u672A\u627E\u5230\u5F15\u7528: {0}
doclet.link.see.reference_not_accessible=\u65E0\u6CD5\u8BBF\u95EE\u5F15\u7528\uFF1A{0}
doclet.see.nested_link=\u6807\u8BB0 {0}\uFF1A\u5D4C\u5957\u94FE\u63A5
doclet.throws.reference_not_found=\u65E0\u6CD5\u6309\u540D\u79F0\u67E5\u627E\u5F02\u5E38\u9519\u8BEF\u7C7B\u578B
doclet.throws.reference_bad_type=\u4E0D\u662F\u5F02\u5E38\u9519\u8BEF\u7C7B\u578B\uFF1A{0}
@@ -163,6 +164,7 @@ 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.Section=\u8282
doclet.External_Specification=\u5916\u90E8\u89C4\u8303
doclet.External_Specifications=\u5916\u90E8\u89C4\u8303
doclet.External_Specifications.All_Specifications=\u6240\u6709\u89C4\u8303

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2010, 2022, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2010, 2023, 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
@@ -48,10 +48,10 @@ doclet.File_not_found=Datei nicht gefunden: {0}
doclet.snippet_file_not_found=Datei nicht gefunden in Quellpfad oder Snippet-Pfad: {0}
doclet.Copy_Overwrite_warning=Datei {0} wurde nicht in {1} kopiert, da bereits eine Datei mit demselben Namen vorhanden ist...
doclet.Copy_Ignored_warning=Die Datei {0} wurde nicht kopiert: ung\u00FCltiger Name
doclet.Copy_to_clipboard=Kopieren
doclet.Copied_to_clipboard=Kopiert.
doclet.Copy_url_to_clipboard=URL kopieren
doclet.Copied_url_to_clipboard=Kopiert.
doclet.Copy_snippet_to_clipboard=Kopieren
doclet.Copied_snippet_to_clipboard=Kopiert.
doclet.Copy_snippet_to_clipboard=Snippet kopieren
doclet.Copying_File_0_To_Dir_1=Datei {0} wird in Verzeichnis {1} kopiert...
doclet.Copying_File_0_To_File_1=Datei {0} wird in Datei {1} kopiert...
doclet.No_Public_Classes_To_Document=Keine \u00F6ffentlichen oder gesch\u00FCtzten Klassen zur Dokumentation gefunden.
@@ -64,6 +64,8 @@ doclet.Building_Index_For_All_Classes=Index f\u00FCr alle Klassen wird erstellt.
doclet.sourcetab_warning=Das Argument f\u00FCr -sourcetab muss eine Ganzzahl sein, die gr\u00F6\u00DFer als 0 ist.
doclet.JavaScript_in_comment=JavaScript in Dokumentationskommentar gefunden.\nVerwenden Sie --allow-script-in-comments, um die Verwendung von JavaScript zuzulassen.
doclet.JavaScript_in_option=Option {0} enth\u00E4lt JavaScript.\nVerwenden Sie --allow-script-in-comments, um die Verwendung von JavaScript zuzulassen.
doclet.Link_icon=Linksymbol
doclet.Link_to_section=Link zu diesem Abschnitt
doclet.Packages=Packages
doclet.All_Packages=Alle Packages
doclet.Modules=Module

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2010, 2022, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2010, 2023, 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
@@ -48,10 +48,10 @@ doclet.File_not_found=\u30D5\u30A1\u30A4\u30EB\u304C\u898B\u3064\u304B\u308A\u30
doclet.snippet_file_not_found=\u30BD\u30FC\u30B9\u30FB\u30D1\u30B9\u307E\u305F\u306F\u30B9\u30CB\u30DA\u30C3\u30C8\u306E\u30D1\u30B9\u306B\u30D5\u30A1\u30A4\u30EB\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093: {0}
doclet.Copy_Overwrite_warning=\u30D5\u30A1\u30A4\u30EB{0}\u306F\u540C\u3058\u540D\u524D\u306E\u30D5\u30A1\u30A4\u30EB\u304C\u3042\u308B\u306E\u3067{1}\u306B\u30B3\u30D4\u30FC\u3055\u308C\u307E\u305B\u3093\u3067\u3057\u305F...
doclet.Copy_Ignored_warning=\u30D5\u30A1\u30A4\u30EB{0}\u306F\u30B3\u30D4\u30FC\u3055\u308C\u307E\u305B\u3093\u3067\u3057\u305F: \u540D\u524D\u304C\u7121\u52B9\u3067\u3059
doclet.Copy_to_clipboard=\u30B3\u30D4\u30FC
doclet.Copied_to_clipboard=\u30B3\u30D4\u30FC\u6E08
doclet.Copy_url_to_clipboard=URL\u306E\u30B3\u30D4\u30FC
doclet.Copied_url_to_clipboard=\u30B3\u30D4\u30FC\u6E08
doclet.Copy_snippet_to_clipboard=\u30B3\u30D4\u30FC
doclet.Copied_snippet_to_clipboard=\u30B3\u30D4\u30FC\u6E08
doclet.Copy_snippet_to_clipboard=\u30B9\u30CB\u30DA\u30C3\u30C8\u306E\u30B3\u30D4\u30FC
doclet.Copying_File_0_To_Dir_1=\u30D5\u30A1\u30A4\u30EB{0}\u3092\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA{1}\u306B\u30B3\u30D4\u30FC\u4E2D...
doclet.Copying_File_0_To_File_1=\u30D5\u30A1\u30A4\u30EB{0}\u3092\u30D5\u30A1\u30A4\u30EB{1}\u306B\u30B3\u30D4\u30FC\u4E2D...
doclet.No_Public_Classes_To_Document=\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u5316\u3059\u308Bpublic\u307E\u305F\u306Fprotected\u30AF\u30E9\u30B9\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002
@@ -64,6 +64,8 @@ doclet.Building_Index_For_All_Classes=\u5168\u30AF\u30E9\u30B9\u306E\u30A4\u30F3
doclet.sourcetab_warning=-sourcetab\u306E\u5F15\u6570\u306F0\u3088\u308A\u5927\u304D\u3044\u6574\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
doclet.JavaScript_in_comment=\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u30FB\u30B3\u30E1\u30F3\u30C8\u306BJavaScript\u304C\u898B\u3064\u304B\u308A\u307E\u3057\u305F\u3002\n--allow-script-in-comments\u3092\u4F7F\u7528\u3057\u3066\u3001JavaScript\u306E\u4F7F\u7528\u3092\u8A31\u53EF\u3057\u3066\u304F\u3060\u3055\u3044\u3002
doclet.JavaScript_in_option=\u30AA\u30D7\u30B7\u30E7\u30F3{0}\u306BJavaScript\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u3059\u3002\n--allow-script-in-comments\u3092\u4F7F\u7528\u3057\u3066\u3001JavaScript\u306E\u4F7F\u7528\u3092\u8A31\u53EF\u3057\u3066\u304F\u3060\u3055\u3044\u3002
doclet.Link_icon=\u30EA\u30F3\u30AF\u30FB\u30A2\u30A4\u30B3\u30F3
doclet.Link_to_section=\u3053\u306E\u30BB\u30AF\u30B7\u30E7\u30F3\u306B\u30EA\u30F3\u30AF
doclet.Packages=\u30D1\u30C3\u30B1\u30FC\u30B8
doclet.All_Packages=\u3059\u3079\u3066\u306E\u30D1\u30C3\u30B1\u30FC\u30B8
doclet.Modules=\u30E2\u30B8\u30E5\u30FC\u30EB

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2010, 2022, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2010, 2023, 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
@@ -48,10 +48,10 @@ doclet.File_not_found=\u627E\u4E0D\u5230\u6587\u4EF6: {0}
doclet.snippet_file_not_found=\u5728\u6E90\u8DEF\u5F84\u6216\u7247\u6BB5\u8DEF\u5F84\u4E2D\u627E\u4E0D\u5230\u6587\u4EF6\uFF1A{0}
doclet.Copy_Overwrite_warning=\u672A\u5C06\u6587\u4EF6{0}\u590D\u5236\u5230 {1}, \u56E0\u4E3A\u73B0\u6709\u6587\u4EF6\u5177\u6709\u76F8\u540C\u540D\u79F0...
doclet.Copy_Ignored_warning=\u672A\u590D\u5236\u6587\u4EF6 {0}\uFF1A\u540D\u79F0\u65E0\u6548
doclet.Copy_to_clipboard=\u590D\u5236
doclet.Copied_to_clipboard=\u5DF2\u590D\u5236\uFF01
doclet.Copy_url_to_clipboard=\u590D\u5236 URL
doclet.Copied_url_to_clipboard=\u5DF2\u590D\u5236\uFF01
doclet.Copy_snippet_to_clipboard=\u590D\u5236
doclet.Copied_snippet_to_clipboard=\u5DF2\u590D\u5236\uFF01
doclet.Copy_snippet_to_clipboard=\u590D\u5236\u7247\u6BB5
doclet.Copying_File_0_To_Dir_1=\u6B63\u5728\u5C06\u6587\u4EF6{0}\u590D\u5236\u5230\u76EE\u5F55 {1}...
doclet.Copying_File_0_To_File_1=\u6B63\u5728\u5C06\u6587\u4EF6{0}\u590D\u5236\u5230\u6587\u4EF6{1}...
doclet.No_Public_Classes_To_Document=\u627E\u4E0D\u5230\u53EF\u4EE5\u6587\u6863\u5316\u7684\u516C\u5171\u6216\u53D7\u4FDD\u62A4\u7684\u7C7B\u3002
@@ -64,6 +64,8 @@ doclet.Building_Index_For_All_Classes=\u6B63\u5728\u6784\u5EFA\u6240\u6709\u7C7B
doclet.sourcetab_warning=-sourcetab \u7684\u53C2\u6570\u5FC5\u987B\u662F\u5927\u4E8E 0 \u7684\u6574\u6570\u3002
doclet.JavaScript_in_comment=\u6587\u6863\u6CE8\u91CA\u4E2D\u53D1\u73B0 JavaScript\u3002\n\u4F7F\u7528 --allow-script-in-comments \u53EF\u5141\u8BB8\u4F7F\u7528 JavaScript\u3002
doclet.JavaScript_in_option=\u9009\u9879 {0} \u5305\u542B JavaScript\u3002\n\u4F7F\u7528 --allow-script-in-comments \u53EF\u5141\u8BB8\u4F7F\u7528 JavaScript\u3002
doclet.Link_icon=\u94FE\u63A5\u56FE\u6807
doclet.Link_to_section=\u94FE\u63A5\u5230\u6B64\u8282
doclet.Packages=\u7A0B\u5E8F\u5305
doclet.All_Packages=\u6240\u6709\u7A0B\u5E8F\u5305
doclet.Modules=\u6A21\u5757

View File

@@ -77,8 +77,8 @@ dc.tag.nested.tag=verschachteltes Tag: {0}
dc.tag.not.allowed.here = Tag hier nicht zul\u00E4ssig: <{0}>
dc.tag.not.allowed = Element nicht zul\u00E4ssig in Dokumentationskommentaren: <{0}>
dc.tag.not.allowed.inline.element = Blockelement nicht zul\u00E4ssig in Inlineelement <{1}>: {0}
dc.tag.not.allowed.inline.tag = Blockelement nicht zul\u00E4ssig in @{1}: {0}
dc.tag.not.allowed.inline.other = Blockelement hier nicht zul\u00E4ssig: {0}
dc.tag.not.allowed.element.default.style = Blockelement <{0}> nicht zul\u00E4ssig in Element <{1}> mit Standardstil
dc.tag.not.allowed.tag.default.style = Blockelement <{0}> nicht zul\u00E4ssig in @{1} mit Standardstil
dc.tag.not.closed= Element nicht geschlossen: {0}
dc.tag.p.in.pre= unerwartete Verwendung von <p> in <pre>-Element
dc.tag.requires.heading = \u00DCberschrift nicht gefunden f\u00FCr </{0}>

View File

@@ -77,8 +77,8 @@ dc.tag.nested.tag=\u30CD\u30B9\u30C8\u3055\u308C\u305F\u30BF\u30B0: {0}
dc.tag.not.allowed.here = \u3053\u3053\u3067\u306F\u30BF\u30B0\u3092\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093: <{0}>
dc.tag.not.allowed = \u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u30FB\u30B3\u30E1\u30F3\u30C8\u3067\u4F7F\u7528\u3067\u304D\u306A\u3044\u8981\u7D20\u3067\u3059: <{0}>
dc.tag.not.allowed.inline.element = \u30A4\u30F3\u30E9\u30A4\u30F3\u8981\u7D20<{1}>\u5185\u3067\u4F7F\u7528\u3067\u304D\u306A\u3044\u30D6\u30ED\u30C3\u30AF\u8981\u7D20\u3067\u3059: {0}
dc.tag.not.allowed.inline.tag = @{1}\u5185\u3067\u4F7F\u7528\u3067\u304D\u306A\u3044\u30D6\u30ED\u30C3\u30AF\u8981\u7D20\u3067\u3059: {0}
dc.tag.not.allowed.inline.other = \u3053\u3053\u3067\u306F\u30D6\u30ED\u30C3\u30AF\u8981\u7D20\u3092\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093: {0}
dc.tag.not.allowed.element.default.style = \u30D6\u30ED\u30C3\u30AF\u8981\u7D20<{0}>\u306F\u30C7\u30D5\u30A9\u30EB\u30C8\u30FB\u30B9\u30BF\u30A4\u30EB\u306E\u8981\u7D20<{1}>\u5185\u3067\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093
dc.tag.not.allowed.tag.default.style = \u30D6\u30ED\u30C3\u30AF\u8981\u7D20<{0}>\u306F\u30C7\u30D5\u30A9\u30EB\u30C8\u30FB\u30B9\u30BF\u30A4\u30EB\u306E@{1}\u5185\u3067\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093
dc.tag.not.closed= \u8981\u7D20\u304C\u9589\u3058\u3089\u308C\u3066\u3044\u307E\u305B\u3093: {0}
dc.tag.p.in.pre= <pre>\u8981\u7D20\u5185\u3067\u4E88\u671F\u3057\u306A\u3044<p>\u304C\u4F7F\u7528\u3055\u308C\u3066\u3044\u307E\u3059
dc.tag.requires.heading = </{0}>\u306E\u898B\u51FA\u3057\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093

View File

@@ -77,8 +77,8 @@ dc.tag.nested.tag=\u5D4C\u5957\u6807\u8BB0\uFF1A{0}
dc.tag.not.allowed.here = \u6B64\u5904\u4E0D\u5141\u8BB8\u4F7F\u7528\u6807\u8BB0: <{0}>
dc.tag.not.allowed = \u6587\u6863\u6CE8\u91CA\u4E2D\u4E0D\u5141\u8BB8\u4F7F\u7528\u5143\u7D20: <{0}>
dc.tag.not.allowed.inline.element = \u5185\u5D4C\u5143\u7D20 <{1}> \u4E2D\u4E0D\u5141\u8BB8\u4F7F\u7528\u5757\u5143\u7D20: {0}
dc.tag.not.allowed.inline.tag = @{1} \u4E2D\u4E0D\u5141\u8BB8\u4F7F\u7528\u5757\u5143\u7D20: {0}
dc.tag.not.allowed.inline.other = \u6B64\u5904\u4E0D\u5141\u8BB8\u4F7F\u7528\u5757\u5143\u7D20: {0}
dc.tag.not.allowed.element.default.style = \u91C7\u7528\u9ED8\u8BA4\u6837\u5F0F\u7684\u5143\u7D20 <{1}> \u4E2D\u4E0D\u5141\u8BB8\u4F7F\u7528\u5757\u5143\u7D20 <{0}>
dc.tag.not.allowed.tag.default.style = \u91C7\u7528\u9ED8\u8BA4\u6837\u5F0F\u7684 @{1} \u4E2D\u4E0D\u5141\u8BB8\u4F7F\u7528\u5757\u5143\u7D20 <{0}>
dc.tag.not.closed= \u5143\u7D20\u672A\u5173\u95ED: {0}
dc.tag.p.in.pre= <pre> \u5143\u7D20\u5185\u90E8\u610F\u5916\u5730\u4F7F\u7528\u4E86 <p>
dc.tag.requires.heading = \u672A\u627E\u5230 </{0}> \u7684\u6807\u9898

View File

@@ -987,7 +987,7 @@ public class ElementsTable {
* @return true if the element is visible
*/
public boolean isSelected(Element e) {
if (toolEnv.isSynthetic((Symbol) e)) {
if (toolEnv.isSynthetic((Symbol) e) && !toolEnv.isUnnamed((Symbol) e)) {
return false;
}
if (visibleElementVisitor == null) {

Some files were not shown because too many files have changed in this diff Show More