diff --git a/.hgtags-top-repo b/.hgtags-top-repo
index e7cd2f8b813..4a5b7897a36 100644
--- a/.hgtags-top-repo
+++ b/.hgtags-top-repo
@@ -319,3 +319,4 @@ c706ef5ea5da00078dc5e4334660315f7d99c15b jdk9-b71
57f3134853ecdd4a3ee2d4d26f22ba981d653d79 jdk9-b74
8fd6eeb878606e39c908f12535f34ebbfd225a4a jdk9-b75
d82072b699b880a1f647a5e2d7c0f86cec958941 jdk9-b76
+7972dc8f2a47f0c4cd8f02fa5662af41f028aa14 jdk9-b77
diff --git a/hotspot/.hgtags b/hotspot/.hgtags
index ec379ef03c1..9662d2a1477 100644
--- a/hotspot/.hgtags
+++ b/hotspot/.hgtags
@@ -479,3 +479,4 @@ e37d432868be0aa7cb5e0f3d7caff1e825d8ead3 jdk9-b73
fff6b54e9770ac4c12c2fb4cab5aa7672affa4bd jdk9-b74
2f354281e9915275693c4e519a959b8a6f22d3a3 jdk9-b75
0bc8d1656d6f2b1fdfe803c1305a108bb9939f35 jdk9-b76
+e66c3813789debfc06f206afde1bf7a84cb08451 jdk9-b77
diff --git a/hotspot/src/cpu/aarch64/vm/aarch64.ad b/hotspot/src/cpu/aarch64/vm/aarch64.ad
index bef849a2050..37d1b09cdda 100644
--- a/hotspot/src/cpu/aarch64/vm/aarch64.ad
+++ b/hotspot/src/cpu/aarch64/vm/aarch64.ad
@@ -2389,9 +2389,11 @@ int HandlerImpl::emit_exception_handler(CodeBuffer& cbuf)
// Note that the code buffer's insts_mark is always relative to insts.
// That's why we must use the macroassembler to generate a handler.
MacroAssembler _masm(&cbuf);
- address base =
- __ start_a_stub(size_exception_handler());
- if (base == NULL) return 0; // CodeBuffer::expand failed
+ address base = __ start_a_stub(size_exception_handler());
+ if (base == NULL) {
+ ciEnv::current()->record_failure("CodeCache is full");
+ return 0; // CodeBuffer::expand failed
+ }
int offset = __ offset();
__ far_jump(RuntimeAddress(OptoRuntime::exception_blob()->entry_point()));
assert(__ offset() - offset <= (int) size_exception_handler(), "overflow");
@@ -2405,9 +2407,11 @@ int HandlerImpl::emit_deopt_handler(CodeBuffer& cbuf)
// Note that the code buffer's insts_mark is always relative to insts.
// That's why we must use the macroassembler to generate a handler.
MacroAssembler _masm(&cbuf);
- address base =
- __ start_a_stub(size_deopt_handler());
- if (base == NULL) return 0; // CodeBuffer::expand failed
+ address base = __ start_a_stub(size_deopt_handler());
+ if (base == NULL) {
+ ciEnv::current()->record_failure("CodeCache is full");
+ return 0; // CodeBuffer::expand failed
+ }
int offset = __ offset();
__ adr(lr, __ pc());
@@ -3657,24 +3661,37 @@ encode %{
MacroAssembler _masm(&cbuf);
address addr = (address)$meth$$method;
+ address call;
if (!_method) {
// A call to a runtime wrapper, e.g. new, new_typeArray_Java, uncommon_trap.
- __ trampoline_call(Address(addr, relocInfo::runtime_call_type), &cbuf);
+ call = __ trampoline_call(Address(addr, relocInfo::runtime_call_type), &cbuf);
} else if (_optimized_virtual) {
- __ trampoline_call(Address(addr, relocInfo::opt_virtual_call_type), &cbuf);
+ call = __ trampoline_call(Address(addr, relocInfo::opt_virtual_call_type), &cbuf);
} else {
- __ trampoline_call(Address(addr, relocInfo::static_call_type), &cbuf);
+ call = __ trampoline_call(Address(addr, relocInfo::static_call_type), &cbuf);
+ }
+ if (call == NULL) {
+ ciEnv::current()->record_failure("CodeCache is full");
+ return;
}
if (_method) {
// Emit stub for static call
- CompiledStaticCall::emit_to_interp_stub(cbuf);
+ address stub = CompiledStaticCall::emit_to_interp_stub(cbuf);
+ if (stub == NULL) {
+ ciEnv::current()->record_failure("CodeCache is full");
+ return;
+ }
}
%}
enc_class aarch64_enc_java_dynamic_call(method meth) %{
MacroAssembler _masm(&cbuf);
- __ ic_call((address)$meth$$method);
+ address call = __ ic_call((address)$meth$$method);
+ if (call == NULL) {
+ ciEnv::current()->record_failure("CodeCache is full");
+ return;
+ }
%}
enc_class aarch64_enc_call_epilog() %{
@@ -3695,7 +3712,11 @@ encode %{
address entry = (address)$meth$$method;
CodeBlob *cb = CodeCache::find_blob(entry);
if (cb) {
- __ trampoline_call(Address(entry, relocInfo::runtime_call_type));
+ address call = __ trampoline_call(Address(entry, relocInfo::runtime_call_type));
+ if (call == NULL) {
+ ciEnv::current()->record_failure("CodeCache is full");
+ return;
+ }
} else {
int gpcnt;
int fpcnt;
diff --git a/hotspot/src/cpu/aarch64/vm/c1_CodeStubs_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/c1_CodeStubs_aarch64.cpp
index 5cb78d2055d..bdfc017aa82 100644
--- a/hotspot/src/cpu/aarch64/vm/c1_CodeStubs_aarch64.cpp
+++ b/hotspot/src/cpu/aarch64/vm/c1_CodeStubs_aarch64.cpp
@@ -327,9 +327,16 @@ void ArrayCopyStub::emit_code(LIR_Assembler* ce) {
ce->align_call(lir_static_call);
ce->emit_static_call_stub();
+ if (ce->compilation()->bailed_out()) {
+ return; // CodeCache is full
+ }
Address resolve(SharedRuntime::get_resolve_static_call_stub(),
relocInfo::static_call_type);
- __ trampoline_call(resolve);
+ address call = __ trampoline_call(resolve);
+ if (call == NULL) {
+ ce->bailout("trampoline stub overflow");
+ return;
+ }
ce->add_call_info_here(info());
#ifndef PRODUCT
diff --git a/hotspot/src/cpu/aarch64/vm/c1_LIRAssembler_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/c1_LIRAssembler_aarch64.cpp
index 353486c402d..907370d1385 100644
--- a/hotspot/src/cpu/aarch64/vm/c1_LIRAssembler_aarch64.cpp
+++ b/hotspot/src/cpu/aarch64/vm/c1_LIRAssembler_aarch64.cpp
@@ -1996,13 +1996,21 @@ void LIR_Assembler::align_call(LIR_Code code) { }
void LIR_Assembler::call(LIR_OpJavaCall* op, relocInfo::relocType rtype) {
- __ trampoline_call(Address(op->addr(), rtype));
+ address call = __ trampoline_call(Address(op->addr(), rtype));
+ if (call == NULL) {
+ bailout("trampoline stub overflow");
+ return;
+ }
add_call_info(code_offset(), op->info());
}
void LIR_Assembler::ic_call(LIR_OpJavaCall* op) {
- __ ic_call(op->addr());
+ address call = __ ic_call(op->addr());
+ if (call == NULL) {
+ bailout("trampoline stub overflow");
+ return;
+ }
add_call_info(code_offset(), op->info());
}
diff --git a/hotspot/src/cpu/aarch64/vm/c1_LIRAssembler_aarch64.hpp b/hotspot/src/cpu/aarch64/vm/c1_LIRAssembler_aarch64.hpp
index d6d323857d3..6d7e27e617b 100644
--- a/hotspot/src/cpu/aarch64/vm/c1_LIRAssembler_aarch64.hpp
+++ b/hotspot/src/cpu/aarch64/vm/c1_LIRAssembler_aarch64.hpp
@@ -26,6 +26,9 @@
#ifndef CPU_X86_VM_C1_LIRASSEMBLER_X86_HPP
#define CPU_X86_VM_C1_LIRASSEMBLER_X86_HPP
+// ArrayCopyStub needs access to bailout
+friend class ArrayCopyStub;
+
private:
int array_element_size(BasicType type) const;
diff --git a/hotspot/src/cpu/aarch64/vm/compiledIC_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/compiledIC_aarch64.cpp
index 44e124cf6d9..b30a4a6df10 100644
--- a/hotspot/src/cpu/aarch64/vm/compiledIC_aarch64.cpp
+++ b/hotspot/src/cpu/aarch64/vm/compiledIC_aarch64.cpp
@@ -51,7 +51,7 @@ bool CompiledIC::is_icholder_call_site(virtual_call_Relocation* call_site) {
// ----------------------------------------------------------------------------
#define __ _masm.
-void CompiledStaticCall::emit_to_interp_stub(CodeBuffer &cbuf) {
+address CompiledStaticCall::emit_to_interp_stub(CodeBuffer &cbuf) {
// Stub is fixed up when the corresponding call is converted from
// calling compiled code to calling interpreted code.
// mov rmethod, 0
@@ -63,10 +63,11 @@ void CompiledStaticCall::emit_to_interp_stub(CodeBuffer &cbuf) {
// That's why we must use the macroassembler to generate a stub.
MacroAssembler _masm(&cbuf);
- address base = __ start_a_stub(to_interp_stub_size()*2);
-
+ address base = __ start_a_stub(to_interp_stub_size());
int offset = __ offset();
- if (base == NULL) return; // CodeBuffer::expand failed
+ if (base == NULL) {
+ return NULL; // CodeBuffer::expand failed
+ }
// static stub relocation stores the instruction address of the call
__ relocate(static_stub_Relocation::spec(mark));
// static stub relocation also tags the Method* in the code-stream.
@@ -76,6 +77,7 @@ void CompiledStaticCall::emit_to_interp_stub(CodeBuffer &cbuf) {
assert((__ offset() - offset) <= (int)to_interp_stub_size(), "stub too big");
__ end_a_stub();
+ return base;
}
#undef __
diff --git a/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp
index e8f0612460c..2bd4127cd50 100644
--- a/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp
+++ b/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp
@@ -664,7 +664,7 @@ void MacroAssembler::call_VM_helper(Register oop_result, address entry_point, in
// Maybe emit a call via a trampoline. If the code cache is small
// trampolines won't be emitted.
-void MacroAssembler::trampoline_call(Address entry, CodeBuffer *cbuf) {
+address MacroAssembler::trampoline_call(Address entry, CodeBuffer *cbuf) {
assert(entry.rspec().type() == relocInfo::runtime_call_type
|| entry.rspec().type() == relocInfo::opt_virtual_call_type
|| entry.rspec().type() == relocInfo::static_call_type
@@ -672,7 +672,10 @@ void MacroAssembler::trampoline_call(Address entry, CodeBuffer *cbuf) {
unsigned int start_offset = offset();
if (far_branches() && !Compile::current()->in_scratch_emit_size()) {
- emit_trampoline_stub(offset(), entry.target());
+ address stub = emit_trampoline_stub(start_offset, entry.target());
+ if (stub == NULL) {
+ return NULL; // CodeCache is full
+ }
}
if (cbuf) cbuf->set_insts_mark();
@@ -682,6 +685,8 @@ void MacroAssembler::trampoline_call(Address entry, CodeBuffer *cbuf) {
} else {
bl(pc());
}
+ // just need to return a non-null address
+ return pc();
}
@@ -696,13 +701,11 @@ void MacroAssembler::trampoline_call(Address entry, CodeBuffer *cbuf) {
// load the call target from the constant pool
// branch (LR still points to the call site above)
-void MacroAssembler::emit_trampoline_stub(int insts_call_instruction_offset,
+address MacroAssembler::emit_trampoline_stub(int insts_call_instruction_offset,
address dest) {
address stub = start_a_stub(Compile::MAX_stubs_size/2);
if (stub == NULL) {
- start_a_stub(Compile::MAX_stubs_size/2);
- Compile::current()->env()->record_out_of_memory_failure();
- return;
+ return NULL; // CodeBuffer::expand failed
}
// Create a trampoline stub relocation which relates this trampoline stub
@@ -729,15 +732,16 @@ void MacroAssembler::emit_trampoline_stub(int insts_call_instruction_offset,
assert(is_NativeCallTrampolineStub_at(stub_start_addr), "doesn't look like a trampoline");
end_a_stub();
+ return stub;
}
-void MacroAssembler::ic_call(address entry) {
+address MacroAssembler::ic_call(address entry) {
RelocationHolder rh = virtual_call_Relocation::spec(pc());
// address const_ptr = long_constant((jlong)Universe::non_oop_word());
// unsigned long offset;
// ldr_constant(rscratch2, const_ptr);
movptr(rscratch2, (uintptr_t)Universe::non_oop_word());
- trampoline_call(Address(entry, rh));
+ return trampoline_call(Address(entry, rh));
}
// Implementation of call_VM versions
diff --git a/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.hpp b/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.hpp
index 5f903720d97..9711266f52d 100644
--- a/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.hpp
+++ b/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.hpp
@@ -539,7 +539,7 @@ public:
static int patch_oop(address insn_addr, address o);
- void emit_trampoline_stub(int insts_call_instruction_offset, address target);
+ address emit_trampoline_stub(int insts_call_instruction_offset, address target);
// The following 4 methods return the offset of the appropriate move instruction
@@ -942,7 +942,7 @@ public:
// Calls
- void trampoline_call(Address entry, CodeBuffer *cbuf = NULL);
+ address trampoline_call(Address entry, CodeBuffer *cbuf = NULL);
static bool far_branches() {
return ReservedCodeCacheSize > branch_range;
@@ -962,7 +962,7 @@ public:
}
// Emit the CompiledIC call idiom
- void ic_call(address entry);
+ address ic_call(address entry);
public:
diff --git a/hotspot/src/cpu/ppc/vm/compiledIC_ppc.cpp b/hotspot/src/cpu/ppc/vm/compiledIC_ppc.cpp
index 1b54594d09c..762a329e259 100644
--- a/hotspot/src/cpu/ppc/vm/compiledIC_ppc.cpp
+++ b/hotspot/src/cpu/ppc/vm/compiledIC_ppc.cpp
@@ -94,7 +94,7 @@ bool CompiledIC::is_icholder_call_site(virtual_call_Relocation* call_site) {
const int IC_pos_in_java_to_interp_stub = 8;
#define __ _masm.
-void CompiledStaticCall::emit_to_interp_stub(CodeBuffer &cbuf) {
+address CompiledStaticCall::emit_to_interp_stub(CodeBuffer &cbuf) {
#ifdef COMPILER2
// Get the mark within main instrs section which is set to the address of the call.
address call_addr = cbuf.insts_mark();
@@ -106,8 +106,7 @@ void CompiledStaticCall::emit_to_interp_stub(CodeBuffer &cbuf) {
// Start the stub.
address stub = __ start_a_stub(CompiledStaticCall::to_interp_stub_size());
if (stub == NULL) {
- Compile::current()->env()->record_out_of_memory_failure();
- return;
+ return NULL; // CodeCache is full
}
// For java_to_interp stubs we use R11_scratch1 as scratch register
@@ -149,6 +148,7 @@ void CompiledStaticCall::emit_to_interp_stub(CodeBuffer &cbuf) {
// End the stub.
__ end_a_stub();
+ return stub;
#else
ShouldNotReachHere();
#endif
diff --git a/hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.cpp b/hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.cpp
index 00330ef3461..2c95de9b782 100644
--- a/hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.cpp
+++ b/hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.cpp
@@ -2187,7 +2187,7 @@ void InterpreterMacroAssembler::get_method_counters(Register method,
}
void InterpreterMacroAssembler::increment_invocation_counter(Register Rcounters, Register iv_be_count, Register Rtmp_r0) {
- assert(UseCompiler, "incrementing must be useful");
+ assert(UseCompiler || LogTouchedMethods, "incrementing must be useful");
Register invocation_count = iv_be_count;
Register backedge_count = Rtmp_r0;
int delta = InvocationCounter::count_increment;
diff --git a/hotspot/src/cpu/ppc/vm/ppc.ad b/hotspot/src/cpu/ppc/vm/ppc.ad
index a4e5f5a454a..5e0e977e287 100644
--- a/hotspot/src/cpu/ppc/vm/ppc.ad
+++ b/hotspot/src/cpu/ppc/vm/ppc.ad
@@ -1082,7 +1082,7 @@ void CallStubImpl::emit_trampoline_stub(MacroAssembler &_masm, int destination_t
// Start the stub.
address stub = __ start_a_stub(Compile::MAX_stubs_size/2);
if (stub == NULL) {
- Compile::current()->env()->record_out_of_memory_failure();
+ ciEnv::current()->record_failure("CodeCache is full");
return;
}
@@ -1160,7 +1160,7 @@ EmitCallOffsets emit_call_with_trampoline_stub(MacroAssembler &_masm, address en
// Emit the trampoline stub which will be related to the branch-and-link below.
CallStubImpl::emit_trampoline_stub(_masm, entry_point_toc_offset, offsets.insts_call_instruction_offset);
- if (Compile::current()->env()->failing()) { return offsets; } // Code cache may be full.
+ if (ciEnv::current()->failing()) { return offsets; } // Code cache may be full.
__ relocate(rtype);
}
@@ -3397,7 +3397,7 @@ encode %{
// Emit the trampoline stub which will be related to the branch-and-link below.
CallStubImpl::emit_trampoline_stub(_masm, entry_point_toc_offset, start_offset);
- if (Compile::current()->env()->failing()) { return; } // Code cache may be full.
+ if (ciEnv::current()->failing()) { return; } // Code cache may be full.
__ relocate(_optimized_virtual ?
relocInfo::opt_virtual_call_type : relocInfo::static_call_type);
}
@@ -3410,7 +3410,11 @@ encode %{
__ bl(__ pc()); // Emits a relocation.
// The stub for call to interpreter.
- CompiledStaticCall::emit_to_interp_stub(cbuf);
+ address stub = CompiledStaticCall::emit_to_interp_stub(cbuf);
+ if (stub == NULL) {
+ ciEnv::current()->record_failure("CodeCache is full");
+ return;
+ }
}
%}
@@ -3455,7 +3459,11 @@ encode %{
assert(_method, "execute next statement conditionally");
// The stub for call to interpreter.
- CompiledStaticCall::emit_to_interp_stub(cbuf);
+ address stub = CompiledStaticCall::emit_to_interp_stub(cbuf);
+ if (stub == NULL) {
+ ciEnv::current()->record_failure("CodeCache is full");
+ return;
+ }
// Restore original sp.
__ ld(R11_scratch1, 0, R1_SP); // Load caller sp.
diff --git a/hotspot/src/cpu/sparc/vm/c1_CodeStubs_sparc.cpp b/hotspot/src/cpu/sparc/vm/c1_CodeStubs_sparc.cpp
index f998a9c3a12..4f511dce70d 100644
--- a/hotspot/src/cpu/sparc/vm/c1_CodeStubs_sparc.cpp
+++ b/hotspot/src/cpu/sparc/vm/c1_CodeStubs_sparc.cpp
@@ -432,6 +432,9 @@ void ArrayCopyStub::emit_code(LIR_Assembler* ce) {
__ mov(length()->as_register(), O4);
ce->emit_static_call_stub();
+ if (ce->compilation()->bailed_out()) {
+ return; // CodeCache is full
+ }
__ call(SharedRuntime::get_resolve_static_call_stub(), relocInfo::static_call_type);
__ delayed()->nop();
diff --git a/hotspot/src/cpu/sparc/vm/compiledIC_sparc.cpp b/hotspot/src/cpu/sparc/vm/compiledIC_sparc.cpp
index a4b2a094a5b..b6021917710 100644
--- a/hotspot/src/cpu/sparc/vm/compiledIC_sparc.cpp
+++ b/hotspot/src/cpu/sparc/vm/compiledIC_sparc.cpp
@@ -53,7 +53,7 @@ bool CompiledIC::is_icholder_call_site(virtual_call_Relocation* call_site) {
// ----------------------------------------------------------------------------
#define __ _masm.
-void CompiledStaticCall::emit_to_interp_stub(CodeBuffer &cbuf) {
+address CompiledStaticCall::emit_to_interp_stub(CodeBuffer &cbuf) {
#ifdef COMPILER2
// Stub is fixed up when the corresponding call is converted from calling
// compiled code to calling interpreted code.
@@ -64,9 +64,10 @@ void CompiledStaticCall::emit_to_interp_stub(CodeBuffer &cbuf) {
MacroAssembler _masm(&cbuf);
- address base =
- __ start_a_stub(to_interp_stub_size()*2);
- if (base == NULL) return; // CodeBuffer::expand failed.
+ address base = __ start_a_stub(to_interp_stub_size());
+ if (base == NULL) {
+ return NULL; // CodeBuffer::expand failed.
+ }
// Static stub relocation stores the instruction address of the call.
__ relocate(static_stub_Relocation::spec(mark));
@@ -81,6 +82,7 @@ void CompiledStaticCall::emit_to_interp_stub(CodeBuffer &cbuf) {
// Update current stubs pointer and restore code_end.
__ end_a_stub();
+ return base;
#else
ShouldNotReachHere();
#endif
diff --git a/hotspot/src/cpu/sparc/vm/interp_masm_sparc.cpp b/hotspot/src/cpu/sparc/vm/interp_masm_sparc.cpp
index 153bfbdda55..44ad8d91dae 100644
--- a/hotspot/src/cpu/sparc/vm/interp_masm_sparc.cpp
+++ b/hotspot/src/cpu/sparc/vm/interp_masm_sparc.cpp
@@ -2314,7 +2314,7 @@ void InterpreterMacroAssembler::get_method_counters(Register method,
}
void InterpreterMacroAssembler::increment_invocation_counter( Register Rcounters, Register Rtmp, Register Rtmp2 ) {
- assert(UseCompiler, "incrementing must be useful");
+ assert(UseCompiler || LogTouchedMethods, "incrementing must be useful");
assert_different_registers(Rcounters, Rtmp, Rtmp2);
Address inv_counter(Rcounters, MethodCounters::invocation_counter_offset() +
diff --git a/hotspot/src/cpu/sparc/vm/sparc.ad b/hotspot/src/cpu/sparc/vm/sparc.ad
index 4a742755f29..04491901ddb 100644
--- a/hotspot/src/cpu/sparc/vm/sparc.ad
+++ b/hotspot/src/cpu/sparc/vm/sparc.ad
@@ -1773,9 +1773,11 @@ int HandlerImpl::emit_exception_handler(CodeBuffer& cbuf) {
AddressLiteral exception_blob(OptoRuntime::exception_blob()->entry_point());
MacroAssembler _masm(&cbuf);
- address base =
- __ start_a_stub(size_exception_handler());
- if (base == NULL) return 0; // CodeBuffer::expand failed
+ address base = __ start_a_stub(size_exception_handler());
+ if (base == NULL) {
+ ciEnv::current()->record_failure("CodeCache is full");
+ return 0; // CodeBuffer::expand failed
+ }
int offset = __ offset();
@@ -1796,9 +1798,11 @@ int HandlerImpl::emit_deopt_handler(CodeBuffer& cbuf) {
AddressLiteral deopt_blob(SharedRuntime::deopt_blob()->unpack());
MacroAssembler _masm(&cbuf);
- address base =
- __ start_a_stub(size_deopt_handler());
- if (base == NULL) return 0; // CodeBuffer::expand failed
+ address base = __ start_a_stub(size_deopt_handler());
+ if (base == NULL) {
+ ciEnv::current()->record_failure("CodeCache is full");
+ return 0; // CodeBuffer::expand failed
+ }
int offset = __ offset();
__ save_frame(0);
@@ -2599,7 +2603,12 @@ encode %{
emit_call_reloc(cbuf, $meth$$method, relocInfo::static_call_type);
}
if (_method) { // Emit stub for static call.
- CompiledStaticCall::emit_to_interp_stub(cbuf);
+ address stub = CompiledStaticCall::emit_to_interp_stub(cbuf);
+ // Stub does not fit into scratch buffer if TraceJumps is enabled
+ if (stub == NULL && !(TraceJumps && Compile::current()->in_scratch_emit_size())) {
+ ciEnv::current()->record_failure("CodeCache is full");
+ return;
+ }
}
%}
diff --git a/hotspot/src/cpu/x86/vm/c1_CodeStubs_x86.cpp b/hotspot/src/cpu/x86/vm/c1_CodeStubs_x86.cpp
index 71684561223..a3196fe0b6d 100644
--- a/hotspot/src/cpu/x86/vm/c1_CodeStubs_x86.cpp
+++ b/hotspot/src/cpu/x86/vm/c1_CodeStubs_x86.cpp
@@ -503,6 +503,9 @@ void ArrayCopyStub::emit_code(LIR_Assembler* ce) {
ce->align_call(lir_static_call);
ce->emit_static_call_stub();
+ if (ce->compilation()->bailed_out()) {
+ return; // CodeCache is full
+ }
AddressLiteral resolve(SharedRuntime::get_resolve_static_call_stub(),
relocInfo::static_call_type);
__ call(resolve);
diff --git a/hotspot/src/cpu/x86/vm/compiledIC_x86.cpp b/hotspot/src/cpu/x86/vm/compiledIC_x86.cpp
index 9537ef971f7..29eba2fb99d 100644
--- a/hotspot/src/cpu/x86/vm/compiledIC_x86.cpp
+++ b/hotspot/src/cpu/x86/vm/compiledIC_x86.cpp
@@ -50,7 +50,7 @@ bool CompiledIC::is_icholder_call_site(virtual_call_Relocation* call_site) {
// ----------------------------------------------------------------------------
#define __ _masm.
-void CompiledStaticCall::emit_to_interp_stub(CodeBuffer &cbuf) {
+address CompiledStaticCall::emit_to_interp_stub(CodeBuffer &cbuf) {
// Stub is fixed up when the corresponding call is converted from
// calling compiled code to calling interpreted code.
// movq rbx, 0
@@ -62,9 +62,10 @@ void CompiledStaticCall::emit_to_interp_stub(CodeBuffer &cbuf) {
// That's why we must use the macroassembler to generate a stub.
MacroAssembler _masm(&cbuf);
- address base =
- __ start_a_stub(to_interp_stub_size()*2);
- if (base == NULL) return; // CodeBuffer::expand failed.
+ address base = __ start_a_stub(to_interp_stub_size());
+ if (base == NULL) {
+ return NULL; // CodeBuffer::expand failed.
+ }
// Static stub relocation stores the instruction address of the call.
__ relocate(static_stub_Relocation::spec(mark), Assembler::imm_operand);
// Static stub relocation also tags the Method* in the code-stream.
@@ -74,6 +75,7 @@ void CompiledStaticCall::emit_to_interp_stub(CodeBuffer &cbuf) {
// Update current stubs pointer and restore insts_end.
__ end_a_stub();
+ return base;
}
#undef __
diff --git a/hotspot/src/cpu/x86/vm/x86.ad b/hotspot/src/cpu/x86/vm/x86.ad
index 53825e4fbb2..c8aa50a106c 100644
--- a/hotspot/src/cpu/x86/vm/x86.ad
+++ b/hotspot/src/cpu/x86/vm/x86.ad
@@ -1594,7 +1594,10 @@ int HandlerImpl::emit_exception_handler(CodeBuffer& cbuf) {
// That's why we must use the macroassembler to generate a handler.
MacroAssembler _masm(&cbuf);
address base = __ start_a_stub(size_exception_handler());
- if (base == NULL) return 0; // CodeBuffer::expand failed
+ if (base == NULL) {
+ ciEnv::current()->record_failure("CodeCache is full");
+ return 0; // CodeBuffer::expand failed
+ }
int offset = __ offset();
__ jump(RuntimeAddress(OptoRuntime::exception_blob()->entry_point()));
assert(__ offset() - offset <= (int) size_exception_handler(), "overflow");
@@ -1609,7 +1612,10 @@ int HandlerImpl::emit_deopt_handler(CodeBuffer& cbuf) {
// That's why we must use the macroassembler to generate a handler.
MacroAssembler _masm(&cbuf);
address base = __ start_a_stub(size_deopt_handler());
- if (base == NULL) return 0; // CodeBuffer::expand failed
+ if (base == NULL) {
+ ciEnv::current()->record_failure("CodeCache is full");
+ return 0; // CodeBuffer::expand failed
+ }
int offset = __ offset();
#ifdef _LP64
diff --git a/hotspot/src/cpu/x86/vm/x86_32.ad b/hotspot/src/cpu/x86/vm/x86_32.ad
index be2f7e65b36..dfe10d5b02a 100644
--- a/hotspot/src/cpu/x86/vm/x86_32.ad
+++ b/hotspot/src/cpu/x86/vm/x86_32.ad
@@ -1907,7 +1907,11 @@ encode %{
static_call_Relocation::spec(), RELOC_IMM32 );
}
if (_method) { // Emit stub for static call.
- CompiledStaticCall::emit_to_interp_stub(cbuf);
+ address stub = CompiledStaticCall::emit_to_interp_stub(cbuf);
+ if (stub == NULL) {
+ ciEnv::current()->record_failure("CodeCache is full");
+ return;
+ }
}
%}
diff --git a/hotspot/src/cpu/x86/vm/x86_64.ad b/hotspot/src/cpu/x86/vm/x86_64.ad
index ea8b1c81276..c04661cda7d 100644
--- a/hotspot/src/cpu/x86/vm/x86_64.ad
+++ b/hotspot/src/cpu/x86/vm/x86_64.ad
@@ -2137,7 +2137,11 @@ encode %{
}
if (_method) {
// Emit stub for static call.
- CompiledStaticCall::emit_to_interp_stub(cbuf);
+ address stub = CompiledStaticCall::emit_to_interp_stub(cbuf);
+ if (stub == NULL) {
+ ciEnv::current()->record_failure("CodeCache is full");
+ return;
+ }
}
%}
diff --git a/hotspot/src/cpu/zero/vm/compiledIC_zero.cpp b/hotspot/src/cpu/zero/vm/compiledIC_zero.cpp
index 143dc317380..185a8b169c0 100644
--- a/hotspot/src/cpu/zero/vm/compiledIC_zero.cpp
+++ b/hotspot/src/cpu/zero/vm/compiledIC_zero.cpp
@@ -60,8 +60,9 @@ bool CompiledIC::is_icholder_call_site(virtual_call_Relocation* call_site) {
// ----------------------------------------------------------------------------
-void CompiledStaticCall::emit_to_interp_stub(CodeBuffer &cbuf) {
+address CompiledStaticCall::emit_to_interp_stub(CodeBuffer &cbuf) {
ShouldNotReachHere(); // Only needed for COMPILER2.
+ return NULL;
}
int CompiledStaticCall::to_interp_stub_size() {
diff --git a/hotspot/src/os/aix/vm/os_aix.cpp b/hotspot/src/os/aix/vm/os_aix.cpp
index c78577c542f..f2c3933f35f 100644
--- a/hotspot/src/os/aix/vm/os_aix.cpp
+++ b/hotspot/src/os/aix/vm/os_aix.cpp
@@ -971,34 +971,32 @@ bool os::create_thread(Thread* thread, ThreadType thr_type, size_t stack_size) {
guarantee(pthread_attr_setsuspendstate_np(&attr, PTHREAD_CREATE_SUSPENDED_NP) == 0, "???");
// calculate stack size if it's not specified by caller
- if (os::Aix::supports_variable_stack_size()) {
- if (stack_size == 0) {
- stack_size = os::Aix::default_stack_size(thr_type);
+ if (stack_size == 0) {
+ stack_size = os::Aix::default_stack_size(thr_type);
- switch (thr_type) {
- case os::java_thread:
- // Java threads use ThreadStackSize whose default value can be changed with the flag -Xss.
- assert(JavaThread::stack_size_at_create() > 0, "this should be set");
- stack_size = JavaThread::stack_size_at_create();
+ switch (thr_type) {
+ case os::java_thread:
+ // Java threads use ThreadStackSize whose default value can be changed with the flag -Xss.
+ assert(JavaThread::stack_size_at_create() > 0, "this should be set");
+ stack_size = JavaThread::stack_size_at_create();
+ break;
+ case os::compiler_thread:
+ if (CompilerThreadStackSize > 0) {
+ stack_size = (size_t)(CompilerThreadStackSize * K);
break;
- case os::compiler_thread:
- if (CompilerThreadStackSize > 0) {
- stack_size = (size_t)(CompilerThreadStackSize * K);
- break;
- } // else fall through:
- // use VMThreadStackSize if CompilerThreadStackSize is not defined
- case os::vm_thread:
- case os::pgc_thread:
- case os::cgc_thread:
- case os::watcher_thread:
- if (VMThreadStackSize > 0) stack_size = (size_t)(VMThreadStackSize * K);
- break;
- }
+ } // else fall through:
+ // use VMThreadStackSize if CompilerThreadStackSize is not defined
+ case os::vm_thread:
+ case os::pgc_thread:
+ case os::cgc_thread:
+ case os::watcher_thread:
+ if (VMThreadStackSize > 0) stack_size = (size_t)(VMThreadStackSize * K);
+ break;
}
+ }
- stack_size = MAX2(stack_size, os::Aix::min_stack_allowed);
- pthread_attr_setstacksize(&attr, stack_size);
- } //else let thread_create() pick the default value (96 K on AIX)
+ stack_size = MAX2(stack_size, os::Aix::min_stack_allowed);
+ pthread_attr_setstacksize(&attr, stack_size);
pthread_t tid;
int ret = pthread_create(&tid, &attr, (void* (*)(void*)) java_start, thread);
diff --git a/hotspot/src/os/aix/vm/os_aix.hpp b/hotspot/src/os/aix/vm/os_aix.hpp
index faba5c2b45e..8e96dd9f6c5 100644
--- a/hotspot/src/os/aix/vm/os_aix.hpp
+++ b/hotspot/src/os/aix/vm/os_aix.hpp
@@ -131,8 +131,6 @@ class Aix {
static void initialize_libo4();
static void initialize_libperfstat();
- static bool supports_variable_stack_size();
-
public:
static void init_thread_fpu_state();
static pthread_t main_thread(void) { return _main_thread; }
diff --git a/hotspot/src/os/bsd/vm/os_bsd.cpp b/hotspot/src/os/bsd/vm/os_bsd.cpp
index 8f935d85c05..1c243ae387f 100644
--- a/hotspot/src/os/bsd/vm/os_bsd.cpp
+++ b/hotspot/src/os/bsd/vm/os_bsd.cpp
@@ -739,40 +739,35 @@ bool os::create_thread(Thread* thread, ThreadType thr_type, size_t stack_size) {
pthread_attr_init(&attr);
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
- // stack size
- if (os::Bsd::supports_variable_stack_size()) {
- // calculate stack size if it's not specified by caller
- if (stack_size == 0) {
- stack_size = os::Bsd::default_stack_size(thr_type);
+ // calculate stack size if it's not specified by caller
+ if (stack_size == 0) {
+ stack_size = os::Bsd::default_stack_size(thr_type);
- switch (thr_type) {
- case os::java_thread:
- // Java threads use ThreadStackSize which default value can be
- // changed with the flag -Xss
- assert(JavaThread::stack_size_at_create() > 0, "this should be set");
- stack_size = JavaThread::stack_size_at_create();
+ switch (thr_type) {
+ case os::java_thread:
+ // Java threads use ThreadStackSize which default value can be
+ // changed with the flag -Xss
+ assert(JavaThread::stack_size_at_create() > 0, "this should be set");
+ stack_size = JavaThread::stack_size_at_create();
+ break;
+ case os::compiler_thread:
+ if (CompilerThreadStackSize > 0) {
+ stack_size = (size_t)(CompilerThreadStackSize * K);
break;
- case os::compiler_thread:
- if (CompilerThreadStackSize > 0) {
- stack_size = (size_t)(CompilerThreadStackSize * K);
- break;
- } // else fall through:
- // use VMThreadStackSize if CompilerThreadStackSize is not defined
- case os::vm_thread:
- case os::pgc_thread:
- case os::cgc_thread:
- case os::watcher_thread:
- if (VMThreadStackSize > 0) stack_size = (size_t)(VMThreadStackSize * K);
- break;
- }
+ } // else fall through:
+ // use VMThreadStackSize if CompilerThreadStackSize is not defined
+ case os::vm_thread:
+ case os::pgc_thread:
+ case os::cgc_thread:
+ case os::watcher_thread:
+ if (VMThreadStackSize > 0) stack_size = (size_t)(VMThreadStackSize * K);
+ break;
}
-
- stack_size = MAX2(stack_size, os::Bsd::min_stack_allowed);
- pthread_attr_setstacksize(&attr, stack_size);
- } else {
- // let pthread_create() pick the default value.
}
+ stack_size = MAX2(stack_size, os::Bsd::min_stack_allowed);
+ pthread_attr_setstacksize(&attr, stack_size);
+
ThreadState state;
{
diff --git a/hotspot/src/os/bsd/vm/os_bsd.hpp b/hotspot/src/os/bsd/vm/os_bsd.hpp
index 8c6dbb78888..8b48cb78cf0 100644
--- a/hotspot/src/os/bsd/vm/os_bsd.hpp
+++ b/hotspot/src/os/bsd/vm/os_bsd.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2015, 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
@@ -75,8 +75,6 @@ class Bsd {
static julong physical_memory() { return _physical_memory; }
static void initialize_system_info();
- static bool supports_variable_stack_size();
-
static void rebuild_cpu_to_node_map();
static GrowableArray
+ * This class is for runtime permissions. A {@code RuntimePermission}
+ * contains a name (also referred to as a "target name") but no actions
+ * list; you either have the named permission or you don't.
+ *
* The target name is the name of the runtime permission (see below). The
* naming convention follows the hierarchical property naming convention.
- * Also, an asterisk
- * may appear at the end of the name, following a ".", or by itself, to
- * signify a wildcard match. For example: "loadLibrary.*" and "*" signify a
- * wildcard match, while "*loadLibrary" and "a*b" do not.
- *
- * The following table lists all the possible RuntimePermission target names,
- * and for each provides a description of what the permission allows
- * and a discussion of the risks of granting code the permission.
+ * Also, an asterisk may appear at the end of the name, following a ".",
+ * or by itself, to signify a wildcard match. For example: "loadLibrary.*"
+ * and "*" signify a wildcard match, while "*loadLibrary" and "a*b" do not.
+ *
+ * The following table lists the standard {@code RuntimePermission}
+ * target names, and for each provides a description of what the permission
+ * allows and a discussion of the risks of granting code the permission.
*
*
@@ -353,6 +350,10 @@ import java.util.StringTokenizer;
*
*
*
+ * @implNote
+ * Implementations may define additional target names, but should use naming
+ * conventions such as reverse domain name notation to avoid name clashes.
+ *
* @see java.security.BasicPermission
* @see java.security.Permission
* @see java.security.Permissions
diff --git a/jdk/src/java.base/share/classes/java/lang/ref/Finalizer.java b/jdk/src/java.base/share/classes/java/lang/ref/Finalizer.java
index d9cabe61543..3bd631226c9 100644
--- a/jdk/src/java.base/share/classes/java/lang/ref/Finalizer.java
+++ b/jdk/src/java.base/share/classes/java/lang/ref/Finalizer.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, 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,10 @@ final class Finalizer extends FinalReference
The content of the new, read-only buffer will be the content of the * given character sequence. The new buffer's capacity and limit will be - * csq.length(), its position will be zero, and its mark will be + * {@code csq.length()}, its position will be zero, and its mark will be * undefined.
* * @param csq @@ -624,7 +623,7 @@ public abstract class $Type$Buffer * @return The $type$ at the given index * * @throws IndexOutOfBoundsException - * If index is negative + * If {@code index} is negative * or not smaller than the buffer's limit */ public abstract $type$ get(int index); @@ -657,7 +656,7 @@ public abstract class $Type$Buffer * @return This buffer * * @throws IndexOutOfBoundsException - * If index is negative + * If {@code index} is negative * or not smaller than the buffer's limit * * @throws ReadOnlyBufferException @@ -674,17 +673,17 @@ public abstract class $Type$Buffer *This method transfers $type$s from this buffer into the given * destination array. If there are fewer $type$s remaining in the * buffer than are required to satisfy the request, that is, if - * length > remaining(), then no + * {@code length} {@code >} {@code remaining()}, then no * $type$s are transferred and a {@link BufferUnderflowException} is * thrown. * - *
Otherwise, this method copies length $type$s from this + *
Otherwise, this method copies {@code length} $type$s from this * buffer into the given array, starting at the current position of this * buffer and at the given offset in the array. The position of this - * buffer is then incremented by length. + * buffer is then incremented by {@code length}. * *
In other words, an invocation of this method of the form
- * src.get(dst, off, len) has exactly the same effect as
+ * src.get(dst, off, len)
has exactly the same effect as
* the loop
*
*
{@code @@ -701,21 +700,21 @@ public abstract class $Type$Buffer * @param offset * The offset within the array of the first $type$ to be * written; must be non-negative and no larger than - * dst.length + * {@code dst.length} * * @param length * The maximum number of $type$s to be written to the given * array; must be non-negative and no larger than - * dst.length - offset + * {@code dst.length - offset} * * @return This buffer * * @throws BufferUnderflowException - * If there are fewer than length $type$s + * If there are fewer than {@code length} $type$s * remaining in this buffer * * @throws IndexOutOfBoundsException - * If the preconditions on the offset and length + * If the preconditions on the {@code offset} and {@code length} * parameters do not hold */ public $Type$Buffer get($type$[] dst, int offset, int length) { @@ -733,7 +732,7 @@ public abstract class $Type$Buffer * *This method transfers $type$s from this buffer into the given * destination array. An invocation of this method of the form - * src.get(a) behaves in exactly the same way as the invocation + * {@code src.get(a)} behaves in exactly the same way as the invocation * *
* src.get(a, 0, a.length)@@ -744,7 +743,7 @@ public abstract class $Type$Buffer * @return This buffer * * @throws BufferUnderflowException - * If there are fewer than length $type$s + * If there are fewer than {@code length} $type$s * remaining in this buffer */ public $Type$Buffer get($type$[] dst) { @@ -760,17 +759,17 @@ public abstract class $Type$Buffer *This method transfers the $type$s remaining in the given source * buffer into this buffer. If there are more $type$s remaining in the * source buffer than in this buffer, that is, if - * src.remaining() > remaining(), + * {@code src.remaining()} {@code >} {@code remaining()}, * then no $type$s are transferred and a {@link * BufferOverflowException} is thrown. * *
Otherwise, this method copies - * n = src.remaining() $type$s from the given + * n = {@code src.remaining()} $type$s from the given * buffer into this buffer, starting at each buffer's current position. * The positions of both buffers are then incremented by n. * *
In other words, an invocation of this method of the form - * dst.put(src) has exactly the same effect as the loop + * {@code dst.put(src)} has exactly the same effect as the loop * *
* while (src.hasRemaining()) @@ -814,17 +813,17 @@ public abstract class $Type$Buffer *This method transfers $type$s into this buffer from the given * source array. If there are more $type$s to be copied from the array * than remain in this buffer, that is, if - * length > remaining(), then no + * {@code length} {@code >} {@code remaining()}, then no * $type$s are transferred and a {@link BufferOverflowException} is * thrown. * - *
Otherwise, this method copies length $type$s from the + *
Otherwise, this method copies {@code length} $type$s from the * given array into this buffer, starting at the given offset in the array * and at the current position of this buffer. The position of this buffer - * is then incremented by length. + * is then incremented by {@code length}. * *
In other words, an invocation of this method of the form - * dst.put(src, off, len) has exactly the same effect as + *
dst.put(src, off, len)
has exactly the same effect as * the loop * *{@code @@ -840,12 +839,12 @@ public abstract class $Type$Buffer * * @param offset * The offset within the array of the first $type$ to be read; - * must be non-negative and no larger than array.length + * must be non-negative and no larger than {@code array.length} * * @param length * The number of $type$s to be read from the given array; * must be non-negative and no larger than - * array.length - offset + * {@code array.length - offset} * * @return This buffer * @@ -853,7 +852,7 @@ public abstract class $Type$Buffer * If there is insufficient space in this buffer * * @throws IndexOutOfBoundsException - * If the preconditions on the offset and length + * If the preconditions on the {@code offset} and {@code length} * parameters do not hold * * @throws ReadOnlyBufferException @@ -874,7 +873,7 @@ public abstract class $Type$Buffer * *This method transfers the entire content of the given source * $type$ array into this buffer. An invocation of this method of the - * form dst.put(a) behaves in exactly the same way as the + * form {@code dst.put(a)} behaves in exactly the same way as the * invocation * *
@@ -903,18 +902,18 @@ public abstract class $Type$Buffer *This method transfers $type$s from the given string into this * buffer. If there are more $type$s to be copied from the string than * remain in this buffer, that is, if - * end - start > remaining(), + *
end - start
{@code >} {@code remaining()}, * then no $type$s are transferred and a {@link * BufferOverflowException} is thrown. * *Otherwise, this method copies - * n = end - start $type$s + * n = {@code end} - {@code start} $type$s * from the given string into this buffer, starting at the given - * start index and at the current position of this buffer. The + * {@code start} index and at the current position of this buffer. The * position of this buffer is then incremented by n. * *
In other words, an invocation of this method of the form - * dst.put(src, start, end) has exactly the same effect + *
dst.put(src, start, end)
has exactly the same effect * as the loop * *{@code @@ -931,12 +930,12 @@ public abstract class $Type$Buffer * @param start * The offset within the string of the first $type$ to be read; * must be non-negative and no larger than - * string.length() + * {@code string.length()} * * @param end * The offset within the string of the last $type$ to be read, * plus one; must be non-negative and no larger than - * string.length() + * {@code string.length()} * * @return This buffer * @@ -944,7 +943,7 @@ public abstract class $Type$Buffer * If there is insufficient space in this buffer * * @throws IndexOutOfBoundsException - * If the preconditions on the start and end + * If the preconditions on the {@code start} and {@code end} * parameters do not hold * * @throws ReadOnlyBufferException @@ -966,7 +965,7 @@ public abstract class $Type$Buffer * *This method transfers the entire content of the given source string * into this buffer. An invocation of this method of the form - * dst.put(s) behaves in exactly the same way as the invocation + * {@code dst.put(s)} behaves in exactly the same way as the invocation * *
* dst.put(s, 0, s.length())@@ -995,11 +994,11 @@ public abstract class $Type$Buffer * Tells whether or not this buffer is backed by an accessible $type$ * array. * - *If this method returns true then the {@link #array() array} + *
If this method returns {@code true} then the {@link #array() array} * and {@link #arrayOffset() arrayOffset} methods may safely be invoked. *
* - * @return true if, and only if, this buffer + * @return {@code true} if, and only if, this buffer * is backed by an array and is not read-only */ public final boolean hasArray() { @@ -1038,7 +1037,7 @@ public abstract class $Type$Buffer * element of the buffer (optional operation). * *If this buffer is backed by an array then buffer position p - * corresponds to array index p + arrayOffset(). + * corresponds to array index p + {@code arrayOffset()}. * *
Invoke the {@link #hasArray hasArray} method before invoking this * method in order to ensure that this buffer has an accessible backing @@ -1166,11 +1165,11 @@ public abstract class $Type$Buffer * *
The $type$s between the buffer's current position and its limit, * if any, are copied to the beginning of the buffer. That is, the - * $type$ at index p = position() is copied + * $type$ at index p = {@code position()} is copied * to index zero, the $type$ at index p + 1 is copied * to index one, and so forth until the $type$ at index - * limit() - 1 is copied to index - * n = limit() - 1 - p. + * {@code limit()} - 1 is copied to index + * n = {@code limit()} - {@code 1} - p. * The buffer's position is then set to n+1 and its limit is set to * its capacity. The mark, if defined, is discarded. * @@ -1183,7 +1182,7 @@ public abstract class $Type$Buffer * *
Invoke this method after writing data from a buffer in case the * write was incomplete. The following loop, for example, copies bytes - * from one channel to another via the buffer buf: + * from one channel to another via the buffer {@code buf}: * *
* * @param local - * The local address to bind the socket, or null to bind + * The local address to bind the socket, or {@code null} to bind * to an automatically assigned socket address * * @return This channel diff --git a/jdk/src/java.base/share/classes/java/nio/channels/AsynchronousSocketChannel.java b/jdk/src/java.base/share/classes/java/nio/channels/AsynchronousSocketChannel.java index 1ed1e8602aa..d5e2abeb63a 100644 --- a/jdk/src/java.base/share/classes/java/nio/channels/AsynchronousSocketChannel.java +++ b/jdk/src/java.base/share/classes/java/nio/channels/AsynchronousSocketChannel.java @@ -452,11 +452,11 @@ public abstract class AsynchronousSocketChannel * at the moment that the read is attempted. * *{@code * buf.clear(); // Prepare buffer for use @@ -1206,7 +1205,7 @@ public abstract class $Type$Buffer /** * Tells whether or not this $type$ buffer is direct. * - * @return true if, and only if, this buffer is direct + * @return {@code true} if, and only if, this buffer is direct */ public abstract boolean isDirect(); @@ -1239,8 +1238,8 @@ public abstract class $Type$Buffer * Returns the current hash code of this buffer. * *The hash code of a $type$ buffer depends only upon its remaining - * elements; that is, upon the elements from position() up to, and - * including, the element at limit() - 1. + * elements; that is, upon the elements from {@code position()} up to, and + * including, the element at {@code limit()} - {@code 1}. * *
Because buffer hash codes are content-dependent, it is inadvisable * to use buffers as keys in hash maps or similar data structures unless it @@ -1289,7 +1288,7 @@ public abstract class $Type$Buffer * * @param ob The object to which this buffer is to be compared * - * @return true if, and only if, this buffer is equal to the + * @return {@code true} if, and only if, this buffer is equal to the * given object */ public boolean equals(Object ob) { @@ -1368,7 +1367,7 @@ public abstract class $Type$Buffer * *
The first character of the resulting string will be the character at * this buffer's position, while the last character will be the character - * at index limit() - 1. Invoking this method does not + * at index {@code limit()} - 1. Invoking this method does not * change the buffer's position.
* * @return The specified string @@ -1388,7 +1387,7 @@ public abstract class $Type$Buffer *When viewed as a character sequence, the length of a character * buffer is simply the number of characters between the position * (inclusive) and the limit (exclusive); that is, it is equivalent to - * remaining().
+ * {@code remaining()}. * * @return The length of this character buffer */ @@ -1402,13 +1401,13 @@ public abstract class $Type$Buffer * * @param index * The index of the character to be read, relative to the position; - * must be non-negative and smaller than remaining() + * must be non-negative and smaller than {@code remaining()} * * @return The character at index - * position() + index + *position() + index
* * @throws IndexOutOfBoundsException - * If the preconditions on index do not hold + * If the preconditions on {@code index} do not hold */ public final char charAt(int index) { return get(position() + checkIndex(index, 1)); @@ -1422,26 +1421,26 @@ public abstract class $Type$Buffer * content of this buffer is mutable then modifications to one buffer will * cause the other to be modified. The new buffer's capacity will be that * of this buffer, its position will be - * position() + start, and its limit will be - * position() + end. The new buffer will be + * {@code position()} + {@code start}, and its limit will be + * {@code position()} + {@code end}. The new buffer will be * direct if, and only if, this buffer is direct, and it will be read-only * if, and only if, this buffer is read-only. * * @param start * The index, relative to the current position, of the first * character in the subsequence; must be non-negative and no larger - * than remaining() + * than {@code remaining()} * * @param end * The index, relative to the current position, of the character * following the last character in the subsequence; must be no - * smaller than start and no larger than - * remaining() + * smaller than {@code start} and no larger than + * {@code remaining()} * * @return The new character buffer * * @throws IndexOutOfBoundsException - * If the preconditions on start and end + * If the preconditions on {@code start} and {@code end} * do not hold */ public abstract CharBuffer subSequence(int start, int end); @@ -1453,21 +1452,21 @@ public abstract class $Type$Buffer * Appends the specified character sequence to this * buffer (optional operation). * - *An invocation of this method of the form dst.append(csq) + *
An invocation of this method of the form {@code dst.append(csq)} * behaves in exactly the same way as the invocation * *
* dst.put(csq.toString())* - *Depending on the specification of toString for the - * character sequence csq, the entire sequence may not be + *
Depending on the specification of {@code toString} for the + * character sequence {@code csq}, the entire sequence may not be * appended. For instance, invoking the {@link $Type$Buffer#toString() * toString} method of a character buffer will return a subsequence whose * content depends upon the buffer's position and limit. * * @param csq - * The character sequence to append. If csq is - * null, then the four characters "null" are + * The character sequence to append. If {@code csq} is + * {@code null}, then the four characters {@code "null"} are * appended to this character buffer. * * @return This buffer @@ -1491,8 +1490,8 @@ public abstract class $Type$Buffer * Appends a subsequence of the specified character sequence to this * buffer (optional operation). * - *
An invocation of this method of the form dst.append(csq, start, - * end) when csq is not null, behaves in exactly the + *
An invocation of this method of the form {@code dst.append(csq, start, + * end)} when {@code csq} is not {@code null}, behaves in exactly the * same way as the invocation * *
@@ -1500,9 +1499,9 @@ public abstract class $Type$Buffer * * @param csq * The character sequence from which a subsequence will be - * appended. If csq is null, then characters - * will be appended as if csq contained the four - * characters "null". + * appended. If {@code csq} is {@code null}, then characters + * will be appended as if {@code csq} contained the four + * characters {@code "null"}. * * @return This buffer * @@ -1510,9 +1509,9 @@ public abstract class $Type$Buffer * If there is insufficient space in this buffer * * @throws IndexOutOfBoundsException - * If start or end are negative, start - * is greater than end, or end is greater than - * csq.length() + * If {@code start} or {@code end} are negative, {@code start} + * is greater than {@code end}, or {@code end} is greater than + * {@code csq.length()} * * @throws ReadOnlyBufferException * If this buffer is read-only @@ -1528,7 +1527,7 @@ public abstract class $Type$Buffer * Appends the specified $type$ to this * buffer (optional operation). * - *An invocation of this method of the form dst.append($x$) + *
An invocation of this method of the form {@code dst.append($x$)} * behaves in exactly the same way as the invocation * *
@@ -1562,7 +1561,7 @@ public abstract class $Type$Buffer * Retrieves this buffer's byte order. * *The byte order of $a$ $type$ buffer created by allocation or by - * wrapping an existing $type$ array is the {@link + * wrapping an existing {@code $type$} array is the {@link * ByteOrder#nativeOrder native order} of the underlying * hardware. The byte order of $a$ $type$ buffer created as a view of a byte buffer is that of the diff --git a/jdk/src/java.base/share/classes/java/nio/channels/AsynchronousByteChannel.java b/jdk/src/java.base/share/classes/java/nio/channels/AsynchronousByteChannel.java index b96a2391151..56003d53ec7 100644 --- a/jdk/src/java.base/share/classes/java/nio/channels/AsynchronousByteChannel.java +++ b/jdk/src/java.base/share/classes/java/nio/channels/AsynchronousByteChannel.java @@ -70,13 +70,13 @@ public interface AsynchronousByteChannel * {@code 0} without initiating an I/O operation. * *
Suppose that a byte sequence of length n is read, where - * 0 < n <= r. + * {@code 0} {@code <} n {@code <=} r. * This byte sequence will be transferred into the buffer so that the first * byte in the sequence is at index p and the last byte is at index - * p + n - 1, + * p {@code +} n {@code -} {@code 1}, * where p is the buffer's position at the moment the read is * performed. Upon completion the buffer's position will be equal to - * p + n; its limit will not have changed. + * p {@code +} n; its limit will not have changed. * *
Buffers are not safe for use by multiple concurrent threads so care * should be taken to not access the buffer until the operation has @@ -151,13 +151,13 @@ public interface AsynchronousByteChannel * {@code 0} without initiating an I/O operation. * *
Suppose that a byte sequence of length n is written, where - * 0 < n <= r. + * {@code 0} {@code <} n {@code <=} r. * This byte sequence will be transferred from the buffer starting at index * p, where p is the buffer's position at the moment the * write is performed; the index of the last byte written will be - * p + n - 1. + * p {@code +} n {@code -} {@code 1}. * Upon completion the buffer's position will be equal to - * p + n; its limit will not have changed. + * p {@code +} n; its limit will not have changed. * *
Buffers are not safe for use by multiple concurrent threads so care * should be taken to not access the buffer until the operation has diff --git a/jdk/src/java.base/share/classes/java/nio/channels/AsynchronousServerSocketChannel.java b/jdk/src/java.base/share/classes/java/nio/channels/AsynchronousServerSocketChannel.java index 29ecbd626ac..44a2460426f 100644 --- a/jdk/src/java.base/share/classes/java/nio/channels/AsynchronousServerSocketChannel.java +++ b/jdk/src/java.base/share/classes/java/nio/channels/AsynchronousServerSocketChannel.java @@ -41,7 +41,7 @@ import java.io.IOException; * by invoking the {@link #bind(SocketAddress,int) bind} method. Once bound, * the {@link #accept(Object,CompletionHandler) accept} method * is used to initiate the accepting of connections to the channel's socket. - * An attempt to invoke the accept method on an unbound channel will + * An attempt to invoke the {@code accept} method on an unbound channel will * cause a {@link NotYetBoundException} to be thrown. * *
Channels of this type are safe for use by multiple concurrent threads @@ -122,13 +122,13 @@ public abstract class AsynchronousServerSocketChannel * java.nio.channels.spi.AsynchronousChannelProvider#openAsynchronousServerSocketChannel * openAsynchronousServerSocketChannel} method on the {@link * java.nio.channels.spi.AsynchronousChannelProvider} object that created - * the given group. If the group parameter is null then the + * the given group. If the group parameter is {@code null} then the * resulting channel is created by the system-wide default provider, and * bound to the default group. * * @param group * The group to which the newly constructed channel should be bound, - * or null for the default group + * or {@code null} for the default group * * @return A new asynchronous server socket channel * @@ -176,7 +176,7 @@ public abstract class AsynchronousServerSocketChannel *
Suppose that a byte sequence of length n is read, where - * 0 < n <= r. - * Up to the first dsts[offset].remaining() bytes of this sequence - * are transferred into buffer dsts[offset], up to the next - * dsts[offset+1].remaining() bytes are transferred into buffer - * dsts[offset+1], and so forth, until the entire byte sequence + * {@code 0} {@code <} n {@code <=} r. + * Up to the first {@code dsts[offset].remaining()} bytes of this sequence + * are transferred into buffer {@code dsts[offset]}, up to the next + * {@code dsts[offset+1].remaining()} bytes are transferred into buffer + * {@code dsts[offset+1]}, and so forth, until the entire byte sequence * is transferred into the given buffers. As many bytes as possible are * transferred into each buffer, hence the final position of each updated * buffer, except the last updated buffer, is guaranteed to be equal to @@ -606,11 +606,11 @@ public abstract class AsynchronousSocketChannel * at the moment that the write is attempted. * *
Suppose that a byte sequence of length n is written, where - * 0 < n <= r. - * Up to the first srcs[offset].remaining() bytes of this sequence - * are written from buffer srcs[offset], up to the next - * srcs[offset+1].remaining() bytes are written from buffer - * srcs[offset+1], and so forth, until the entire byte sequence is + * {@code 0} {@code <} n {@code <=} r. + * Up to the first {@code srcs[offset].remaining()} bytes of this sequence + * are written from buffer {@code srcs[offset]}, up to the next + * {@code srcs[offset+1].remaining()} bytes are written from buffer + * {@code srcs[offset+1]}, and so forth, until the entire byte sequence is * written. As many bytes as possible are written from each buffer, hence * the final position of each updated buffer, except the last updated * buffer, is guaranteed to be equal to that buffer's limit. The underlying diff --git a/jdk/src/java.base/share/classes/java/nio/channels/Channel.java b/jdk/src/java.base/share/classes/java/nio/channels/Channel.java index 663d0e098b2..5cca15e0b5d 100644 --- a/jdk/src/java.base/share/classes/java/nio/channels/Channel.java +++ b/jdk/src/java.base/share/classes/java/nio/channels/Channel.java @@ -58,7 +58,7 @@ public interface Channel extends Closeable { /** * Tells whether or not this channel is open. * - * @return true if, and only if, this channel is open + * @return {@code true} if, and only if, this channel is open */ public boolean isOpen(); diff --git a/jdk/src/java.base/share/classes/java/nio/channels/DatagramChannel.java b/jdk/src/java.base/share/classes/java/nio/channels/DatagramChannel.java index b85c98c59c7..0b3278bf356 100644 --- a/jdk/src/java.base/share/classes/java/nio/channels/DatagramChannel.java +++ b/jdk/src/java.base/share/classes/java/nio/channels/DatagramChannel.java @@ -187,8 +187,8 @@ public abstract class DatagramChannel * operations. * *
Datagram channels support reading and writing, so this method - * returns ({@link SelectionKey#OP_READ} | {@link - * SelectionKey#OP_WRITE}).
+ * returns {@code (}{@link SelectionKey#OP_READ} {@code |} {@link + * SelectionKey#OP_WRITE}{@code )}. * * @return The valid-operation set */ @@ -341,7 +341,7 @@ public abstract class DatagramChannel * copied into the given byte buffer and its source address is returned. * If this channel is in non-blocking mode and a datagram is not * immediately available then this method immediately returns - * null. + * {@code null}. * *The datagram is transferred into the given byte buffer starting at * its current position, as if by a regular {@link @@ -371,7 +371,7 @@ public abstract class DatagramChannel * The buffer into which the datagram is to be transferred * * @return The datagram's source address, - * or null if this channel is in non-blocking mode + * or {@code null} if this channel is in non-blocking mode * and no datagram was immediately available * * @throws ClosedChannelException diff --git a/jdk/src/java.base/share/classes/java/nio/channels/FileChannel.java b/jdk/src/java.base/share/classes/java/nio/channels/FileChannel.java index eb3934d3dea..066ef8a9fa9 100644 --- a/jdk/src/java.base/share/classes/java/nio/channels/FileChannel.java +++ b/jdk/src/java.base/share/classes/java/nio/channels/FileChannel.java @@ -63,7 +63,7 @@ import java.util.Collections; * *
A region of a file may be {@link #map mapped} * directly into memory; for large files this is often much more efficient - * than invoking the usual read or write methods. + * than invoking the usual {@code read} or {@code write} methods. *
Updates made to a file may be {@link #force forced @@ -107,10 +107,10 @@ import java.util.Collections; * existing {@link java.io.FileInputStream#getChannel FileInputStream}, {@link * java.io.FileOutputStream#getChannel FileOutputStream}, or {@link * java.io.RandomAccessFile#getChannel RandomAccessFile} object by invoking - * that object's getChannel method, which returns a file channel that + * that object's {@code getChannel} method, which returns a file channel that * is connected to the same underlying file. Where the file channel is obtained * from an existing stream or random access file then the state of the file - * channel is intimately connected to that of the object whose getChannel + * channel is intimately connected to that of the object whose {@code getChannel} * method returned the channel. Changing the channel's position, whether * explicitly or by reading or writing bytes, will change the file position of * the originating object, and vice versa. Changing the file's length via the @@ -128,14 +128,14 @@ import java.util.Collections; * writing. Finally, a channel obtained via the {@link * java.io.RandomAccessFile#getChannel getChannel} method of a {@link * java.io.RandomAccessFile} instance will be open for reading if the instance - * was created with mode "r" and will be open for reading and writing - * if the instance was created with mode "rw". + * was created with mode {@code "r"} and will be open for reading and writing + * if the instance was created with mode {@code "rw"}. * *
A file channel that is open for writing may be in * append mode, for example if it was obtained from a file-output stream * that was created by invoking the {@link * java.io.FileOutputStream#FileOutputStream(java.io.File,boolean) - * FileOutputStream(File,boolean)} constructor and passing true for + * FileOutputStream(File,boolean)} constructor and passing {@code true} for * the second parameter. In this mode each invocation of a relative write * operation first advances the position to the end of the file and then writes * the requested data. Whether the advancement of the position and the writing @@ -516,10 +516,10 @@ public abstract class FileChannel *
If the file does not reside on a local device then no such guarantee * is made. * - *
The metaData parameter can be used to limit the number of + *
The {@code metaData} parameter can be used to limit the number of * I/O operations that this method is required to perform. Passing - * false for this parameter indicates that only updates to the - * file's content need be written to storage; passing true + * {@code false} for this parameter indicates that only updates to the + * file's content need be written to storage; passing {@code true} * indicates that updates to both the file's content and metadata must be * written, which generally requires at least one more I/O operation. * Whether this parameter actually has any effect is dependent upon the @@ -540,7 +540,7 @@ public abstract class FileChannel * force changes made to the buffer's content to be written.
* * @param metaData - * If true then this method is required to force changes + * If {@code true} then this method is required to force changes * to both the file's content and metadata to be written to * storage; otherwise, it need only force content changes to be * written @@ -557,14 +557,14 @@ public abstract class FileChannel * Transfers bytes from this channel's file to the given writable byte * channel. * - *An attempt is made to read up to count bytes starting at - * the given position in this channel's file and write them to the + *
An attempt is made to read up to {@code count} bytes starting at + * the given {@code position} in this channel's file and write them to the * target channel. An invocation of this method may or may not transfer * all of the requested bytes; whether or not it does so depends upon the * natures and states of the channels. Fewer than the requested number of * bytes are transferred if this channel's file contains fewer than - * count bytes starting at the given position, or if the - * target channel is non-blocking and it has fewer than count + * {@code count} bytes starting at the given {@code position}, or if the + * target channel is non-blocking and it has fewer than {@code count} * bytes free in its output buffer. * *
This method does not modify this channel's position. If the given @@ -624,14 +624,14 @@ public abstract class FileChannel * Transfers bytes into this channel's file from the given readable byte * channel. * - *
An attempt is made to read up to count bytes from the + *
An attempt is made to read up to {@code count} bytes from the * source channel and write them to this channel's file starting at the - * given position. An invocation of this method may or may not + * given {@code position}. An invocation of this method may or may not * transfer all of the requested bytes; whether or not it does so depends * upon the natures and states of the channels. Fewer than the requested * number of bytes will be transferred if the source channel has fewer than - * count bytes remaining, or if the source channel is non-blocking - * and has fewer than count bytes immediately available in its + * {@code count} bytes remaining, or if the source channel is non-blocking + * and has fewer than {@code count} bytes immediately available in its * input buffer. * *
This method does not modify this channel's position. If the given @@ -704,7 +704,7 @@ public abstract class FileChannel * The file position at which the transfer is to begin; * must be non-negative * - * @return The number of bytes read, possibly zero, or -1 if the + * @return The number of bytes read, possibly zero, or {@code -1} if the * given position is greater than or equal to the file's current * size * @@ -855,7 +855,7 @@ public abstract class FileChannel * *
The {@link MappedByteBuffer mapped byte buffer} * returned by this method will have a position of zero and a limit and - * capacity of size; its mark will be undefined. The buffer and + * capacity of {@code size}; its mark will be undefined. The buffer and * the mapping that it represents will remain valid until the buffer itself * is garbage-collected. * @@ -895,11 +895,11 @@ public abstract class FileChannel * @return The mapped byte buffer * * @throws NonReadableChannelException - * If the mode is {@link MapMode#READ_ONLY READ_ONLY} but + * If the {@code mode} is {@link MapMode#READ_ONLY READ_ONLY} but * this channel was not opened for reading * * @throws NonWritableChannelException - * If the mode is {@link MapMode#READ_WRITE READ_WRITE} or + * If the {@code mode} is {@link MapMode#READ_WRITE READ_WRITE} or * {@link MapMode#PRIVATE PRIVATE} but this channel was not opened * for both reading and writing * @@ -936,7 +936,7 @@ public abstract class FileChannel * will be thrown immediately; the thread's interrupt status will not be * changed. * - *
The region specified by the position and size + *
The region specified by the {@code position} and {@code size} * parameters need not be contained within, or even overlap, the actual * underlying file. Lock regions are fixed in size; if a locked region * initially contains the end of the file and the file grows beyond the @@ -963,12 +963,12 @@ public abstract class FileChannel * * @param size * The size of the locked region; must be non-negative, and the sum - * position + size must be non-negative + * {@code position} + {@code size} must be non-negative * * @param shared - * true to request a shared lock, in which case this + * {@code true} to request a shared lock, in which case this * channel must be open for reading (and possibly writing); - * false to request an exclusive lock, in which case this + * {@code false} to request an exclusive lock, in which case this * channel must be open for writing (and possibly reading) * * @return A lock object representing the newly-acquired lock @@ -994,11 +994,11 @@ public abstract class FileChannel * region * * @throws NonReadableChannelException - * If shared is true this channel was not + * If {@code shared} is {@code true} this channel was not * opened for reading * * @throws NonWritableChannelException - * If shared is false but this channel was not + * If {@code shared} is {@code false} but this channel was not * opened for writing * * @throws IOException @@ -1014,7 +1014,7 @@ public abstract class FileChannel /** * Acquires an exclusive lock on this channel's file. * - *
An invocation of this method of the form fc.lock() behaves + *
An invocation of this method of the form {@code fc.lock()} behaves * in exactly the same way as the invocation * *
@@ -1060,10 +1060,10 @@ public abstract class FileChannel * immediately, either having acquired a lock on the requested region or * having failed to do so. If it fails to acquire a lock because an * overlapping lock is held by another program then it returns - * null. If it fails to acquire a lock for any other reason then + * {@code null}. If it fails to acquire a lock for any other reason then * an appropriate exception is thrown. * - *The region specified by the position and size + *
The region specified by the {@code position} and {@code size} * parameters need not be contained within, or even overlap, the actual * underlying file. Lock regions are fixed in size; if a locked region * initially contains the end of the file and the file grows beyond the @@ -1090,14 +1090,14 @@ public abstract class FileChannel * * @param size * The size of the locked region; must be non-negative, and the sum - * position + size must be non-negative + * {@code position} + {@code size} must be non-negative * * @param shared - * true to request a shared lock, - * false to request an exclusive lock + * {@code true} to request a shared lock, + * {@code false} to request an exclusive lock * * @return A lock object representing the newly-acquired lock, - * or null if the lock could not be acquired + * or {@code null} if the lock could not be acquired * because another program holds an overlapping lock * * @throws IllegalArgumentException @@ -1125,14 +1125,14 @@ public abstract class FileChannel /** * Attempts to acquire an exclusive lock on this channel's file. * - *
An invocation of this method of the form fc.tryLock() + *
An invocation of this method of the form {@code fc.tryLock()} * behaves in exactly the same way as the invocation * *
* fc.{@link #tryLock(long,long,boolean) tryLock}(0L, Long.MAX_VALUE, false)* * @return A lock object representing the newly-acquired lock, - * or null if the lock could not be acquired + * or {@code null} if the lock could not be acquired * because another program holds an overlapping lock * * @throws ClosedChannelException diff --git a/jdk/src/java.base/share/classes/java/nio/channels/FileLock.java b/jdk/src/java.base/share/classes/java/nio/channels/FileLock.java index 73e351126ca..3a5c6a1a4b7 100644 --- a/jdk/src/java.base/share/classes/java/nio/channels/FileLock.java +++ b/jdk/src/java.base/share/classes/java/nio/channels/FileLock.java @@ -136,11 +136,11 @@ public abstract class FileLock implements AutoCloseable { * * @param size * The size of the locked region; must be non-negative, and the sum - * position + size must be non-negative + * {@code position} + {@code size} must be non-negative * * @param shared - * true if this lock is shared, - * false if it is exclusive + * {@code true} if this lock is shared, + * {@code false} if it is exclusive * * @throws IllegalArgumentException * If the preconditions on the parameters do not hold @@ -173,11 +173,11 @@ public abstract class FileLock implements AutoCloseable { * * @param size * The size of the locked region; must be non-negative, and the sum - * position + size must be non-negative + * {@code position} + {@code size} must be non-negative * * @param shared - * true if this lock is shared, - * false if it is exclusive + * {@code true} if this lock is shared, + * {@code false} if it is exclusive * * @throws IllegalArgumentException * If the preconditions on the parameters do not hold @@ -254,8 +254,8 @@ public abstract class FileLock implements AutoCloseable { /** * Tells whether this lock is shared. * - * @return true if lock is shared, - * false if it is exclusive + * @return {@code true} if lock is shared, + * {@code false} if it is exclusive */ public final boolean isShared() { return shared; @@ -269,7 +269,7 @@ public abstract class FileLock implements AutoCloseable { * @param size * The size of the lock range * - * @return true if, and only if, this lock and the given lock + * @return {@code true} if, and only if, this lock and the given lock * range overlap by at least one byte */ public final boolean overlaps(long position, long size) { @@ -286,7 +286,7 @@ public abstract class FileLock implements AutoCloseable { *A lock object remains valid until it is released or the associated * file channel is closed, whichever comes first.
* - * @return true if, and only if, this lock is valid + * @return {@code true} if, and only if, this lock is valid */ public abstract boolean isValid(); diff --git a/jdk/src/java.base/share/classes/java/nio/channels/GatheringByteChannel.java b/jdk/src/java.base/share/classes/java/nio/channels/GatheringByteChannel.java index 9c50d9325e3..f2ae40e5170 100644 --- a/jdk/src/java.base/share/classes/java/nio/channels/GatheringByteChannel.java +++ b/jdk/src/java.base/share/classes/java/nio/channels/GatheringByteChannel.java @@ -66,11 +66,11 @@ public interface GatheringByteChannel * at the moment that this method is invoked. * *Suppose that a byte sequence of length n is written, where - * 0 <= n <= r. - * Up to the first srcs[offset].remaining() bytes of this sequence - * are written from buffer srcs[offset], up to the next - * srcs[offset+1].remaining() bytes are written from buffer - * srcs[offset+1], and so forth, until the entire byte sequence is + * {@code 0} {@code <=} n {@code <=} r. + * Up to the first {@code srcs[offset].remaining()} bytes of this sequence + * are written from buffer {@code srcs[offset]}, up to the next + * {@code srcs[offset+1].remaining()} bytes are written from buffer + * {@code srcs[offset+1]}, and so forth, until the entire byte sequence is * written. As many bytes as possible are written from each buffer, hence * the final position of each updated buffer, except the last updated * buffer, is guaranteed to be equal to that buffer's limit. @@ -92,17 +92,17 @@ public interface GatheringByteChannel * @param offset * The offset within the buffer array of the first buffer from * which bytes are to be retrieved; must be non-negative and no - * larger than srcs.length + * larger than {@code srcs.length} * * @param length * The maximum number of buffers to be accessed; must be * non-negative and no larger than - * srcs.length - offset + * {@code srcs.length} - {@code offset} * * @return The number of bytes written, possibly zero * * @throws IndexOutOfBoundsException - * If the preconditions on the offset and length + * If the preconditions on the {@code offset} and {@code length} * parameters do not hold * * @throws NonWritableChannelException @@ -131,7 +131,7 @@ public interface GatheringByteChannel /** * Writes a sequence of bytes to this channel from the given buffers. * - *
An invocation of this method of the form c.write(srcs) + *
An invocation of this method of the form {@code c.write(srcs)} * behaves in exactly the same manner as the invocation * *
diff --git a/jdk/src/java.base/share/classes/java/nio/channels/InterruptibleChannel.java b/jdk/src/java.base/share/classes/java/nio/channels/InterruptibleChannel.java index 0e49aa680da..d13a37aeae4 100644 --- a/jdk/src/java.base/share/classes/java/nio/channels/InterruptibleChannel.java +++ b/jdk/src/java.base/share/classes/java/nio/channels/InterruptibleChannel.java @@ -54,7 +54,7 @@ import java.io.IOException; * *A channel supports asynchronous closing and interruption if, and only * if, it implements this interface. This can be tested at runtime, if - * necessary, via the instanceof operator. + * necessary, via the {@code instanceof} operator. * * * @author Mark Reinhold diff --git a/jdk/src/java.base/share/classes/java/nio/channels/ReadableByteChannel.java b/jdk/src/java.base/share/classes/java/nio/channels/ReadableByteChannel.java index 4cd99c0936c..83fd12b44fb 100644 --- a/jdk/src/java.base/share/classes/java/nio/channels/ReadableByteChannel.java +++ b/jdk/src/java.base/share/classes/java/nio/channels/ReadableByteChannel.java @@ -52,16 +52,16 @@ public interface ReadableByteChannel extends Channel { * *
An attempt is made to read up to r bytes from the channel, * where r is the number of bytes remaining in the buffer, that is, - * dst.remaining(), at the moment this method is invoked. + * {@code dst.remaining()}, at the moment this method is invoked. * *
Suppose that a byte sequence of length n is read, where - * 0 <= n <= r. + * {@code 0} {@code <=} n {@code <=} r. * This byte sequence will be transferred into the buffer so that the first * byte in the sequence is at index p and the last byte is at index - * p + n - 1, + * p {@code +} n {@code -} {@code 1}, * where p is the buffer's position at the moment this method is * invoked. Upon return the buffer's position will be equal to - * p + n; its limit will not have changed. + * p {@code +} n; its limit will not have changed. * *
A read operation might not fill the buffer, and in fact it might not * read any bytes at all. Whether or not it does so depends upon the @@ -81,7 +81,7 @@ public interface ReadableByteChannel extends Channel { * @param dst * The buffer into which bytes are to be transferred * - * @return The number of bytes read, possibly zero, or -1 if the + * @return The number of bytes read, possibly zero, or {@code -1} if the * channel has reached end-of-stream * * @throws NonReadableChannelException diff --git a/jdk/src/java.base/share/classes/java/nio/channels/ScatteringByteChannel.java b/jdk/src/java.base/share/classes/java/nio/channels/ScatteringByteChannel.java index 7922909fe88..d4493979627 100644 --- a/jdk/src/java.base/share/classes/java/nio/channels/ScatteringByteChannel.java +++ b/jdk/src/java.base/share/classes/java/nio/channels/ScatteringByteChannel.java @@ -66,11 +66,11 @@ public interface ScatteringByteChannel * at the moment that this method is invoked. * *
Suppose that a byte sequence of length n is read, where - * 0 <= n <= r. - * Up to the first dsts[offset].remaining() bytes of this sequence - * are transferred into buffer dsts[offset], up to the next - * dsts[offset+1].remaining() bytes are transferred into buffer - * dsts[offset+1], and so forth, until the entire byte sequence + * {@code 0} {@code <=} n {@code <=} r. + * Up to the first {@code dsts[offset].remaining()} bytes of this sequence + * are transferred into buffer {@code dsts[offset]}, up to the next + * {@code dsts[offset+1].remaining()} bytes are transferred into buffer + * {@code dsts[offset+1]}, and so forth, until the entire byte sequence * is transferred into the given buffers. As many bytes as possible are * transferred into each buffer, hence the final position of each updated * buffer, except the last updated buffer, is guaranteed to be equal to @@ -87,18 +87,18 @@ public interface ScatteringByteChannel * @param offset * The offset within the buffer array of the first buffer into * which bytes are to be transferred; must be non-negative and no - * larger than dsts.length + * larger than {@code dsts.length} * * @param length * The maximum number of buffers to be accessed; must be * non-negative and no larger than - * dsts.length - offset + * {@code dsts.length} - {@code offset} * * @return The number of bytes read, possibly zero, - * or -1 if the channel has reached end-of-stream + * or {@code -1} if the channel has reached end-of-stream * * @throws IndexOutOfBoundsException - * If the preconditions on the offset and length + * If the preconditions on the {@code offset} and {@code length} * parameters do not hold * * @throws NonReadableChannelException @@ -126,7 +126,7 @@ public interface ScatteringByteChannel /** * Reads a sequence of bytes from this channel into the given buffers. * - *
An invocation of this method of the form c.read(dsts) + *
An invocation of this method of the form {@code c.read(dsts)} * behaves in exactly the same manner as the invocation * *
* * @param sel * The selector with which this channel is to be registered @@ -267,7 +267,7 @@ public abstract class SelectableChannel * but the corresponding key has already been cancelled * * @throws IllegalArgumentException - * If a bit in ops does not correspond to an operation + * If a bit in {@code ops} does not correspond to an operation * that is supported by this channel, that is, if {@code set & * ~validOps() != 0} * @@ -296,8 +296,8 @@ public abstract class SelectableChannel * of the {@link #register(Selector, int) register} method is in progress * then it will first block until the other operation is complete. * - * @param block If true then this channel will be placed in - * blocking mode; if false then it will be placed + * @param block If {@code true} then this channel will be placed in + * blocking mode; if {@code false} then it will be placed * non-blocking mode * * @return This selectable channel @@ -306,7 +306,7 @@ public abstract class SelectableChannel * If this channel is closed * * @throws IllegalBlockingModeException - * If block is true and this channel is + * If {@code block} is {@code true} and this channel is * registered with one or more selectors * * @throws IOException @@ -327,7 +327,7 @@ public abstract class SelectableChannel *@@ -136,7 +136,7 @@ public interface ScatteringByteChannel * The buffers into which bytes are to be transferred * * @return The number of bytes read, possibly zero, - * or -1 if the channel has reached end-of-stream + * or {@code -1} if the channel has reached end-of-stream * * @throws NonReadableChannelException * If this channel was not opened for reading diff --git a/jdk/src/java.base/share/classes/java/nio/channels/SelectableChannel.java b/jdk/src/java.base/share/classes/java/nio/channels/SelectableChannel.java index 997d5c5ec57..8cf4dab27a4 100644 --- a/jdk/src/java.base/share/classes/java/nio/channels/SelectableChannel.java +++ b/jdk/src/java.base/share/classes/java/nio/channels/SelectableChannel.java @@ -132,7 +132,7 @@ public abstract class SelectableChannel * of its keys have been cancelled. A channel may also remain registered * for some time after it is closed. * - * @return true if, and only if, this channel is registered + * @return {@code true} if, and only if, this channel is registered */ public abstract boolean isRegistered(); // @@ -146,7 +146,7 @@ public abstract class SelectableChannel * The selector * * @return The key returned when this channel was last registered with the - * given selector, or null if this channel is not + * given selector, or {@code null} if this channel is not * currently registered with that selector */ public abstract SelectionKey keyFor(Selector sel); @@ -159,16 +159,16 @@ public abstract class SelectableChannel * *If this channel is currently registered with the given selector then * the selection key representing that registration is returned. The key's - * interest set will have been changed to ops, as if by invoking + * interest set will have been changed to {@code ops}, as if by invoking * the {@link SelectionKey#interestOps(int) interestOps(int)} method. If - * the att argument is not null then the key's attachment + * the {@code att} argument is not {@code null} then the key's attachment * will have been set to that value. A {@link CancelledKeyException} will * be thrown if the key has already been cancelled. * *
Otherwise this channel has not yet been registered with the given * selector, so it is registered and the resulting new key is returned. - * The key's initial interest set will be ops and its attachment - * will be att. + * The key's initial interest set will be {@code ops} and its attachment + * will be {@code att}. * *
This method may be invoked at any time. If this method is invoked * while another invocation of this method or of the {@link @@ -189,7 +189,7 @@ public abstract class SelectableChannel * The interest set for the resulting key * * @param att - * The attachment for the resulting key; may be null + * The attachment for the resulting key; may be {@code null} * * @throws ClosedChannelException * If this channel is closed @@ -209,7 +209,7 @@ public abstract class SelectableChannel * but the corresponding key has already been cancelled * * @throws IllegalArgumentException - * If a bit in the ops set does not correspond to an + * If a bit in the {@code ops} set does not correspond to an * operation that is supported by this channel, that is, if * {@code set & ~validOps() != 0} * @@ -235,13 +235,13 @@ public abstract class SelectableChannel * *
An invocation of this convenience method of the form * - *
sc.register(sel, ops)+ *{@code sc.register(sel, ops)}* * behaves in exactly the same way as the invocation * - *sc.{@link + *+ * register(sel, ops, null)}{@code sc.}{@link * #register(java.nio.channels.Selector,int,java.lang.Object) - * register}(sel, ops, null)If this channel is closed then the value returned by this method is * not specified.
* - * @return true if, and only if, this channel is in blocking mode + * @return {@code true} if, and only if, this channel is in blocking mode */ public abstract boolean isBlocking(); diff --git a/jdk/src/java.base/share/classes/java/nio/channels/SelectionKey.java b/jdk/src/java.base/share/classes/java/nio/channels/SelectionKey.java index 00ea670f9ba..86c133d192f 100644 --- a/jdk/src/java.base/share/classes/java/nio/channels/SelectionKey.java +++ b/jdk/src/java.base/share/classes/java/nio/channels/SelectionKey.java @@ -139,7 +139,7 @@ public abstract class SelectionKey { *A key is valid upon creation and remains so until it is cancelled, * its channel is closed, or its selector is closed.
* - * @return true if, and only if, this key is valid + * @return {@code true} if, and only if, this key is valid */ public abstract boolean isValid(); @@ -218,11 +218,11 @@ public abstract class SelectionKey { * Operation-set bit for read operations. * *Suppose that a selection key's interest set contains - * OP_READ at the start of a selection operation. If the selector * detects that the corresponding channel is ready for reading, has reached * end-of-stream, has been remotely shut down for further reading, or has - * an error pending, then it will add OP_READ to the key's + * an error pending, then it will add {@code OP_READ} to the key's * ready-operation set and add the key to its selected-key set.
*/ public static final int OP_READ = 1 << 0; @@ -231,11 +231,11 @@ public abstract class SelectionKey { * Operation-set bit for write operations. * *Suppose that a selection key's interest set contains - * OP_WRITE at the start of a selection operation. If the selector * detects that the corresponding channel is ready for writing, has been * remotely shut down for further writing, or has an error pending, then it - * will add OP_WRITE to the key's ready set and add the key to its + * will add {@code OP_WRITE} to the key's ready set and add the key to its * selected-key set.
*/ public static final int OP_WRITE = 1 << 2; @@ -244,11 +244,11 @@ public abstract class SelectionKey { * Operation-set bit for socket-connect operations. * *Suppose that a selection key's interest set contains - * OP_CONNECT at the start of a selection operation. If the selector * detects that the corresponding socket channel is ready to complete its * connection sequence, or has an error pending, then it will add - * OP_CONNECT to the key's ready set and add the key to its + * {@code OP_CONNECT} to the key's ready set and add the key to its * selected-key set.
*/ public static final int OP_CONNECT = 1 << 3; @@ -257,11 +257,11 @@ public abstract class SelectionKey { * Operation-set bit for socket-accept operations. * *Suppose that a selection key's interest set contains - * OP_ACCEPT at the start of a selection operation. If the selector * detects that the corresponding server-socket channel is ready to accept * another connection, or has an error pending, then it will add - * OP_ACCEPT to the key's ready set and add the key to its + * {@code OP_ACCEPT} to the key's ready set and add the key to its * selected-key set.
*/ public static final int OP_ACCEPT = 1 << 4; @@ -269,7 +269,7 @@ public abstract class SelectionKey { /** * Tests whether this key's channel is ready for reading. * - *An invocation of this method of the form k.isReadable() + *
An invocation of this method of the form {@code k.isReadable()} * behaves in exactly the same way as the expression * *
* *{@code @@ -277,9 +277,9 @@ public abstract class SelectionKey { * }If this key's channel does not support read operations then this - * method always returns false.
+ * method always returns {@code false}. * - * @return true if, and only if, + * @return {@code true} if, and only if, {@code readyOps() & OP_READ} is nonzero * * @throws CancelledKeyException @@ -292,7 +292,7 @@ public abstract class SelectionKey { /** * Tests whether this key's channel is ready for writing. * - *An invocation of this method of the form k.isWritable() + *
An invocation of this method of the form {@code k.isWritable()} * behaves in exactly the same way as the expression * *
* *{@code @@ -300,9 +300,9 @@ public abstract class SelectionKey { * }If this key's channel does not support write operations then this - * method always returns false.
+ * method always returns {@code false}. * - * @return true if, and only if, + * @return {@code true} if, and only if, * {@code readyOps() & OP_WRITE} is nonzero * * @throws CancelledKeyException @@ -316,7 +316,7 @@ public abstract class SelectionKey { * Tests whether this key's channel has either finished, or failed to * finish, its socket-connection operation. * - *An invocation of this method of the form k.isConnectable() + *
An invocation of this method of the form {@code k.isConnectable()} * behaves in exactly the same way as the expression * *
* *{@code @@ -324,9 +324,9 @@ public abstract class SelectionKey { * }If this key's channel does not support socket-connect operations - * then this method always returns false.
+ * then this method always returns {@code false}. * - * @return true if, and only if, + * @return {@code true} if, and only if, * {@code readyOps() & OP_CONNECT} is nonzero * * @throws CancelledKeyException @@ -340,7 +340,7 @@ public abstract class SelectionKey { * Tests whether this key's channel is ready to accept a new socket * connection. * - *An invocation of this method of the form k.isAcceptable() + *
An invocation of this method of the form {@code k.isAcceptable()} * behaves in exactly the same way as the expression * *
* *{@code @@ -348,9 +348,9 @@ public abstract class SelectionKey { * }If this key's channel does not support socket-accept operations then - * this method always returns false.
+ * this method always returns {@code false}. * - * @return true if, and only if, + * @return {@code true} if, and only if, * {@code readyOps() & OP_ACCEPT} is nonzero * * @throws CancelledKeyException @@ -376,13 +376,13 @@ public abstract class SelectionKey { *An attached object may later be retrieved via the {@link #attachment() * attachment} method. Only one object may be attached at a time; invoking * this method causes any previous attachment to be discarded. The current - * attachment may be discarded by attaching null.
+ * attachment may be discarded by attaching {@code null}. * * @param ob - * The object to be attached; may be null + * The object to be attached; may be {@code null} * * @return The previously-attached object, if any, - * otherwise null + * otherwise {@code null} */ public final Object attach(Object ob) { return attachmentUpdater.getAndSet(this, ob); @@ -392,7 +392,7 @@ public abstract class SelectionKey { * Retrieves the current attachment. * * @return The object currently attached to this key, - * or null if there is no attachment + * or {@code null} if there is no attachment */ public final Object attachment() { return attachment; diff --git a/jdk/src/java.base/share/classes/java/nio/channels/Selector.java b/jdk/src/java.base/share/classes/java/nio/channels/Selector.java index ea72acb6400..cfed526b47d 100644 --- a/jdk/src/java.base/share/classes/java/nio/channels/Selector.java +++ b/jdk/src/java.base/share/classes/java/nio/channels/Selector.java @@ -230,7 +230,7 @@ public abstract class Selector implements Closeable { /** * Tells whether or not this selector is open. * - * @return true if, and only if, this selector is open + * @return {@code true} if, and only if, this selector is open */ public abstract boolean isOpen(); @@ -309,7 +309,7 @@ public abstract class Selector implements Closeable { *This method does not offer real-time guarantees: It schedules the * timeout as if by invoking the {@link Object#wait(long)} method.
* - * @param timeout If positive, block for up to timeout + * @param timeout If positive, block for up to {@code timeout} * milliseconds, more or less, while waiting for a * channel to become ready; if zero, block indefinitely; * must not be negative diff --git a/jdk/src/java.base/share/classes/java/nio/channels/ServerSocketChannel.java b/jdk/src/java.base/share/classes/java/nio/channels/ServerSocketChannel.java index 8d967b355c7..7c9666bbdd8 100644 --- a/jdk/src/java.base/share/classes/java/nio/channels/ServerSocketChannel.java +++ b/jdk/src/java.base/share/classes/java/nio/channels/ServerSocketChannel.java @@ -223,7 +223,7 @@ public abstract class ServerSocketChannel * Accepts a connection made to this channel's socket. * *If this channel is in non-blocking mode then this method will - * immediately return null if there are no pending connections. + * immediately return {@code null} if there are no pending connections. * Otherwise it will block indefinitely until a new connection is available * or an I/O error occurs. * @@ -239,7 +239,7 @@ public abstract class ServerSocketChannel * java.lang.SecurityManager#checkAccept checkAccept} method.
* * @return The socket channel for the new connection, - * or null if this channel is in non-blocking mode + * or {@code null} if this channel is in non-blocking mode * and no connection is available to be accepted * * @throws ClosedChannelException diff --git a/jdk/src/java.base/share/classes/java/nio/channels/SocketChannel.java b/jdk/src/java.base/share/classes/java/nio/channels/SocketChannel.java index eb13b156eee..c25cc68edf2 100644 --- a/jdk/src/java.base/share/classes/java/nio/channels/SocketChannel.java +++ b/jdk/src/java.base/share/classes/java/nio/channels/SocketChannel.java @@ -58,7 +58,7 @@ import java.nio.channels.spi.SelectorProvider; * If the input side of a socket is shut down by one thread while another * thread is blocked in a read operation on the socket's channel, then the read * operation in the blocked thread will complete without reading any bytes and - * will return -1. If the output side of a socket is shut down by one + * will return {@code -1}. If the output side of a socket is shut down by one * thread while another thread is blocked in a write operation on the socket's * channel, then the blocked thread will receive an {@link * AsynchronousCloseException}. @@ -150,7 +150,7 @@ public abstract class SocketChannel * *This convenience method works as if by invoking the {@link #open()} * method, invoking the {@link #connect(SocketAddress) connect} method upon - * the resulting socket channel, passing it remote, and then + * the resulting socket channel, passing it {@code remote}, and then * returning that channel.
* * @param remote @@ -204,9 +204,9 @@ public abstract class SocketChannel * operations. * *Socket channels support connecting, reading, and writing, so this - * method returns ({@link SelectionKey#OP_CONNECT} - * | {@link SelectionKey#OP_READ} | {@link - * SelectionKey#OP_WRITE}).
+ * method returns {@code (}{@link SelectionKey#OP_CONNECT} + * {@code |} {@link SelectionKey#OP_READ} {@code |} {@link + * SelectionKey#OP_WRITE}{@code )}. * * @return The valid-operation set */ @@ -304,7 +304,7 @@ public abstract class SocketChannel /** * Tells whether or not this channel's network socket is connected. * - * @return true if, and only if, this channel's network socket + * @return {@code true} if, and only if, this channel's network socket * is {@link #isOpen open} and connected */ public abstract boolean isConnected(); @@ -313,7 +313,7 @@ public abstract class SocketChannel * Tells whether or not a connection operation is in progress on this * channel. * - * @return true if, and only if, a connection operation has been + * @return {@code true} if, and only if, a connection operation has been * initiated on this channel but not yet completed by invoking the * {@link #finishConnect finishConnect} method */ @@ -325,8 +325,8 @@ public abstract class SocketChannel *If this channel is in non-blocking mode then an invocation of this * method initiates a non-blocking connection operation. If the connection * is established immediately, as can happen with a local connection, then - * this method returns true. Otherwise this method returns - * false and the connection operation must later be completed by + * this method returns {@code true}. Otherwise this method returns + * {@code false} and the connection operation must later be completed by * invoking the {@link #finishConnect finishConnect} method. * *
If this channel is in blocking mode then an invocation of this @@ -349,8 +349,8 @@ public abstract class SocketChannel * @param remote * The remote address to which this channel is to be connected * - * @return true if a connection was established, - * false if this channel is in non-blocking mode + * @return {@code true} if a connection was established, + * {@code false} if this channel is in non-blocking mode * and the connection operation is in progress * * @throws AlreadyConnectedException @@ -400,11 +400,11 @@ public abstract class SocketChannel * {@link java.io.IOException} to be thrown. * *
If this channel is already connected then this method will not block - * and will immediately return true. If this channel is in - * non-blocking mode then this method will return false if the + * and will immediately return {@code true}. If this channel is in + * non-blocking mode then this method will return {@code false} if the * connection process is not yet complete. If this channel is in blocking * mode then this method will block until the connection either completes - * or fails, and will always either return true or throw a checked + * or fails, and will always either return {@code true} or throw a checked * exception describing the failure. * *
This method may be invoked at any time. If a read or write @@ -414,7 +414,7 @@ public abstract class SocketChannel * invocation of this method throws a checked exception, then the channel * will be closed.
* - * @return true if, and only if, this channel's socket is now + * @return {@code true} if, and only if, this channel's socket is now * connected * * @throws NoConnectionPendingException diff --git a/jdk/src/java.base/share/classes/java/nio/channels/WritableByteChannel.java b/jdk/src/java.base/share/classes/java/nio/channels/WritableByteChannel.java index b2ea06598cd..ef8efa5037c 100644 --- a/jdk/src/java.base/share/classes/java/nio/channels/WritableByteChannel.java +++ b/jdk/src/java.base/share/classes/java/nio/channels/WritableByteChannel.java @@ -54,16 +54,16 @@ public interface WritableByteChannel * *An attempt is made to write up to r bytes to the channel, * where r is the number of bytes remaining in the buffer, that is, - * src.remaining(), at the moment this method is invoked. + * {@code src.remaining()}, at the moment this method is invoked. * *
Suppose that a byte sequence of length n is written, where - * 0 <= n <= r. + * {@code 0} {@code <=} n {@code <=} r. * This byte sequence will be transferred from the buffer starting at index * p, where p is the buffer's position at the moment this * method is invoked; the index of the last byte written will be - * p + n - 1. + * p {@code +} n {@code -} {@code 1}. * Upon return the buffer's position will be equal to - * p + n; its limit will not have changed. + * p {@code +} n; its limit will not have changed. * *
Unless otherwise specified, a write operation will return only after * writing all of the r requested bytes. Some types of channels, diff --git a/jdk/src/java.base/share/classes/java/nio/channels/package-info.java b/jdk/src/java.base/share/classes/java/nio/channels/package-info.java index 81183472108..b38bdea058a 100644 --- a/jdk/src/java.base/share/classes/java/nio/channels/package-info.java +++ b/jdk/src/java.base/share/classes/java/nio/channels/package-info.java @@ -32,29 +32,29 @@ * *
* @@ -99,8 +99,8 @@ * Internet Protocol (IP) multicast groups. * **
- * Channels Description {@link java.nio.channels.Channel} + *- * {@link java.nio.channels.Channel} *A nexus for I/O operations {@link java.nio.channels.ReadableByteChannel} + *- * {@link java.nio.channels.ReadableByteChannel} *Can read into a buffer {@link java.nio.channels.ScatteringByteChannel} + *- * {@link java.nio.channels.ScatteringByteChannel} *Can read into a sequence of buffers {@link java.nio.channels.WritableByteChannel} + *- * {@link java.nio.channels.WritableByteChannel} *Can write from a buffer {@link java.nio.channels.GatheringByteChannel} + *- * {@link java.nio.channels.GatheringByteChannel} *Can write from a sequence of buffers {@link java.nio.channels.ByteChannel} + *- * {@link java.nio.channels.ByteChannel} *Can read/write to/from a buffer {@link java.nio.channels.SeekableByteChannel} + *- * {@link java.nio.channels.SeekableByteChannel} *A {@code ByteChannel} connected to an entity that contains a variable-length sequence of bytes {@link java.nio.channels.AsynchronousChannel} + *- * {@link java.nio.channels.AsynchronousChannel} *Supports asynchronous I/O operations. {@link java.nio.channels.AsynchronousByteChannel} + *- * {@link java.nio.channels.AsynchronousByteChannel} *Can read and write bytes asynchronously {@link java.nio.channels.NetworkChannel} + *- * {@link java.nio.channels.NetworkChannel} *A channel to a network socket {@link java.nio.channels.MulticastChannel} + *- * {@link java.nio.channels.MulticastChannel} *Can join Internet Protocol (IP) multicast groups {@link java.nio.channels.Channels} + ** {@link java.nio.channels.Channels} *Utility methods for channel/stream interoperation The {@link java.nio.channels.Channels} utility class defines static methods - * that support the interoperation of the stream classes of the {@link - * java.io} package with the channel classes of this package. An appropriate + * that support the interoperation of the stream classes of the {@link + * java.io} package with the channel classes of this package. An appropriate * channel can be constructed from an {@link java.io.InputStream} or an {@link * java.io.OutputStream}, and conversely an {@link java.io.InputStream} or an * {@link java.io.OutputStream} can be constructed from a channel. A {@link @@ -111,11 +111,11 @@ * *
* @@ -133,30 +133,30 @@ * java.nio.channels.FileChannel#open open} methods, or by invoking the {@code * getChannel} method of a {@link java.io.FileInputStream}, {@link * java.io.FileOutputStream}, or {@link java.io.RandomAccessFile} to return a - * file channel connected to the same underlying file as the {@link java.io} + * file channel connected to the same underlying file as the {@link java.io} * class. * * **
- * File channels Description {@link java.nio.channels.FileChannel} + *- * {@link java.nio.channels.FileChannel} *Reads, writes, maps, and manipulates files {@link java.nio.channels.FileLock} + *- * {@link java.nio.channels.FileLock} *A lock on a (region of a) file {@link java.nio.MappedByteBuffer} + ** {@link java.nio.MappedByteBuffer} *A direct byte buffer mapped to a region of a file * @@ -194,18 +194,18 @@ * **
- * Multiplexed, non-blocking I/O Description
{@link java.nio.channels.SelectableChannel} + *- * {@link java.nio.channels.SelectableChannel} *A channel that can be multiplexed {@link java.nio.channels.DatagramChannel} + *- * {@link java.nio.channels.DatagramChannel} *A channel to a datagram-oriented socket {@link java.nio.channels.Pipe.SinkChannel} + *- * {@link java.nio.channels.Pipe.SinkChannel} *The write end of a pipe {@link java.nio.channels.Pipe.SourceChannel} + *- * {@link java.nio.channels.Pipe.SourceChannel} *The read end of a pipe {@link java.nio.channels.ServerSocketChannel} + *- * {@link java.nio.channels.ServerSocketChannel} *A channel to a stream-oriented listening socket {@link java.nio.channels.SocketChannel} + *- * {@link java.nio.channels.SocketChannel} *A channel for a stream-oriented connecting socket {@link java.nio.channels.Selector} + *- * {@link java.nio.channels.Selector} *A multiplexor of selectable channels {@link java.nio.channels.SelectionKey} + *- * {@link java.nio.channels.SelectionKey} *A token representing the registration
of a channel * with a selector{@link java.nio.channels.Pipe} + ** {@link java.nio.channels.Pipe} *Two channels that form a unidirectional pipe This package defines selectable-channel classes corresponding to the {@link * java.net.DatagramSocket}, {@link java.net.ServerSocket}, and {@link - * java.net.Socket} classes defined in the {@link java.net} package. + * java.net.Socket} classes defined in the {@link java.net} package. * Minor changes to these classes have been made in order to support sockets that * are associated with channels. This package also defines a simple class that * implements unidirectional pipes. In all cases, a new selectable channel is - * created by invoking the static open method of the corresponding class. + * created by invoking the static {@code open} method of the corresponding class. * If a channel needs an associated socket then a socket will be created as a side * effect of this operation. * *
The implementation of selectors, selectable channels, and selection keys * can be replaced by "plugging in" an alternative definition or instance of the - * {@link java.nio.channels.spi.SelectorProvider} class defined in the {@link - * java.nio.channels.spi} package. It is not expected that many developers + * {@link java.nio.channels.spi.SelectorProvider} class defined in the {@link + * java.nio.channels.spi} package. It is not expected that many developers * will actually make use of this facility; it is provided primarily so that * sophisticated users can take advantage of operating-system-specific * I/O-multiplexing mechanisms when very high performance is required. @@ -215,8 +215,8 @@ * java.nio.channels.spi.AbstractInterruptibleChannel}, {@link * java.nio.channels.spi.AbstractSelectableChannel}, {@link * java.nio.channels.spi.AbstractSelectionKey}, and {@link - * java.nio.channels.spi.AbstractSelector} classes in the {@link - * java.nio.channels.spi} package. When defining a custom selector provider, + * java.nio.channels.spi.AbstractSelector} classes in the {@link + * java.nio.channels.spi} package. When defining a custom selector provider, * only the {@link java.nio.channels.spi.AbstractSelector} and {@link * java.nio.channels.spi.AbstractSelectionKey} classes should be subclassed * directly; custom channel classes should extend the appropriate {@link @@ -226,15 +226,15 @@ * *
* @@ -272,13 +272,13 @@ **
- * Asynchronous I/O Description {@link java.nio.channels.AsynchronousFileChannel} + *- * {@link java.nio.channels.AsynchronousFileChannel} *An asynchronous channel for reading, writing, and manipulating a file {@link java.nio.channels.AsynchronousSocketChannel} + *- * {@link java.nio.channels.AsynchronousSocketChannel} *An asynchronous channel to a stream-oriented connecting socket {@link java.nio.channels.AsynchronousServerSocketChannel} + *- * {@link java.nio.channels.AsynchronousServerSocketChannel} *An asynchronous channel to a stream-oriented listening socket {@link java.nio.channels.CompletionHandler} + *- * {@link java.nio.channels.CompletionHandler} *A handler for consuming the result of an asynchronous operation {@link java.nio.channels.AsynchronousChannelGroup} + ** {@link java.nio.channels.AsynchronousChannelGroup} *A grouping of asynchronous channels for the purpose of resource sharing As with selectors, the implementation of asynchronous channels can be * replaced by "plugging in" an alternative definition or instance of the {@link * java.nio.channels.spi.AsynchronousChannelProvider} class defined in the - * {@link java.nio.channels.spi} package. It is not expected that many + * {@link java.nio.channels.spi} package. It is not expected that many * developers will actually make use of this facility; it is provided primarily * so that sophisticated users can take advantage of operating-system-specific * asynchronous I/O mechanisms when very high performance is required. * *
- *Unless otherwise noted, passing a null argument to a constructor + *
Unless otherwise noted, passing a {@code null} argument to a constructor * or method in any class or interface in this package will cause a {@link * java.lang.NullPointerException NullPointerException} to be thrown. * diff --git a/jdk/src/java.base/share/classes/java/nio/channels/spi/AbstractInterruptibleChannel.java b/jdk/src/java.base/share/classes/java/nio/channels/spi/AbstractInterruptibleChannel.java index fccc2904c7d..e45be24c166 100644 --- a/jdk/src/java.base/share/classes/java/nio/channels/spi/AbstractInterruptibleChannel.java +++ b/jdk/src/java.base/share/classes/java/nio/channels/spi/AbstractInterruptibleChannel.java @@ -46,7 +46,7 @@ import sun.nio.ch.Interruptible; * before and after, respectively, invoking an I/O operation that might block * indefinitely. In order to ensure that the {@link #end end} method is always * invoked, these methods should be used within a - * try ... finally block: + * {@code try} ... {@code finally} block: * *
* - ** boolean completed = false; @@ -58,11 +58,11 @@ import sun.nio.ch.Interruptible; * end(completed); * }The completed argument to the {@link #end end} method tells + *
The {@code completed} argument to the {@link #end end} method tells * whether or not the I/O operation actually completed, that is, whether it had * any effect that would be visible to the invoker. In the case of an * operation that reads bytes, for example, this argument should be - * true if, and only if, some bytes were actually transferred into the + * {@code true} if, and only if, some bytes were actually transferred into the * invoker's target buffer. * *
A concrete channel class must also implement the {@link @@ -148,7 +148,7 @@ public abstract class AbstractInterruptibleChannel * Marks the beginning of an I/O operation that might block indefinitely. * *
This method should be invoked in tandem with the {@link #end end} - * method, using a try ... finally block as + * method, using a {@code try} ... {@code finally} block as * shown above, in order to implement asynchronous * closing and interruption for this channel.
*/ @@ -177,12 +177,12 @@ public abstract class AbstractInterruptibleChannel * Marks the end of an I/O operation that might block indefinitely. * *This method should be invoked in tandem with the {@link #begin - * begin} method, using a try ... finally block + * begin} method, using a {@code try} ... {@code finally} block * as shown above, in order to implement asynchronous * closing and interruption for this channel.
* * @param completed - * true if, and only if, the I/O operation completed + * {@code true} if, and only if, the I/O operation completed * successfully, that is, had some effect that would be visible to * the operation's invoker * diff --git a/jdk/src/java.base/share/classes/java/nio/channels/spi/AbstractSelectableChannel.java b/jdk/src/java.base/share/classes/java/nio/channels/spi/AbstractSelectableChannel.java index 0de212d2df4..cb3ced9111d 100644 --- a/jdk/src/java.base/share/classes/java/nio/channels/spi/AbstractSelectableChannel.java +++ b/jdk/src/java.base/share/classes/java/nio/channels/spi/AbstractSelectableChannel.java @@ -305,8 +305,8 @@ public abstract class AbstractSelectableChannel * changing the blocking mode. This method is only invoked if the new mode * is different from the current mode. * - * @param block If true then this channel will be placed in - * blocking mode; if false then it will be placed + * @param block If {@code true} then this channel will be placed in + * blocking mode; if {@code false} then it will be placed * non-blocking mode * * @throws IOException diff --git a/jdk/src/java.base/share/classes/java/nio/channels/spi/AbstractSelector.java b/jdk/src/java.base/share/classes/java/nio/channels/spi/AbstractSelector.java index 09e3b61491f..3c4eda99dc7 100644 --- a/jdk/src/java.base/share/classes/java/nio/channels/spi/AbstractSelector.java +++ b/jdk/src/java.base/share/classes/java/nio/channels/spi/AbstractSelector.java @@ -43,7 +43,7 @@ import java.util.concurrent.atomic.AtomicBoolean; * after, respectively, invoking an I/O operation that might block * indefinitely. In order to ensure that the {@link #end end} method is always * invoked, these methods should be used within a - * try ... finally block: + * {@code try} ... {@code finally} block: * ** try { @@ -197,7 +197,7 @@ public abstract class AbstractSelector * Marks the beginning of an I/O operation that might block indefinitely. * *This method should be invoked in tandem with the {@link #end end} - * method, using a try ... finally block as + * method, using a {@code try} ... {@code finally} block as * shown above, in order to implement interruption for * this selector. * @@ -223,7 +223,7 @@ public abstract class AbstractSelector * Marks the end of an I/O operation that might block indefinitely. * *
This method should be invoked in tandem with the {@link #begin begin} - * method, using a try ... finally block as + * method, using a {@code try} ... {@code finally} block as * shown above, in order to implement interruption for * this selector.
*/ diff --git a/jdk/src/java.base/share/classes/java/nio/channels/spi/AsynchronousChannelProvider.java b/jdk/src/java.base/share/classes/java/nio/channels/spi/AsynchronousChannelProvider.java index d14c853522b..f720261d03b 100644 --- a/jdk/src/java.base/share/classes/java/nio/channels/spi/AsynchronousChannelProvider.java +++ b/jdk/src/java.base/share/classes/java/nio/channels/spi/AsynchronousChannelProvider.java @@ -64,7 +64,7 @@ public abstract class AsynchronousChannelProvider { * * @throws SecurityException * If a security manager has been installed and it denies - * {@link RuntimePermission}("asynchronousChannelProvider") + * {@link RuntimePermission}{@code ("asynchronousChannelProvider")} */ protected AsynchronousChannelProvider() { this(checkPermission()); @@ -137,7 +137,7 @@ public abstract class AsynchronousChannelProvider { ** *
- @@ -145,8 +145,8 @@ public abstract class AsynchronousChannelProvider { *
If the system property - * java.nio.channels.spi.AsynchronousChannelProvider is defined + * {@code java.nio.channels.spi.AsynchronousChannelProvider} is defined * then it is taken to be the fully-qualified name of a concrete provider class. * The class is loaded and instantiated; if this process fails then an * unspecified error is thrown.
- diff --git a/jdk/src/java.base/share/classes/java/nio/channels/spi/SelectorProvider.java b/jdk/src/java.base/share/classes/java/nio/channels/spi/SelectorProvider.java index ca704a8e5a5..cfe444a0041 100644 --- a/jdk/src/java.base/share/classes/java/nio/channels/spi/SelectorProvider.java +++ b/jdk/src/java.base/share/classes/java/nio/channels/spi/SelectorProvider.java @@ -46,7 +46,7 @@ import sun.security.action.GetPropertyAction; * #provider() provider} method. The first invocation of that method will locate * the default provider as specified below. * - *
If a provider class has been installed in a jar file that is * visible to the system class loader, and that jar file contains a * provider-configuration file named - * java.nio.channels.spi.AsynchronousChannelProvider in the resource - * directory META-INF/services, then the first class name + * {@code java.nio.channels.spi.AsynchronousChannelProvider} in the resource + * directory {@code META-INF/services}, then the first class name * specified in that file is taken. The class is loaded and * instantiated; if this process fails then an unspecified error is * thrown.
The system-wide default provider is used by the static open + *
The system-wide default provider is used by the static {@code open} * methods of the {@link java.nio.channels.DatagramChannel#open * DatagramChannel}, {@link java.nio.channels.Pipe#open Pipe}, {@link * java.nio.channels.Selector#open Selector}, {@link @@ -54,7 +54,7 @@ import sun.security.action.GetPropertyAction; * java.nio.channels.SocketChannel#open SocketChannel} classes. It is also * used by the {@link java.lang.System#inheritedChannel System.inheritedChannel()} * method. A program may make use of a provider other than the default provider - * by instantiating that provider and then directly invoking the open + * by instantiating that provider and then directly invoking the {@code open} * methods defined in this class. * *
All of the methods in this class are safe for use by multiple concurrent @@ -84,7 +84,7 @@ public abstract class SelectorProvider { * * @throws SecurityException * If a security manager has been installed and it denies - * {@link RuntimePermission}("selectorProvider") + * {@link RuntimePermission}{@code ("selectorProvider")} */ protected SelectorProvider() { this(checkPermission()); @@ -142,7 +142,7 @@ public abstract class SelectorProvider { *
* *
- @@ -150,8 +150,8 @@ public abstract class SelectorProvider { *
If the system property - * java.nio.channels.spi.SelectorProvider is defined then it is + * {@code java.nio.channels.spi.SelectorProvider} is defined then it is * taken to be the fully-qualified name of a concrete provider class. * The class is loaded and instantiated; if this process fails then an * unspecified error is thrown.
- @@ -305,14 +305,14 @@ public abstract class SelectorProvider { * returned. Subsequent invocations of this method return the same * channel. * - * @return The inherited channel, if any, otherwise null. + * @return The inherited channel, if any, otherwise {@code null}. * * @throws IOException * If an I/O error occurs * * @throws SecurityException * If a security manager has been installed and it denies - * {@link RuntimePermission}("inheritedChannel") + * {@link RuntimePermission}{@code ("inheritedChannel")} * * @since 1.5 */ diff --git a/jdk/src/java.base/share/classes/java/nio/charset/Charset-X-Coder.java.template b/jdk/src/java.base/share/classes/java/nio/charset/Charset-X-Coder.java.template index faa51bb45d4..74b6f928439 100644 --- a/jdk/src/java.base/share/classes/java/nio/charset/Charset-X-Coder.java.template +++ b/jdk/src/java.base/share/classes/java/nio/charset/Charset-X-Coder.java.template @@ -55,12 +55,12 @@ import java.util.Arrays; * has not been used before;
If a provider class has been installed in a jar file that is * visible to the system class loader, and that jar file contains a * provider-configuration file named - * java.nio.channels.spi.SelectorProvider in the resource - * directory META-INF/services, then the first class name + * {@code java.nio.channels.spi.SelectorProvider} in the resource + * directory {@code META-INF/services}, then the first class name * specified in that file is taken. The class is loaded and * instantiated; if this process fails then an unspecified error is * thrown.
Invoke the {@link #$code$ $code$} method zero or more times, as - * long as additional input may be available, passing false for the - * endOfInput argument and filling the input buffer and flushing the + * long as additional input may be available, passing {@code false} for the + * {@code endOfInput} argument and filling the input buffer and flushing the * output buffer between invocations;
Invoke the {@link #$code$ $code$} method one final time, passing - * true for the endOfInput argument; and then
Invoke the {@link #flush flush} method so that the $coder$ can * flush any internal state to the output buffer.
This method invokes the {@link #implOnMalformedInput * implOnMalformedInput} method, passing the new action.
* - * @param newAction The new action; must not be null + * @param newAction The new action; must not be {@code null} * * @return This $coder$ * @@ -400,7 +400,7 @@ public abstract class Charset$Coder$ { * Returns this $coder$'s current action for unmappable-character errors. * * @return The current unmappable-character action, which is never - * null + * {@code null} */ public CodingErrorAction unmappableCharacterAction() { return unmappableCharacterAction; @@ -412,7 +412,7 @@ public abstract class Charset$Coder$ { *This method invokes the {@link #implOnUnmappableCharacter * implOnUnmappableCharacter} method, passing the new action.
* - * @param newAction The new action; must not be null + * @param newAction The new action; must not be {@code null} * * @return This $coder$ * @@ -521,16 +521,16 @@ public abstract class Charset$Coder$ { * operation then care should be taken to preserve any $itype$s remaining * in the input buffer so that they are available to the next invocation. * - *The endOfInput parameter advises this method as to whether + *
The {@code endOfInput} parameter advises this method as to whether * the invoker can provide further input beyond that contained in the given * input buffer. If there is a possibility of providing additional input - * then the invoker should pass false for this parameter; if there + * then the invoker should pass {@code false} for this parameter; if there * is no possibility of providing further input then the invoker should - * pass true. It is not erroneous, and in fact it is quite - * common, to pass false in one invocation and later discover that + * pass {@code true}. It is not erroneous, and in fact it is quite + * common, to pass {@code false} in one invocation and later discover that * no further input was actually available. It is critical, however, that * the final invocation of this method in a sequence of invocations always - * pass true so that any remaining un$code$d input will be treated + * pass {@code true} so that any remaining un$code$d input will be treated * as being malformed. * *
This method works by invoking the {@link #$code$Loop $code$Loop} @@ -545,7 +545,7 @@ public abstract class Charset$Coder$ { * The output $otype$ buffer * * @param endOfInput - * true if, and only if, the invoker can provide no + * {@code true} if, and only if, the invoker can provide no * additional input $itype$s beyond those in the given buffer * * @return A coder-result object describing the reason for termination @@ -553,9 +553,9 @@ public abstract class Charset$Coder$ { * @throws IllegalStateException * If $a$ $coding$ operation is already in progress and the previous * step was an invocation neither of the {@link #reset reset} - * method, nor of this method with a value of false for - * the endOfInput parameter, nor of this method with a - * value of true for the endOfInput parameter + * method, nor of this method with a value of {@code false} for + * the {@code endOfInput} parameter, nor of this method with a + * value of {@code true} for the {@code endOfInput} parameter * but a return value indicating an incomplete $coding$ operation * * @throws CoderMalfunctionError @@ -659,7 +659,7 @@ public abstract class Charset$Coder$ { * invocation neither of the {@link #flush flush} method nor of * the three-argument {@link * #$code$($Itype$Buffer,$Otype$Buffer,boolean) $code$} method - * with a value of true for the endOfInput + * with a value of {@code true} for the {@code endOfInput} * parameter */ public final CoderResult flush($Otype$Buffer out) { @@ -824,10 +824,10 @@ public abstract class Charset$Coder$ { * Tells whether or not this decoder implements an auto-detecting charset. * *
The default implementation of this method always returns - * false; it should be overridden by auto-detecting decoders to - * return true.
+ * {@code false}; it should be overridden by auto-detecting decoders to + * return {@code true}. * - * @return true if, and only if, this decoder implements an + * @return {@code true} if, and only if, this decoder implements an * auto-detecting charset */ public boolean isAutoDetecting() { @@ -840,21 +840,21 @@ public abstract class Charset$Coder$ { * *If this decoder implements an auto-detecting charset then at a * single point during a decoding operation this method may start returning - * true to indicate that a specific charset has been detected in + * {@code true} to indicate that a specific charset has been detected in * the input byte sequence. Once this occurs, the {@link #detectedCharset * detectedCharset} method may be invoked to retrieve the detected charset. * - *
That this method returns false does not imply that no bytes + *
That this method returns {@code false} does not imply that no bytes * have yet been decoded. Some auto-detecting decoders are capable of * decoding some, or even all, of an input byte sequence without fixing on * a particular charset. * *
The default implementation of this method always throws an {@link * UnsupportedOperationException}; it should be overridden by - * auto-detecting decoders to return true once the input charset + * auto-detecting decoders to return {@code true} once the input charset * has been determined.
* - * @return true if, and only if, this decoder has detected a + * @return {@code true} if, and only if, this decoder has detected a * specific charset * * @throws UnsupportedOperationException @@ -880,7 +880,7 @@ public abstract class Charset$Coder$ { * auto-detecting decoders to return the appropriate value. * * @return The charset detected by this auto-detecting decoder, - * or null if the charset has not yet been determined + * or {@code null} if the charset has not yet been determined * * @throws IllegalStateException * If insufficient bytes have been read to determine a charset @@ -920,7 +920,7 @@ public abstract class Charset$Coder$ { /** * Tells whether or not this encoder can encode the given character. * - *This method returns false if the given character is a + *
This method returns {@code false} if the given character is a * surrogate character; such characters can be interpreted only when they * are members of a pair consisting of a high surrogate followed by a low * surrogate. The {@link #canEncode(java.lang.CharSequence) @@ -937,7 +937,7 @@ public abstract class Charset$Coder$ { * @param c * The given character * - * @return true if, and only if, this encoder can encode + * @return {@code true} if, and only if, this encoder can encode * the given character * * @throws IllegalStateException @@ -954,7 +954,7 @@ public abstract class Charset$Coder$ { * Tells whether or not this encoder can encode the given character * sequence. * - *
If this method returns false for a particular character + *
If this method returns {@code false} for a particular character * sequence then more information about why the sequence cannot be encoded * may be obtained by performing a full encoding * operation. @@ -968,7 +968,7 @@ public abstract class Charset$Coder$ { * @param cs * The given character sequence * - * @return true if, and only if, this encoder can encode + * @return {@code true} if, and only if, this encoder can encode * the given character without throwing any exceptions and without * performing any replacements * diff --git a/jdk/src/java.base/share/classes/java/nio/charset/Charset.java b/jdk/src/java.base/share/classes/java/nio/charset/Charset.java index a242b9c7ac8..6766cb53c3d 100644 --- a/jdk/src/java.base/share/classes/java/nio/charset/Charset.java +++ b/jdk/src/java.base/share/classes/java/nio/charset/Charset.java @@ -73,29 +73,29 @@ import sun.security.action.GetPropertyAction; * *
'\u0041'
through '\u005a'
),
*
- * '\u0061'
through '\u007a'
),
*
- * '\u0030'
through '\u0039'
),
*
- * '\u002d'
, HYPHEN-MINUS),
*
- * '\u002b'
, PLUS SIGN),
*
- * '\u002e'
, FULL STOP),
*
- * '\u003a'
, COLON), and
*
- * '\u005f'
, LOW LINE).
*
* Some charsets have an historical name that is defined for * compatibility with previous versions of the Java platform. A charset's * historical name is either its canonical name or one of its aliases. The - * historical name is returned by the getEncoding() methods of the + * historical name is returned by the {@code getEncoding()} methods of the * {@link java.io.InputStreamReader#getEncoding InputStreamReader} and {@link * java.io.OutputStreamWriter#getEncoding OutputStreamWriter} classes. * @@ -128,7 +128,7 @@ import sun.security.action.GetPropertyAction; * than one registry name then its canonical name must be the MIME-preferred * name and the other names in the registry must be valid aliases. If a * supported charset is not listed in the IANA registry then its canonical name - * must begin with one of the strings "X-" or "x-". + * must begin with one of the strings {@code "X-"} or {@code "x-"}. * *
The IANA charset registry does change over time, and so the canonical * name and the aliases of a particular charset may also change over time. To @@ -148,53 +148,53 @@ import sun.security.action.GetPropertyAction; * *
* - **
- * Charset Description US-ASCII - *Seven-bit ASCII, a.k.a. ISO646-US, + * - * {@code US-ASCII} + *Seven-bit ASCII, a.k.a. {@code ISO646-US}, * a.k.a. the Basic Latin block of the Unicode character set - * ISO-8859-1 - *ISO Latin Alphabet No. 1, a.k.a. ISO-LATIN-1 UTF-8 + *+ * + * ISO-8859-1
ISO Latin Alphabet No. 1, a.k.a. {@code ISO-LATIN-1} - * {@code UTF-8} *Eight-bit UCS Transformation Format UTF-16BE + *- * {@code UTF-16BE} *Sixteen-bit UCS Transformation Format, * big-endian byte order UTF-16LE + *- * {@code UTF-16LE} *Sixteen-bit UCS Transformation Format, * little-endian byte order UTF-16 + ** {@code UTF-16} *Sixteen-bit UCS Transformation Format, * byte order identified by an optional byte-order mark
The UTF-8 charset is specified by The {@code UTF-8} charset is specified by RFC 2279; the * transformation format upon which it is based is specified in * Amendment 2 of ISO 10646-1 and is also described in the Unicode * Standard. * - *
The UTF-16 charsets are specified by The {@code UTF-16} charsets are specified by RFC 2781; the * transformation formats upon which they are based are specified in * Amendment 1 of ISO 10646-1 and are also described in the Unicode * Standard. * - *
The UTF-16 charsets use sixteen-bit quantities and are + *
The {@code UTF-16} charsets use sixteen-bit quantities and are
* therefore sensitive to byte order. In these encodings the byte order of a
* stream may be indicated by an initial byte-order mark represented by
- * the Unicode character '\uFEFF'. Byte-order marks are handled
+ * the Unicode character '\uFEFF'
. Byte-order marks are handled
* as follows:
*
*
When decoding, the UTF-16BE and UTF-16LE + *
When decoding, the {@code UTF-16BE} and {@code UTF-16LE} * charsets interpret the initial byte-order marks as a ZERO-WIDTH * NON-BREAKING SPACE; when encoding, they do not write * byte-order marks.
When decoding, the UTF-16 charset interprets the + *
When decoding, the {@code UTF-16} charset interprets the * byte-order mark at the beginning of the input stream to indicate the * byte-order of the stream but defaults to big-endian if there is no * byte-order mark; when encoding, it uses big-endian byte order and writes @@ -247,9 +247,9 @@ import sun.security.action.GetPropertyAction; * character-encoding scheme then the corresponding charset is usually * named for the coded character set; otherwise a charset is usually named * for the encoding scheme and, possibly, the locale of the coded - * character sets that it supports. Hence US-ASCII is both the + * character sets that it supports. Hence {@code US-ASCII} is both the * name of a coded character set and of the charset that encodes it, while - * EUC-JP is the name of the charset that encodes the + * {@code EUC-JP} is the name of the charset that encodes the * JIS X 0201, JIS X 0208, and JIS X 0212 * coded character sets for the Japanese language. * @@ -495,14 +495,14 @@ public abstract class Charset * The name of the requested charset; may be either * a canonical name or an alias * - * @return true if, and only if, support for the named charset + * @return {@code true} if, and only if, support for the named charset * is available in the current Java virtual machine * * @throws IllegalCharsetNameException * If the given charset name is illegal * * @throws IllegalArgumentException - * If the given charsetName is null + * If the given {@code charsetName} is null */ public static boolean isSupported(String charsetName) { return (lookup(charsetName) != null); @@ -521,7 +521,7 @@ public abstract class Charset * If the given charset name is illegal * * @throws IllegalArgumentException - * If the given charsetName is null + * If the given {@code charsetName} is null * * @throws UnsupportedCharsetException * If no support for the named charset is available @@ -692,7 +692,7 @@ public abstract class Charset * href="http://www.iana.org/assignments/character-sets">IANA Charset * Registry. * - * @return true if, and only if, this charset is known by its + * @return {@code true} if, and only if, this charset is known by its * implementor to be registered with the IANA */ public final boolean isRegistered() { @@ -732,15 +732,15 @@ public abstract class Charset *
Every charset contains itself. * *
This method computes an approximation of the containment relation: - * If it returns true then the given charset is known to be - * contained by this charset; if it returns false, however, then + * If it returns {@code true} then the given charset is known to be + * contained by this charset; if it returns {@code false}, however, then * it is not necessarily the case that the given charset is not contained * in this charset. * * @param cs * The given charset * - * @return true if the given charset is contained in this charset + * @return {@code true} if the given charset is contained in this charset */ public abstract boolean contains(Charset cs); @@ -770,9 +770,9 @@ public abstract class Charset * input byte sequence. Such charsets do not support encoding because * there is no way to determine which encoding should be used on output. * Implementations of such charsets should override this method to return - * false.
+ * {@code false}. * - * @return true if, and only if, this charset supports encoding + * @return {@code true} if, and only if, this charset supports encoding */ public boolean canEncode() { return true; @@ -782,7 +782,7 @@ public abstract class Charset * Convenience method that decodes bytes in this charset into Unicode * characters. * - *An invocation of this method upon a charset cs returns the + *
An invocation of this method upon a charset {@code cs} returns the * same result as the expression * *
@@ -818,7 +818,7 @@ public abstract class Charset * Convenience method that encodes Unicode characters into bytes in this * charset. * - *An invocation of this method upon a charset cs returns the + *
An invocation of this method upon a charset {@code cs} returns the * same result as the expression * *
@@ -853,7 +853,7 @@ public abstract class Charset /** * Convenience method that encodes a string into bytes in this charset. * - *An invocation of this method upon a charset cs returns the + *
An invocation of this method upon a charset {@code cs} returns the * same result as the expression * *
@@ -898,7 +898,7 @@ public abstract class Charset *Two charsets are equal if, and only if, they have the same canonical * names. A charset is never equal to any other type of object.
* - * @return true if, and only if, this charset is equal to the + * @return {@code true} if, and only if, this charset is equal to the * given object */ public final boolean equals(Object ob) { diff --git a/jdk/src/java.base/share/classes/java/nio/charset/CoderResult.java b/jdk/src/java.base/share/classes/java/nio/charset/CoderResult.java index 79d4843e2de..3d5e1c43a65 100644 --- a/jdk/src/java.base/share/classes/java/nio/charset/CoderResult.java +++ b/jdk/src/java.base/share/classes/java/nio/charset/CoderResult.java @@ -46,24 +46,24 @@ import java.util.HashMap; * processed, or there is insufficient input and additional input is * required. This condition is represented by the unique result object * {@link #UNDERFLOW}, whose {@link #isUnderflow() isUnderflow} method - * returns true.
Overflow is reported when there is insufficient room * remaining in the output buffer. This condition is represented by the * unique result object {@link #OVERFLOW}, whose {@link #isOverflow() - * isOverflow} method returns true.
A malformed-input error is reported when a sequence of * input units is not well-formed. Such errors are described by instances of * this class whose {@link #isMalformed() isMalformed} method returns - * true and whose {@link #length() length} method returns the length + * {@code true} and whose {@link #length() length} method returns the length * of the malformed sequence. There is one unique instance of this class for * all malformed-input errors of a given length.
An unmappable-character error is reported when a sequence * of input units denotes a character that cannot be represented in the * output charset. Such errors are described by instances of this class - * whose {@link #isUnmappable() isUnmappable} method returns true and + * whose {@link #isUnmappable() isUnmappable} method returns {@code true} and * whose {@link #length() length} method returns the length of the input * sequence denoting the unmappable character. There is one unique instance * of this class for all unmappable-character errors of a given length. @@ -71,9 +71,9 @@ import java.util.HashMap; * *
For convenience, the {@link #isError() isError} method returns true + *
For convenience, the {@link #isError() isError} method returns {@code true} * for result objects that describe malformed-input and unmappable-character - * errors but false for those that describe underflow or overflow + * errors but {@code false} for those that describe underflow or overflow * conditions.
* * @@ -114,7 +114,7 @@ public class CoderResult { /** * Tells whether or not this object describes an underflow condition. * - * @return true if, and only if, this object denotes underflow + * @return {@code true} if, and only if, this object denotes underflow */ public boolean isUnderflow() { return (type == CR_UNDERFLOW); @@ -123,7 +123,7 @@ public class CoderResult { /** * Tells whether or not this object describes an overflow condition. * - * @return true if, and only if, this object denotes overflow + * @return {@code true} if, and only if, this object denotes overflow */ public boolean isOverflow() { return (type == CR_OVERFLOW); @@ -132,7 +132,7 @@ public class CoderResult { /** * Tells whether or not this object describes an error condition. * - * @return true if, and only if, this object denotes either a + * @return {@code true} if, and only if, this object denotes either a * malformed-input error or an unmappable-character error */ public boolean isError() { @@ -142,7 +142,7 @@ public class CoderResult { /** * Tells whether or not this object describes a malformed-input error. * - * @return true if, and only if, this object denotes a + * @return {@code true} if, and only if, this object denotes a * malformed-input error */ public boolean isMalformed() { @@ -153,7 +153,7 @@ public class CoderResult { * Tells whether or not this object describes an unmappable-character * error. * - * @return true if, and only if, this object denotes an + * @return {@code true} if, and only if, this object denotes an * unmappable-character error */ public boolean isUnmappable() { @@ -168,7 +168,7 @@ public class CoderResult { * * @throws UnsupportedOperationException * If this object does not describe an error condition, that is, - * if the {@link #isError() isError} does not return true + * if the {@link #isError() isError} does not return {@code true} */ public int length() { if (!isError()) diff --git a/jdk/src/java.base/share/classes/java/nio/charset/package-info.java b/jdk/src/java.base/share/classes/java/nio/charset/package-info.java index e18f568004a..9d93a710a25 100644 --- a/jdk/src/java.base/share/classes/java/nio/charset/package-info.java +++ b/jdk/src/java.base/share/classes/java/nio/charset/package-info.java @@ -74,10 +74,10 @@ * *Support for new charsets can be made available via the * interface defined in the {@link - * java.nio.charset.spi.CharsetProvider} class in the {@link - * java.nio.charset.spi} package. + * java.nio.charset.spi.CharsetProvider} class in the {@link + * java.nio.charset.spi} package. * - *
Unless otherwise noted, passing a null argument to a + *
Unless otherwise noted, passing a {@code null} argument to a * constructor or method in any class or interface in this package * will cause a {@link java.lang.NullPointerException * NullPointerException} to be thrown. diff --git a/jdk/src/java.base/share/classes/java/nio/charset/spi/CharsetProvider.java b/jdk/src/java.base/share/classes/java/nio/charset/spi/CharsetProvider.java index f859245a9dc..63f01bf7cfa 100644 --- a/jdk/src/java.base/share/classes/java/nio/charset/spi/CharsetProvider.java +++ b/jdk/src/java.base/share/classes/java/nio/charset/spi/CharsetProvider.java @@ -42,13 +42,13 @@ import java.util.Iterator; * loader}. * *
A charset provider identifies itself with a provider-configuration file
- * named java.nio.charset.spi.CharsetProvider in the resource
- * directory META-INF/services. The file should contain a list of
+ * named {@code java.nio.charset.spi.CharsetProvider} in the resource
+ * directory {@code META-INF/services}. The file should contain a list of
* fully-qualified concrete charset-provider class names, one per line. A line
- * is terminated by any one of a line feed ('\n'), a carriage return
- * ('\r'), or a carriage return followed immediately by a line feed.
+ * is terminated by any one of a line feed ({@code '\n'}), a carriage return
+ * ({@code '\r'}), or a carriage return followed immediately by a line feed.
* Space and tab characters surrounding each name, as well as blank lines, are
- * ignored. The comment character is '#' ('\u0023'); on
+ * ignored. The comment character is {@code '#'} ('\u0023'
); on
* each line all characters following the first comment character are ignored.
* The file must be encoded in UTF-8.
*
@@ -83,7 +83,7 @@ public abstract class CharsetProvider {
*
* @throws SecurityException
* If a security manager has been installed and it denies
- * {@link RuntimePermission}("charsetProvider")
+ * {@link RuntimePermission}{@code ("charsetProvider")}
*/
protected CharsetProvider() {
this(checkPermission());
@@ -107,7 +107,7 @@ public abstract class CharsetProvider {
* a canonical name or an alias
*
* @return A charset object for the named charset,
- * or null if the named charset
+ * or {@code null} if the named charset
* is not supported by this provider
*/
public abstract Charset charsetForName(String charsetName);
diff --git a/jdk/src/java.base/share/classes/java/nio/exceptions b/jdk/src/java.base/share/classes/java/nio/exceptions
index 062ccc4e438..d8cba29cc2d 100644
--- a/jdk/src/java.base/share/classes/java/nio/exceptions
+++ b/jdk/src/java.base/share/classes/java/nio/exceptions
@@ -56,5 +56,5 @@ SUPER=UnsupportedOperationException
gen ReadOnlyBufferException "
* Unchecked exception thrown when a content-mutation method such as
- * put or compact is invoked upon a read-only buffer." \
+ * put
or compact
is invoked upon a read-only buffer." \
-1210063976496234090L
diff --git a/jdk/src/java.base/share/classes/java/nio/file/FileSystem.java b/jdk/src/java.base/share/classes/java/nio/file/FileSystem.java
index 03ace89e7ac..1c60862c857 100644
--- a/jdk/src/java.base/share/classes/java/nio/file/FileSystem.java
+++ b/jdk/src/java.base/share/classes/java/nio/file/FileSystem.java
@@ -202,7 +202,7 @@ public abstract class FileSystem
*
*
In the case of the default provider, and a security manager is * installed, the security manager is invoked to check {@link - * RuntimePermission}("getFileStoreAttributes"). If denied, then + * RuntimePermission}{@code ("getFileStoreAttributes")}. If denied, then * no file stores are returned by the iterator. In addition, the security * manager's {@link SecurityManager#checkRead(String)} method is invoked to * check read access to the file store's top-most directory. If @@ -334,19 +334,19 @@ public abstract class FileSystem * character extension * *
/home/*/*
+ * /home/gus/data
on UNIX platforms/home/**
+ * /home/gus
and
+ * /home/gus/data
on UNIX platformsC:\\*
+ * C:\foo
and C:\bar
on the Windows
* platform (note that the backslash is escaped; as a string literal in the
- * Java Language the pattern would be "C:\\\\*") "C:\\\\*"
)
* Leading period/dot characters in file name are + *
Leading period For any two {@link #normalize normalized} paths p and
* q, where q does not have a root component,
* When symbolic links are supported, then whether the resulting path,
@@ -525,9 +526,9 @@ public interface Path
* The default provider provides a similar round-trip guarantee
* to the {@link java.io.File} class. For a given {@code Path} p it
* is guaranteed that
- * The default provider provides a similar round-trip guarantee
* to the {@link java.io.File} class. For a given {@code Path} p it
* is guaranteed that
- * Unless otherwise noted, passing a null argument to a constructor
+ * Unless otherwise noted, passing a {@code null} argument to a constructor
* or method in any class or interface in this package will cause a {@link
* java.lang.NullPointerException NullPointerException} to be thrown.
*
diff --git a/jdk/src/java.base/share/classes/java/nio/file/spi/FileSystemProvider.java b/jdk/src/java.base/share/classes/java/nio/file/spi/FileSystemProvider.java
index dad51083401..b92cf525eef 100644
--- a/jdk/src/java.base/share/classes/java/nio/file/spi/FileSystemProvider.java
+++ b/jdk/src/java.base/share/classes/java/nio/file/spi/FileSystemProvider.java
@@ -102,7 +102,7 @@ public abstract class FileSystemProvider {
*
* @throws SecurityException
* If a security manager has been installed and it denies
- * {@link RuntimePermission}("fileSystemProvider")
+ * {@link RuntimePermission}{@code ("fileSystemProvider")}
*/
protected FileSystemProvider() {
this(checkPermission());
@@ -644,7 +644,7 @@ public abstract class FileSystemProvider {
* if an I/O error occurs
* @throws SecurityException
* In the case of the default provider, and a security manager
- * is installed, it denies {@link LinkPermission}("symbolic")
+ * is installed, it denies {@link LinkPermission}{@code ("symbolic")}
* or its {@link SecurityManager#checkWrite(String) checkWrite}
* method denies write access to the path of the symbolic link.
*/
@@ -677,7 +677,7 @@ public abstract class FileSystemProvider {
* if an I/O error occurs
* @throws SecurityException
* In the case of the default provider, and a security manager
- * is installed, it denies {@link LinkPermission}("hard")
+ * is installed, it denies {@link LinkPermission}{@code ("hard")}
* or its {@link SecurityManager#checkWrite(String) checkWrite}
* method denies write access to either the link or the
* existing file.
@@ -902,8 +902,8 @@ public abstract class FileSystemProvider {
* In the case of the default provider, and a security manager is
* installed, the {@link SecurityManager#checkRead(String) checkRead}
* method is invoked to check read access to the file, and in
- * addition it checks {@link RuntimePermission}
- * ("getFileStoreAttributes")
+ * addition it checks
+ * {@link RuntimePermission}{@code ("getFileStoreAttributes")}
*/
public abstract FileStore getFileStore(Path path) throws IOException;
diff --git a/jdk/src/java.base/share/classes/java/nio/file/spi/FileTypeDetector.java b/jdk/src/java.base/share/classes/java/nio/file/spi/FileTypeDetector.java
index ee118d63129..1e06a119331 100644
--- a/jdk/src/java.base/share/classes/java/nio/file/spi/FileTypeDetector.java
+++ b/jdk/src/java.base/share/classes/java/nio/file/spi/FileTypeDetector.java
@@ -62,7 +62,7 @@ public abstract class FileTypeDetector {
*
* @throws SecurityException
* If a security manager has been installed and it denies
- * {@link RuntimePermission}("fileTypeDetector")
+ * {@link RuntimePermission}{@code ("fileTypeDetector")}
*/
protected FileTypeDetector() {
this(checkPermission());
diff --git a/jdk/src/java.base/share/classes/java/nio/file/spi/package-info.java b/jdk/src/java.base/share/classes/java/nio/file/spi/package-info.java
index b86affe5ef4..d263ef72ecb 100644
--- a/jdk/src/java.base/share/classes/java/nio/file/spi/package-info.java
+++ b/jdk/src/java.base/share/classes/java/nio/file/spi/package-info.java
@@ -24,12 +24,12 @@
*/
/**
- * Service-provider classes for the {@link java.nio.file} package.
+ * Service-provider classes for the {@link java.nio.file} package.
*
* Only developers who are defining new file system providers or file type
* detectors should need to make direct use of this package. Unless otherwise noted, passing a null argument to a constructor
+ * Unless otherwise noted, passing a {@code null} argument to a constructor
* or method in any class or interface in this package will cause a {@link
* java.lang.NullPointerException NullPointerException} to be thrown.
*
diff --git a/jdk/src/java.base/share/classes/java/nio/package-info.java b/jdk/src/java.base/share/classes/java/nio/package-info.java
index 374e0bb59a9..b36faeac3c6 100644
--- a/jdk/src/java.base/share/classes/java/nio/package-info.java
+++ b/jdk/src/java.base/share/classes/java/nio/package-info.java
@@ -52,7 +52,7 @@
*
*
*
- * The java.nio package defines the buffer classes, which
+ * The {@code java.nio} package defines the buffer classes, which
* are used throughout the NIO APIs. The charset API is defined in
* the {@link java.nio.charset} package, and the channel and selector
* APIs are defined in the {@link java.nio.channels} package. Each of
@@ -64,26 +64,26 @@
*
* Unless otherwise noted, passing a null argument to a
+ * Unless otherwise noted, passing a {@code null} argument to a
* constructor or method in any class or interface in this package
* will cause a {@link java.lang.NullPointerException
* NullPointerException} to be thrown.
diff --git a/jdk/src/java.base/share/classes/java/security/SecurityPermission.java b/jdk/src/java.base/share/classes/java/security/SecurityPermission.java
index 5bb74569d3f..60d1d785860 100644
--- a/jdk/src/java.base/share/classes/java/security/SecurityPermission.java
+++ b/jdk/src/java.base/share/classes/java/security/SecurityPermission.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, 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
@@ -31,19 +31,19 @@ import java.util.Hashtable;
import java.util.StringTokenizer;
/**
- * This class is for security permissions.
- * A SecurityPermission contains a name (also referred to as a "target name")
- * but no actions list; you either have the named permission
- * or you don't.
- *
- * The target name is the name of a security configuration parameter (see below).
- * Currently the SecurityPermission object is used to guard access
- * to the Policy, Security, Provider, Signer, and Identity
+ * This class is for security permissions. A {@code SecurityPermission}
+ * contains a name (also referred to as a "target name") but no actions list;
+ * you either have the named permission or you don't.
+ *
+ * The target name is the name of a security configuration parameter
+ * (see below). Currently the {@code SecurityPermission} object is used to
+ * guard access to the {@link AccessControlContext}, {@link Policy},
+ * {@link Provider}, {@link Security}, {@link Signer}, and {@link Identity}
* objects.
- *
- * The following table lists all the possible SecurityPermission target names,
- * and for each provides a description of what the permission allows
- * and a discussion of the risks of granting code the permission.
+ *
+ * The following table lists the standard {@code SecurityPermission}
+ * target names, and for each provides a description of what the permission
+ * allows and a discussion of the risks of granting code the permission.
*
*
*
* To implement an unmodifiable collection, the programmer needs only to
- * extend this class and provide implementations for the iterator and
- * size methods. (The iterator returned by the iterator
- * method must implement hasNext and next.)
+ * extend this class and provide implementations for the {@code iterator} and
+ * {@code size} methods. (The iterator returned by the {@code iterator}
+ * method must implement {@code hasNext} and {@code next}.)
*
* To implement a modifiable collection, the programmer must additionally
- * override this class's add method (which otherwise throws an
- * UnsupportedOperationException), and the iterator returned by the
- * iterator method must additionally implement its remove
+ * override this class's {@code add} method (which otherwise throws an
+ * {@code UnsupportedOperationException}), and the iterator returned by the
+ * {@code iterator} method must additionally implement its {@code remove}
* method.
*
* The programmer should generally provide a void (no argument) and
- * Collection constructor, as per the recommendation in the
- * Collection interface specification.
+ * {@code Collection} constructor, as per the recommendation in the
+ * {@code Collection} interface specification.
*
* The documentation for each non-abstract method in this class describes its
* implementation in detail. Each of these methods may be overridden if
@@ -81,7 +81,7 @@ public abstract class AbstractCollection Note that this implementation throws an
- * UnsupportedOperationException if the iterator returned by this
- * collection's iterator method does not implement the remove
+ * {@code UnsupportedOperationException} if the iterator returned by this
+ * collection's iterator method does not implement the {@code remove}
* method and this collection contains the specified object.
*
* @throws UnsupportedOperationException {@inheritDoc}
@@ -314,7 +314,7 @@ public abstract class AbstractCollection Note that this implementation will throw an
- * UnsupportedOperationException unless add is
+ * {@code UnsupportedOperationException} unless {@code add} is
* overridden (assuming the specified collection is non-empty).
*
* @throws UnsupportedOperationException {@inheritDoc}
@@ -361,11 +361,11 @@ public abstract class AbstractCollection Note that this implementation will throw an
- * UnsupportedOperationException if the iterator returned by the
- * iterator method does not implement the remove method
+ * {@code UnsupportedOperationException} if the iterator returned by the
+ * {@code iterator} method does not implement the {@code remove} method
* and this collection contains one or more elements in common with the
* specified collection.
*
@@ -396,11 +396,11 @@ public abstract class AbstractCollection Note that this implementation will throw an
- * UnsupportedOperationException if the iterator returned by the
- * iterator method does not implement the remove method
+ * {@code UnsupportedOperationException} if the iterator returned by the
+ * {@code iterator} method does not implement the {@code remove} method
* and this collection contains one or more elements not present in the
* specified collection.
*
@@ -429,14 +429,14 @@ public abstract class AbstractCollection Note that this implementation will throw an
- * UnsupportedOperationException if the iterator returned by this
- * collection's iterator method does not implement the
- * remove method and this collection is non-empty.
+ * {@code UnsupportedOperationException} if the iterator returned by this
+ * collection's {@code iterator} method does not implement the
+ * {@code remove} method and this collection is non-empty.
*
* @throws UnsupportedOperationException {@inheritDoc}
*/
@@ -455,8 +455,8 @@ public abstract class AbstractCollection To implement an unmodifiable map, the programmer needs only to extend this
- * class and provide an implementation for the entrySet method, which
+ * class and provide an implementation for the {@code entrySet} method, which
* returns a set-view of the map's mappings. Typically, the returned set
- * will, in turn, be implemented atop AbstractSet. This set should
- * not support the add or remove methods, and its iterator
- * should not support the remove method.
+ * will, in turn, be implemented atop {@code AbstractSet}. This set should
+ * not support the {@code add} or {@code remove} methods, and its iterator
+ * should not support the {@code remove} method.
*
* To implement a modifiable map, the programmer must additionally override
- * this class's put method (which otherwise throws an
- * UnsupportedOperationException), and the iterator returned by
- * entrySet().iterator() must additionally implement its
- * remove method.
+ * this class's {@code put} method (which otherwise throws an
+ * {@code UnsupportedOperationException}), and the iterator returned by
+ * {@code entrySet().iterator()} must additionally implement its
+ * {@code remove} method.
*
* The programmer should generally provide a void (no argument) and map
- * constructor, as per the recommendation in the Map interface
+ * constructor, as per the recommendation in the {@code Map} interface
* specification.
*
* The documentation for each non-abstract method in this class describes its
@@ -79,7 +79,7 @@ public abstract class AbstractMap Note that this implementation throws an
- * UnsupportedOperationException if the entrySet
- * iterator does not support the remove method and this map
+ * {@code UnsupportedOperationException} if the {@code entrySet}
+ * iterator does not support the {@code remove} method and this map
* contains a mapping for the specified key.
*
* @throws UnsupportedOperationException {@inheritDoc}
@@ -264,12 +264,12 @@ public abstract class AbstractMap Note that this implementation throws an
- * UnsupportedOperationException if this map does not support
- * the put operation and the specified map is nonempty.
+ * {@code UnsupportedOperationException} if this map does not support
+ * the {@code put} operation and the specified map is nonempty.
*
* @throws UnsupportedOperationException {@inheritDoc}
* @throws ClassCastException {@inheritDoc}
@@ -285,11 +285,11 @@ public abstract class AbstractMap Note that this implementation throws an
- * UnsupportedOperationException if the entrySet
- * does not support the clear operation.
+ * {@code UnsupportedOperationException} if the {@code entrySet}
+ * does not support the {@code clear} operation.
*
* @throws UnsupportedOperationException {@inheritDoc}
*/
@@ -314,10 +314,10 @@ public abstract class AbstractMap The set is created the first time this method is called,
* and returned in response to all subsequent calls. No synchronization
@@ -371,10 +371,10 @@ public abstract class AbstractMap The collection is created the first time this method is called, and
* returned in response to all subsequent calls. No synchronization is
@@ -429,25 +429,25 @@ public abstract class AbstractMap
*
- * This class is the opposite of the AbstractList class in the sense
- * that it implements the "random access" methods (get(int index),
- * set(int index, E element), add(int index, E element) and
- * remove(int index)) on top of the list's list iterator, instead of
+ * This class is the opposite of the {@code AbstractList} class in the sense
+ * that it implements the "random access" methods ({@code get(int index)},
+ * {@code set(int index, E element)}, {@code add(int index, E element)} and
+ * {@code remove(int index)}) on top of the list's list iterator, instead of
* the other way around.
*
* To implement a list the programmer needs only to extend this class and
- * provide implementations for the listIterator and size
+ * provide implementations for the {@code listIterator} and {@code size}
* methods. For an unmodifiable list, the programmer need only implement the
- * list iterator's hasNext, next, hasPrevious,
- * previous and index methods.
+ * list iterator's {@code hasNext}, {@code next}, {@code hasPrevious},
+ * {@code previous} and {@code index} methods.
*
* For a modifiable list the programmer should additionally implement the list
- * iterator's set method. For a variable-size list the programmer
- * should additionally implement the list iterator's remove and
- * add methods.
+ * iterator's {@code set} method. For a variable-size list the programmer
+ * should additionally implement the list iterator's {@code remove} and
+ * {@code add} methods.
*
* The programmer should generally provide a void (no argument) and collection
- * constructor, as per the recommendation in the Collection interface
+ * constructor, as per the recommendation in the {@code Collection} interface
* specification.
*
* This class is a member of the
@@ -78,8 +78,8 @@ public abstract class AbstractSequentialList This implementation first gets a list iterator pointing to the
- * indexed element (with listIterator(index)). Then, it gets
- * the element using ListIterator.next and returns it.
+ * indexed element (with {@code listIterator(index)}). Then, it gets
+ * the element using {@code ListIterator.next} and returns it.
*
* @throws IndexOutOfBoundsException {@inheritDoc}
*/
@@ -96,13 +96,13 @@ public abstract class AbstractSequentialList This implementation first gets a list iterator pointing to the
- * indexed element (with listIterator(index)). Then, it gets
- * the current element using ListIterator.next and replaces it
- * with ListIterator.set.
+ * indexed element (with {@code listIterator(index)}). Then, it gets
+ * the current element using {@code ListIterator.next} and replaces it
+ * with {@code ListIterator.set}.
*
* Note that this implementation will throw an
- * UnsupportedOperationException if the list iterator does not
- * implement the set operation.
+ * {@code UnsupportedOperationException} if the list iterator does not
+ * implement the {@code set} operation.
*
* @throws UnsupportedOperationException {@inheritDoc}
* @throws ClassCastException {@inheritDoc}
@@ -128,12 +128,12 @@ public abstract class AbstractSequentialList This implementation first gets a list iterator pointing to the
- * indexed element (with listIterator(index)). Then, it
- * inserts the specified element with ListIterator.add.
+ * indexed element (with {@code listIterator(index)}). Then, it
+ * inserts the specified element with {@code ListIterator.add}.
*
* Note that this implementation will throw an
- * UnsupportedOperationException if the list iterator does not
- * implement the add operation.
+ * {@code UnsupportedOperationException} if the list iterator does not
+ * implement the {@code add} operation.
*
* @throws UnsupportedOperationException {@inheritDoc}
* @throws ClassCastException {@inheritDoc}
@@ -156,12 +156,12 @@ public abstract class AbstractSequentialList This implementation first gets a list iterator pointing to the
- * indexed element (with listIterator(index)). Then, it removes
- * the element with ListIterator.remove.
+ * indexed element (with {@code listIterator(index)}). Then, it removes
+ * the element with {@code ListIterator.remove}.
*
* Note that this implementation will throw an
- * UnsupportedOperationException if the list iterator does not
- * implement the remove operation.
+ * {@code UnsupportedOperationException} if the list iterator does not
+ * implement the {@code remove} operation.
*
* @throws UnsupportedOperationException {@inheritDoc}
* @throws IndexOutOfBoundsException {@inheritDoc}
@@ -193,14 +193,14 @@ public abstract class AbstractSequentialList This implementation gets an iterator over the specified collection and
* a list iterator over this list pointing to the indexed element (with
- * listIterator(index)). Then, it iterates over the specified
+ * {@code listIterator(index)}). Then, it iterates over the specified
* collection, inserting the elements obtained from the iterator into this
- * list, one at a time, using ListIterator.add followed by
- * ListIterator.next (to skip over the added element).
+ * list, one at a time, using {@code ListIterator.add} followed by
+ * {@code ListIterator.next} (to skip over the added element).
*
* Note that this implementation will throw an
- * UnsupportedOperationException if the list iterator returned by
- * the listIterator method does not implement the add
+ * {@code UnsupportedOperationException} if the list iterator returned by
+ * the {@code listIterator} method does not implement the {@code add}
* operation.
*
* @throws UnsupportedOperationException {@inheritDoc}
@@ -243,7 +243,7 @@ public abstract class AbstractSequentialList
*
* The process of implementing a set by extending this class is identical
* to that of implementing a Collection by extending AbstractCollection,
* except that all of the methods and constructors in subclasses of this
- * class must obey the additional constraints imposed by the Set
+ * class must obey the additional constraints imposed by the {@code Set}
* interface (for instance, the add method must not permit addition of
* multiple instances of an object to a set).
*
* Note that this class does not override any of the implementations from
- * the AbstractCollection class. It merely adds implementations
- * for equals and hashCode.
+ * the {@code AbstractCollection} class. It merely adds implementations
+ * for {@code equals} and {@code hashCode}. Many methods in Collections Framework interfaces are defined in
* terms of the {@link Object#equals(Object) equals} method. For example,
* the specification for the {@link #contains(Object) contains(Object o)}
- * method says: "returns true if and only if this collection
- * contains at least one element e such that
- * (o==null ? e==null : o.equals(e))." This specification should
- * not be construed to imply that invoking Collection.contains
- * with a non-null argument o will cause o.equals(e) to be
- * invoked for any element e. Implementations are free to implement
- * optimizations whereby the equals invocation is avoided, for
+ * method says: "returns {@code true} if and only if this collection
+ * contains at least one element {@code e} such that
+ * {@code (o==null ? e==null : o.equals(e))}." This specification should
+ * not be construed to imply that invoking {@code Collection.contains}
+ * with a non-null argument {@code o} will cause {@code o.equals(e)} to be
+ * invoked for any element {@code e}. Implementations are free to implement
+ * optimizations whereby the {@code equals} invocation is avoided, for
* example, by first comparing the hash codes of the two elements. (The
* {@link Object#hashCode()} specification guarantees that two objects with
* unequal hash codes cannot be equal.) More generally, implementations of
@@ -146,28 +146,28 @@ public interface Collection If this collection fits in the specified array with room to spare
* (i.e., the array has more elements than this collection), the element
* in the array immediately following the end of the collection is set to
- * null. (This is useful in determining the length of this
+ * {@code null}. (This is useful in determining the length of this
* collection only if the caller knows that this collection does
- * not contain any null elements.)
+ * not contain any {@code null} elements.)
*
* If this collection makes any guarantees as to what order its elements
* are returned by its iterator, this method must return the elements in
@@ -229,15 +229,15 @@ public interface Collection Suppose x is a collection known to contain only strings.
+ * Suppose {@code x} is a collection known to contain only strings.
* The following code can be used to dump the collection into a newly
- * allocated array of String:
+ * allocated array of {@code String}:
*
*
*
* Collections that support this operation may place limitations on what
* elements may be added to this collection. In particular, some
- * collections will refuse to add null elements, and others will
+ * collections will refuse to add {@code null} elements, and others will
* impose restrictions on the type of elements that may be added.
* Collection classes should clearly specify in their documentation any
* restrictions on what elements may be added.
*
* If a collection refuses to add a particular element for any reason
* other than that it already contains the element, it must throw
- * an exception (rather than returning false). This preserves
+ * an exception (rather than returning {@code false}). This preserves
* the invariant that a collection always contains the specified element
* after this call returns.
*
* @param e element whose presence in this collection is to be ensured
- * @return true if this collection changed as a result of the
+ * @return {@code true} if this collection changed as a result of the
* call
- * @throws UnsupportedOperationException if the add operation
+ * @throws UnsupportedOperationException if the {@code add} operation
* is not supported by this collection
* @throws ClassCastException if the class of the specified element
* prevents it from being added to this collection
@@ -291,21 +291,21 @@ public interface Collection
*
- * While the Collection interface adds no stipulations to the
- * general contract for the Object.equals, programmers who
- * implement the Collection interface "directly" (in other words,
- * create a class that is a Collection but is not a Set
- * or a List) must exercise care if they choose to override the
- * Object.equals. It is not necessary to do so, and the simplest
- * course of action is to rely on Object's implementation, but
+ * While the {@code Collection} interface adds no stipulations to the
+ * general contract for the {@code Object.equals}, programmers who
+ * implement the {@code Collection} interface "directly" (in other words,
+ * create a class that is a {@code Collection} but is not a {@code Set}
+ * or a {@code List}) must exercise care if they choose to override the
+ * {@code Object.equals}. It is not necessary to do so, and the simplest
+ * course of action is to rely on {@code Object}'s implementation, but
* the implementor may wish to implement a "value comparison" in place of
- * the default "reference comparison." (The List and
- * Set interfaces mandate such value comparisons.)
+ * the default "reference comparison." (The {@code List} and
+ * {@code Set} interfaces mandate such value comparisons.)
*
- * The general contract for the Object.equals method states that
- * equals must be symmetric (in other words, a.equals(b) if and
- * only if b.equals(a)). The contracts for List.equals
- * and Set.equals state that lists are only equal to other lists,
- * and sets to other sets. Thus, a custom equals method for a
- * collection class that implements neither the List nor
- * Set interface must return false when this collection
+ * The general contract for the {@code Object.equals} method states that
+ * equals must be symmetric (in other words, {@code a.equals(b)} if and
+ * only if {@code b.equals(a)}). The contracts for {@code List.equals}
+ * and {@code Set.equals} state that lists are only equal to other lists,
+ * and sets to other sets. Thus, a custom {@code equals} method for a
+ * collection class that implements neither the {@code List} nor
+ * {@code Set} interface must return {@code false} when this collection
* is compared to any list or set. (By the same logic, it is not possible
- * to write a class that correctly implements both the Set and
- * List interfaces.)
+ * to write a class that correctly implements both the {@code Set} and
+ * {@code List} interfaces.)
*
* @param o object to be compared for equality with this collection
- * @return true if the specified object is equal to this
+ * @return {@code true} if the specified object is equal to this
* collection
*
* @see Object#equals(Object)
@@ -492,13 +492,13 @@ public interface Collection The methods of this class all throw a NullPointerException
+ * The methods of this class all throw a {@code NullPointerException}
* if the collections or class objects provided to them are null.
*
* The documentation for the polymorphic algorithms contained in this class
@@ -52,17 +52,17 @@ import java.util.stream.StreamSupport;
* descriptions should be regarded as implementation notes, rather than
* parts of the specification. Implementors should feel free to
* substitute other algorithms, so long as the specification itself is adhered
- * to. (For example, the algorithm used by sort does not have to be
+ * to. (For example, the algorithm used by {@code sort} does not have to be
* a mergesort, but it does have to be stable.)
*
* The "destructive" algorithms contained in this class, that is, the
* algorithms that modify the collection on which they operate, are specified
- * to throw UnsupportedOperationException if the collection does not
- * support the appropriate mutation primitive(s), such as the set
+ * to throw {@code UnsupportedOperationException} if the collection does not
+ * support the appropriate mutation primitive(s), such as the {@code set}
* method. These algorithms may, but are not required to, throw this
* exception if an invocation would have no effect on the collection. For
- * example, invoking the sort method on an unmodifiable list that is
- * already sorted may or may not throw UnsupportedOperationException.
+ * example, invoking the {@code sort} method on an unmodifiable list that is
+ * already sorted may or may not throw {@code UnsupportedOperationException}.
*
* This class is a member of the
*
@@ -195,10 +195,10 @@ public class Collections {
* @param list the list to be searched.
* @param key the key to be searched for.
* @return the index of the search key, if it is contained in the list;
- * otherwise, (-(insertion point) - 1). The
+ * otherwise,
+ * comparable (that is, {@code e1.compareTo(e2)} must not throw a
+ * {@code ClassCastException} for any elements {@code e1} and
+ * {@code e2} in the collection).
*
* This method iterates over the entire collection, hence it requires
* time proportional to the size of the collection.
@@ -607,9 +607,9 @@ public class Collections {
* Returns the minimum element of the given collection, according to the
* order induced by the specified comparator. All elements in the
* collection must be mutually comparable by the specified
- * comparator (that is, comp.compare(e1, e2) must not throw a
- * ClassCastException for any elements e1 and
- * e2 in the collection).
+ * comparator (that is, {@code comp.compare(e1, e2)} must not throw a
+ * {@code ClassCastException} for any elements {@code e1} and
+ * {@code e2} in the collection).
*
* This method iterates over the entire collection, hence it requires
* time proportional to the size of the collection.
@@ -617,7 +617,7 @@ public class Collections {
* @param
+ * comparable (that is, {@code e1.compareTo(e2)} must not throw a
+ * {@code ClassCastException} for any elements {@code e1} and
+ * {@code e2} in the collection).
*
* This method iterates over the entire collection, hence it requires
* time proportional to the size of the collection.
@@ -680,9 +680,9 @@ public class Collections {
* Returns the maximum element of the given collection, according to the
* order induced by the specified comparator. All elements in the
* collection must be mutually comparable by the specified
- * comparator (that is, comp.compare(e1, e2) must not throw a
- * ClassCastException for any elements e1 and
- * e2 in the collection).
+ * comparator (that is, {@code comp.compare(e1, e2)} must not throw a
+ * {@code ClassCastException} for any elements {@code e1} and
+ * {@code e2} in the collection).
*
* This method iterates over the entire collection, hence it requires
* time proportional to the size of the collection.
@@ -690,7 +690,7 @@ public class Collections {
* @param For example, suppose list comprises [t, a, n, k, s].
- * After invoking Collections.rotate(list, 1) (or
- * Collections.rotate(list, -4)), list will comprise
- * [s, t, a, n, k].
+ * For example, suppose {@code list} comprises{@code [t, a, n, k, s]}.
+ * After invoking {@code Collections.rotate(list, 1)} (or
+ * {@code Collections.rotate(list, -4)}), {@code list} will comprise
+ * {@code [s, t, a, n, k]}.
*
* Note that this method can usefully be applied to sublists to
* move one or more elements within a list while preserving the
* order of the remaining elements. For example, the following idiom
- * moves the element at index j forward to position
- * k (which must be greater than or equal to j):
+ * moves the element at index {@code j} forward to position
+ * {@code k} (which must be greater than or equal to {@code j}):
* To move more than one element forward, increase the absolute value
* of the rotation distance. To move elements backward, use a positive
@@ -755,8 +755,8 @@ public class Collections {
* element is swapped into the first element. If necessary, the process
* is repeated on the second and successive elements, until the rotation
* is complete. If the specified list is large and doesn't implement the
- * RandomAccess interface, this implementation breaks the
- * list into two sublist views around index -distance mod size.
+ * {@code RandomAccess} interface, this implementation breaks the
+ * list into two sublist views around index {@code -distance mod size}.
* Then the {@link #reverse(List)} method is invoked on each sublist view,
* and finally it is invoked on the entire list. For a more complete
* description of both algorithms, see Section 2.3 of Jon Bentley's
@@ -765,9 +765,9 @@ public class Collections {
* @param list the list to be rotated.
* @param distance the distance to rotate the list. There are no
* constraints on this value; it may be zero, negative, or
- * greater than list.size().
+ * greater than {@code list.size()}.
* @throws UnsupportedOperationException if the specified list or
- * its list-iterator does not support the set operation.
+ * its list-iterator does not support the {@code set} operation.
* @since 1.4
*/
public static void rotate(List> list, int distance) {
@@ -817,21 +817,21 @@ public class Collections {
/**
* Replaces all occurrences of one specified value in a list with another.
- * More formally, replaces with newVal each element e
- * in list such that
- * (oldVal==null ? e==null : oldVal.equals(e)).
+ * More formally, replaces with {@code newVal} each element {@code e}
+ * in {@code list} such that
+ * {@code (oldVal==null ? e==null : oldVal.equals(e))}.
* (This method has no effect on the size of the list.)
*
* @param
+ * {@code UnsupportedOperationException}.
*
* The returned collection does not pass the hashCode and equals
* operations through to the backing collection, but relies on
- * Object's equals and hashCode methods. This
+ * {@code Object}'s {@code equals} and {@code hashCode} methods. This
* is necessary to preserve the contracts of these operations in the case
* that the backing collection is a set or a list.
*
@@ -1105,7 +1105,7 @@ public class Collections {
* modules to provide users with "read-only" access to internal sets.
* Query operations on the returned set "read through" to the specified
* set, and attempts to modify the returned set, whether direct or via its
- * iterator, result in an UnsupportedOperationException.
+ * iterator, result in an {@code UnsupportedOperationException}.
*
* The returned set will be serializable if the specified set
* is serializable.
@@ -1136,8 +1136,8 @@ public class Collections {
* sorted sets. Query operations on the returned sorted set "read
* through" to the specified sorted set. Attempts to modify the returned
* sorted set, whether direct, via its iterator, or via its
- * subSet, headSet, or tailSet views, result in
- * an UnsupportedOperationException.
+ * {@code subSet}, {@code headSet}, or {@code tailSet} views, result in
+ * an {@code UnsupportedOperationException}.
*
* The returned sorted set will be serializable if the specified sorted set
* is serializable.
@@ -1273,7 +1273,7 @@ public class Collections {
* lists. Query operations on the returned list "read through" to the
* specified list, and attempts to modify the returned list, whether
* direct or via its iterator, result in an
- * UnsupportedOperationException.
+ * {@code UnsupportedOperationException}.
*
* The returned list will be serializable if the specified list
* is serializable. Similarly, the returned list will implement
@@ -1419,7 +1419,7 @@ public class Collections {
* maps. Query operations on the returned map "read through"
* to the specified map, and attempts to modify the returned
* map, whether direct or via its collection views, result in an
- * UnsupportedOperationException.
+ * {@code UnsupportedOperationException}.
*
* The returned map will be serializable if the specified map
* is serializable.
@@ -1769,8 +1769,8 @@ public class Collections {
* sorted maps. Query operations on the returned sorted map "read through"
* to the specified sorted map. Attempts to modify the returned
* sorted map, whether direct, via its collection views, or via its
- * subMap, headMap, or tailMap views, result in
- * an UnsupportedOperationException.
+ * {@code subMap}, {@code headMap}, or {@code tailMap} views, result in
+ * an {@code UnsupportedOperationException}.
*
* The returned sorted map will be serializable if the specified sorted map
* is serializable.
@@ -2148,8 +2148,8 @@ public class Collections {
* through the returned sorted set (or its views).
*
* It is imperative that the user manually synchronize on the returned
- * sorted set when iterating over it or any of its subSet,
- * headSet, or tailSet views.
+ * sorted set when iterating over it or any of its {@code subSet},
+ * {@code headSet}, or {@code tailSet} views.
* When elements are specified individually, this method provides a
@@ -5387,16 +5387,16 @@ public class Collections {
* Each method invocation on the set returned by this method results in
- * exactly one method invocation on the backing map or its keySet
- * view, with one exception. The addAll method is implemented
- * as a sequence of put invocations on the backing map.
+ * exactly one method invocation on the backing map or its {@code keySet}
+ * view, with one exception. The {@code addAll} method is implemented
+ * as a sequence of {@code put} invocations on the backing map.
*
* The specified map must be empty at the time this method is invoked,
* and should not be accessed directly after this method returns. These
@@ -5436,7 +5436,7 @@ public class Collections {
* returned set
* @param map the backing map
* @return the set backed by the map
- * @throws IllegalArgumentException if map is not empty
+ * @throws IllegalArgumentException if {@code map} is not empty
* @since 1.6
*/
public static Each method invocation on the queue returned by this method
* results in exactly one method invocation on the backing deque, with
diff --git a/jdk/src/java.base/share/classes/java/util/Comparator.java b/jdk/src/java.base/share/classes/java/util/Comparator.java
index ecf8d64ea95..9afb1c4e4c9 100644
--- a/jdk/src/java.base/share/classes/java/util/Comparator.java
+++ b/jdk/src/java.base/share/classes/java/util/Comparator.java
@@ -42,20 +42,20 @@ import java.util.Comparators;
* SortedMap sorted maps}), or to provide an ordering for collections of
* objects that don't have a {@link Comparable natural ordering}.
*
- * The ordering imposed by a comparator c on a set of elements
- * S is said to be consistent with equals if and only if
- * c.compare(e1, e2)==0 has the same boolean value as
- * e1.equals(e2) for every e1 and e2 in
- * S.
+ * The ordering imposed by a comparator {@code c} on a set of elements
+ * {@code S} is said to be consistent with equals if and only if
+ * {@code c.compare(e1, e2)==0} has the same boolean value as
+ * {@code e1.equals(e2)} for every {@code e1} and {@code e2} in
+ * {@code S}.
*
* Caution should be exercised when using a comparator capable of imposing an
* ordering inconsistent with equals to order a sorted set (or sorted map).
- * Suppose a sorted set (or sorted map) with an explicit comparator c
- * is used with elements (or keys) drawn from a set S. If the
- * ordering imposed by c on S is inconsistent with equals,
+ * Suppose a sorted set (or sorted map) with an explicit comparator {@code c}
+ * is used with elements (or keys) drawn from a set {@code S}. If the
+ * ordering imposed by {@code c} on {@code S} is inconsistent with equals,
* the sorted set (or sorted map) will behave "strangely." In particular the
* sorted set (or sorted map) will violate the general contract for set (or
- * map), which is defined in terms of equals.
+ * map), which is defined in terms of {@code equals}.
*
* For example, suppose one adds two elements {@code a} and {@code b} such that
* {@code (a.equals(b) && c.compare(a, b) != 0)}
@@ -67,23 +67,23 @@ import java.util.Comparators;
* {@link Set#add Set.add} method.
*
* Note: It is generally a good idea for comparators to also implement
- * java.io.Serializable, as they may be used as ordering methods in
+ * {@code java.io.Serializable}, as they may be used as ordering methods in
* serializable data structures (like {@link TreeSet}, {@link TreeMap}). In
* order for the data structure to serialize successfully, the comparator (if
- * provided) must implement Serializable.
+ * provided) must implement {@code Serializable}.
*
* For the mathematically inclined, the relation that defines the
- * imposed ordering that a given comparator c imposes on a
- * given set of objects S is:
*
* In the foregoing description, the notation
- * sgn(expression) designates the mathematical
- * signum function, which is defined to return one of -1,
- * 0, or 1 according to whether the value of
+ * {@code sgn(}expression{@code )} designates the mathematical
+ * signum function, which is defined to return one of {@code -1},
+ * {@code 0}, or {@code 1} according to whether the value of
* expression is negative, zero or positive.
*
- * The implementor must ensure that sgn(compare(x, y)) ==
- * -sgn(compare(y, x)) for all x and y. (This
- * implies that compare(x, y) must throw an exception if and only
- * if compare(y, x) throws an exception.)
+ * The implementor must ensure that {@code sgn(compare(x, y)) ==
+ * -sgn(compare(y, x))} for all {@code x} and {@code y}. (This
+ * implies that {@code compare(x, y)} must throw an exception if and only
+ * if {@code compare(y, x)} throws an exception.)
*
* The implementor must also ensure that the relation is transitive:
- * ((compare(x, y)>0) && (compare(y, z)>0)) implies
- * compare(x, z)>0.
+ * {@code ((compare(x, y)>0) && (compare(y, z)>0))} implies
+ * {@code compare(x, z)>0}.
*
- * Finally, the implementor must ensure that compare(x, y)==0
- * implies that sgn(compare(x, z))==sgn(compare(y, z)) for all
- * z.
+ * Finally, the implementor must ensure that {@code compare(x, y)==0}
+ * implies that {@code sgn(compare(x, z))==sgn(compare(y, z))} for all
+ * {@code z}.
*
* It is generally the case, but not strictly required that
- * (compare(x, y)==0) == (x.equals(y)). Generally speaking,
+ * {@code (compare(x, y)==0) == (x.equals(y))}. Generally speaking,
* any comparator that violates this condition should clearly indicate
* this fact. The recommended language is "Note: this comparator
* imposes orderings that are inconsistent with equals."
@@ -153,19 +153,19 @@ public interface Comparator
+ * {@code comp1.equals(comp2)} implies that {@code sgn(comp1.compare(o1,
+ * o2))==sgn(comp2.compare(o1, o2))} for every object reference
+ * {@code o1} and {@code o2}.
*
* Note that it is always safe not to override
- * Object.equals(Object). However, overriding this method may,
+ * {@code Object.equals(Object)}. However, overriding this method may,
* in some cases, improve performance by allowing programs to determine
* that two distinct comparators impose the same order.
*
* @param obj the reference object with which to compare.
- * @return
- * As a rule, the
* NOTE: This class is obsolete. New implementations should
@@ -64,17 +64,17 @@ class Dictionary
* If this dictionary already contains an entry for the specified
- * key, the value already in this dictionary for that
- * key is returned, after modifying the entry to contain the
+ * {@code key}, the value already in this dictionary for that
+ * {@code key} is returned, after modifying the entry to contain the
* new element. If this dictionary does not already have an entry
- * for the specified key, an entry is created for the
- * specified key and value, and null is
+ * for the specified {@code key}, an entry is created for the
+ * specified {@code key} and {@code value}, and {@code null} is
* returned.
*
- * The Unless otherwise specified, passing a null argument to any
+ * Unless otherwise specified, passing a {@code null} argument to any
* method or constructor in this class will cause a {@link
* NullPointerException} to be thrown.
*
diff --git a/jdk/src/java.base/share/classes/java/util/EmptyStackException.java b/jdk/src/java.base/share/classes/java/util/EmptyStackException.java
index ea1c49d723c..53dcacd5742 100644
--- a/jdk/src/java.base/share/classes/java/util/EmptyStackException.java
+++ b/jdk/src/java.base/share/classes/java/util/EmptyStackException.java
@@ -26,7 +26,7 @@
package java.util;
/**
- * Thrown by methods in the Like most collection implementations EnumMap is not
+ * Like most collection implementations {@code EnumMap} is not
* synchronized. If multiple threads access an enum map concurrently, and at
* least one of the threads modifies the map, it should be synchronized
* externally. This is typically accomplished by synchronizing on some
@@ -80,7 +80,7 @@ public class EnumMap The iterator returned by the iterator method traverses the
+ * The iterator returned by the {@code iterator} method traverses the
* elements in their natural order (the order in which the enum
* constants are declared). The returned iterator is weakly
* consistent: it will never throw {@link ConcurrentModificationException}
@@ -50,7 +50,7 @@ import sun.misc.SharedSecrets;
* presence of a null element or to remove one will, however, function
* properly.
*
- * Like most collection implementations, EnumSet is not
+ * Like most collection implementations, {@code EnumSet} is not
* synchronized. If multiple threads access an enum set concurrently, and at
* least one of the threads modifies the set, it should be synchronized
* externally. This is typically accomplished by synchronizing on some
@@ -106,7 +106,7 @@ public abstract class EnumSet
- * For example, to print all elements of a Vector<E> v:
+ * For example, to print all elements of a {@code Vector Unless otherwise specified, passing a null argument to any
+ * Unless otherwise specified, passing a {@code null} argument to any
* method or constructor in this class will cause a {@link
* NullPointerException} to be thrown.
*
diff --git a/jdk/src/java.base/share/classes/java/util/Formattable.java b/jdk/src/java.base/share/classes/java/util/Formattable.java
index fa87e9c7022..2caabaedfa8 100644
--- a/jdk/src/java.base/share/classes/java/util/Formattable.java
+++ b/jdk/src/java.base/share/classes/java/util/Formattable.java
@@ -28,8 +28,8 @@ package java.util;
import java.io.IOException;
/**
- * The Formattable interface must be implemented by any class that
- * needs to perform custom formatting using the 's' conversion
+ * The {@code Formattable} interface must be implemented by any class that
+ * needs to perform custom formatting using the {@code 's'} conversion
* specifier of {@link java.util.Formatter}. This interface allows basic
* control for formatting arbitrary objects.
*
@@ -110,7 +110,7 @@ import java.io.IOException;
* safety is optional and may be enforced by classes that extend and implement
* this interface.
*
- * Unless otherwise specified, passing a null argument to
+ * Unless otherwise specified, passing a {@code null} argument to
* any method in this interface will cause a {@link
* NullPointerException} to be thrown.
*
@@ -126,7 +126,7 @@ public interface Formattable {
* {@link Formatter#out() formatter.out()} or {@link
* Formatter#locale() formatter.locale()} to obtain the {@link
* Appendable} or {@link Locale} used by this
- * formatter respectively.
+ * {@code formatter} respectively.
*
* @param flags
* The flags modify the output format. The value is interpreted as
@@ -139,19 +139,19 @@ public interface Formattable {
* @param width
* The minimum number of characters to be written to the output.
* If the length of the converted value is less than the
- * width then the output will be padded by
- * ' ' until the total number of characters
+ * {@code width} then the output will be padded by
+ * This flag corresponds to '-' ('\u002d') in
+ * This flag corresponds to {@code '-'} ( This flag corresponds to 'S' ('\u0053') in
+ * This flag corresponds to {@code 'S'} ( This flag corresponds to '#' ('\u0023') in
+ * This flag corresponds to {@code '#'} ( Another way to reference arguments by position is to use the
- * {@code '<'} ('\u003c') flag, which causes the argument for
+ * {@code '<'} ( If the argument, arg is {@code null}, then the
@@ -730,11 +730,11 @@ import sun.misc.FormattedFloatingDecimal;
* FormatFlagsConversionMismatchException} will be thrown.
*
* If the argument is {@code null}, then the result is
@@ -748,7 +748,7 @@ import sun.misc.FormattedFloatingDecimal;
* will be thrown.
*
* The width is the minimum number of characters to
* be written to the
* output. If the length of the converted value is less than the width then
- * the output will be padded by ' ' ('\u0020')
+ * the output will be padded by If {@code '('}, ' ', {@code '+'}, or
+ * If {@code '('}, If both the {@code '+'} and ' ' flags are given
+ * If both the {@code '+'} and If both the {@code '+'} and ' ' flags are given
+ * If both the {@code '+'} and If x is negative then the result will be a signed value
- * beginning with {@code '-'} ('\u002d'). Signed output is
+ * beginning with {@code '-'} ( If x is positive or zero and the {@code '+'} flag is given
- * then the result will begin with {@code '+'} ('\u002b').
+ * then the result will begin with {@code '+'} ( If the {@code '#'} flag is given then the output will always begin
* with {@code '0'} prefix.
@@ -1089,18 +1089,18 @@ import sun.misc.FormattedFloatingDecimal;
* FormatFlagsConversionMismatchException} will be thrown.
*
* If x is negative then the result will be a signed value
- * beginning with {@code '-'} ('\u002d'). Signed output is
+ * beginning with {@code '-'} ( If x is positive or zero and the {@code '+'} flag is given
- * then the result will begin with {@code '+'} ('\u002b').
+ * then the result will begin with {@code '+'} ( If the {@code '#'} flag is given then the output will always begin
* with the radix indicator {@code "0x"}.
@@ -1113,12 +1113,12 @@ import sun.misc.FormattedFloatingDecimal;
* FormatFlagsConversionMismatchException} will be thrown.
*
* If x is negative or a negative-zero value then the result
- * will begin with {@code '-'} ('\u002d').
+ * will begin with {@code '-'} ( If x is positive or a positive-zero value and the
* {@code '+'} flag is given then the result will begin with {@code '+'}
- * ('\u002b').
+ * ( The formatting of the magnitude m depends upon its value.
*
@@ -1295,7 +1295,7 @@ import sun.misc.FormattedFloatingDecimal;
* exponent fields. The significand is represented by the characters
* {@code "0x1."} followed by the hexadecimal representation of the rest
* of the significand as a fraction. The exponent is represented by
- * {@code 'p'} ('\u0070') followed by a decimal string of the
+ * {@code 'p'} ( The width is the minimum number of characters to
* be written to the output. If the length of the converted value is less than
* the {@code width} then the output will be padded by spaces
- * ('\u0020') until the total number of characters equals width.
+ * ( The width is the minimum number of characters to
* be written to the output including the {@code '%'}. If the length of the
* converted value is less than the {@code width} then the output will be
- * padded by spaces ('\u0020') until the total number of
+ * padded by spaces ( Unless otherwise specified, passing a null argument to any
+ * Unless otherwise specified, passing a {@code null} argument to any
* method or constructor in this class will cause a {@link
* NullPointerException} to be thrown.
*
diff --git a/jdk/src/java.base/share/classes/java/util/HashMap.java b/jdk/src/java.base/share/classes/java/util/HashMap.java
index ea56781c628..17b58b150d1 100644
--- a/jdk/src/java.base/share/classes/java/util/HashMap.java
+++ b/jdk/src/java.base/share/classes/java/util/HashMap.java
@@ -36,24 +36,24 @@ import java.util.function.Consumer;
import java.util.function.Function;
/**
- * Hash table based implementation of the Map interface. This
+ * Hash table based implementation of the {@code Map} interface. This
* implementation provides all of the optional map operations, and permits
- * null values and the null key. (The HashMap
- * class is roughly equivalent to Hashtable, except that it is
+ * {@code null} values and the {@code null} key. (The {@code HashMap}
+ * class is roughly equivalent to {@code Hashtable}, except that it is
* unsynchronized and permits nulls.) This class makes no guarantees as to
* the order of the map; in particular, it does not guarantee that the order
* will remain constant over time.
*
* This implementation provides constant-time performance for the basic
- * operations (get and put), assuming the hash function
+ * operations ({@code get} and {@code put}), assuming the hash function
* disperses the elements properly among the buckets. Iteration over
* collection views requires time proportional to the "capacity" of the
- * HashMap instance (the number of buckets) plus its size (the number
+ * {@code HashMap} instance (the number of buckets) plus its size (the number
* of key-value mappings). Thus, it's very important not to set the initial
* capacity too high (or the load factor too low) if iteration performance is
* important.
*
- * An instance of HashMap has two parameters that affect its
+ * An instance of {@code HashMap} has two parameters that affect its
* performance: initial capacity and load factor. The
* capacity is the number of buckets in the hash table, and the initial
* capacity is simply the capacity at the time the hash table is created. The
@@ -67,15 +67,15 @@ import java.util.function.Function;
* As a general rule, the default load factor (.75) offers a good
* tradeoff between time and space costs. Higher values decrease the
* space overhead but increase the lookup cost (reflected in most of
- * the operations of the HashMap class, including
- * get and put). The expected number of entries in
+ * the operations of the {@code HashMap} class, including
+ * {@code get} and {@code put}). The expected number of entries in
* the map and its load factor should be taken into account when
* setting its initial capacity, so as to minimize the number of
* rehash operations. If the initial capacity is greater than the
* maximum number of entries divided by the load factor, no rehash
* operations will ever occur.
*
- * If many mappings are to be stored in a HashMap
+ * If many mappings are to be stored in a {@code HashMap}
* instance, creating it with a sufficiently large capacity will allow
* the mappings to be stored more efficiently than letting it perform
* automatic rehashing as needed to grow the table. Note that using
@@ -102,7 +102,7 @@ import java.util.function.Function;
* The iterators returned by all of this class's "collection view methods"
* are fail-fast: if the map is structurally modified at any time after
* the iterator is created, in any way except through the iterator's own
- * remove method, the iterator will throw a
+ * {@code remove} method, the iterator will throw a
* {@link ConcurrentModificationException}. Thus, in the face of concurrent
* modification, the iterator fails quickly and cleanly, rather than risking
* arbitrary, non-deterministic behavior at an undetermined time in the
@@ -111,7 +111,7 @@ import java.util.function.Function;
* Note that the fail-fast behavior of an iterator cannot be guaranteed
* as it is, generally speaking, impossible to make any hard guarantees in the
* presence of unsynchronized concurrent modification. Fail-fast iterators
- * throw ConcurrentModificationException on a best-effort basis.
+ * throw {@code ConcurrentModificationException} on a best-effort basis.
* Therefore, it would be wrong to write a program that depended on this
* exception for its correctness: the fail-fast behavior of iterators
* should be used only to detect bugs.
@@ -435,7 +435,7 @@ public class HashMap/
dot characters in file name are
* treated as regular characters in match operations. For example,
* the {@code "*"} glob pattern matches file name {@code ".login"}.
* The {@link Files#isHidden} method may be used to test whether a file
diff --git a/jdk/src/java.base/share/classes/java/nio/file/FileSystems.java b/jdk/src/java.base/share/classes/java/nio/file/FileSystems.java
index 8524518f9f3..a5216b9196d 100644
--- a/jdk/src/java.base/share/classes/java/nio/file/FileSystems.java
+++ b/jdk/src/java.base/share/classes/java/nio/file/FileSystems.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2015, 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
@@ -321,9 +321,12 @@ public final class FileSystems {
String scheme = uri.getScheme();
// check installed providers
- for (FileSystemProvider provider: FileSystemProvider.installedProviders()) {
+ for (FileSystemProvider provider : FileSystemProvider.installedProviders()) {
if (scheme.equalsIgnoreCase(provider.getScheme())) {
- return provider.newFileSystem(uri, env);
+ try {
+ return provider.newFileSystem(uri, env);
+ } catch (UnsupportedOperationException uoe) {
+ }
}
}
@@ -331,9 +334,12 @@ public final class FileSystems {
if (loader != null) {
ServiceLoader
- * p.relativize(p.resolve(q)).equals(q)
+ * p{@code .relativize(}p
+ * {@code .resolve(}q{@code )).equals(}q{@code )}
*
*
*
- * {@link Paths#get(URI) Paths.get}(p.toUri()).equals(p
- * .{@link #toAbsolutePath() toAbsolutePath}())
+ *
+ * {@link Paths#get(URI) Paths.get}{@code (}p{@code .toUri()).equals(}p
+ * {@code .}{@link #toAbsolutePath() toAbsolutePath}{@code ())}
*
* so long as the original {@code Path}, the {@code URI}, and the new {@code
* Path} are all created in (possibly different invocations of) the same
diff --git a/jdk/src/java.base/share/classes/java/nio/file/Paths.java b/jdk/src/java.base/share/classes/java/nio/file/Paths.java
index bb49f99121e..3f57aaf7cb8 100644
--- a/jdk/src/java.base/share/classes/java/nio/file/Paths.java
+++ b/jdk/src/java.base/share/classes/java/nio/file/Paths.java
@@ -103,9 +103,9 @@ public final class Paths {
*
- * Paths.get(p.{@link Path#toUri() toUri}()).equals(
- * p.{@link Path#toAbsolutePath() toAbsolutePath}())
+ *
{@code
+ * Paths.get(}p{@code .}{@link Path#toUri() toUri}{@code ()).equals(}
+ * p{@code .}{@link Path#toAbsolutePath() toAbsolutePath}{@code ())}
*
* so long as the original {@code Path}, the {@code URI}, and the new {@code
* Path} are all created in (possibly different invocations of) the same
diff --git a/jdk/src/java.base/share/classes/java/nio/file/attribute/AclFileAttributeView.java b/jdk/src/java.base/share/classes/java/nio/file/attribute/AclFileAttributeView.java
index 129d0ee2197..429bfde8a1b 100644
--- a/jdk/src/java.base/share/classes/java/nio/file/attribute/AclFileAttributeView.java
+++ b/jdk/src/java.base/share/classes/java/nio/file/attribute/AclFileAttributeView.java
@@ -165,7 +165,7 @@ public interface AclFileAttributeView
* if an I/O error occurs
* @throws SecurityException
* In the case of the default provider, a security manager is
- * installed, and it denies {@link RuntimePermission}("accessUserInformation")
+ * installed, and it denies {@link RuntimePermission}{@code ("accessUserInformation")}
* or its {@link SecurityManager#checkRead(String) checkRead} method
* denies read access to the file.
*/
@@ -201,7 +201,7 @@ public interface AclFileAttributeView
* if an I/O error occurs or the ACL is invalid
* @throws SecurityException
* In the case of the default provider, a security manager is
- * installed, it denies {@link RuntimePermission}("accessUserInformation")
+ * installed, it denies {@link RuntimePermission}{@code ("accessUserInformation")}
* or its {@link SecurityManager#checkWrite(String) checkWrite}
* method denies write access to the file.
*/
diff --git a/jdk/src/java.base/share/classes/java/nio/file/attribute/FileOwnerAttributeView.java b/jdk/src/java.base/share/classes/java/nio/file/attribute/FileOwnerAttributeView.java
index f18caaf86a3..9acde225339 100644
--- a/jdk/src/java.base/share/classes/java/nio/file/attribute/FileOwnerAttributeView.java
+++ b/jdk/src/java.base/share/classes/java/nio/file/attribute/FileOwnerAttributeView.java
@@ -69,7 +69,7 @@ public interface FileOwnerAttributeView
* @throws SecurityException
* In the case of the default provider, a security manager is
* installed, and it denies {@link
- * RuntimePermission}("accessUserInformation") or its
+ * RuntimePermission}{@code ("accessUserInformation")} or its
* {@link SecurityManager#checkRead(String) checkRead} method
* denies read access to the file.
*/
@@ -93,7 +93,7 @@ public interface FileOwnerAttributeView
* @throws SecurityException
* In the case of the default provider, a security manager is
* installed, and it denies {@link
- * RuntimePermission}("accessUserInformation") or its
+ * RuntimePermission}{@code ("accessUserInformation")} or its
* {@link SecurityManager#checkWrite(String) checkWrite} method
* denies write access to the file.
*/
diff --git a/jdk/src/java.base/share/classes/java/nio/file/attribute/PosixFileAttributeView.java b/jdk/src/java.base/share/classes/java/nio/file/attribute/PosixFileAttributeView.java
index 25466f2dbce..f8c36523d66 100644
--- a/jdk/src/java.base/share/classes/java/nio/file/attribute/PosixFileAttributeView.java
+++ b/jdk/src/java.base/share/classes/java/nio/file/attribute/PosixFileAttributeView.java
@@ -149,7 +149,8 @@ public interface PosixFileAttributeView
* @throws IOException {@inheritDoc}
* @throws SecurityException
* In the case of the default provider, a security manager is
- * installed, and it denies {@link RuntimePermission}("accessUserInformation")
+ * installed, and it denies
+ * {@link RuntimePermission}{@code ("accessUserInformation")}
* or its {@link SecurityManager#checkRead(String) checkRead} method
* denies read access to the file.
*/
@@ -169,7 +170,8 @@ public interface PosixFileAttributeView
* if an I/O error occurs
* @throws SecurityException
* In the case of the default provider, a security manager is
- * installed, and it denies {@link RuntimePermission}("accessUserInformation")
+ * installed, and it denies
+ * {@link RuntimePermission}{@code ("accessUserInformation")}
* or its {@link SecurityManager#checkWrite(String) checkWrite}
* method denies write access to the file.
*/
@@ -185,7 +187,8 @@ public interface PosixFileAttributeView
* if an I/O error occurs
* @throws SecurityException
* In the case of the default provider, and a security manager is
- * installed, it denies {@link RuntimePermission}("accessUserInformation")
+ * installed, it denies
+ * {@link RuntimePermission}{@code ("accessUserInformation")}
* or its {@link SecurityManager#checkWrite(String) checkWrite}
* method denies write access to the file.
*/
diff --git a/jdk/src/java.base/share/classes/java/nio/file/attribute/UserDefinedFileAttributeView.java b/jdk/src/java.base/share/classes/java/nio/file/attribute/UserDefinedFileAttributeView.java
index 56e7135ed43..ffd89b9e7b2 100644
--- a/jdk/src/java.base/share/classes/java/nio/file/attribute/UserDefinedFileAttributeView.java
+++ b/jdk/src/java.base/share/classes/java/nio/file/attribute/UserDefinedFileAttributeView.java
@@ -89,7 +89,7 @@ public interface UserDefinedFileAttributeView
* @throws SecurityException
* In the case of the default provider, a security manager is
* installed, and it denies {@link
- * RuntimePermission}("accessUserDefinedAttributes")
+ * RuntimePermission}{@code ("accessUserDefinedAttributes")}
* or its {@link SecurityManager#checkRead(String) checkRead} method
* denies read access to the file.
*/
@@ -110,7 +110,7 @@ public interface UserDefinedFileAttributeView
* @throws SecurityException
* In the case of the default provider, a security manager is
* installed, and it denies {@link
- * RuntimePermission}("accessUserDefinedAttributes")
+ * RuntimePermission}{@code ("accessUserDefinedAttributes")}
* or its {@link SecurityManager#checkRead(String) checkRead} method
* denies read access to the file.
*/
@@ -156,7 +156,7 @@ public interface UserDefinedFileAttributeView
* @throws SecurityException
* In the case of the default provider, a security manager is
* installed, and it denies {@link
- * RuntimePermission}("accessUserDefinedAttributes")
+ * RuntimePermission}{@code ("accessUserDefinedAttributes")}
* or its {@link SecurityManager#checkRead(String) checkRead} method
* denies read access to the file.
*
@@ -206,7 +206,7 @@ public interface UserDefinedFileAttributeView
* @throws SecurityException
* In the case of the default provider, a security manager is
* installed, and it denies {@link
- * RuntimePermission}("accessUserDefinedAttributes")
+ * RuntimePermission}{@code ("accessUserDefinedAttributes")}
* or its {@link SecurityManager#checkWrite(String) checkWrite}
* method denies write access to the file.
*/
@@ -223,7 +223,7 @@ public interface UserDefinedFileAttributeView
* @throws SecurityException
* In the case of the default provider, a security manager is
* installed, and it denies {@link
- * RuntimePermission}("accessUserDefinedAttributes")
+ * RuntimePermission}{@code ("accessUserDefinedAttributes")}
* or its {@link SecurityManager#checkWrite(String) checkWrite}
* method denies write access to the file.
*/
diff --git a/jdk/src/java.base/share/classes/java/nio/file/attribute/UserPrincipalLookupService.java b/jdk/src/java.base/share/classes/java/nio/file/attribute/UserPrincipalLookupService.java
index c3f3befa96d..64e26604bd8 100644
--- a/jdk/src/java.base/share/classes/java/nio/file/attribute/UserPrincipalLookupService.java
+++ b/jdk/src/java.base/share/classes/java/nio/file/attribute/UserPrincipalLookupService.java
@@ -72,7 +72,8 @@ public abstract class UserPrincipalLookupService {
* if an I/O error occurs
* @throws SecurityException
* In the case of the default provider, and a security manager is
- * installed, it checks {@link RuntimePermission}("lookupUserInformation")
+ * installed, it checks
+ * {@link RuntimePermission}{@code ("lookupUserInformation")}
*/
public abstract UserPrincipal lookupPrincipalByName(String name)
throws IOException;
@@ -97,7 +98,8 @@ public abstract class UserPrincipalLookupService {
* if an I/O error occurs
* @throws SecurityException
* In the case of the default provider, and a security manager is
- * installed, it checks {@link RuntimePermission}("lookupUserInformation")
+ * installed, it checks
+ * {@link RuntimePermission}{@code ("lookupUserInformation")}
*/
public abstract GroupPrincipal lookupPrincipalByGroupName(String group)
throws IOException;
diff --git a/jdk/src/java.base/share/classes/java/nio/file/attribute/UserPrincipalNotFoundException.java b/jdk/src/java.base/share/classes/java/nio/file/attribute/UserPrincipalNotFoundException.java
index 5cf0ab0a5f3..563b339d3f2 100644
--- a/jdk/src/java.base/share/classes/java/nio/file/attribute/UserPrincipalNotFoundException.java
+++ b/jdk/src/java.base/share/classes/java/nio/file/attribute/UserPrincipalNotFoundException.java
@@ -54,7 +54,7 @@ public class UserPrincipalNotFoundException
/**
* Returns the user principal name if this exception was created with the
- * user principal name that was not found, otherwise null.
+ * user principal name that was not found, otherwise {@code null}.
*
* @return the user principal name or {@code null}
*/
diff --git a/jdk/src/java.base/share/classes/java/nio/file/attribute/package-info.java b/jdk/src/java.base/share/classes/java/nio/file/attribute/package-info.java
index be46551c60d..1dd20f627c7 100644
--- a/jdk/src/java.base/share/classes/java/nio/file/attribute/package-info.java
+++ b/jdk/src/java.base/share/classes/java/nio/file/attribute/package-info.java
@@ -28,23 +28,23 @@
*
*
*
@@ -100,7 +100,7 @@
*
*
*
- *
*
- * Attribute views Description {@link java.nio.file.attribute.AttributeView}
+ *
- * {@link java.nio.file.attribute.AttributeView}
* Can read or update non-opaque values associated with objects in a file system {@link java.nio.file.attribute.FileAttributeView}
+ *
- * {@link java.nio.file.attribute.FileAttributeView}
* Can read or update file attributes {@link java.nio.file.attribute.BasicFileAttributeView}
+ *
- * {@link java.nio.file.attribute.BasicFileAttributeView}
* Can read or update a basic set of file attributes {@link java.nio.file.attribute.PosixFileAttributeView}
+ *
- * {@link java.nio.file.attribute.PosixFileAttributeView}
* Can read or update POSIX defined file attributes {@link java.nio.file.attribute.DosFileAttributeView}
+ *
- * {@link java.nio.file.attribute.DosFileAttributeView}
* Can read or update FAT file attributes {@link java.nio.file.attribute.FileOwnerAttributeView}
+ *
- * {@link java.nio.file.attribute.FileOwnerAttributeView}
* Can read or update the owner of a file {@link java.nio.file.attribute.AclFileAttributeView}
+ *
- * {@link java.nio.file.attribute.AclFileAttributeView}
* Can read or update Access Control Lists {@link java.nio.file.attribute.UserDefinedFileAttributeView}
+ *
- * {@link java.nio.file.attribute.UserDefinedFileAttributeView}
* Can read or update user-defined file attributes {@link java.nio.file.attribute.FileStoreAttributeView}
+ *
* {@link java.nio.file.attribute.FileStoreAttributeView}
* Can read or update file system attributes
*
@@ -129,7 +129,7 @@
*
*
*
- *
*
- * Buffers Description {@link java.nio.Buffer}
+ *
- * {@link java.nio.Buffer}
* Position, limit, and capacity;
*
clear, flip, rewind, and mark/reset {@link java.nio.ByteBuffer}
+ *
- * {@link java.nio.ByteBuffer}
* Get/put, compact, views; allocate, wrap {@link java.nio.MappedByteBuffer}
+ *
- * {@link java.nio.MappedByteBuffer}
* A byte buffer mapped to a file {@link java.nio.CharBuffer}
+ *
- * {@link java.nio.CharBuffer}
* Get/put, compact; allocate, wrap {@link java.nio.DoubleBuffer}
+ *
- * {@link java.nio.DoubleBuffer}
* ' ' {@link java.nio.FloatBuffer}
+ *
- * {@link java.nio.FloatBuffer}
* ' ' {@link java.nio.IntBuffer}
+ *
- * {@link java.nio.IntBuffer}
* ' ' {@link java.nio.LongBuffer}
+ *
- * {@link java.nio.LongBuffer}
* ' ' {@link java.nio.ShortBuffer}
+ *
- * {@link java.nio.ShortBuffer}
* ' ' {@link java.nio.ByteOrder}
+ *
* {@link java.nio.ByteOrder}
* Typesafe enumeration for byte orders
*
*
+ * @implNote
+ * Implementations may define additional target names, but should use naming
+ * conventions such as reverse domain name notation to avoid name clashes.
+ *
* @see java.security.BasicPermission
* @see java.security.Permission
* @see java.security.Permissions
diff --git a/jdk/src/java.base/share/classes/java/util/AbstractCollection.java b/jdk/src/java.base/share/classes/java/util/AbstractCollection.java
index 4e530150706..6f344f8befe 100644
--- a/jdk/src/java.base/share/classes/java/util/AbstractCollection.java
+++ b/jdk/src/java.base/share/classes/java/util/AbstractCollection.java
@@ -26,23 +26,23 @@
package java.util;
/**
- * This class provides a skeletal implementation of the Collection
+ * This class provides a skeletal implementation of the {@code Collection}
* interface, to minimize the effort required to implement this interface.
@@ -299,6 +299,10 @@ import java.util.StringTokenizer;
*
* next
method)
+ * iterator (by a call to the {@code next} method)
* @return a list iterator over the elements in this list (in proper
* sequence)
* @throws IndexOutOfBoundsException {@inheritDoc}
diff --git a/jdk/src/java.base/share/classes/java/util/AbstractSet.java b/jdk/src/java.base/share/classes/java/util/AbstractSet.java
index e999188564d..35e2ba4ec99 100644
--- a/jdk/src/java.base/share/classes/java/util/AbstractSet.java
+++ b/jdk/src/java.base/share/classes/java/util/AbstractSet.java
@@ -26,20 +26,20 @@
package java.util;
/**
- * This class provides a skeletal implementation of the Set
+ * This class provides a skeletal implementation of the {@code Set}
* interface to minimize the effort required to implement this
* interface.
* String[] y = x.toArray(new String[0]);
*
- * Note that toArray(new Object[0]) is identical in function to
- * toArray().
+ * Note that {@code toArray(new Object[0])} is identical in function to
+ * {@code toArray()}.
*
* @param (-(insertion point) - 1)
. The
* insertion point is defined as the point at which the
* key would be inserted into the list: the index of the first
- * element greater than the key, or list.size() if all
+ * element greater than the key, or {@code list.size()} if all
* elements in the list are less than the specified key. Note
* that this guarantees that the return value will be >= 0 if
* and only if the key is found.
@@ -296,13 +296,13 @@ public class Collections {
* @param list the list to be searched.
* @param key the key to be searched for.
* @param c the comparator by which the list is ordered.
- * A null value indicates that the elements'
+ * A {@code null} value indicates that the elements'
* {@linkplain Comparable natural ordering} should be used.
* @return the index of the search key, if it is contained in the list;
- * otherwise, (-(insertion point) - 1). The
+ * otherwise, (-(insertion point) - 1)
. The
* insertion point is defined as the point at which the
* key would be inserted into the list: the index of the first
- * element greater than the key, or list.size() if all
+ * element greater than the key, or {@code list.size()} if all
* elements in the list are less than the specified key. Note
* that this guarantees that the return value will be >= 0 if
* and only if the key is found.
@@ -368,7 +368,7 @@ public class Collections {
*
* @param list the list whose elements are to be reversed.
* @throws UnsupportedOperationException if the specified list or
- * its list-iterator does not support the set operation.
+ * its list-iterator does not support the {@code set} operation.
*/
@SuppressWarnings({"rawtypes", "unchecked"})
public static void reverse(List> list) {
@@ -416,7 +416,7 @@ public class Collections {
*
* @param list the list to be shuffled.
* @throws UnsupportedOperationException if the specified list or
- * its list-iterator does not support the set operation.
+ * its list-iterator does not support the {@code set} operation.
*/
public static void shuffle(List> list) {
Random rnd = r;
@@ -448,7 +448,7 @@ public class Collections {
* @param list the list to be shuffled.
* @param rnd the source of randomness to use to shuffle the list.
* @throws UnsupportedOperationException if the specified list or its
- * list-iterator does not support the set operation.
+ * list-iterator does not support the {@code set} operation.
*/
@SuppressWarnings({"rawtypes", "unchecked"})
public static void shuffle(List> list, Random rnd) {
@@ -483,7 +483,7 @@ public class Collections {
* @param list The list in which to swap elements.
* @param i the index of one element to be swapped.
* @param j the index of the other element to be swapped.
- * @throws IndexOutOfBoundsException if either i or j
+ * @throws IndexOutOfBoundsException if either {@code i} or {@code j}
* is out of range (i < 0 || i >= list.size()
* || j < 0 || j >= list.size()).
* @since 1.4
@@ -516,7 +516,7 @@ public class Collections {
* @param list the list to be filled with the specified element.
* @param obj The element with which to fill the specified list.
* @throws UnsupportedOperationException if the specified list or its
- * list-iterator does not support the set operation.
+ * list-iterator does not support the {@code set} operation.
*/
public static
* Collections.rotate(list.subList(j, k+1), -1);
*
- * To make this concrete, suppose list comprises
- * [a, b, c, d, e]. To move the element at index 1
- * (b) forward two positions, perform the following invocation:
+ * To make this concrete, suppose {@code list} comprises
+ * {@code [a, b, c, d, e]}. To move the element at index {@code 1}
+ * ({@code b}) forward two positions, perform the following invocation:
*
* Collections.rotate(l.subList(1, 4), -1);
*
- * The resulting list is [a, c, d, b, e].
+ * The resulting list is {@code [a, c, d, b, e]}.
*
*
* SortedSet s = Collections.synchronizedSortedSet(new TreeSet());
* ...
@@ -2700,8 +2700,8 @@ public class Collections {
*
* It is imperative that the user manually synchronize on the returned
* sorted map when iterating over any of its collection views, or the
- * collections views of any of its subMap, headMap or
- * tailMap views.
+ * collections views of any of its {@code subMap}, {@code headMap} or
+ * {@code tailMap} views.
*
*
* @param
* SortedMap m = Collections.synchronizedSortedMap(new TreeMap());
* ...
@@ -4406,7 +4406,7 @@ public class Collections {
*
*
* @implNote
- * Implementations of this method need not create a separate List
+ * Implementations of this method need not create a separate {@code List}
* object for each call. Using this method is likely to have comparable
* cost to using the like-named field. (Unlike this method, the field does
* not provide type safety.)
@@ -4846,7 +4846,7 @@ public class Collections {
* @param
+ * imposed ordering that a given comparator {@code c} imposes on a
+ * given set of objects {@code S} is:
* {(x, y) such that c.compare(x, y) <= 0}.
*
The quotient for this total order is:
* {(x, y) such that c.compare(x, y) == 0}.
*
*
- * It follows immediately from the contract for compare that the
- * quotient is an equivalence relation on S, and that the
- * imposed ordering is a total order on S. When we say that
- * the ordering imposed by c on S is consistent with
+ * It follows immediately from the contract for {@code compare} that the
+ * quotient is an equivalence relation on {@code S}, and that the
+ * imposed ordering is a total order on {@code S}. When we say that
+ * the ordering imposed by {@code c} on {@code S} is consistent with
* equals, we mean that the quotient for the ordering is the equivalence
* relation defined by the objects' {@link Object#equals(Object)
* equals(Object)} method(s):
@@ -113,26 +113,26 @@ public interface Comparator
comp1.equals(comp2)
implies that sgn(comp1.compare(o1,
- * o2))==sgn(comp2.compare(o1, o2)) for every object reference
- * o1 and o2.true
only if the specified object is also
+ * @return {@code true} only if the specified object is also
* a comparator and it imposes the same ordering as this
* comparator.
* @see Object#equals(Object)
diff --git a/jdk/src/java.base/share/classes/java/util/Dictionary.java b/jdk/src/java.base/share/classes/java/util/Dictionary.java
index 5f439b3edda..4d89ec2dff5 100644
--- a/jdk/src/java.base/share/classes/java/util/Dictionary.java
+++ b/jdk/src/java.base/share/classes/java/util/Dictionary.java
@@ -26,14 +26,14 @@
package java.util;
/**
- * The Dictionary
class is the abstract parent of any
- * class, such as Hashtable
, which maps keys to values.
- * Every key and every value is an object. In any one Dictionary
+ * The {@code Dictionary} class is the abstract parent of any
+ * class, such as {@code Hashtable}, which maps keys to values.
+ * Every key and every value is an object. In any one {@code Dictionary}
* object, every key is associated with at most one value. Given a
- * Dictionary and a key, the associated element can be looked up.
- * Any non-null
object can be used as a key and as a value.
+ * {@code Dictionary} and a key, the associated element can be looked up.
+ * Any non-{@code null} object can be used as a key and as a value.
* equals
method should be used by
+ * As a rule, the {@code equals} method should be used by
* implementations of this class to decide if two keys are the same.
* true
if this dictionary maps no keys to values;
- * false
otherwise.
+ * @return {@code true} if this dictionary maps no keys to values;
+ * {@code false} otherwise.
*/
abstract public boolean isEmpty();
/**
* Returns an enumeration of the keys in this dictionary. The general
- * contract for the keys method is that an Enumeration object
+ * contract for the keys method is that an {@code Enumeration} object
* is returned that will generate all the keys for which this dictionary
* contains entries.
*
@@ -86,8 +86,8 @@ class Dictionarynull
if the key is not mapped to any value in
+ * {@code null} if the key is not mapped to any value in
* this dictionary.
- * @exception NullPointerException if the key is null.
+ * @exception NullPointerException if the {@code key} is {@code null}.
* @see java.util.Dictionary#put(java.lang.Object, java.lang.Object)
*/
abstract public V get(Object key);
/**
- * Maps the specified key
to the specified
- * value
in this dictionary. Neither the key nor the
- * value can be null
.
+ * Maps the specified {@code key} to the specified
+ * {@code value} in this dictionary. Neither the key nor the
+ * value can be {@code null}.
* value
can be retrieved by calling the
- * get
method with a key
that is equal to
- * the original key
.
+ * The {@code value} can be retrieved by calling the
+ * {@code get} method with a {@code key} that is equal to
+ * the original {@code key}.
*
* @param key the hashtable key.
* @param value the value.
- * @return the previous value to which the key
was mapped
- * in this dictionary, or null
if the key did not
+ * @return the previous value to which the {@code key} was mapped
+ * in this dictionary, or {@code null} if the key did not
* have a previous mapping.
- * @exception NullPointerException if the key
or
- * value
is null
.
+ * @exception NullPointerException if the {@code key} or
+ * {@code value} is {@code null}.
* @see java.lang.Object#equals(java.lang.Object)
* @see java.util.Dictionary#get(java.lang.Object)
*/
abstract public V put(K key, V value);
/**
- * Removes the key
(and its corresponding
- * value
) from this dictionary. This method does nothing
- * if the key
is not in this dictionary.
+ * Removes the {@code key} (and its corresponding
+ * {@code value}) from this dictionary. This method does nothing
+ * if the {@code key} is not in this dictionary.
*
* @param key the key that needs to be removed.
- * @return the value to which the key
had been mapped in this
- * dictionary, or null
if the key did not have a
+ * @return the value to which the {@code key} had been mapped in this
+ * dictionary, or {@code null} if the key did not have a
* mapping.
- * @exception NullPointerException if key is null.
+ * @exception NullPointerException if {@code key} is {@code null}.
*/
abstract public V remove(Object key);
}
diff --git a/jdk/src/java.base/share/classes/java/util/DuplicateFormatFlagsException.java b/jdk/src/java.base/share/classes/java/util/DuplicateFormatFlagsException.java
index 0dcdf3762ce..ec016a59e58 100644
--- a/jdk/src/java.base/share/classes/java/util/DuplicateFormatFlagsException.java
+++ b/jdk/src/java.base/share/classes/java/util/DuplicateFormatFlagsException.java
@@ -29,7 +29,7 @@ package java.util;
* Unchecked exception thrown when duplicate flags are provided in the format
* specifier.
*
- * Stack
class to indicate
+ * Thrown by methods in the {@code Stack} class to indicate
* that the stack is empty.
*
* @author Jonathan Payne
@@ -38,7 +38,7 @@ class EmptyStackException extends RuntimeException {
private static final long serialVersionUID = 5084686378493302095L;
/**
- * Constructs a new EmptyStackException
with null
+ * Constructs a new {@code EmptyStackException} with {@code null}
* as its error message string.
*/
public EmptyStackException() {
diff --git a/jdk/src/java.base/share/classes/java/util/EnumMap.java b/jdk/src/java.base/share/classes/java/util/EnumMap.java
index b732ef0bf54..b99a93fda5f 100644
--- a/jdk/src/java.base/share/classes/java/util/EnumMap.java
+++ b/jdk/src/java.base/share/classes/java/util/EnumMap.java
@@ -50,7 +50,7 @@ import sun.misc.SharedSecrets;
* presence of a null key or to remove one will, however, function properly.
* Null values are permitted.
- * nextElement
method return successive elements of the
+ * {@code nextElement} method return successive elements of the
* series.
*
* for (Enumeration<E> e = v.elements(); e.hasMoreElements();)
* System.out.println(e.nextElement());
@@ -39,7 +39,7 @@ package java.util;
* Methods are provided to enumerate through the elements of a
* vector, the keys of a hashtable, and the values in a hashtable.
* Enumerations are also used to specify the input streams to a
- * SequenceInputStream
.
+ * {@code SequenceInputStream}.
*
* @apiNote
* The functionality of this interface is duplicated by the {@link Iterator}
@@ -65,9 +65,9 @@ public interface Enumerationtrue
if and only if this enumeration object
+ * @return {@code true} if and only if this enumeration object
* contains at least one more element to provide;
- * false
otherwise.
+ * {@code false} otherwise.
*/
boolean hasMoreElements();
diff --git a/jdk/src/java.base/share/classes/java/util/FormatFlagsConversionMismatchException.java b/jdk/src/java.base/share/classes/java/util/FormatFlagsConversionMismatchException.java
index 58f593ebc21..664cd398554 100644
--- a/jdk/src/java.base/share/classes/java/util/FormatFlagsConversionMismatchException.java
+++ b/jdk/src/java.base/share/classes/java/util/FormatFlagsConversionMismatchException.java
@@ -28,7 +28,7 @@ package java.util;
/**
* Unchecked exception thrown when a conversion and flag are incompatible.
*
- * ' '
until the total number of characters
* equals width. The padding is at the beginning by default. If
* the {@link FormattableFlags#LEFT_JUSTIFY} flag is set then the
- * padding will be at the end. If width is -1
+ * padding will be at the end. If {@code width} is {@code -1}
* then there is no minimum.
*
* @param precision
* The maximum number of characters to be written to the output.
* The precision is applied before the width, thus the output will
- * be truncated to precision characters even if the
- * width is greater than the precision. If
- * precision is -1 then there is no explicit
+ * be truncated to {@code precision} characters even if the
+ * {@code width} is greater than the {@code precision}. If
+ * {@code precision} is {@code -1} then there is no explicit
* limit on the number of characters.
*
* @throws IllegalFormatException
diff --git a/jdk/src/java.base/share/classes/java/util/FormattableFlags.java b/jdk/src/java.base/share/classes/java/util/FormattableFlags.java
index 11a10ddfc40..6c9962c3dba 100644
--- a/jdk/src/java.base/share/classes/java/util/FormattableFlags.java
+++ b/jdk/src/java.base/share/classes/java/util/FormattableFlags.java
@@ -39,12 +39,12 @@ public class FormattableFlags {
private FormattableFlags() {}
/**
- * Left-justifies the output. Spaces ('\u0020') will be added
+ * Left-justifies the output. Spaces ('\u0020'
) will be added
* at the end of the converted value as required to fill the minimum width
* of the field. If this flag is not set then the output will be
* right-justified.
*
- * '\u002d'
) in
* the format specifier.
*/
public static final int LEFT_JUSTIFY = 1<<0; // '-'
@@ -52,23 +52,23 @@ public class FormattableFlags {
/**
* Converts the output to upper case according to the rules of the
* {@linkplain java.util.Locale locale} given during creation of the
- * formatter argument of the {@link Formattable#formatTo
+ * {@code formatter} argument of the {@link Formattable#formatTo
* formatTo()} method. The output should be equivalent the following
* invocation of {@link String#toUpperCase(java.util.Locale)}
*
*
* out.toUpperCase()
*
- * '\u0053'
) in
* the format specifier.
*/
public static final int UPPERCASE = 1<<1; // 'S'
/**
* Requires the output to use an alternate form. The definition of the
- * form is specified by the Formattable.
+ * form is specified by the {@code Formattable}.
*
- * '\u0023'
) in
* the format specifier.
*/
public static final int ALTERNATE = 1<<2; // '#'
diff --git a/jdk/src/java.base/share/classes/java/util/Formatter.java b/jdk/src/java.base/share/classes/java/util/Formatter.java
index 62fbedd793a..14909eca9ad 100644
--- a/jdk/src/java.base/share/classes/java/util/Formatter.java
+++ b/jdk/src/java.base/share/classes/java/util/Formatter.java
@@ -267,7 +267,7 @@ import sun.misc.FormattedFloatingDecimal;
* {@link Date} and {@link TemporalAccessor TemporalAccessor}
*
* '\u0025'
)
*
* {@code '%'}
* percent
- * The result is a literal {@code '%'} ('\u0025')
+ * The result is a literal {@code '%'} ( '\u0025'
)
*
* {@code 'n'}
* line separator
@@ -644,7 +644,7 @@ import sun.misc.FormattedFloatingDecimal;
* "{@code 1$}", the second by "{@code 2$}", etc.
*
* '\u003c'
) flag, which causes the argument for
* the previous format specifier to be re-used. For example, the following two
* statements would produce identical strings:
*
@@ -701,7 +701,7 @@ import sun.misc.FormattedFloatingDecimal;
*
*
*
@@ -758,15 +758,15 @@ import sun.misc.FormattedFloatingDecimal;
* {@code 'b'}
- * '\u0062'
+ * '\u0062'
* Produces either "{@code true}" or "{@code false}" as returned by
* {@link Boolean#toString(boolean)}.
*
@@ -715,11 +715,11 @@ import sun.misc.FormattedFloatingDecimal;
* FormatFlagsConversionMismatchException} will be thrown.
*
* {@code 'B'}
- * '\u0042'
+ * '\u0042'
* The upper-case variant of {@code 'b'}.
*
* {@code 'h'}
- * '\u0068'
+ * '\u0068'
* Produces a string representing the hash code value of the object.
*
* {@code 'H'}
- * '\u0048'
+ * '\u0048'
* The upper-case variant of {@code 'h'}.
*
* {@code 's'}
- * '\u0073'
+ * '\u0073'
* Produces a string.
*
* {@code 'S'}
- * '\u0053'
+ * '\u0053'
* The upper-case variant of {@code 's'}.
*
*
*
*
{@code '-'}
- * '\u002d'
- * Left justifies the output. Spaces ('\u0020') will be
+ * '\u002d'
+ * Left justifies the output. Spaces ( '\u0020'
) will be
* added at the end of the converted value as required to fill the minimum
* width of the field. If the width is not provided, then a {@link
* MissingFormatWidthException} will be thrown. If this flag is not given
* then the output will be right-justified.
*
* {@code '#'}
- * '\u0023'
+ * '\u0023'
* Requires the output use an alternate form. The definition of the
* form is specified by the conversion.
*
@@ -775,7 +775,7 @@ import sun.misc.FormattedFloatingDecimal;
* ' '
('\u0020'
)
* until the total number of characters equals the width. The padding is on
* the left by default. If the {@code '-'} flag is given, then the padding
* will be on the right. If the width is not specified then there is no
@@ -799,7 +799,7 @@ import sun.misc.FormattedFloatingDecimal;
*
*
*
@@ -859,7 +859,7 @@ import sun.misc.FormattedFloatingDecimal;
* java.text.DecimalFormatSymbols#getDecimalSeparator decimal separator} is
* substituted.
*
- * {@code 'c'}
- * '\u0063'
+ * '\u0063'
* Formats the argument as a Unicode character as described in Unicode Character
* Representation. This may be more than one 16-bit {@code char} in
@@ -809,7 +809,7 @@ import sun.misc.FormattedFloatingDecimal;
* FormatFlagsConversionMismatchException} will be thrown.
*
* {@code 'C'}
- * '\u0043'
+ * '\u0043'
* The upper-case variant of {@code 'c'}.
*
* '\u002c'
)
* flag is given, then the locale-specific {@linkplain
* java.text.DecimalFormatSymbols#getGroupingSeparator grouping separator} is
* inserted by scanning the integer part of the string from least significant
@@ -873,15 +873,15 @@ import sun.misc.FormattedFloatingDecimal;
* the length of the string is equal to the requested field width.
*
* '\u0028'
) is prepended and a {@code ')'}
+ * ('\u0029'
) is appended.
*
* '\u002d'
)
* is prepended.
*
* '\u002b'
)
* will be prepended.
*
*
@@ -900,7 +900,7 @@ import sun.misc.FormattedFloatingDecimal;
*
*
*
*
@@ -980,24 +980,24 @@ import sun.misc.FormattedFloatingDecimal;
* {@code 'd'}
- * '\u0064'
+ * '\u0064'
* Formats the argument as a decimal integer. The localization algorithm is applied.
*
@@ -911,7 +911,7 @@ import sun.misc.FormattedFloatingDecimal;
* FormatFlagsConversionMismatchException} will be thrown.
*
* {@code 'o'}
- * '\u006f'
+ * '\u006f'
* Formats the argument as an integer in base eight. No localization
* is applied.
*
@@ -933,7 +933,7 @@ import sun.misc.FormattedFloatingDecimal;
* thrown.
*
* {@code 'x'}
- * '\u0078'
+ * '\u0078'
* Formats the argument as an integer in base sixteen. No
* localization is applied.
*
@@ -951,17 +951,17 @@ import sun.misc.FormattedFloatingDecimal;
* the field width with leading zeros after the radix indicator or sign (if
* present).
*
- * ' '
, {@code '+'}, or
* {@code ','} flags are given then a {@link
* FormatFlagsConversionMismatchException} will be thrown.
*
* {@code 'X'}
- * '\u0058'
+ * '\u0058'
* The upper-case variant of {@code 'x'}. The entire string
* representing the number will be converted to {@linkplain
* String#toUpperCase upper case} including the {@code 'x'} (if any) and
* all hexadecimal digits {@code 'a'} - {@code 'f'}
- * ('\u0061' - '\u0066').
+ * ( '\u0061'
- '\u0066'
).
*
*
*
*
*
@@ -1029,7 +1029,7 @@ import sun.misc.FormattedFloatingDecimal;
*
* {@code '+'}
- * '\u002b'
+ * '\u002b'
* Requires the output to include a positive sign for all positive
* numbers. If this flag is not given then only negative values will
* include a sign.
*
- * ' '
flags are given
* then an {@link IllegalFormatFlagsException} will be thrown.
*
- * ' '
- * '\u0020'
+ * ' '
+ * '\u0020'
* Requires the output to include a single extra space
- * ('\u0020') for non-negative values.
+ * ( '\u0020'
) for non-negative values.
*
- * ' '
flags are given
* then an {@link IllegalFormatFlagsException} will be thrown.
*
* {@code '0'}
- * '\u0030'
+ * '\u0030'
* Requires the output to be padded with leading {@linkplain
* java.text.DecimalFormatSymbols#getZeroDigit zeros} to the minimum field
* width following any sign or radix indicator except when converting NaN
@@ -1008,17 +1008,17 @@ import sun.misc.FormattedFloatingDecimal;
* {@link IllegalFormatFlagsException} will be thrown.
*
* {@code ','}
- * '\u002c'
+ * '\u002c'
* Requires the output to include the locale-specific {@linkplain
* java.text.DecimalFormatSymbols#getGroupingSeparator group separators} as
* described in the "group" section of the
* localization algorithm.
*
* {@code '('}
- * '\u0028'
+ * '\u0028'
* Requires the output to prepend a {@code '('}
- * ('\u0028') and append a {@code ')'}
- * ('\u0029') to negative values.
+ * ( '\u0028'
) and append a {@code ')'}
+ * ('\u0029'
) to negative values.
*
* '\u002d'
)
*
* '\u0020'
) until the total number of characters equals
* width. The padding is on the left by default. If {@code '-'} flag is
* given then the padding will be on the right. If width is not specified then
* there is no minimum.
@@ -1058,7 +1058,7 @@ import sun.misc.FormattedFloatingDecimal;
*
*
*
*
@@ -1152,7 +1152,7 @@ import sun.misc.FormattedFloatingDecimal;
* {@code 'd'}
- * '\u0064'
+ * '\u0064'
* Requires the output to be formatted as a decimal integer. The localization algorithm is applied.
*
@@ -1066,18 +1066,18 @@ import sun.misc.FormattedFloatingDecimal;
* FormatFlagsConversionMismatchException} will be thrown.
*
* {@code 'o'}
- * '\u006f'
+ * '\u006f'
* Requires the output to be formatted as an integer in base eight.
* No localization is applied.
*
* '\u002d'
). Signed output is
* allowed for this type because unlike the primitive types it is not
* possible to create an unsigned equivalent without assuming an explicit
* data-type size.
*
* '\u002b'
).
*
* {@code 'x'}
- * '\u0078'
+ * '\u0078'
* Requires the output to be formatted as an integer in base
* sixteen. No localization is applied.
*
* '\u002d'
). Signed output is
* allowed for this type because unlike the primitive types it is not
* possible to create an unsigned equivalent without assuming an explicit
* data-type size.
*
* '\u002b'
).
*
* {@code 'X'}
- * '\u0058'
+ * '\u0058'
* The upper-case variant of {@code 'x'}. The entire string
* representing the number will be converted to {@linkplain
* String#toUpperCase upper case} including the {@code 'x'} (if any) and
* all hexadecimal digits {@code 'a'} - {@code 'f'}
- * ('\u0061' - '\u0066').
+ * ( '\u0061'
- '\u0066'
).
*
*
*
*
*
@@ -1357,7 +1357,7 @@ import sun.misc.FormattedFloatingDecimal;
* separators, decimal separators, exponential symbol, radix indicator,
* parentheses, and strings representing infinity and NaN as applicable. If
* the length of the converted value is less than the width then the output
- * will be padded by spaces ('\u0020') until the total number of
+ * will be padded by spaces ( {@code 'e'}
- * '\u0065'
+ * '\u0065'
* Requires the output to be formatted using computerized scientific notation. The localization algorithm is applied.
@@ -1179,7 +1179,7 @@ import sun.misc.FormattedFloatingDecimal;
* integer part of a, as a single decimal digit, followed by the
* decimal separator followed by decimal digits representing the fractional
* part of a, followed by the exponent symbol {@code 'e'}
- * ('\u0065'), followed by the sign of the exponent, followed
+ * ( '\u0065'
), followed by the sign of the exponent, followed
* by a representation of n as a decimal integer, as produced by the
* method {@link Long#toString(long, int)}, and zero-padded to include at
* least two digits.
@@ -1200,12 +1200,12 @@ import sun.misc.FormattedFloatingDecimal;
* FormatFlagsConversionMismatchException} will be thrown.
*
* {@code 'E'}
- * '\u0045'
+ * '\u0045'
* The upper-case variant of {@code 'e'}. The exponent symbol
- * will be {@code 'E'} ('\u0045').
+ * will be {@code 'E'} ( '\u0045'
).
*
* {@code 'g'}
- * '\u0067'
+ * '\u0067'
* Requires the output to be formatted in general scientific notation
* as described below. The localization
* algorithm is applied.
@@ -1230,11 +1230,11 @@ import sun.misc.FormattedFloatingDecimal;
* FormatFlagsConversionMismatchException} will be thrown.
*
* {@code 'G'}
- * '\u0047'
+ * '\u0047'
* The upper-case variant of {@code 'g'}.
*
* {@code 'f'}
- * '\u0066'
+ * '\u0066'
* Requires the output to be formatted using decimal
* format. The localization algorithm is
* applied.
@@ -1266,7 +1266,7 @@ import sun.misc.FormattedFloatingDecimal;
* appropriate.
*
* {@code 'a'}
- * '\u0061'
+ * '\u0061'
* Requires the output to be formatted in hexadecimal exponential
* form. No localization is applied.
*
@@ -1274,11 +1274,11 @@ import sun.misc.FormattedFloatingDecimal;
* (absolute value) of the argument x.
*
* '\u002d'
).
*
* '\u002b'
).
*
* '\u0070'
) followed by a decimal string of the
* unbiased exponent as if produced by invoking {@link
* Integer#toString(int) Integer.toString} on the exponent value. If the
* precision is specified, the value is rounded to the given number of
@@ -1319,12 +1319,12 @@ import sun.misc.FormattedFloatingDecimal;
* FormatFlagsConversionMismatchException} will be thrown.
*
* {@code 'A'}
- * '\u0041'
+ * '\u0041'
* The upper-case variant of {@code 'a'}. The entire string
* representing the number will be converted to upper case including the
- * {@code 'x'} ('\u0078') and {@code 'p'}
- * ('\u0070' and all hexadecimal digits {@code 'a'} -
- * {@code 'f'} ('\u0061' - '\u0066').
+ * {@code 'x'} ( '\u0078'
) and {@code 'p'}
+ * ('\u0070'
and all hexadecimal digits {@code 'a'} -
+ * {@code 'f'} ('\u0061'
- '\u0066'
).
*
* '\u0020'
) until the total number of
* characters equals width. The padding is on the left by default. If the
* {@code '-'} flag is given then the padding will be on the right. If width
* is not specified then there is no minimum.
@@ -1386,7 +1386,7 @@ import sun.misc.FormattedFloatingDecimal;
*
*
*
{@code 'e'}
- * '\u0065'
+ * '\u0065'
* Requires the output to be formatted using computerized scientific notation. The localization algorithm is applied.
@@ -1409,7 +1409,7 @@ import sun.misc.FormattedFloatingDecimal;
* integer part of a, as a single decimal digit, followed by the
* decimal separator followed by decimal digits representing the fractional
* part of a, followed by the exponent symbol {@code 'e'}
- * ('\u0065'), followed by the sign of the exponent, followed
+ * ( '\u0065'
), followed by the sign of the exponent, followed
* by a representation of n as a decimal integer, as produced by the
* method {@link Long#toString(long, int)}, and zero-padded to include at
* least two digits.
@@ -1428,12 +1428,12 @@ import sun.misc.FormattedFloatingDecimal;
* FormatFlagsConversionMismatchException} will be thrown.
*
* {@code 'E'}
- * '\u0045'
+ * '\u0045'
* The upper-case variant of {@code 'e'}. The exponent symbol
- * will be {@code 'E'} ('\u0045').
+ * will be {@code 'E'} ( '\u0045'
).
*
* {@code 'g'}
- * '\u0067'
+ * '\u0067'
* Requires the output to be formatted in general scientific notation
* as described below. The localization
* algorithm is applied.
@@ -1458,11 +1458,11 @@ import sun.misc.FormattedFloatingDecimal;
* FormatFlagsConversionMismatchException} will be thrown.
*
* {@code 'G'}
- * '\u0047'
+ * '\u0047'
* The upper-case variant of {@code 'g'}.
*
* {@code 'f'}
- * '\u0066'
+ * '\u0066'
* Requires the output to be formatted using decimal
* format. The localization algorithm is
* applied.
@@ -1510,10 +1510,10 @@ import sun.misc.FormattedFloatingDecimal;
*
*
*
@@ -1530,52 +1530,52 @@ import sun.misc.FormattedFloatingDecimal;
* {@code 't'}
- * '\u0074'
+ * '\u0074'
* Prefix for date and time conversion characters.
* {@code 'T'}
- * '\u0054'
+ * '\u0054'
* The upper-case variant of {@code 't'}.
*
*
*
*
{@code 'H'}
- * '\u0048'
+ * '\u0048'
* Hour of the day for the 24-hour clock, formatted as two digits with
* a leading zero as necessary i.e. {@code 00 - 23}. {@code 00}
* corresponds to midnight.
*
* {@code 'I'}
- * '\u0049'
+ * '\u0049'
* Hour for the 12-hour clock, formatted as two digits with a leading
* zero as necessary, i.e. {@code 01 - 12}. {@code 01} corresponds to
* one o'clock (either morning or afternoon).
*
* {@code 'k'}
- * '\u006b'
+ * '\u006b'
* Hour of the day for the 24-hour clock, i.e. {@code 0 - 23}.
* {@code 0} corresponds to midnight.
*
* {@code 'l'}
- * '\u006c'
+ * '\u006c'
* Hour for the 12-hour clock, i.e. {@code 1 - 12}. {@code 1}
* corresponds to one o'clock (either morning or afternoon).
*
* {@code 'M'}
- * '\u004d'
+ * '\u004d'
* Minute within the hour formatted as two digits with a leading zero
* as necessary, i.e. {@code 00 - 59}.
*
* {@code 'S'}
- * '\u0053'
+ * '\u0053'
* Seconds within the minute, formatted as two digits with a leading
* zero as necessary, i.e. {@code 00 - 60} ("{@code 60}" is a special
* value required to support leap seconds).
*
* {@code 'L'}
- * '\u004c'
+ * '\u004c'
* Millisecond within the second formatted as three digits with
* leading zeros as necessary, i.e. {@code 000 - 999}.
*
* {@code 'N'}
- * '\u004e'
+ * '\u004e'
* Nanosecond within the second, formatted as nine digits with leading
* zeros as necessary, i.e. {@code 000000000 - 999999999}. The precision
* of this value is limited by the resolution of the underlying operating
* system or hardware.
*
* {@code 'p'}
- * '\u0070'
+ * '\u0070'
* Locale-specific {@linkplain
* java.text.DateFormatSymbols#getAmPmStrings morning or afternoon} marker
* in lower case, e.g."{@code am}" or "{@code pm}". Use of the
@@ -1585,7 +1585,7 @@ import sun.misc.FormattedFloatingDecimal;
* upper-case output.)
*
* {@code 'z'}
- * '\u007a'
+ * '\u007a'
* RFC 822
* style numeric time zone offset from GMT, e.g. {@code -0800}. This
* value will be adjusted as necessary for Daylight Saving Time. For
@@ -1594,7 +1594,7 @@ import sun.misc.FormattedFloatingDecimal;
* instance of the Java virtual machine.
*
* {@code 'Z'}
- * '\u005a'
+ * '\u005a'
* A string representing the abbreviation for the time zone. This
* value will be adjusted as necessary for Daylight Saving Time. For
* {@code long}, {@link Long}, and {@link Date} the time zone used is
@@ -1603,13 +1603,13 @@ import sun.misc.FormattedFloatingDecimal;
* supersede the locale of the argument (if any).
*
* {@code 's'}
- * '\u0073'
+ * '\u0073'
* Seconds since the beginning of the epoch starting at 1 January 1970
* {@code 00:00:00} UTC, i.e. {@code Long.MIN_VALUE/1000} to
* {@code Long.MAX_VALUE/1000}.
*
* {@code 'Q'}
- * '\u004f'
+ * '\u004f'
* Milliseconds since the beginning of the epoch starting at 1 January
* 1970 {@code 00:00:00} UTC, i.e. {@code Long.MIN_VALUE} to
* {@code Long.MAX_VALUE}. The precision of this value is limited by
@@ -1622,68 +1622,68 @@ import sun.misc.FormattedFloatingDecimal;
*
*
*
{@code 'B'}
- * '\u0042'
+ * '\u0042'
* Locale-specific {@linkplain java.text.DateFormatSymbols#getMonths
* full month name}, e.g. {@code "January"}, {@code "February"}.
*
* {@code 'b'}
- * '\u0062'
+ * '\u0062'
* Locale-specific {@linkplain
* java.text.DateFormatSymbols#getShortMonths abbreviated month name},
* e.g. {@code "Jan"}, {@code "Feb"}.
*
* {@code 'h'}
- * '\u0068'
+ * '\u0068'
* Same as {@code 'b'}.
*
* {@code 'A'}
- * '\u0041'
+ * '\u0041'
* Locale-specific full name of the {@linkplain
* java.text.DateFormatSymbols#getWeekdays day of the week},
* e.g. {@code "Sunday"}, {@code "Monday"}
*
* {@code 'a'}
- * '\u0061'
+ * '\u0061'
* Locale-specific short name of the {@linkplain
* java.text.DateFormatSymbols#getShortWeekdays day of the week},
* e.g. {@code "Sun"}, {@code "Mon"}
*
* {@code 'C'}
- * '\u0043'
+ * '\u0043'
* Four-digit year divided by {@code 100}, formatted as two digits
* with leading zero as necessary, i.e. {@code 00 - 99}
*
* {@code 'Y'}
- * '\u0059' Year, formatted to at least
+ * '\u0059'
Year, formatted to at least
* four digits with leading zeros as necessary, e.g. {@code 0092} equals
* {@code 92} CE for the Gregorian calendar.
*
* {@code 'y'}
- * '\u0079'
+ * '\u0079'
* Last two digits of the year, formatted with leading zeros as
* necessary, i.e. {@code 00 - 99}.
*
* {@code 'j'}
- * '\u006a'
+ * '\u006a'
* Day of year, formatted as three digits with leading zeros as
* necessary, e.g. {@code 001 - 366} for the Gregorian calendar.
* {@code 001} corresponds to the first day of the year.
*
* {@code 'm'}
- * '\u006d'
+ * '\u006d'
* Month, formatted as two digits with leading zeros as necessary,
* i.e. {@code 01 - 13}, where "{@code 01}" is the first month of the
* year and ("{@code 13}" is a special value required to support lunar
* calendars).
*
* {@code 'd'}
- * '\u0064'
+ * '\u0064'
* Day of month, formatted as two digits with leading zeros as
* necessary, i.e. {@code 01 - 31}, where "{@code 01}" is the first day
* of the month.
*
* {@code 'e'}
- * '\u0065'
+ * '\u0065'
* Day of month, formatted as two digits, i.e. {@code 1 - 31} where
* "{@code 1}" is the first day of the month.
*
@@ -1695,30 +1695,30 @@ import sun.misc.FormattedFloatingDecimal;
*
*
*
{@code 'R'}
- * '\u0052'
+ * '\u0052'
* Time formatted for the 24-hour clock as {@code "%tH:%tM"}
*
* {@code 'T'}
- * '\u0054'
+ * '\u0054'
* Time formatted for the 24-hour clock as {@code "%tH:%tM:%tS"}.
*
* {@code 'r'}
- * '\u0072'
+ * '\u0072'
* Time formatted for the 12-hour clock as {@code "%tI:%tM:%tS
* %Tp"}. The location of the morning or afternoon marker
* ({@code '%Tp'}) may be locale-dependent.
*
* {@code 'D'}
- * '\u0044'
+ * '\u0044'
* Date formatted as {@code "%tm/%td/%ty"}.
*
* {@code 'F'}
- * '\u0046'
+ * '\u0046'
* ISO 8601
* complete date formatted as {@code "%tY-%tm-%td"}.
*
* {@code 'c'}
- * '\u0063'
+ * '\u0063'
* Date and time formatted as {@code "%ta %tb %td %tT %tZ %tY"},
* e.g. {@code "Sun Jul 20 16:17:00 EDT 1969"}.
*
@@ -1731,7 +1731,7 @@ import sun.misc.FormattedFloatingDecimal;
* '\u0020'
) until the total number of characters equals width.
* The padding is on the left by default. If the {@code '-'} flag is given
* then the padding will be on the right. If width is not specified then there
* is no minimum.
@@ -1746,12 +1746,12 @@ import sun.misc.FormattedFloatingDecimal;
*
*
*
{@code '%'}
- * The result is a literal {@code '%'} ('\u0025')
+ * The result is a literal {@code '%'} ( '\u0025'
)
*
* '\u0020'
) until the total number of
* characters equals width. The padding is on the left. If width is not
* specified then just the {@code '%'} is output.
*
@@ -1801,7 +1801,7 @@ import sun.misc.FormattedFloatingDecimal;
*
*
* '\u003c'
) flag which causes the argument for
* the previous format specifier to be re-used. If there is no previous
* argument, then a {@link MissingFormatArgumentException} is thrown.
*
diff --git a/jdk/src/java.base/share/classes/java/util/FormatterClosedException.java b/jdk/src/java.base/share/classes/java/util/FormatterClosedException.java
index b0aa872fa81..856dc974fc0 100644
--- a/jdk/src/java.base/share/classes/java/util/FormatterClosedException.java
+++ b/jdk/src/java.base/share/classes/java/util/FormatterClosedException.java
@@ -28,7 +28,7 @@ package java.util;
/**
* Unchecked exception thrown when the formatter has been closed.
*
- *