# HG changeset patch
# User duke
# Date 1499280335 -7200
# Node ID 2f4e33b3de4e54248e4fd50a3546a21a4b8f73e1
# Parent 23662c20a4420c8aad6da61a806a8e9d22f41845# Parent ff1303c5758778475b034958a17de0c0316c7433
Merge
diff -r 23662c20a442 -r 2f4e33b3de4e .hgtags-top-repo
--- a/.hgtags-top-repo Thu Aug 13 14:15:11 2015 -0700
+++ b/.hgtags-top-repo Wed Jul 05 20:45:35 2017 +0200
@@ -319,3 +319,4 @@
57f3134853ecdd4a3ee2d4d26f22ba981d653d79 jdk9-b74
8fd6eeb878606e39c908f12535f34ebbfd225a4a jdk9-b75
d82072b699b880a1f647a5e2d7c0f86cec958941 jdk9-b76
+7972dc8f2a47f0c4cd8f02fa5662af41f028aa14 jdk9-b77
diff -r 23662c20a442 -r 2f4e33b3de4e corba/.hgtags
--- a/corba/.hgtags Thu Aug 13 14:15:11 2015 -0700
+++ b/corba/.hgtags Wed Jul 05 20:45:35 2017 +0200
@@ -319,3 +319,4 @@
622fe934e351e89107edf3c667d6b57f543f58f1 jdk9-b74
960b56805abd8460598897481820bd6a75f979e7 jdk9-b75
d8126bc88fa5cd1ae4e44d86a4b1280ca1c9e2aa jdk9-b76
+8bb2441c0fec8b28f7bf11a0ca3ec1642e7ef457 jdk9-b77
diff -r 23662c20a442 -r 2f4e33b3de4e hotspot/.hgtags
--- a/hotspot/.hgtags Thu Aug 13 14:15:11 2015 -0700
+++ b/hotspot/.hgtags Wed Jul 05 20:45:35 2017 +0200
@@ -479,3 +479,4 @@
fff6b54e9770ac4c12c2fb4cab5aa7672affa4bd jdk9-b74
2f354281e9915275693c4e519a959b8a6f22d3a3 jdk9-b75
0bc8d1656d6f2b1fdfe803c1305a108bb9939f35 jdk9-b76
+e66c3813789debfc06f206afde1bf7a84cb08451 jdk9-b77
diff -r 23662c20a442 -r 2f4e33b3de4e hotspot/src/cpu/aarch64/vm/aarch64.ad
--- a/hotspot/src/cpu/aarch64/vm/aarch64.ad Thu Aug 13 14:15:11 2015 -0700
+++ b/hotspot/src/cpu/aarch64/vm/aarch64.ad Wed Jul 05 20:45:35 2017 +0200
@@ -2389,9 +2389,11 @@
// 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 @@
// 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 @@
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 @@
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 -r 23662c20a442 -r 2f4e33b3de4e hotspot/src/cpu/aarch64/vm/c1_CodeStubs_aarch64.cpp
--- a/hotspot/src/cpu/aarch64/vm/c1_CodeStubs_aarch64.cpp Thu Aug 13 14:15:11 2015 -0700
+++ b/hotspot/src/cpu/aarch64/vm/c1_CodeStubs_aarch64.cpp Wed Jul 05 20:45:35 2017 +0200
@@ -327,9 +327,16 @@
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 -r 23662c20a442 -r 2f4e33b3de4e hotspot/src/cpu/aarch64/vm/c1_LIRAssembler_aarch64.cpp
--- a/hotspot/src/cpu/aarch64/vm/c1_LIRAssembler_aarch64.cpp Thu Aug 13 14:15:11 2015 -0700
+++ b/hotspot/src/cpu/aarch64/vm/c1_LIRAssembler_aarch64.cpp Wed Jul 05 20:45:35 2017 +0200
@@ -1996,13 +1996,21 @@
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 -r 23662c20a442 -r 2f4e33b3de4e hotspot/src/cpu/aarch64/vm/c1_LIRAssembler_aarch64.hpp
--- a/hotspot/src/cpu/aarch64/vm/c1_LIRAssembler_aarch64.hpp Thu Aug 13 14:15:11 2015 -0700
+++ b/hotspot/src/cpu/aarch64/vm/c1_LIRAssembler_aarch64.hpp Wed Jul 05 20:45:35 2017 +0200
@@ -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 -r 23662c20a442 -r 2f4e33b3de4e hotspot/src/cpu/aarch64/vm/compiledIC_aarch64.cpp
--- a/hotspot/src/cpu/aarch64/vm/compiledIC_aarch64.cpp Thu Aug 13 14:15:11 2015 -0700
+++ b/hotspot/src/cpu/aarch64/vm/compiledIC_aarch64.cpp Wed Jul 05 20:45:35 2017 +0200
@@ -51,7 +51,7 @@
// ----------------------------------------------------------------------------
#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 @@
// 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 @@
assert((__ offset() - offset) <= (int)to_interp_stub_size(), "stub too big");
__ end_a_stub();
+ return base;
}
#undef __
diff -r 23662c20a442 -r 2f4e33b3de4e hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp
--- a/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp Thu Aug 13 14:15:11 2015 -0700
+++ b/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp Wed Jul 05 20:45:35 2017 +0200
@@ -664,7 +664,7 @@
// 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 @@
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 @@
} else {
bl(pc());
}
+ // just need to return a non-null address
+ return pc();
}
@@ -696,13 +701,11 @@
// 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 @@
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 -r 23662c20a442 -r 2f4e33b3de4e hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.hpp
--- a/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.hpp Thu Aug 13 14:15:11 2015 -0700
+++ b/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.hpp Wed Jul 05 20:45:35 2017 +0200
@@ -539,7 +539,7 @@
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 @@
// 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 @@
}
// Emit the CompiledIC call idiom
- void ic_call(address entry);
+ address ic_call(address entry);
public:
diff -r 23662c20a442 -r 2f4e33b3de4e hotspot/src/cpu/ppc/vm/compiledIC_ppc.cpp
--- a/hotspot/src/cpu/ppc/vm/compiledIC_ppc.cpp Thu Aug 13 14:15:11 2015 -0700
+++ b/hotspot/src/cpu/ppc/vm/compiledIC_ppc.cpp Wed Jul 05 20:45:35 2017 +0200
@@ -94,7 +94,7 @@
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 @@
// 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 @@
// End the stub.
__ end_a_stub();
+ return stub;
#else
ShouldNotReachHere();
#endif
diff -r 23662c20a442 -r 2f4e33b3de4e hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.cpp
--- a/hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.cpp Thu Aug 13 14:15:11 2015 -0700
+++ b/hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.cpp Wed Jul 05 20:45:35 2017 +0200
@@ -2187,7 +2187,7 @@
}
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 -r 23662c20a442 -r 2f4e33b3de4e hotspot/src/cpu/ppc/vm/ppc.ad
--- a/hotspot/src/cpu/ppc/vm/ppc.ad Thu Aug 13 14:15:11 2015 -0700
+++ b/hotspot/src/cpu/ppc/vm/ppc.ad Wed Jul 05 20:45:35 2017 +0200
@@ -1082,7 +1082,7 @@
// 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 @@
// 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 @@
// 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 @@
__ 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 @@
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 -r 23662c20a442 -r 2f4e33b3de4e hotspot/src/cpu/sparc/vm/c1_CodeStubs_sparc.cpp
--- a/hotspot/src/cpu/sparc/vm/c1_CodeStubs_sparc.cpp Thu Aug 13 14:15:11 2015 -0700
+++ b/hotspot/src/cpu/sparc/vm/c1_CodeStubs_sparc.cpp Wed Jul 05 20:45:35 2017 +0200
@@ -432,6 +432,9 @@
__ 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 -r 23662c20a442 -r 2f4e33b3de4e hotspot/src/cpu/sparc/vm/compiledIC_sparc.cpp
--- a/hotspot/src/cpu/sparc/vm/compiledIC_sparc.cpp Thu Aug 13 14:15:11 2015 -0700
+++ b/hotspot/src/cpu/sparc/vm/compiledIC_sparc.cpp Wed Jul 05 20:45:35 2017 +0200
@@ -53,7 +53,7 @@
// ----------------------------------------------------------------------------
#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 @@
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 @@
// Update current stubs pointer and restore code_end.
__ end_a_stub();
+ return base;
#else
ShouldNotReachHere();
#endif
diff -r 23662c20a442 -r 2f4e33b3de4e hotspot/src/cpu/sparc/vm/interp_masm_sparc.cpp
--- a/hotspot/src/cpu/sparc/vm/interp_masm_sparc.cpp Thu Aug 13 14:15:11 2015 -0700
+++ b/hotspot/src/cpu/sparc/vm/interp_masm_sparc.cpp Wed Jul 05 20:45:35 2017 +0200
@@ -2314,7 +2314,7 @@
}
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 -r 23662c20a442 -r 2f4e33b3de4e hotspot/src/cpu/sparc/vm/sparc.ad
--- a/hotspot/src/cpu/sparc/vm/sparc.ad Thu Aug 13 14:15:11 2015 -0700
+++ b/hotspot/src/cpu/sparc/vm/sparc.ad Wed Jul 05 20:45:35 2017 +0200
@@ -1773,9 +1773,11 @@
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 @@
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 @@
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 -r 23662c20a442 -r 2f4e33b3de4e hotspot/src/cpu/x86/vm/c1_CodeStubs_x86.cpp
--- a/hotspot/src/cpu/x86/vm/c1_CodeStubs_x86.cpp Thu Aug 13 14:15:11 2015 -0700
+++ b/hotspot/src/cpu/x86/vm/c1_CodeStubs_x86.cpp Wed Jul 05 20:45:35 2017 +0200
@@ -503,6 +503,9 @@
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 -r 23662c20a442 -r 2f4e33b3de4e hotspot/src/cpu/x86/vm/compiledIC_x86.cpp
--- a/hotspot/src/cpu/x86/vm/compiledIC_x86.cpp Thu Aug 13 14:15:11 2015 -0700
+++ b/hotspot/src/cpu/x86/vm/compiledIC_x86.cpp Wed Jul 05 20:45:35 2017 +0200
@@ -50,7 +50,7 @@
// ----------------------------------------------------------------------------
#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 @@
// 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 @@
// Update current stubs pointer and restore insts_end.
__ end_a_stub();
+ return base;
}
#undef __
diff -r 23662c20a442 -r 2f4e33b3de4e hotspot/src/cpu/x86/vm/x86.ad
--- a/hotspot/src/cpu/x86/vm/x86.ad Thu Aug 13 14:15:11 2015 -0700
+++ b/hotspot/src/cpu/x86/vm/x86.ad Wed Jul 05 20:45:35 2017 +0200
@@ -1594,7 +1594,10 @@
// 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 @@
// 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 -r 23662c20a442 -r 2f4e33b3de4e hotspot/src/cpu/x86/vm/x86_32.ad
--- a/hotspot/src/cpu/x86/vm/x86_32.ad Thu Aug 13 14:15:11 2015 -0700
+++ b/hotspot/src/cpu/x86/vm/x86_32.ad Wed Jul 05 20:45:35 2017 +0200
@@ -1907,7 +1907,11 @@
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 -r 23662c20a442 -r 2f4e33b3de4e hotspot/src/cpu/x86/vm/x86_64.ad
--- a/hotspot/src/cpu/x86/vm/x86_64.ad Thu Aug 13 14:15:11 2015 -0700
+++ b/hotspot/src/cpu/x86/vm/x86_64.ad Wed Jul 05 20:45:35 2017 +0200
@@ -2137,7 +2137,11 @@
}
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 -r 23662c20a442 -r 2f4e33b3de4e hotspot/src/cpu/zero/vm/compiledIC_zero.cpp
--- a/hotspot/src/cpu/zero/vm/compiledIC_zero.cpp Thu Aug 13 14:15:11 2015 -0700
+++ b/hotspot/src/cpu/zero/vm/compiledIC_zero.cpp Wed Jul 05 20:45:35 2017 +0200
@@ -60,8 +60,9 @@
// ----------------------------------------------------------------------------
-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 -r 23662c20a442 -r 2f4e33b3de4e hotspot/src/os/aix/vm/os_aix.cpp
--- a/hotspot/src/os/aix/vm/os_aix.cpp Thu Aug 13 14:15:11 2015 -0700
+++ b/hotspot/src/os/aix/vm/os_aix.cpp Wed Jul 05 20:45:35 2017 +0200
@@ -971,34 +971,32 @@
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);
-
- 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();
+ 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();
+ 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 -r 23662c20a442 -r 2f4e33b3de4e hotspot/src/os/aix/vm/os_aix.hpp
--- a/hotspot/src/os/aix/vm/os_aix.hpp Thu Aug 13 14:15:11 2015 -0700
+++ b/hotspot/src/os/aix/vm/os_aix.hpp Wed Jul 05 20:45:35 2017 +0200
@@ -131,8 +131,6 @@
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 -r 23662c20a442 -r 2f4e33b3de4e hotspot/src/os/bsd/vm/os_bsd.cpp
--- a/hotspot/src/os/bsd/vm/os_bsd.cpp Thu Aug 13 14:15:11 2015 -0700
+++ b/hotspot/src/os/bsd/vm/os_bsd.cpp Wed Jul 05 20:45:35 2017 +0200
@@ -739,40 +739,35 @@
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);
-
- 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();
+ // 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();
+ 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 -r 23662c20a442 -r 2f4e33b3de4e hotspot/src/os/bsd/vm/os_bsd.hpp
--- a/hotspot/src/os/bsd/vm/os_bsd.hpp Thu Aug 13 14:15:11 2015 -0700
+++ b/hotspot/src/os/bsd/vm/os_bsd.hpp Wed Jul 05 20:45:35 2017 +0200
@@ -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 @@
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 @@
*
*
*
+ * @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 -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/share/classes/java/lang/ref/Finalizer.java
--- a/jdk/src/java.base/share/classes/java/lang/ref/Finalizer.java Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/lang/ref/Finalizer.java Wed Jul 05 20:45:35 2017 +0200
@@ -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 @@
add();
}
+ static ReferenceQueue
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 @@ * @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 @@ * @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 @@ *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 @@ * @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 @@ * *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 @@ * @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 @@ *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 @@ *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 @@ * * @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 @@ * 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 @@ * *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 @@ *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 @@ * @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 @@ * 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 @@ * *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 @@ * 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 @@ * 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 @@ * *
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 @@ * *
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 -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/share/classes/java/nio/channels/AsynchronousSocketChannel.java --- a/jdk/src/java.base/share/classes/java/nio/channels/AsynchronousSocketChannel.java Thu Aug 13 14:15:11 2015 -0700 +++ b/jdk/src/java.base/share/classes/java/nio/channels/AsynchronousSocketChannel.java Wed Jul 05 20:45:35 2017 +0200 @@ -452,11 +452,11 @@ * at the moment that the read is attempted. * *{@code * buf.clear(); // Prepare buffer for use @@ -1206,7 +1205,7 @@ /** * 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 @@ * 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 @@ * * @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 @@ * *
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 @@ *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 @@ * * @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 @@ * 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 @@ * 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 @@ * 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 @@ * * @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 @@ * 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 @@ * 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 @@ * 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 -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/share/classes/java/nio/channels/AsynchronousByteChannel.java --- a/jdk/src/java.base/share/classes/java/nio/channels/AsynchronousByteChannel.java Thu Aug 13 14:15:11 2015 -0700 +++ b/jdk/src/java.base/share/classes/java/nio/channels/AsynchronousByteChannel.java Wed Jul 05 20:45:35 2017 +0200 @@ -70,13 +70,13 @@ * {@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 @@ * {@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 -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/share/classes/java/nio/channels/AsynchronousServerSocketChannel.java --- a/jdk/src/java.base/share/classes/java/nio/channels/AsynchronousServerSocketChannel.java Thu Aug 13 14:15:11 2015 -0700 +++ b/jdk/src/java.base/share/classes/java/nio/channels/AsynchronousServerSocketChannel.java Wed Jul 05 20:45:35 2017 +0200 @@ -41,7 +41,7 @@ * 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 @@ * 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 @@ *
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 @@ * 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 -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/share/classes/java/nio/channels/Channel.java --- a/jdk/src/java.base/share/classes/java/nio/channels/Channel.java Thu Aug 13 14:15:11 2015 -0700 +++ b/jdk/src/java.base/share/classes/java/nio/channels/Channel.java Wed Jul 05 20:45:35 2017 +0200 @@ -58,7 +58,7 @@ /** * 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 -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/share/classes/java/nio/channels/DatagramChannel.java --- a/jdk/src/java.base/share/classes/java/nio/channels/DatagramChannel.java Thu Aug 13 14:15:11 2015 -0700 +++ b/jdk/src/java.base/share/classes/java/nio/channels/DatagramChannel.java Wed Jul 05 20:45:35 2017 +0200 @@ -187,8 +187,8 @@ * 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 @@ * 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 @@ * 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 -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/share/classes/java/nio/channels/FileChannel.java --- a/jdk/src/java.base/share/classes/java/nio/channels/FileChannel.java Thu Aug 13 14:15:11 2015 -0700 +++ b/jdk/src/java.base/share/classes/java/nio/channels/FileChannel.java Wed Jul 05 20:45:35 2017 +0200 @@ -63,7 +63,7 @@ * *
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 @@ * 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 @@ * 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 @@ *
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 @@ * 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 @@ * 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 @@ * 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 @@ * 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 @@ * *
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 @@ * @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 @@ * 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 @@ * * @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 @@ * 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 @@ /** * 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 @@ * 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 @@ * * @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 @@ /** * 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 -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/share/classes/java/nio/channels/FileLock.java --- a/jdk/src/java.base/share/classes/java/nio/channels/FileLock.java Thu Aug 13 14:15:11 2015 -0700 +++ b/jdk/src/java.base/share/classes/java/nio/channels/FileLock.java Wed Jul 05 20:45:35 2017 +0200 @@ -136,11 +136,11 @@ * * @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 @@ * * @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 @@ /** * 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 @@ * @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 @@ *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 -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/share/classes/java/nio/channels/GatheringByteChannel.java --- a/jdk/src/java.base/share/classes/java/nio/channels/GatheringByteChannel.java Thu Aug 13 14:15:11 2015 -0700 +++ b/jdk/src/java.base/share/classes/java/nio/channels/GatheringByteChannel.java Wed Jul 05 20:45:35 2017 +0200 @@ -66,11 +66,11 @@ * 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 @@ * @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 @@ /** * 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 -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/share/classes/java/nio/channels/InterruptibleChannel.java --- a/jdk/src/java.base/share/classes/java/nio/channels/InterruptibleChannel.java Thu Aug 13 14:15:11 2015 -0700 +++ b/jdk/src/java.base/share/classes/java/nio/channels/InterruptibleChannel.java Wed Jul 05 20:45:35 2017 +0200 @@ -54,7 +54,7 @@ * *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 -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/share/classes/java/nio/channels/ReadableByteChannel.java --- a/jdk/src/java.base/share/classes/java/nio/channels/ReadableByteChannel.java Thu Aug 13 14:15:11 2015 -0700 +++ b/jdk/src/java.base/share/classes/java/nio/channels/ReadableByteChannel.java Wed Jul 05 20:45:35 2017 +0200 @@ -52,16 +52,16 @@ * *
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 @@ * @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 -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/share/classes/java/nio/channels/ScatteringByteChannel.java --- a/jdk/src/java.base/share/classes/java/nio/channels/ScatteringByteChannel.java Thu Aug 13 14:15:11 2015 -0700 +++ b/jdk/src/java.base/share/classes/java/nio/channels/ScatteringByteChannel.java Wed Jul 05 20:45:35 2017 +0200 @@ -66,11 +66,11 @@ * 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 @@ * @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 @@ /** * 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 @@ * 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 @@ * 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 @@ * 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 @@ *@@ -136,7 +136,7 @@ * 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 -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/share/classes/java/nio/channels/SelectableChannel.java --- a/jdk/src/java.base/share/classes/java/nio/channels/SelectableChannel.java Thu Aug 13 14:15:11 2015 -0700 +++ b/jdk/src/java.base/share/classes/java/nio/channels/SelectableChannel.java Wed Jul 05 20:45:35 2017 +0200 @@ -132,7 +132,7 @@ * 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 @@ * 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 @@ * *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 @@ * 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 @@ * 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 @@ * *
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 -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/share/classes/java/nio/channels/SelectionKey.java --- a/jdk/src/java.base/share/classes/java/nio/channels/SelectionKey.java Thu Aug 13 14:15:11 2015 -0700 +++ b/jdk/src/java.base/share/classes/java/nio/channels/SelectionKey.java Wed Jul 05 20:45:35 2017 +0200 @@ -139,7 +139,7 @@ *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 @@ * 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 @@ * 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 @@ * 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 @@ * 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 @@ /** * 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 @@ * }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 @@ /** * 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 @@ * }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 @@ * 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 @@ * }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 @@ * 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 @@ * }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 @@ *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 @@ * 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 -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/share/classes/java/nio/channels/Selector.java --- a/jdk/src/java.base/share/classes/java/nio/channels/Selector.java Thu Aug 13 14:15:11 2015 -0700 +++ b/jdk/src/java.base/share/classes/java/nio/channels/Selector.java Wed Jul 05 20:45:35 2017 +0200 @@ -230,7 +230,7 @@ /** * 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 @@ *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 -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/share/classes/java/nio/channels/ServerSocketChannel.java --- a/jdk/src/java.base/share/classes/java/nio/channels/ServerSocketChannel.java Thu Aug 13 14:15:11 2015 -0700 +++ b/jdk/src/java.base/share/classes/java/nio/channels/ServerSocketChannel.java Wed Jul 05 20:45:35 2017 +0200 @@ -223,7 +223,7 @@ * 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 @@ * 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 -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/share/classes/java/nio/channels/SocketChannel.java --- a/jdk/src/java.base/share/classes/java/nio/channels/SocketChannel.java Thu Aug 13 14:15:11 2015 -0700 +++ b/jdk/src/java.base/share/classes/java/nio/channels/SocketChannel.java Wed Jul 05 20:45:35 2017 +0200 @@ -58,7 +58,7 @@ * 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 @@ * *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 @@ * 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 @@ /** * 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 @@ * 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 @@ *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 @@ * @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 @@ * {@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 @@ * 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 -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/share/classes/java/nio/channels/WritableByteChannel.java --- a/jdk/src/java.base/share/classes/java/nio/channels/WritableByteChannel.java Thu Aug 13 14:15:11 2015 -0700 +++ b/jdk/src/java.base/share/classes/java/nio/channels/WritableByteChannel.java Wed Jul 05 20:45:35 2017 +0200 @@ -54,16 +54,16 @@ * *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 -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/share/classes/java/nio/channels/package-info.java --- a/jdk/src/java.base/share/classes/java/nio/channels/package-info.java Thu Aug 13 14:15:11 2015 -0700 +++ b/jdk/src/java.base/share/classes/java/nio/channels/package-info.java Wed Jul 05 20:45:35 2017 +0200 @@ -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 -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/share/classes/java/nio/channels/spi/AbstractInterruptibleChannel.java --- a/jdk/src/java.base/share/classes/java/nio/channels/spi/AbstractInterruptibleChannel.java Thu Aug 13 14:15:11 2015 -0700 +++ b/jdk/src/java.base/share/classes/java/nio/channels/spi/AbstractInterruptibleChannel.java Wed Jul 05 20:45:35 2017 +0200 @@ -46,7 +46,7 @@ * 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 @@ * 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 @@ * 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 @@ * 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 -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/share/classes/java/nio/channels/spi/AbstractSelectableChannel.java --- a/jdk/src/java.base/share/classes/java/nio/channels/spi/AbstractSelectableChannel.java Thu Aug 13 14:15:11 2015 -0700 +++ b/jdk/src/java.base/share/classes/java/nio/channels/spi/AbstractSelectableChannel.java Wed Jul 05 20:45:35 2017 +0200 @@ -305,8 +305,8 @@ * 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 -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/share/classes/java/nio/channels/spi/AbstractSelector.java --- a/jdk/src/java.base/share/classes/java/nio/channels/spi/AbstractSelector.java Thu Aug 13 14:15:11 2015 -0700 +++ b/jdk/src/java.base/share/classes/java/nio/channels/spi/AbstractSelector.java Wed Jul 05 20:45:35 2017 +0200 @@ -43,7 +43,7 @@ * 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 @@ * 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 @@ * 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 -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/share/classes/java/nio/channels/spi/AsynchronousChannelProvider.java --- a/jdk/src/java.base/share/classes/java/nio/channels/spi/AsynchronousChannelProvider.java Thu Aug 13 14:15:11 2015 -0700 +++ b/jdk/src/java.base/share/classes/java/nio/channels/spi/AsynchronousChannelProvider.java Wed Jul 05 20:45:35 2017 +0200 @@ -64,7 +64,7 @@ * * @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 @@ ** *
- @@ -145,8 +145,8 @@ *
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 -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/share/classes/java/nio/channels/spi/SelectorProvider.java --- a/jdk/src/java.base/share/classes/java/nio/channels/spi/SelectorProvider.java Thu Aug 13 14:15:11 2015 -0700 +++ b/jdk/src/java.base/share/classes/java/nio/channels/spi/SelectorProvider.java Wed Jul 05 20:45:35 2017 +0200 @@ -46,7 +46,7 @@ * #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 @@ * 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 @@ * * @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 @@ *
* *
- @@ -150,8 +150,8 @@ *
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 @@ * 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 -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/share/classes/java/nio/charset/Charset-X-Coder.java.template --- a/jdk/src/java.base/share/classes/java/nio/charset/Charset-X-Coder.java.template Thu Aug 13 14:15:11 2015 -0700 +++ b/jdk/src/java.base/share/classes/java/nio/charset/Charset-X-Coder.java.template Wed Jul 05 20:45:35 2017 +0200 @@ -55,12 +55,12 @@ * 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 @@ * 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 @@ *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 @@ * 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 @@ * 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 @@ * @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 @@ * 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 @@ * 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 @@ * *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 @@ * 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 @@ /** * 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 @@ * @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 @@ * 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 @@ * @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 -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/share/classes/java/nio/charset/Charset.java --- a/jdk/src/java.base/share/classes/java/nio/charset/Charset.java Thu Aug 13 14:15:11 2015 -0700 +++ b/jdk/src/java.base/share/classes/java/nio/charset/Charset.java Wed Jul 05 20:45:35 2017 +0200 @@ -73,29 +73,29 @@ * *
'\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 @@ * 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 @@ * *
* - **
- * 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 @@ * 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 @@ * 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 @@ * 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 @@ * 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 @@ *
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 @@ * 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 @@ * 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 @@ * 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 @@ /** * 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 @@ *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 -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/share/classes/java/nio/charset/CoderResult.java --- a/jdk/src/java.base/share/classes/java/nio/charset/CoderResult.java Thu Aug 13 14:15:11 2015 -0700 +++ b/jdk/src/java.base/share/classes/java/nio/charset/CoderResult.java Wed Jul 05 20:45:35 2017 +0200 @@ -46,24 +46,24 @@ * 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 @@ * *
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 @@ /** * 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 @@ /** * 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 @@ /** * 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 @@ /** * 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 @@ * 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 @@ * * @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 -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/share/classes/java/nio/charset/package-info.java --- a/jdk/src/java.base/share/classes/java/nio/charset/package-info.java Thu Aug 13 14:15:11 2015 -0700 +++ b/jdk/src/java.base/share/classes/java/nio/charset/package-info.java Wed Jul 05 20:45:35 2017 +0200 @@ -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 -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/share/classes/java/nio/charset/spi/CharsetProvider.java --- a/jdk/src/java.base/share/classes/java/nio/charset/spi/CharsetProvider.java Thu Aug 13 14:15:11 2015 -0700 +++ b/jdk/src/java.base/share/classes/java/nio/charset/spi/CharsetProvider.java Wed Jul 05 20:45:35 2017 +0200 @@ -42,13 +42,13 @@ * 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 @@
*
* @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 @@
* 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 -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/share/classes/java/nio/exceptions
--- a/jdk/src/java.base/share/classes/java/nio/exceptions Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/nio/exceptions Wed Jul 05 20:45:35 2017 +0200
@@ -56,5 +56,5 @@
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 -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/share/classes/java/nio/file/FileSystem.java
--- a/jdk/src/java.base/share/classes/java/nio/file/FileSystem.java Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/nio/file/FileSystem.java Wed Jul 05 20:45:35 2017 +0200
@@ -202,7 +202,7 @@
*
*
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 @@ * 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 @@
* 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 -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/share/classes/java/nio/file/spi/FileSystemProvider.java
--- a/jdk/src/java.base/share/classes/java/nio/file/spi/FileSystemProvider.java Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/nio/file/spi/FileSystemProvider.java Wed Jul 05 20:45:35 2017 +0200
@@ -102,7 +102,7 @@
*
* @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 @@
* 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 @@
* 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 @@
* 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 -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/share/classes/java/nio/file/spi/FileTypeDetector.java
--- a/jdk/src/java.base/share/classes/java/nio/file/spi/FileTypeDetector.java Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/nio/file/spi/FileTypeDetector.java Wed Jul 05 20:45:35 2017 +0200
@@ -62,7 +62,7 @@
*
* @throws SecurityException
* If a security manager has been installed and it denies
- * {@link RuntimePermission}("fileTypeDetector")
+ * {@link RuntimePermission}{@code ("fileTypeDetector")}
*/
protected FileTypeDetector() {
this(checkPermission());
diff -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/share/classes/java/nio/file/spi/package-info.java
--- a/jdk/src/java.base/share/classes/java/nio/file/spi/package-info.java Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/nio/file/spi/package-info.java Wed Jul 05 20:45:35 2017 +0200
@@ -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 -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/share/classes/java/nio/package-info.java
--- a/jdk/src/java.base/share/classes/java/nio/package-info.java Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/nio/package-info.java Wed Jul 05 20:45:35 2017 +0200
@@ -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 -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/share/classes/java/security/SecurityPermission.java
--- a/jdk/src/java.base/share/classes/java/security/SecurityPermission.java Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/security/SecurityPermission.java Wed Jul 05 20:45:35 2017 +0200
@@ -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.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 @@
* {@inheritDoc}
*
* @implSpec
- * This implementation returns size() == 0.
+ * This implementation returns {@code size() == 0}.
*/
public boolean isEmpty() {
return size() == 0;
@@ -255,7 +255,7 @@
*
* @implSpec
* This implementation always throws an
- * UnsupportedOperationException.
+ * {@code UnsupportedOperationException}.
*
* @throws UnsupportedOperationException {@inheritDoc}
* @throws ClassCastException {@inheritDoc}
@@ -276,8 +276,8 @@
* from the collection using the iterator's remove method.
*
* 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 @@
* This implementation iterates over the specified collection,
* checking each element returned by the iterator in turn to see
* if it's contained in this collection. If all elements are so
- * contained true is returned, otherwise false.
+ * contained {@code true} is returned, otherwise {@code false}.
*
* @throws ClassCastException {@inheritDoc}
* @throws NullPointerException {@inheritDoc}
@@ -335,7 +335,7 @@
* each object returned by the iterator to this collection, in turn.
*
* 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 @@
* This implementation iterates over this collection, checking each
* element returned by the iterator in turn to see if it's contained
* in the specified collection. If it's so contained, it's removed from
- * this collection with the iterator's remove method.
+ * this collection with the iterator's {@code remove} method.
*
* 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 @@
* This implementation iterates over this collection, checking each
* element returned by the iterator in turn to see if it's contained
* in the specified collection. If it's not so contained, it's removed
- * from this collection with the iterator's remove method.
+ * from this collection with the iterator's {@code remove} method.
*
* 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 @@
*
* @implSpec
* This implementation iterates over this collection, removing each
- * element using the Iterator.remove operation. Most
+ * element using the {@code Iterator.remove} operation. Most
* implementations will probably choose to override this method for
* efficiency.
*
* 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 @@
* Returns a string representation of this collection. The string
* representation consists of a list of the collection's elements in the
* order they are returned by its iterator, enclosed in square brackets
- * ("[]"). Adjacent elements are separated by the characters
- * ", " (comma and space). Elements are converted to strings as
+ * ({@code "[]"}). Adjacent elements are separated by the characters
+ * {@code ", "} (comma and space). Elements are converted to strings as
* by {@link String#valueOf(Object)}.
*
* @return a string representation of this collection
diff -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/share/classes/java/util/AbstractMap.java
--- a/jdk/src/java.base/share/classes/java/util/AbstractMap.java Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/util/AbstractMap.java Wed Jul 05 20:45:35 2017 +0200
@@ -27,24 +27,24 @@
import java.util.Map.Entry;
/**
- * This class provides a skeletal implementation of the Map
+ * This class provides a skeletal implementation of the {@code Map}
* interface, to minimize the effort required to implement this interface.
*
* 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 @@
* {@inheritDoc}
*
* @implSpec
- * This implementation returns entrySet().size().
+ * This implementation returns {@code entrySet().size()}.
*/
public int size() {
return entrySet().size();
@@ -89,7 +89,7 @@
* {@inheritDoc}
*
* @implSpec
- * This implementation returns size() == 0.
+ * This implementation returns {@code size() == 0}.
*/
public boolean isEmpty() {
return size() == 0;
@@ -99,10 +99,10 @@
* {@inheritDoc}
*
* @implSpec
- * This implementation iterates over entrySet() searching
+ * This implementation iterates over {@code entrySet()} searching
* for an entry with the specified value. If such an entry is found,
- * true is returned. If the iteration terminates without
- * finding such an entry, false is returned. Note that this
+ * {@code true} is returned. If the iteration terminates without
+ * finding such an entry, {@code false} is returned. Note that this
* implementation requires linear time in the size of the map.
*
* @throws ClassCastException {@inheritDoc}
@@ -130,10 +130,10 @@
* {@inheritDoc}
*
* @implSpec
- * This implementation iterates over entrySet() searching
+ * This implementation iterates over {@code entrySet()} searching
* for an entry with the specified key. If such an entry is found,
- * true is returned. If the iteration terminates without
- * finding such an entry, false is returned. Note that this
+ * {@code true} is returned. If the iteration terminates without
+ * finding such an entry, {@code false} is returned. Note that this
* implementation requires linear time in the size of the map; many
* implementations will override this method.
*
@@ -162,10 +162,10 @@
* {@inheritDoc}
*
* @implSpec
- * This implementation iterates over entrySet() searching
+ * This implementation iterates over {@code entrySet()} searching
* for an entry with the specified key. If such an entry is found,
* the entry's value is returned. If the iteration terminates without
- * finding such an entry, null is returned. Note that this
+ * finding such an entry, {@code null} is returned. Note that this
* implementation requires linear time in the size of the map; many
* implementations will override this method.
*
@@ -198,7 +198,7 @@
*
* @implSpec
* This implementation always throws an
- * UnsupportedOperationException.
+ * {@code UnsupportedOperationException}.
*
* @throws UnsupportedOperationException {@inheritDoc}
* @throws ClassCastException {@inheritDoc}
@@ -213,18 +213,18 @@
* {@inheritDoc}
*
* @implSpec
- * This implementation iterates over entrySet() searching for an
+ * This implementation iterates over {@code entrySet()} searching for an
* entry with the specified key. If such an entry is found, its value is
- * obtained with its getValue operation, the entry is removed
+ * obtained with its {@code getValue} operation, the entry is removed
* from the collection (and the backing map) with the iterator's
- * remove operation, and the saved value is returned. If the
- * iteration terminates without finding such an entry, null is
+ * {@code remove} operation, and the saved value is returned. If the
+ * iteration terminates without finding such an entry, {@code null} is
* returned. Note that this implementation requires linear time in the
* size of the map; many implementations will override this method.
*
* 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 @@
*
* @implSpec
* This implementation iterates over the specified map's
- * entrySet() collection, and calls this map's put
+ * {@code entrySet()} collection, and calls this map's {@code put}
* operation once for each entry returned by the iteration.
*
* 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 @@
* {@inheritDoc}
*
* @implSpec
- * This implementation calls entrySet().clear().
+ * This implementation calls {@code entrySet().clear()}.
*
* 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 @@
* @implSpec
* This implementation returns a set that subclasses {@link AbstractSet}.
* The subclass's iterator method returns a "wrapper object" over this
- * map's entrySet() iterator. The size method
- * delegates to this map's size method and the
- * contains method delegates to this map's
- * containsKey method.
+ * map's {@code entrySet()} iterator. The {@code size} method
+ * delegates to this map's {@code size} method and the
+ * {@code contains} method delegates to this map's
+ * {@code containsKey} method.
*
* 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 @@
* @implSpec
* This implementation returns a collection that subclasses {@link
* AbstractCollection}. The subclass's iterator method returns a
- * "wrapper object" over this map's entrySet() iterator.
- * The size method delegates to this map's size
- * method and the contains method delegates to this map's
- * containsValue method.
+ * "wrapper object" over this map's {@code entrySet()} iterator.
+ * The {@code size} method delegates to this map's {@code size}
+ * method and the {@code contains} method delegates to this map's
+ * {@code containsValue} method.
*
* 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 @@
/**
* Compares the specified object with this map for equality. Returns
- * true if the given object is also a map and the two maps
- * represent the same mappings. More formally, two maps m1 and
- * m2 represent the same mappings if
- * m1.entrySet().equals(m2.entrySet()). This ensures that the
- * equals method works properly across different implementations
- * of the Map interface.
+ * {@code true} if the given object is also a map and the two maps
+ * represent the same mappings. More formally, two maps {@code m1} and
+ * {@code m2} represent the same mappings if
+ * {@code m1.entrySet().equals(m2.entrySet())}. This ensures that the
+ * {@code equals} method works properly across different implementations
+ * of the {@code Map} interface.
*
* @implSpec
* This implementation first checks if the specified object is this map;
- * if so it returns true. Then, it checks if the specified
+ * if so it returns {@code true}. Then, it checks if the specified
* object is a map whose size is identical to the size of this map; if
- * not, it returns false. If so, it iterates over this map's
- * entrySet collection, and checks that the specified map
+ * not, it returns {@code false}. If so, it iterates over this map's
+ * {@code entrySet} collection, and checks that the specified map
* contains each mapping that this map contains. If the specified map
- * fails to contain such a mapping, false is returned. If the
- * iteration completes, true is returned.
+ * fails to contain such a mapping, {@code false} is returned. If the
+ * iteration completes, {@code true} is returned.
*
* @param o object to be compared for equality with this map
- * @return true if the specified object is equal to this map
+ * @return {@code true} if the specified object is equal to this map
*/
public boolean equals(Object o) {
if (o == this)
@@ -483,13 +483,13 @@
/**
* Returns the hash code value for this map. The hash code of a map is
* defined to be the sum of the hash codes of each entry in the map's
- * entrySet() view. This ensures that m1.equals(m2)
- * implies that m1.hashCode()==m2.hashCode() for any two maps
- * m1 and m2, as required by the general contract of
+ * {@code entrySet()} view. This ensures that {@code m1.equals(m2)}
+ * implies that {@code m1.hashCode()==m2.hashCode()} for any two maps
+ * {@code m1} and {@code m2}, as required by the general contract of
* {@link Object#hashCode}.
*
* @implSpec
- * This implementation iterates over entrySet(), calling
+ * This implementation iterates over {@code entrySet()}, calling
* {@link Map.Entry#hashCode hashCode()} on each element (entry) in the
* set, and adding up the results.
*
@@ -508,10 +508,10 @@
/**
* Returns a string representation of this map. The string representation
* consists of a list of key-value mappings in the order returned by the
- * map's entrySet view's iterator, enclosed in braces
- * ("{}"). Adjacent mappings are separated by the characters
- * ", " (comma and space). Each key-value mapping is rendered as
- * the key followed by an equals sign ("=") followed by the
+ * map's {@code entrySet} view's iterator, enclosed in braces
+ * ({@code "{}"}). Adjacent mappings are separated by the characters
+ * {@code ", "} (comma and space). Each key-value mapping is rendered as
+ * the key followed by an equals sign ({@code "="}) followed by the
* associated value. Keys and values are converted to strings as by
* {@link String#valueOf(Object)}.
*
@@ -538,7 +538,7 @@
}
/**
- * Returns a shallow copy of this AbstractMap instance: the keys
+ * Returns a shallow copy of this {@code AbstractMap} instance: the keys
* and values themselves are not cloned.
*
* @return a shallow copy of this map
@@ -570,11 +570,11 @@
/**
* An Entry maintaining a key and a value. The value may be
- * changed using the setValue method. This class
+ * changed using the {@code setValue} method. This class
* facilitates the process of building custom map
* implementations. For example, it may be convenient to return
- * arrays of SimpleEntry instances in method
- * Map.entrySet().toArray.
+ * arrays of {@code SimpleEntry} instances in method
+ * {@code Map.entrySet().toArray}.
*
* @since 1.6
*/
@@ -689,7 +689,7 @@
/**
* Returns a String representation of this map entry. This
* implementation returns the string representation of this
- * entry's key followed by the equals character ("=")
+ * entry's key followed by the equals character ("{@code =}")
* followed by the string representation of this entry's value.
*
* @return a String representation of this map entry
@@ -702,7 +702,7 @@
/**
* An Entry maintaining an immutable key and value. This class
- * does not support method setValue. This class may be
+ * does not support method {@code setValue}. This class may be
* convenient in methods that return thread-safe snapshots of
* key-value mappings.
*
@@ -760,7 +760,7 @@
/**
* Replaces the value corresponding to this entry with the specified
* value (optional operation). This implementation simply throws
- * UnsupportedOperationException, as this class implements
+ * {@code UnsupportedOperationException}, as this class implements
* an immutable map entry.
*
* @param value new value to be stored in this entry
@@ -820,7 +820,7 @@
/**
* Returns a String representation of this map entry. This
* implementation returns the string representation of this
- * entry's key followed by the equals character ("=")
+ * entry's key followed by the equals character ("{@code =}")
* followed by the string representation of this entry's value.
*
* @return a String representation of this map entry
diff -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/share/classes/java/util/AbstractSequentialList.java
--- a/jdk/src/java.base/share/classes/java/util/AbstractSequentialList.java Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/util/AbstractSequentialList.java Wed Jul 05 20:45:35 2017 +0200
@@ -26,31 +26,31 @@
package java.util;
/**
- * This class provides a skeletal implementation of the List
+ * This class provides a skeletal implementation of the {@code List}
* interface to minimize the effort required to implement this interface
* backed by a "sequential access" data store (such as a linked list). For
- * random access data (such as an array), AbstractList should be used
+ * random access data (such as an array), {@code AbstractList} should be used
* in preference to this class.
*
- * 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 @@
* Returns the element at the specified position in this list.
*
* 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 @@
* specified element (optional operation).
*
* 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 @@
* indices).
*
* 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 @@
* list.
*
* 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 @@
*
* 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 @@
* sequence).
*
* @param index index of first element to be returned from the list
- * iterator (by a call to the
*
* 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 @@
/**
* Returns the number of elements in this collection. If this collection
- * contains more than Integer.MAX_VALUE elements, returns
- * Integer.MAX_VALUE.
+ * contains more than {@code Integer.MAX_VALUE} elements, returns
+ * {@code Integer.MAX_VALUE}.
*
* @return the number of elements in this collection
*/
int size();
/**
- * Returns true if this collection contains no elements.
+ * Returns {@code true} if this collection contains no elements.
*
- * @return true if this collection contains no elements
+ * @return {@code true} if this collection contains no elements
*/
boolean isEmpty();
/**
- * Returns true if this collection contains the specified element.
- * More formally, returns true if and only if this collection
- * contains at least one element e such that
- * (o==null ? e==null : o.equals(e)).
+ * Returns {@code true} if this collection contains the specified element.
+ * More formally, returns {@code true} if and only if this collection
+ * contains at least one element {@code e} such that
+ * {@code Objects.equals(o, e)}.
*
* @param o element whose presence in this collection is to be tested
- * @return true if this collection contains the specified
+ * @return {@code true} if this collection contains the specified
* element
* @throws ClassCastException if the type of the specified element
* is incompatible with this collection
@@ -184,7 +184,7 @@
* (unless this collection is an instance of some class that provides a
* guarantee).
*
- * @return an Iterator over the elements in this collection
+ * @return an {@code Iterator} over the elements in this collection
*/
Iterator 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 @@
* precise control over the runtime type of the output array, and may,
* under certain circumstances, be used to save allocation costs.
*
- * 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 @@
/**
* Removes a single instance of the specified element from this
* collection, if it is present (optional operation). More formally,
- * removes an element e such that
- * (o==null ? e==null : o.equals(e)), if
+ * removes an element {@code e} such that
+ * {@code Objects.equals(o, e)}, if
* this collection contains one or more such elements. Returns
- * true if this collection contained the specified element (or
+ * {@code true} if this collection contained the specified element (or
* equivalently, if this collection changed as a result of the call).
*
* @param o element to be removed from this collection, if present
- * @return true if an element was removed as a result of this call
+ * @return {@code true} if an element was removed as a result of this call
* @throws ClassCastException if the type of the specified element
* is incompatible with this collection
* (optional)
* @throws NullPointerException if the specified element is null and this
* collection does not permit null elements
* (optional)
- * @throws UnsupportedOperationException if the remove operation
+ * @throws UnsupportedOperationException if the {@code remove} operation
* is not supported by this collection
*/
boolean remove(Object o);
@@ -314,11 +314,11 @@
// Bulk Operations
/**
- * Returns true if this collection contains all of the elements
+ * Returns {@code true} if this collection contains all of the elements
* in the specified collection.
*
* @param c collection to be checked for containment in this collection
- * @return true if this collection contains all of the elements
+ * @return {@code true} if this collection contains all of the elements
* in the specified collection
* @throws ClassCastException if the types of one or more elements
* in the specified collection are incompatible with this
@@ -342,8 +342,8 @@
* nonempty.)
*
* @param c collection containing elements to be added to this collection
- * @return true if this collection changed as a result of the call
- * @throws UnsupportedOperationException if the addAll operation
+ * @return {@code true} if this collection changed as a result of the call
+ * @throws UnsupportedOperationException if the {@code addAll} operation
* is not supported by this collection
* @throws ClassCastException if the class of an element of the specified
* collection prevents it from being added to this collection
@@ -366,9 +366,9 @@
* collection.
*
* @param c collection containing elements to be removed from this collection
- * @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 removeAll method
+ * @throws UnsupportedOperationException if the {@code removeAll} method
* is not supported by this collection
* @throws ClassCastException if the types of one or more elements
* in this collection are incompatible with the specified
@@ -426,8 +426,8 @@
* specified collection.
*
* @param c collection containing elements to be retained in this collection
- * @return true if this collection changed as a result of the call
- * @throws UnsupportedOperationException if the retainAll operation
+ * @return {@code true} if this collection changed as a result of the call
+ * @throws UnsupportedOperationException if the {@code retainAll} operation
* is not supported by this collection
* @throws ClassCastException if the types of one or more elements
* in this collection are incompatible with the specified
@@ -447,7 +447,7 @@
* Removes all of the elements from this collection (optional operation).
* The collection will be empty after this method returns.
*
- * @throws UnsupportedOperationException if the clear operation
+ * @throws UnsupportedOperationException if the {@code clear} operation
* is not supported by this collection
*/
void clear();
@@ -458,30 +458,30 @@
/**
* Compares the specified object with this collection for equality.
*
- * 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 @@
/**
* Returns the hash code value for this collection. While the
- * Collection interface adds no stipulations to the general
- * contract for the Object.hashCode method, programmers should
- * take note that any class that overrides the Object.equals
- * method must also override the Object.hashCode method in order
- * to satisfy the general contract for the Object.hashCode method.
- * In particular, c1.equals(c2) implies that
- * c1.hashCode()==c2.hashCode().
+ * {@code Collection} interface adds no stipulations to the general
+ * contract for the {@code Object.hashCode} method, programmers should
+ * take note that any class that overrides the {@code Object.equals}
+ * method must also override the {@code Object.hashCode} method in order
+ * to satisfy the general contract for the {@code Object.hashCode} method.
+ * In particular, {@code c1.equals(c2)} implies that
+ * {@code c1.hashCode()==c2.hashCode()}.
*
* @return the hash code value for this collection
*
diff -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/share/classes/java/util/Collections.java
--- a/jdk/src/java.base/share/classes/java/util/Collections.java Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/util/Collections.java Wed Jul 05 20:45:35 2017 +0200
@@ -44,7 +44,7 @@
* collections, "wrappers", which return a new collection backed by a
* specified collection, and a few other odds and ends.
*
- * 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 @@
* 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 @@
* @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 @@
* 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 @@
* @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 @@
* 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 @@
* @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 @@
* 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 @@
* @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 @@
/**
* 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 @@
* 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 @@
* 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 @@
* 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 @@
* 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 @@
* 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 @@
* 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 @@
* 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 @@
* 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 -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/share/classes/java/util/Comparator.java
--- a/jdk/src/java.base/share/classes/java/util/Comparator.java Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/util/Comparator.java Wed Jul 05 20:45:35 2017 +0200
@@ -42,20 +42,20 @@
* 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 @@
* {@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 @@
* Indicates whether some other object is "equal to" this
* comparator. This method must obey the general contract of
* {@link Object#equals(Object)}. Additionally, this method can return
- * true only if the specified object is also a comparator
+ * {@code true} only if the specified object is also a comparator
* and it imposes the same ordering as this comparator. Thus,
- *
+ * {@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 @@
/**
* Tests if this dictionary maps no keys to value. The general contract
- * for the isEmpty method is that the result is true if and only
+ * for the {@code isEmpty} method is that the result is true if and only
* if this dictionary contains no entries.
*
- * @return
* 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 -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/share/classes/java/util/EmptyStackException.java
--- a/jdk/src/java.base/share/classes/java/util/EmptyStackException.java Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/util/EmptyStackException.java Wed Jul 05 20:45:35 2017 +0200
@@ -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 @@
implements java.io.Serializable, Cloneable
{
/**
- * The Class object for the enum type of all the keys of this map.
+ * The {@code Class} object for the enum type of all the keys of this map.
*
* @serial
*/
@@ -131,7 +131,7 @@
* Creates an empty enum map with the specified key type.
*
* @param keyType the class object of the key type for this enum map
- * @throws NullPointerException if keyType is null
+ * @throws NullPointerException if {@code keyType} is null
*/
public EnumMap(Class 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 @@
* 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 @@
* @param elementType the class object of the element type for this enum
* set
* @return An empty enum set of the specified type.
- * @throws NullPointerException if elementType is null
+ * @throws NullPointerException if {@code elementType} is null
*/
public static
- * 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 -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/share/classes/java/util/Formattable.java
--- a/jdk/src/java.base/share/classes/java/util/Formattable.java Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/util/Formattable.java Wed Jul 05 20:45:35 2017 +0200
@@ -28,8 +28,8 @@
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 @@
* 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 @@
* {@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 @@
* @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 @@
* FormatFlagsConversionMismatchException} will be thrown.
*
* If the argument is {@code null}, then the result is
@@ -748,7 +748,7 @@
* 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 @@
* 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 @@
* 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 @@
* 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 -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/share/classes/java/util/HashMap.java
--- a/jdk/src/java.base/share/classes/java/util/HashMap.java Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/util/HashMap.java Wed Jul 05 20:45:35 2017 +0200
@@ -36,24 +36,24 @@
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 @@
* 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 @@
* 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 @@
* 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 operations -------------- */
/**
- * Constructs an empty HashMap with the specified initial
+ * Constructs an empty {@code HashMap} with the specified initial
* capacity and load factor.
*
* @param initialCapacity the initial capacity
@@ -457,7 +457,7 @@
}
/**
- * Constructs an empty HashMap with the specified initial
+ * Constructs an empty {@code HashMap} with the specified initial
* capacity and the default load factor (0.75).
*
* @param initialCapacity the initial capacity.
@@ -468,7 +468,7 @@
}
/**
- * Constructs an empty HashMap with the default initial capacity
+ * Constructs an empty {@code HashMap} with the default initial capacity
* (16) and the default load factor (0.75).
*/
public HashMap() {
@@ -476,10 +476,10 @@
}
/**
- * Constructs a new HashMap with the same mappings as the
- * specified Map. The HashMap is created with
+ * Constructs a new {@code HashMap} with the same mappings as the
+ * specified {@code Map}. The {@code HashMap} is created with
* default load factor (0.75) and an initial capacity sufficient to
- * hold the mappings in the specified Map.
+ * hold the mappings in the specified {@code Map}.
*
* @param m the map whose mappings are to be placed in this map
* @throws NullPointerException if the specified map is null
@@ -526,9 +526,9 @@
}
/**
- * Returns true if this map contains no key-value mappings.
+ * Returns {@code true} if this map contains no key-value mappings.
*
- * @return true if this map contains no key-value mappings
+ * @return {@code true} if this map contains no key-value mappings
*/
public boolean isEmpty() {
return size == 0;
@@ -584,11 +584,11 @@
}
/**
- * Returns true if this map contains a mapping for the
+ * Returns {@code true} if this map contains a mapping for the
* specified key.
*
* @param key The key whose presence in this map is to be tested
- * @return true if this map contains a mapping for the specified
+ * @return {@code true} if this map contains a mapping for the specified
* key.
*/
public boolean containsKey(Object key) {
@@ -602,10 +602,10 @@
*
* @param key key with which the specified value is to be associated
* @param value value to be associated with the specified key
- * @return the previous value associated with key, or
- * null if there was no mapping for key.
- * (A null return can also indicate that the map
- * previously associated null with key.)
+ * @return the previous value associated with {@code key}, or
+ * {@code null} if there was no mapping for {@code key}.
+ * (A {@code null} return can also indicate that the map
+ * previously associated {@code null} with {@code key}.)
*/
public V put(K key, V value) {
return putVal(hash(key), key, value, false, true);
@@ -788,10 +788,10 @@
* Removes the mapping for the specified key from this map if present.
*
* @param key key whose mapping is to be removed from the map
- * @return the previous value associated with key, or
- * null if there was no mapping for key.
- * (A null return can also indicate that the map
- * previously associated null with key.)
+ * @return the previous value associated with {@code key}, or
+ * {@code null} if there was no mapping for {@code key}.
+ * (A {@code null} return can also indicate that the map
+ * previously associated {@code null} with {@code key}.)
*/
public V remove(Object key) {
Node This class offers constant time performance for the basic operations
- * (add, remove, contains and size),
+ * ({@code add}, {@code remove}, {@code contains} and {@code size}),
* assuming the hash function disperses the elements properly among the
* buckets. Iterating over this set requires time proportional to the sum of
- * the HashSet instance's size (the number of elements) plus the
- * "capacity" of the backing HashMap instance (the number of
+ * the {@code HashSet} instance's size (the number of elements) plus the
+ * "capacity" of the backing {@code HashMap} instance (the number of
* buckets). Thus, it's very important not to set the initial capacity too
* high (or the load factor too low) if iteration performance is important.
*
@@ -55,9 +55,9 @@
* unsynchronized access to the set: The iterators returned by this class's iterator method are
+ * The iterators returned by this class's {@code iterator} method are
* fail-fast: if the set is modified at any time after the iterator is
- * created, in any way except through the iterator's own remove
+ * created, in any way except through the iterator's own {@code remove}
* method, the Iterator throws a {@link ConcurrentModificationException}.
* Thus, in the face of concurrent modification, the iterator fails quickly
* and cleanly, rather than risking arbitrary, non-deterministic behavior at
@@ -66,7 +66,7 @@
* 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.
@@ -98,7 +98,7 @@
private static final Object PRESENT = new Object();
/**
- * Constructs a new, empty set; the backing HashMap instance has
+ * Constructs a new, empty set; the backing {@code HashMap} instance has
* default initial capacity (16) and load factor (0.75).
*/
public HashSet() {
@@ -107,7 +107,7 @@
/**
* Constructs a new set containing the elements in the specified
- * collection. The HashMap is created with default load factor
+ * collection. The {@code HashMap} is created with default load factor
* (0.75) and an initial capacity sufficient to contain the elements in
* the specified collection.
*
@@ -120,7 +120,7 @@
}
/**
- * Constructs a new, empty set; the backing HashMap instance has
+ * Constructs a new, empty set; the backing {@code HashMap} instance has
* the specified initial capacity and the specified load factor.
*
* @param initialCapacity the initial capacity of the hash map
@@ -133,7 +133,7 @@
}
/**
- * Constructs a new, empty set; the backing HashMap instance has
+ * Constructs a new, empty set; the backing {@code HashMap} instance has
* the specified initial capacity and default load factor (0.75).
*
* @param initialCapacity the initial capacity of the hash table
@@ -182,22 +182,22 @@
}
/**
- * Returns true if this set contains no elements.
+ * Returns {@code true} if this set contains no elements.
*
- * @return true if this set contains no elements
+ * @return {@code true} if this set contains no elements
*/
public boolean isEmpty() {
return map.isEmpty();
}
/**
- * Returns true if this set contains the specified element.
- * More formally, returns true if and only if this set
- * contains an element e such that
- * (o==null ? e==null : o.equals(e)).
+ * Returns {@code true} if this set contains the specified element.
+ * More formally, returns {@code true} if and only if this set
+ * contains an element {@code e} such that
+ * {@code Objects.equals(o, e)}.
*
* @param o element whose presence in this set is to be tested
- * @return true if this set contains the specified element
+ * @return {@code true} if this set contains the specified element
*/
public boolean contains(Object o) {
return map.containsKey(o);
@@ -205,14 +205,14 @@
/**
* Adds the specified element to this set if it is not already present.
- * More formally, adds the specified element e to this set if
- * this set contains no element e2 such that
- * (e==null ? e2==null : e.equals(e2)).
+ * More formally, adds the specified element {@code e} to this set if
+ * this set contains no element {@code e2} such that
+ * {@code Objects.equals(e, e2)}.
* If this set already contains the element, the call leaves the set
- * unchanged and returns false.
+ * unchanged and returns {@code false}.
*
* @param e element to be added to this set
- * @return true if this set did not already contain the specified
+ * @return {@code true} if this set did not already contain the specified
* element
*/
public boolean add(E e) {
@@ -221,15 +221,15 @@
/**
* Removes the specified element from this set if it is present.
- * More formally, removes an element e such that
- * (o==null ? e==null : o.equals(e)),
- * if this set contains such an element. Returns true if
+ * More formally, removes an element {@code e} such that
+ * {@code Objects.equals(o, e)},
+ * if this set contains such an element. Returns {@code true} if
* this set contained the element (or equivalently, if this set
* changed as a result of the call). (This set will not contain the
* element once the call returns.)
*
* @param o object to be removed from this set, if present
- * @return true if the set contained the specified element
+ * @return {@code true} if the set contained the specified element
*/
public boolean remove(Object o) {
return map.remove(o)==PRESENT;
@@ -244,7 +244,7 @@
}
/**
- * Returns a shallow copy of this HashSet instance: the elements
+ * Returns a shallow copy of this {@code HashSet} instance: the elements
* themselves are not cloned.
*
* @return a shallow copy of this set
@@ -261,10 +261,10 @@
}
/**
- * Save the state of this HashSet instance to a stream (that is,
+ * Save the state of this {@code HashSet} instance to a stream (that is,
* serialize it).
*
- * @serialData The capacity of the backing HashMap instance
+ * @serialData The capacity of the backing {@code HashMap} instance
* (int), and its load factor (float) are emitted, followed by
* the size of the set (the number of elements it contains)
* (int), followed by all of its elements (each an Object) in
@@ -288,7 +288,7 @@
}
/**
- * Reconstitute the HashSet instance from a stream (that is,
+ * Reconstitute the {@code HashSet} instance from a stream (that is,
* deserialize it).
*/
private void readObject(java.io.ObjectInputStream s)
diff -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/share/classes/java/util/Hashtable.java
--- a/jdk/src/java.base/share/classes/java/util/Hashtable.java Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/util/Hashtable.java Wed Jul 05 20:45:35 2017 +0200
@@ -32,13 +32,13 @@
/**
* This class implements a hash table, which maps keys to values. Any
- * non-
+ * non-{@code null} object can be used as a key or as a value.
*
* To successfully store and retrieve objects from a hashtable, the
- * objects used as keys must implement the
+ * objects used as keys must implement the {@code hashCode}
+ * method and the {@code equals} method.
*
- * An instance of
+ * {@code Hashtable} operations, including {@code get} and {@code put}).
*
* The initial capacity controls a tradeoff between wasted space and the
- * need for
*
- * If many entries are to be made into a
@@ -83,11 +83,11 @@
* System.out.println("two = " + n);
* }}
*
- * The iterators returned by the iterator method of the collections
+ * The iterators returned by the {@code iterator} method of the collections
* returned by all of this class's "collection view methods" are
* fail-fast: if the Hashtable 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 {@link
+ * {@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 future.
@@ -99,7 +99,7 @@
* 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.
@@ -241,8 +241,8 @@
/**
* Tests if this hashtable maps no keys to values.
*
- * @return
+ * Maps the specified {@code key} to the specified
+ * {@code value} in this hashtable. Neither the key nor the
+ * value can be {@code null}.
*
- * The value can be retrieved by calling the This class is not a general-purpose Map
- * implementation! While this class implements the Map interface, it
- * intentionally violates Map's general contract, which mandates the
- * use of the equals method when comparing objects. This class is
+ * This class is not a general-purpose {@code Map}
+ * implementation! While this class implements the {@code Map} interface, it
+ * intentionally violates {@code Map's} general contract, which mandates the
+ * use of the {@code equals} method when comparing objects. This class is
* designed for use only in the rare cases wherein reference-equality
* semantics are required.
*
@@ -56,12 +56,12 @@
* each object in the program being debugged.
*
* This class provides all of the optional map operations, and permits
- * null values and the null key. This class makes no
+ * {@code null} values and the {@code null} key. 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 class provides constant-time performance for the basic
- * operations (get and put), assuming the system
+ * operations ({@code get} and {@code put}), assuming the system
* identity hash function ({@link System#identityHashCode(Object)})
* disperses elements properly among the buckets.
*
@@ -96,11 +96,11 @@
* unsynchronized access to the map: The iterators returned by the iterator method of the
+ * The iterators returned by the {@code iterator} method of the
* collections 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
+ * through the iterator's own {@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
@@ -109,7 +109,7 @@
* 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: fail-fast iterators should be used only
* to detect bugs.
@@ -217,7 +217,7 @@
* somewhat time-consuming.
*
* @param expectedMaxSize the expected maximum size of the map
- * @throws IllegalArgumentException if expectedMaxSize is negative
+ * @throws IllegalArgumentException if {@code expectedMaxSize} is negative
*/
public IdentityHashMap(int expectedMaxSize) {
if (expectedMaxSize < 0)
@@ -277,10 +277,10 @@
}
/**
- * Returns true if this identity hash map contains no key-value
+ * Returns {@code true} if this identity hash map contains no key-value
* mappings.
*
- * @return true if this identity hash map contains no key-value
+ * @return {@code true} if this identity hash map contains no key-value
* mappings
*/
public boolean isEmpty() {
@@ -341,7 +341,7 @@
* hash map.
*
* @param key possible key
- * @return Owing to the reference-equality-based semantics of this map it is
* possible that the symmetry and transitivity requirements of the
- * Object.equals contract may be violated if this map is compared
- * to a normal map. However, the Object.equals contract is
- * guaranteed to hold among IdentityHashMap instances.
+ * {@code Object.equals} contract may be violated if this map is compared
+ * to a normal map. However, the {@code Object.equals} contract is
+ * guaranteed to hold among {@code IdentityHashMap} instances.
*
* @param o object to be compared for equality with this map
- * @return true if the specified object is equal to this map
+ * @return {@code true} if the specified object is equal to this map
* @see Object#equals(Object)
*/
public boolean equals(Object o) {
@@ -662,17 +662,17 @@
/**
* Returns the hash code value for this map. The hash code of a map is
* defined to be the sum of the hash codes of each entry in the map's
- * entrySet() view. This ensures that m1.equals(m2)
- * implies that m1.hashCode()==m2.hashCode() for any two
- * IdentityHashMap instances m1 and m2, as
+ * {@code entrySet()} view. This ensures that {@code m1.equals(m2)}
+ * implies that {@code m1.hashCode()==m2.hashCode()} for any two
+ * {@code IdentityHashMap} instances {@code m1} and {@code m2}, as
* required by the general contract of {@link Object#hashCode}.
*
* Owing to the reference-equality-based semantics of the
- * Map.Entry instances in the set returned by this map's
- * entrySet method, it is possible that the contractual
- * requirement of Object.hashCode mentioned in the previous
+ * {@code Map.Entry} instances in the set returned by this map's
+ * {@code entrySet} method, it is possible that the contractual
+ * requirement of {@code Object.hashCode} mentioned in the previous
* paragraph will be violated if one of the two objects being compared is
- * an IdentityHashMap instance and the other is a normal map.
+ * an {@code IdentityHashMap} instance and the other is a normal map.
*
* @return the hash code value for this map
* @see Object#equals(Object)
@@ -930,32 +930,32 @@
* the set, and vice-versa. If the map is modified while an iteration
* over the set is in progress, the results of the iteration are
* undefined. The set supports element removal, which removes the
- * corresponding mapping from the map, via the Iterator.remove,
- * Set.remove, removeAll, retainAll, and
- * clear methods. It does not support the add or
- * addAll methods.
+ * corresponding mapping from the map, via the {@code Iterator.remove},
+ * {@code Set.remove}, {@code removeAll}, {@code retainAll}, and
+ * {@code clear} methods. It does not support the {@code add} or
+ * {@code addAll} methods.
*
* While the object returned by this method implements the
- * Set interface, it does not obey Set's general
+ * {@code Set} interface, it does not obey {@code Set's} general
* contract. Like its backing map, the set returned by this method
* defines element equality as reference-equality rather than
- * object-equality. This affects the behavior of its contains,
- * remove, containsAll, equals, and
- * hashCode methods.
+ * object-equality. This affects the behavior of its {@code contains},
+ * {@code remove}, {@code containsAll}, {@code equals}, and
+ * {@code hashCode} methods.
*
- * The equals method of the returned set returns true
+ * The {@code equals} method of the returned set returns {@code true}
* only if the specified object is a set containing exactly the same
* object references as the returned set. The symmetry and transitivity
- * requirements of the Object.equals contract may be violated if
+ * requirements of the {@code Object.equals} contract may be violated if
* the set returned by this method is compared to a normal set. However,
- * the Object.equals contract is guaranteed to hold among sets
+ * the {@code Object.equals} contract is guaranteed to hold among sets
* returned by this method.
*
- * The hashCode method of the returned set returns the sum of
+ * The {@code hashCode} method of the returned set returns the sum of
* the identity hashcodes of the elements in the set, rather than
* the sum of their hashcodes. This is mandated by the change in the
- * semantics of the equals method, in order to enforce the
- * general contract of the Object.hashCode method among sets
+ * semantics of the {@code equals} method, in order to enforce the
+ * general contract of the {@code Object.hashCode} method among sets
* returned by this method.
*
* @return an identity-based set view of the keys contained in this map
@@ -1054,18 +1054,18 @@
* modified while an iteration over the collection is in progress,
* the results of the iteration are undefined. The collection
* supports element removal, which removes the corresponding
- * mapping from the map, via the Iterator.remove,
- * Collection.remove, removeAll,
- * retainAll and clear methods. It does not
- * support the add or addAll methods.
+ * mapping from the map, via the {@code Iterator.remove},
+ * {@code Collection.remove}, {@code removeAll},
+ * {@code retainAll} and {@code clear} methods. It does not
+ * support the {@code add} or {@code addAll} methods.
*
* While the object returned by this method implements the
- * Collection interface, it does not obey
- * Collection's general contract. Like its backing map,
+ * {@code Collection} interface, it does not obey
+ * {@code Collection's} general contract. Like its backing map,
* the collection returned by this method defines element equality as
* reference-equality rather than object-equality. This affects the
- * behavior of its contains, remove and
- * containsAll methods.
+ * behavior of its {@code contains}, {@code remove} and
+ * {@code containsAll} methods.
*/
public Collection Like the backing map, the Map.Entry objects in the set
+ * Like the backing map, the {@code Map.Entry} objects in the set
* returned by this method define key and value equality as
* reference-equality rather than object-equality. This affects the
- * behavior of the equals and hashCode methods of these
- * Map.Entry objects. A reference-equality based Map.Entry
- * e is equal to an object o if and only if o is a
- * Map.Entry and e.getKey()==o.getKey() &&
- * e.getValue()==o.getValue(). To accommodate these equals
- * semantics, the hashCode method returns
- * System.identityHashCode(e.getKey()) ^
- * System.identityHashCode(e.getValue()).
+ * behavior of the {@code equals} and {@code hashCode} methods of these
+ * {@code Map.Entry} objects. A reference-equality based {@code Map.Entry
+ * e} is equal to an object {@code o} if and only if {@code o} is a
+ * {@code Map.Entry} and {@code e.getKey()==o.getKey() &&
+ * e.getValue()==o.getValue()}. To accommodate these equals
+ * semantics, the {@code hashCode} method returns
+ * {@code System.identityHashCode(e.getKey()) ^
+ * System.identityHashCode(e.getValue())}.
*
* Owing to the reference-equality-based semantics of the
- * Map.Entry instances in the set returned by this method,
+ * {@code Map.Entry} instances in the set returned by this method,
* it is possible that the symmetry and transitivity requirements of
* the {@link Object#equals(Object)} contract may be violated if any of
* the entries in the set is compared to a normal map entry, or if
* the set returned by this method is compared to a set of normal map
* entries (such as would be returned by a call to this method on a normal
- * map). However, the Object.equals contract is guaranteed to
+ * map). However, the {@code Object.equals} contract is guaranteed to
* hold among identity-based map entries, and among sets of such entries.
*
*
@@ -1260,11 +1260,11 @@
private static final long serialVersionUID = 8188218128353913216L;
/**
- * Saves the state of the IdentityHashMap instance to a stream
+ * Saves the state of the {@code IdentityHashMap} instance to a stream
* (i.e., serializes it).
*
* @serialData The size of the HashMap (the number of key-value
- * mappings) (int), followed by the key (Object) and
+ * mappings) ({@code int}), followed by the key (Object) and
* value (Object) for each key-value mapping represented by the
* IdentityHashMap. The key-value mappings are emitted in no
* particular order.
@@ -1289,7 +1289,7 @@
}
/**
- * Reconstitutes the IdentityHashMap instance from a stream (i.e.,
+ * Reconstitutes the {@code IdentityHashMap} instance from a stream (i.e.,
* deserializes it).
*/
private void readObject(java.io.ObjectInputStream s)
diff -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/share/classes/java/util/IllegalFormatCodePointException.java
--- a/jdk/src/java.base/share/classes/java/util/IllegalFormatCodePointException.java Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/util/IllegalFormatCodePointException.java Wed Jul 05 20:45:35 2017 +0200
@@ -30,7 +30,7 @@
* point as defined by {@link Character#isValidCodePoint} is passed to the
* {@link Formatter}.
*
- * 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 -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/share/classes/java/util/IllegalFormatConversionException.java
--- a/jdk/src/java.base/share/classes/java/util/IllegalFormatConversionException.java Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/util/IllegalFormatConversionException.java Wed Jul 05 20:45:35 2017 +0200
@@ -29,7 +29,7 @@
* Unchecked exception thrown when the argument corresponding to the format
* specifier is of an incompatible type.
*
- * 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 -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/share/classes/java/util/IllegalFormatFlagsException.java
--- a/jdk/src/java.base/share/classes/java/util/IllegalFormatFlagsException.java Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/util/IllegalFormatFlagsException.java Wed Jul 05 20:45:35 2017 +0200
@@ -28,7 +28,7 @@
/**
* Unchecked exception thrown when an illegal combination flags is given.
*
- * 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 -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/share/classes/java/util/IllegalFormatPrecisionException.java
--- a/jdk/src/java.base/share/classes/java/util/IllegalFormatPrecisionException.java Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/util/IllegalFormatPrecisionException.java Wed Jul 05 20:45:35 2017 +0200
@@ -27,7 +27,7 @@
/**
* Unchecked exception thrown when the precision is a negative value other than
- * -1, the conversion does not support a precision, or the value is
+ * {@code -1}, the conversion does not support a precision, or the value is
* otherwise unsupported.
*
* @since 1.5
diff -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/share/classes/java/util/IllegalFormatWidthException.java
--- a/jdk/src/java.base/share/classes/java/util/IllegalFormatWidthException.java Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/util/IllegalFormatWidthException.java Wed Jul 05 20:45:35 2017 +0200
@@ -27,7 +27,7 @@
/**
* Unchecked exception thrown when the format width is a negative value other
- * than -1 or is otherwise unsupported.
+ * than {@code -1} or is otherwise unsupported.
*
* @since 1.5
*/
diff -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/share/classes/java/util/InputMismatchException.java
--- a/jdk/src/java.base/share/classes/java/util/InputMismatchException.java Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/util/InputMismatchException.java Wed Jul 05 20:45:35 2017 +0200
@@ -26,7 +26,7 @@
package java.util;
/**
- * Thrown by a Hash table and linked list implementation of the Map interface,
+ * Hash table and linked list implementation of the {@code Map} interface,
* with predictable iteration order. This implementation differs from
- * HashMap in that it maintains a doubly-linked list running through
+ * {@code HashMap} in that it maintains a doubly-linked list running through
* all of its entries. This linked list defines the iteration ordering,
* which is normally the order in which keys were inserted into the map
* (insertion-order). Note that insertion order is not affected
- * if a key is re-inserted into the map. (A key k is
- * reinserted into a map m if m.put(k, v) is invoked when
- * m.containsKey(k) would return true immediately prior to
+ * if a key is re-inserted into the map. (A key {@code k} is
+ * reinserted into a map {@code m} if {@code m.put(k, v)} is invoked when
+ * {@code m.containsKey(k)} would return {@code true} immediately prior to
* the invocation.)
*
* This implementation spares its clients from the unspecified, generally
@@ -78,23 +78,23 @@
* impose a policy for removing stale mappings automatically when new mappings
* are added to the map.
*
- * This class provides all of the optional Map operations, and
- * permits null elements. Like HashMap, it provides constant-time
- * performance for the basic operations (add, contains and
- * remove), assuming the hash function disperses elements
+ * This class provides all of the optional {@code Map} operations, and
+ * permits null elements. Like {@code HashMap}, it provides constant-time
+ * performance for the basic operations ({@code add}, {@code contains} and
+ * {@code remove}), assuming the hash function disperses elements
* properly among the buckets. Performance is likely to be just slightly
- * below that of HashMap, due to the added expense of maintaining the
+ * below that of {@code HashMap}, due to the added expense of maintaining the
* linked list, with one exception: Iteration over the collection-views
- * of a LinkedHashMap requires time proportional to the size
- * of the map, regardless of its capacity. Iteration over a HashMap
+ * of a {@code LinkedHashMap} requires time proportional to the size
+ * of the map, regardless of its capacity. Iteration over a {@code HashMap}
* is likely to be more expensive, requiring time proportional to its
* capacity.
*
* A linked hash map has two parameters that affect its performance:
* initial capacity and load factor. They are defined precisely
- * as for HashMap. Note, however, that the penalty for choosing an
+ * as for {@code HashMap}. Note, however, that the penalty for choosing an
* excessively high value for initial capacity is less severe for this class
- * than for HashMap, as iteration times for this class are unaffected
+ * than for {@code HashMap}, as iteration times for this class are unaffected
* by capacity.
*
* Note that this implementation is not synchronized.
@@ -114,14 +114,14 @@
* iteration order. In insertion-ordered linked hash maps, merely changing
* the value associated with a key that is already contained in the map is not
* a structural modification. In access-ordered linked hash maps,
- * merely querying the map with get is a structural modification.
+ * merely querying the map with {@code get} is a structural modification.
* )
*
- * The iterators returned by the iterator method of the collections
+ * The iterators returned by the {@code iterator} method of the collections
* 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 {@link
+ * {@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 future.
@@ -129,7 +129,7 @@
* 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.
@@ -209,8 +209,8 @@
transient LinkedHashMap.Entry This implementation merely returns false (so that this
+ * This implementation merely returns {@code false} (so that this
* map acts like a normal map - the eldest element is never removed).
*
* @param eldest The least recently inserted entry in the map, or if
* this is an access-ordered map, the least recently accessed
* entry. This is the entry that will be removed it this
- * method returns true. If the map was empty prior
- * to the put or putAll invocation resulting
+ * method returns {@code true}. If the map was empty prior
+ * to the {@code put} or {@code putAll} invocation resulting
* in this invocation, this will be the entry that was just
* inserted; in other words, if the map contains a single
* entry, the eldest entry is also the newest.
- * @return true if the eldest entry should be removed
- * from the map; false if it should be retained.
+ * @return {@code true} if the eldest entry should be removed
+ * from the map; {@code false} if it should be retained.
*/
protected boolean removeEldestEntry(Map.Entry Hash table and linked list implementation of the Set interface,
+ * Hash table and linked list implementation of the {@code Set} interface,
* with predictable iteration order. This implementation differs from
- * HashSet in that it maintains a doubly-linked list running through
+ * {@code HashSet} in that it maintains a doubly-linked list running through
* all of its entries. This linked list defines the iteration ordering,
* which is the order in which elements were inserted into the set
* (insertion-order). Note that insertion order is not affected
- * if an element is re-inserted into the set. (An element e
- * is reinserted into a set s if s.add(e) is invoked when
- * s.contains(e) would return true immediately prior to
+ * if an element is re-inserted into the set. (An element {@code e}
+ * is reinserted into a set {@code s} if {@code s.add(e)} is invoked when
+ * {@code s.contains(e)} would return {@code true} immediately prior to
* the invocation.)
*
* This implementation spares its clients from the unspecified, generally
@@ -53,22 +53,22 @@
* the copy. (Clients generally appreciate having things returned in the same
* order they were presented.)
*
- * This class provides all of the optional Set operations, and
- * permits null elements. Like HashSet, it provides constant-time
- * performance for the basic operations (add, contains and
- * remove), assuming the hash function disperses elements
+ * This class provides all of the optional {@code Set} operations, and
+ * permits null elements. Like {@code HashSet}, it provides constant-time
+ * performance for the basic operations ({@code add}, {@code contains} and
+ * {@code remove}), assuming the hash function disperses elements
* properly among the buckets. Performance is likely to be just slightly
- * below that of HashSet, due to the added expense of maintaining the
- * linked list, with one exception: Iteration over a LinkedHashSet
+ * below that of {@code HashSet}, due to the added expense of maintaining the
+ * linked list, with one exception: Iteration over a {@code LinkedHashSet}
* requires time proportional to the size of the set, regardless of
- * its capacity. Iteration over a HashSet is likely to be more
+ * its capacity. Iteration over a {@code HashSet} is likely to be more
* expensive, requiring time proportional to its capacity.
*
* A linked hash set has two parameters that affect its performance:
* initial capacity and load factor. They are defined precisely
- * as for HashSet. Note, however, that the penalty for choosing an
+ * as for {@code HashSet}. Note, however, that the penalty for choosing an
* excessively high value for initial capacity is less severe for this class
- * than for HashSet, as iteration times for this class are unaffected
+ * than for {@code HashSet}, as iteration times for this class are unaffected
* by capacity.
*
* Note that this implementation is not synchronized.
@@ -83,9 +83,9 @@
* unsynchronized access to the set: The iterators returned by this class's iterator method are
+ * The iterators returned by this class's {@code iterator} method are
* fail-fast: if the set is modified at any time after the iterator
- * is created, in any way except through the iterator's own remove
+ * is created, in any way except through the iterator's own {@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
@@ -94,7 +94,7 @@
* 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.
diff -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/share/classes/java/util/LinkedList.java
--- a/jdk/src/java.base/share/classes/java/util/LinkedList.java Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/util/LinkedList.java Wed Jul 05 20:45:35 2017 +0200
@@ -312,7 +312,7 @@
* Returns {@code true} if this list contains the specified element.
* More formally, returns {@code true} if and only if this list contains
* at least one element {@code e} such that
- * (o==null ? e==null : o.equals(e)).
+ * {@code Objects.equals(o, e)}.
*
* @param o element whose presence in this list is to be tested
* @return {@code true} if this list contains the specified element
@@ -348,7 +348,7 @@
* if it is present. If this list does not contain the element, it is
* unchanged. More formally, removes the element with the lowest index
* {@code i} such that
- * (o==null ? get(i)==null : o.equals(get(i)))
+ * {@code Objects.equals(o, get(i))}
* (if such an element exists). Returns {@code true} if this list
* contained the specified element (or equivalently, if this list
* changed as a result of the call).
@@ -589,7 +589,7 @@
* Returns the index of the first occurrence of the specified element
* in this list, or -1 if this list does not contain the element.
* More formally, returns the lowest index {@code i} such that
- * (o==null ? get(i)==null : o.equals(get(i))),
+ * {@code Objects.equals(o, get(i))},
* or -1 if there is no such index.
*
* @param o element to search for
@@ -618,7 +618,7 @@
* Returns the index of the last occurrence of the specified element
* in this list, or -1 if this list does not contain the element.
* More formally, returns the highest index {@code i} such that
- * (o==null ? get(i)==null : o.equals(get(i))),
+ * {@code Objects.equals(o, get(i))},
* or -1 if there is no such index.
*
* @param o element to search for
diff -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/share/classes/java/util/List.java
--- a/jdk/src/java.base/share/classes/java/util/List.java Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/util/List.java Wed Jul 05 20:45:35 2017 +0200
@@ -34,50 +34,50 @@
* the list), and search for elements in the list.
*
* Unlike sets, lists typically allow duplicate elements. More formally,
- * lists typically allow pairs of elements e1 and e2
- * such that e1.equals(e2), and they typically allow multiple
+ * lists typically allow pairs of elements {@code e1} and {@code e2}
+ * such that {@code e1.equals(e2)}, and they typically allow multiple
* null elements if they allow null elements at all. It is not inconceivable
* that someone might wish to implement a list that prohibits duplicates, by
* throwing runtime exceptions when the user attempts to insert them, but we
* expect this usage to be rare.
*
- * The List interface places additional stipulations, beyond those
- * specified in the Collection interface, on the contracts of the
- * iterator, add, remove, equals, and
- * hashCode methods. Declarations for other inherited methods are
+ * The {@code List} interface places additional stipulations, beyond those
+ * specified in the {@code Collection} interface, on the contracts of the
+ * {@code iterator}, {@code add}, {@code remove}, {@code equals}, and
+ * {@code hashCode} methods. Declarations for other inherited methods are
* also included here for convenience.
*
- * The List interface provides four methods for positional (indexed)
+ * The {@code List} interface provides four methods for positional (indexed)
* access to list elements. Lists (like Java arrays) are zero based. Note
* that these operations may execute in time proportional to the index value
- * for some implementations (the LinkedList class, for
+ * for some implementations (the {@code LinkedList} class, for
* example). Thus, iterating over the elements in a list is typically
* preferable to indexing through it if the caller does not know the
* implementation.
*
- * The List interface provides a special iterator, called a
- * ListIterator, that allows element insertion and replacement, and
+ * The {@code List} interface provides a special iterator, called a
+ * {@code ListIterator}, that allows element insertion and replacement, and
* bidirectional access in addition to the normal operations that the
- * Iterator interface provides. A method is provided to obtain a
+ * {@code Iterator} interface provides. A method is provided to obtain a
* list iterator that starts at a specified position in the list.
*
- * The List interface provides two methods to search for a specified
+ * The {@code List} interface provides two methods to search for a specified
* object. From a performance standpoint, these methods should be used with
* caution. In many implementations they will perform costly linear
* searches.
*
- * The List interface provides two methods to efficiently insert and
+ * The {@code List} interface provides two methods to efficiently insert and
* remove multiple elements at an arbitrary point in the list.
*
* Note: While it is permissible for lists to contain themselves as elements,
- * extreme caution is advised: the equals and hashCode
+ * extreme caution is advised: the {@code equals} and {@code hashCode}
* methods are no longer well defined on such a list.
*
* Some list implementations have restrictions on the elements that
* they may contain. For example, some implementations prohibit null elements,
* and some have restrictions on the types of their elements. Attempting to
* add an ineligible element throws an unchecked exception, typically
- * NullPointerException or ClassCastException. Attempting
+ * {@code NullPointerException} or {@code ClassCastException}. Attempting
* to query the presence of an ineligible element may throw an exception,
* or it may simply return false; some implementations will exhibit the former
* behavior and some will exhibit the latter. More generally, attempting an
@@ -113,28 +113,28 @@
/**
* Returns the number of elements in this list. If this list contains
- * more than Integer.MAX_VALUE elements, returns
- * Integer.MAX_VALUE.
+ * more than {@code Integer.MAX_VALUE} elements, returns
+ * {@code Integer.MAX_VALUE}.
*
* @return the number of elements in this list
*/
int size();
/**
- * Returns true if this list contains no elements.
+ * Returns {@code true} if this list contains no elements.
*
- * @return true if this list contains no elements
+ * @return {@code true} if this list contains no elements
*/
boolean isEmpty();
/**
- * Returns true if this list contains the specified element.
- * More formally, returns true if and only if this list contains
- * at least one element e such that
- * (o==null ? e==null : o.equals(e)).
+ * Returns {@code true} if this list contains the specified element.
+ * More formally, returns {@code true} if and only if this list contains
+ * at least one element {@code e} such that
+ * {@code Objects.equals(o, e)}.
*
* @param o element whose presence in this list is to be tested
- * @return true if this list contains the specified element
+ * @return {@code true} if this list contains the specified element
* @throws ClassCastException if the type of the specified element
* is incompatible with this list
* (optional)
@@ -179,7 +179,7 @@
*
* If the list fits in the specified array with room to spare (i.e.,
* the array has more elements than the list), the element in the array
- * immediately following the end of the list is set to null.
+ * immediately following the end of the list is set to {@code null}.
* (This is useful in determining the length of the list only if
* the caller knows that the list does not contain any null elements.)
*
@@ -188,16 +188,16 @@
* precise control over the runtime type of the output array, and may,
* under certain circumstances, be used to save allocation costs.
*
- * Suppose x is a list known to contain only strings.
+ * Suppose {@code x} is a list known to contain only strings.
* The following code can be used to dump the list into a newly
- * allocated array of String:
+ * allocated array of {@code String}:
*
*
+ * Similar idioms may be constructed for {@code indexOf} and
+ * {@code lastIndexOf}, and all of the algorithms in the
+ * {@code Collections} class can be applied to a subList.
*
* The semantics of the list returned by this method become undefined if
* the backing list (i.e., this list) is structurally modified in
@@ -702,8 +702,8 @@
* @param toIndex high endpoint (exclusive) of the subList
* @return a view of the specified range within this list
* @throws IndexOutOfBoundsException for an illegal endpoint index value
- * (fromIndex < 0 || toIndex > size ||
- * fromIndex > toIndex)
+ * ({@code fromIndex < 0 || toIndex > size ||
+ * fromIndex > toIndex})
*/
List For compatibility reasons, two
* non-conforming locales are treated as special cases. These are
- * ja_JP_JP and th_TH_TH. These are ill-formed
+ * {@code ja_JP_JP} and {@code th_TH_TH}. These are ill-formed
* in BCP 47 since the variants are too short. To ease migration to BCP 47,
* these are treated specially during construction. These two cases (and only
* these) cause a constructor to generate an extension, all other values behave
* exactly as they did prior to Java 7.
*
- * Java has used ja_JP_JP to represent Japanese as used in
+ * Java has used {@code ja_JP_JP} to represent Japanese as used in
* Japan together with the Japanese Imperial calendar. This is now
* representable using a Unicode locale extension, by specifying the
- * Unicode locale key ca (for "calendar") and type
- * japanese. When the Locale constructor is called with the
+ * Unicode locale key {@code ca} (for "calendar") and type
+ * {@code japanese}. When the Locale constructor is called with the
* arguments "ja", "JP", "JP", the extension "u-ca-japanese" is
* automatically added.
*
- * Java has used th_TH_TH to represent Thai as used in
+ * Java has used {@code th_TH_TH} to represent Thai as used in
* Thailand together with Thai digits. This is also now representable using
* a Unicode locale extension, by specifying the Unicode locale key
- * nu (for "number") and value thai. When the Locale
+ * {@code nu} (for "number") and value {@code thai}. When the Locale
* constructor is called with the arguments "th", "TH", "TH", the
* extension "u-nu-thai" is automatically added.
*
@@ -446,9 +446,9 @@
* Locale's constructor has always converted three language codes to
- * their earlier, obsoleted forms: he maps to iw,
- * yi maps to ji, and id maps to
- * in. This continues to be the case, in order to not break
+ * their earlier, obsoleted forms: {@code he} maps to {@code iw},
+ * {@code yi} maps to {@code ji}, and {@code id} maps to
+ * {@code in}. This continues to be the case, in order to not break
* backwards compatibility.
*
* The APIs added in 1.7 map between the old and new language codes,
@@ -1272,14 +1272,14 @@
* {@link #toLanguageTag}.
*
* Examples: This interface takes the place of the Dictionary class, which
+ * This interface takes the place of the {@code Dictionary} class, which
* was a totally abstract class rather than an interface.
*
- * The Map interface provides three collection views, which
+ * The {@code Map} interface provides three collection views, which
* allow a map's contents to be viewed as a set of keys, collection of values,
* or set of key-value mappings. The order of a map is defined as
* the order in which the iterators on the map's collection views return their
- * elements. Some map implementations, like the TreeMap class, make
- * specific guarantees as to their order; others, like the HashMap
+ * elements. Some map implementations, like the {@code TreeMap} class, make
+ * specific guarantees as to their order; others, like the {@code HashMap}
* class, do not.
*
* Note: great care must be exercised if mutable objects are used as map
* keys. The behavior of a map is not specified if the value of an object is
- * changed in a manner that affects equals comparisons while the
+ * changed in a manner that affects {@code equals} comparisons while the
* object is a key in the map. A special case of this prohibition is that it
* is not permissible for a map to contain itself as a key. While it is
* permissible for a map to contain itself as a value, extreme caution is
- * advised: the equals and hashCode methods are no longer
+ * advised: the {@code equals} and {@code hashCode} methods are no longer
* well defined on such a map.
*
* All general-purpose map implementation classes should provide two
* "standard" constructors: a void (no arguments) constructor which creates an
- * empty map, and a constructor with a single argument of type Map,
+ * empty map, and a constructor with a single argument of type {@code Map},
* which creates a new map with the same key-value mappings as its argument.
* In effect, the latter constructor allows the user to copy any map,
* producing an equivalent map of the desired class. There is no way to
@@ -65,9 +65,9 @@
*
* The "destructive" methods contained in this interface, that is, the
* methods that modify the map on which they operate, are specified to throw
- * UnsupportedOperationException if this map does not support the
+ * {@code UnsupportedOperationException} if this map does not support the
* operation. If this is the case, these methods may, but are not required
- * to, throw an UnsupportedOperationException if the invocation would
+ * to, throw an {@code UnsupportedOperationException} if the invocation would
* have no effect on the map. For example, invoking the {@link #putAll(Map)}
* method on an unmodifiable map may, but is not required to, throw the
* exception if the map whose mappings are to be "superimposed" is empty.
@@ -76,7 +76,7 @@
* may contain. For example, some implementations prohibit null keys and
* values, and some have restrictions on the types of their keys. Attempting
* to insert an ineligible key or value throws an unchecked exception,
- * typically NullPointerException or ClassCastException.
+ * typically {@code NullPointerException} or {@code ClassCastException}.
* Attempting to query the presence of an ineligible key or value may throw an
* exception, or it may simply return false; some implementations will exhibit
* the former behavior and some will exhibit the latter. More generally,
@@ -89,13 +89,13 @@
* 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 #containsKey(Object)
- * containsKey(Object key)} method says: "returns true if and
- * only if this map contains a mapping for a key k such that
- * (key==null ? k==null : key.equals(k))." This specification should
- * not be construed to imply that invoking Map.containsKey
- * with a non-null argument key will cause key.equals(k) to
- * be invoked for any key k. Implementations are free to
- * implement optimizations whereby the equals invocation is avoided,
+ * containsKey(Object key)} method says: "returns {@code true} if and
+ * only if this map contains a mapping for a key {@code k} such that
+ * {@code (key==null ? k==null : key.equals(k))}." This specification should
+ * not be construed to imply that invoking {@code Map.containsKey}
+ * with a non-null argument {@code key} will cause {@code key.equals(k)} to
+ * be invoked for any key {@code k}. Implementations are free to
+ * implement optimizations whereby the {@code equals} invocation is avoided,
* for example, by first comparing the hash codes of the two keys. (The
* {@link Object#hashCode()} specification guarantees that two objects with
* unequal hash codes cannot be equal.) More generally, implementations of
@@ -131,29 +131,29 @@
/**
* Returns the number of key-value mappings in this map. If the
- * map contains more than Integer.MAX_VALUE elements, returns
- * Integer.MAX_VALUE.
+ * map contains more than {@code Integer.MAX_VALUE} elements, returns
+ * {@code Integer.MAX_VALUE}.
*
* @return the number of key-value mappings in this map
*/
int size();
/**
- * Returns true if this map contains no key-value mappings.
+ * Returns {@code true} if this map contains no key-value mappings.
*
- * @return true if this map contains no key-value mappings
+ * @return {@code true} if this map contains no key-value mappings
*/
boolean isEmpty();
/**
- * Returns true if this map contains a mapping for the specified
- * key. More formally, returns true if and only if
- * this map contains a mapping for a key k such that
- * (key==null ? k==null : key.equals(k)). (There can be
+ * Returns {@code true} if this map contains a mapping for the specified
+ * key. More formally, returns {@code true} if and only if
+ * this map contains a mapping for a key {@code k} such that
+ * {@code Objects.equals(key, k)}. (There can be
* at most one such mapping.)
*
* @param key key whose presence in this map is to be tested
- * @return true if this map contains a mapping for the specified
+ * @return {@code true} if this map contains a mapping for the specified
* key
* @throws ClassCastException if the key is of an inappropriate type for
* this map
@@ -165,15 +165,15 @@
boolean containsKey(Object key);
/**
- * Returns true if this map maps one or more keys to the
- * specified value. More formally, returns true if and only if
- * this map contains at least one mapping to a value v such that
- * (value==null ? v==null : value.equals(v)). This operation
+ * Returns {@code true} if this map maps one or more keys to the
+ * specified value. More formally, returns {@code true} if and only if
+ * this map contains at least one mapping to a value {@code v} such that
+ * {@code Objects.equals(value, v)}. This operation
* will probably require time linear in the map size for most
- * implementations of the Map interface.
+ * implementations of the {@code Map} interface.
*
* @param value value whose presence in this map is to be tested
- * @return true if this map maps one or more keys to the
+ * @return {@code true} if this map maps one or more keys to the
* specified value
* @throws ClassCastException if the value is of an inappropriate type for
* this map
@@ -189,8 +189,9 @@
* or {@code null} if this map contains no mapping for the key.
*
* More formally, if this map contains a mapping from a key
- * {@code k} to a value {@code v} such that {@code (key==null ? k==null :
- * key.equals(k))}, then this method returns {@code v}; otherwise
+ * {@code k} to a value {@code v} such that
+ * {@code Objects.equals(key, k)},
+ * then this method returns {@code v}; otherwise
* it returns {@code null}. (There can be at most one such mapping.)
*
* If this map permits null values, then a return value of
@@ -217,18 +218,18 @@
* Associates the specified value with the specified key in this map
* (optional operation). If the map previously contained a mapping for
* the key, the old value is replaced by the specified value. (A map
- * m is said to contain a mapping for a key k if and only
+ * {@code m} is said to contain a mapping for a key {@code k} if and only
* if {@link #containsKey(Object) m.containsKey(k)} would return
- * true.)
+ * {@code true}.)
*
* @param key key with which the specified value is to be associated
* @param value value to be associated with the specified key
- * @return the previous value associated with key, or
- * null if there was no mapping for key.
- * (A null return can also indicate that the map
- * previously associated null with key,
- * if the implementation supports null values.)
- * @throws UnsupportedOperationException if the put operation
+ * @return the previous value associated with {@code key}, or
+ * {@code null} if there was no mapping for {@code key}.
+ * (A {@code null} return can also indicate that the map
+ * previously associated {@code null} with {@code key},
+ * if the implementation supports {@code null} values.)
+ * @throws UnsupportedOperationException if the {@code put} operation
* is not supported by this map
* @throws ClassCastException if the class of the specified key or value
* prevents it from being stored in this map
@@ -242,25 +243,25 @@
/**
* Removes the mapping for a key from this map if it is present
* (optional operation). More formally, if this map contains a mapping
- * from key k to value v such that
- * Returns the value to which this map previously associated the key,
- * or null if the map contained no mapping for the key.
+ * or {@code null} if the map contained no mapping for the key.
*
* If this map permits null values, then a return value of
- * null does not necessarily indicate that the map
+ * {@code null} does not necessarily indicate that the map
* contained no mapping for the key; it's also possible that the map
- * explicitly mapped the key to null.
+ * explicitly mapped the key to {@code null}.
*
* The map will not contain a mapping for the specified key once the
* call returns.
*
* @param key key whose mapping is to be removed from the map
- * @return the previous value associated with key, or
- * null if there was no mapping for key.
- * @throws UnsupportedOperationException if the remove operation
+ * @return the previous value associated with {@code key}, or
+ * {@code null} if there was no mapping for {@code key}.
+ * @throws UnsupportedOperationException if the {@code remove} operation
* is not supported by this map
* @throws ClassCastException if the key is of an inappropriate type for
* this map
@@ -278,12 +279,12 @@
* Copies all of the mappings from the specified map to this map
* (optional operation). The effect of this call is equivalent to that
* of calling {@link #put(Object,Object) put(k, v)} on this map once
- * for each mapping from key k to value v in the
+ * for each mapping from key {@code k} to value {@code v} in the
* specified map. The behavior of this operation is undefined if the
* specified map is modified while the operation is in progress.
*
* @param m mappings to be stored in this map
- * @throws UnsupportedOperationException if the putAll operation
+ * @throws UnsupportedOperationException if the {@code putAll} operation
* is not supported by this map
* @throws ClassCastException if the class of a key or value in the
* specified map prevents it from being stored in this map
@@ -299,7 +300,7 @@
* Removes all of the mappings from this map (optional operation).
* The map will be empty after this call returns.
*
- * @throws UnsupportedOperationException if the clear operation
+ * @throws UnsupportedOperationException if the {@code clear} operation
* is not supported by this map
*/
void clear();
@@ -312,12 +313,12 @@
* The set is backed by the map, so changes to the map are
* reflected in the set, and vice-versa. If the map is modified
* while an iteration over the set is in progress (except through
- * the iterator's own remove operation), the results of
+ * the iterator's own {@code remove} operation), the results of
* the iteration are undefined. The set supports element removal,
* which removes the corresponding mapping from the map, via the
- * Iterator.remove, Set.remove,
- * removeAll, retainAll, and clear
- * operations. It does not support the add or addAll
+ * {@code Iterator.remove}, {@code Set.remove},
+ * {@code removeAll}, {@code retainAll}, and {@code clear}
+ * operations. It does not support the {@code add} or {@code addAll}
* operations.
*
* @return a set view of the keys contained in this map
@@ -329,13 +330,13 @@
* The collection is backed by the map, so changes to the map are
* reflected in the collection, and vice-versa. If the map is
* modified while an iteration over the collection is in progress
- * (except through the iterator's own remove operation),
+ * (except through the iterator's own {@code remove} operation),
* the results of the iteration are undefined. The collection
* supports element removal, which removes the corresponding
- * mapping from the map, via the Iterator.remove,
- * Collection.remove, removeAll,
- * retainAll and clear operations. It does not
- * support the add or addAll operations.
+ * mapping from the map, via the {@code Iterator.remove},
+ * {@code Collection.remove}, {@code removeAll},
+ * {@code retainAll} and {@code clear} operations. It does not
+ * support the {@code add} or {@code addAll} operations.
*
* @return a collection view of the values contained in this map
*/
@@ -346,28 +347,28 @@
* The set is backed by the map, so changes to the map are
* reflected in the set, and vice-versa. If the map is modified
* while an iteration over the set is in progress (except through
- * the iterator's own remove operation, or through the
- * setValue operation on a map entry returned by the
+ * the iterator's own {@code remove} operation, or through the
+ * {@code setValue} operation on a map entry returned by the
* iterator) the results of the iteration are undefined. The set
* supports element removal, which removes the corresponding
- * mapping from the map, via the Iterator.remove,
- * Set.remove, removeAll, retainAll and
- * clear operations. It does not support the
- * add or addAll operations.
+ * mapping from the map, via the {@code Iterator.remove},
+ * {@code Set.remove}, {@code removeAll}, {@code retainAll} and
+ * {@code clear} operations. It does not support the
+ * {@code add} or {@code addAll} operations.
*
* @return a set view of the mappings contained in this map
*/
Set 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 -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/share/classes/java/util/MissingFormatWidthException.java
--- a/jdk/src/java.base/share/classes/java/util/MissingFormatWidthException.java Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/util/MissingFormatWidthException.java Wed Jul 05 20:45:35 2017 +0200
@@ -28,7 +28,7 @@
/**
* Unchecked exception thrown when the format width is required.
*
- * 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 -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/share/classes/java/util/MissingResourceException.java
--- a/jdk/src/java.base/share/classes/java/util/MissingResourceException.java Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/util/MissingResourceException.java Wed Jul 05 20:45:35 2017 +0200
@@ -64,10 +64,10 @@
}
/**
- * Constructs a
* An observable object can have one or more observers. An observer
- * may be any object that implements interface Observer. After an
+ * may be any object that implements interface {@code Observer}. After an
* observable instance changes, an application calling the
- *
* The order in which notifications will be delivered is unspecified.
* The default implementation provided in the Observable class will
@@ -45,12 +45,12 @@
* subclass follows this order, as they choose.
*
* Note that this notification mechanism has nothing to do with threads
- * and is completely separate from the wait and notify
- * mechanism of class Object.
+ * and is completely separate from the {@code wait} and {@code notify}
+ * mechanism of class {@code Object}.
*
* When an observable object is newly created, its set of observers is
* empty. Two observers are considered the same if and only if the
- * equals method returns true for them.
+ * {@code equals} method returns true for them.
*
* @author Chris Warth
* @see java.util.Observable#notifyObservers()
@@ -88,7 +88,7 @@
/**
* Deletes an observer from the set of observers of this object.
- * Passing
- * Each observer has its
- * Each observer has its
- * The {@link #load(java.io.Reader) load(Reader)} /
+ * The {@link #load(java.io.Reader) load(Reader)} {@code /}
* {@link #store(java.io.Writer, java.lang.String) store(Writer, String)}
* methods load and store properties from and to a character based stream
* in a simple line-oriented format specified below.
*
- * The {@link #load(java.io.InputStream) load(InputStream)} /
+ * The {@link #load(java.io.InputStream) load(InputStream)} {@code /}
* {@link #store(java.io.OutputStream, java.lang.String) store(OutputStream, String)}
* methods work the same way as the load(Reader)/store(Writer, String) pair, except
* the input/output stream is encoded in ISO 8859-1 character encoding.
@@ -105,7 +105,7 @@
* This class is thread-safe: multiple threads can share a single
- * Properties object without the need for external synchronization.
+ * {@code Properties} object without the need for external synchronization.
*
* @author Arthur van Hoff
* @author Michael McCloskey
@@ -144,13 +144,13 @@
}
/**
- * Calls the Hashtable method {@code put}. Provided for
- * parallelism with the getProperty method. Enforces use of
+ * Calls the {@code Hashtable} method {@code put}. Provided for
+ * parallelism with the {@code getProperty} method. Enforces use of
* strings for property keys and values. The value returned is the
- * result of the Hashtable call to {@code put}.
+ * result of the {@code Hashtable} call to {@code put}.
*
* @param key the key to be placed into this property list.
- * @param value the value corresponding to key.
+ * @param value the value corresponding to {@code key}.
* @return the previous value of the specified key in this property
* list, or {@code null} if it did not have one.
* @see #getProperty
@@ -756,7 +756,7 @@
* @param writer an output character stream writer.
* @param comments a description of the property list.
* @exception IOException if writing this property list to the specified
- * output stream throws an IOException.
+ * output stream throws an {@code IOException}.
* @exception ClassCastException if this {@code Properties} object
* contains any keys or values that are not {@code Strings}.
* @exception NullPointerException if {@code writer} is null.
@@ -803,7 +803,7 @@
* @param out an output stream.
* @param comments a description of the property list.
* @exception IOException if writing this property list to the specified
- * output stream throws an IOException.
+ * output stream throws an {@code IOException}.
* @exception ClassCastException if this {@code Properties} object
* contains any keys or values that are not {@code Strings}.
* @exception NullPointerException if {@code out} is null.
@@ -860,7 +860,7 @@
*
* @param in the input stream from which to read the XML document.
* @throws IOException if reading from the specified input stream
- * results in an IOException.
+ * results in an {@code IOException}.
* @throws java.io.UnsupportedEncodingException if the document's encoding
* declaration can be read and it specifies an encoding that is not
* supported
@@ -885,15 +885,15 @@
* Emits an XML document representing all of the properties contained
* in this table.
*
- * An invocation of this method of the form props.storeToXML(os,
- * comment) behaves in exactly the same way as the invocation
- * props.storeToXML(os, comment, "UTF-8");.
+ * An invocation of this method of the form {@code props.storeToXML(os,
+ * comment)} behaves in exactly the same way as the invocation
+ * {@code props.storeToXML(os, comment, "UTF-8");}.
*
* @param os the output stream on which to emit the XML document.
* @param comment a description of the property list, or {@code null}
* if no comment is desired.
* @throws IOException if writing to the specified output stream
- * results in an IOException.
+ * results in an {@code IOException}.
* @throws NullPointerException if {@code os} is null.
* @throws ClassCastException if this {@code Properties} object
* contains any keys or values that are not
@@ -933,7 +933,7 @@
* character encoding
*
* @throws IOException if writing to the specified output stream
- * results in an IOException.
+ * results in an {@code IOException}.
* @throws java.io.UnsupportedEncodingException if the encoding is not
* supported by the implementation.
* @throws NullPointerException if {@code os} is {@code null},
@@ -1016,10 +1016,10 @@
* including distinct keys in the default property list if a key
* of the same name has not already been found from the main
* properties list. Properties whose key or value is not
- * of type String are omitted.
+ * of type {@code String} are omitted.
*
- * The returned set is not backed by the Properties object.
- * Changes to this Properties are not reflected in the set,
+ * The returned set is not backed by the {@code Properties} object.
+ * Changes to this {@code Properties} are not reflected in the set,
* or vice versa.
*
* @return a set of keys in this property list where
diff -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/share/classes/java/util/RandomAccess.java
--- a/jdk/src/java.base/share/classes/java/util/RandomAccess.java Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/util/RandomAccess.java Wed Jul 05 20:45:35 2017 +0200
@@ -26,27 +26,27 @@
package java.util;
/**
- * Marker interface used by List implementations to indicate that
+ * Marker interface used by {@code List} implementations to indicate that
* they support fast (generally constant time) random access. The primary
* purpose of this interface is to allow generic algorithms to alter their
* behavior to provide good performance when applied to either random or
* sequential access lists.
*
* The best algorithms for manipulating random access lists (such as
- * ArrayList) can produce quadratic behavior when applied to
- * sequential access lists (such as LinkedList). Generic list
+ * {@code ArrayList}) can produce quadratic behavior when applied to
+ * sequential access lists (such as {@code LinkedList}). Generic list
* algorithms are encouraged to check whether the given list is an
- * instanceof this interface before applying an algorithm that would
+ * {@code instanceof} this interface before applying an algorithm that would
* provide poor performance if it were applied to a sequential access list,
* and to alter their behavior if necessary to guarantee acceptable
* performance.
*
* It is recognized that the distinction between random and sequential
- * access is often fuzzy. For example, some List implementations
+ * access is often fuzzy. For example, some {@code List} implementations
* provide asymptotically linear access times if they get huge, but constant
- * access times in practice. Such a List implementation
+ * access times in practice. Such a {@code List} implementation
* should generally implement this interface. As a rule of thumb, a
- * List implementation should implement this interface if,
+ * {@code List} implementation should implement this interface if,
* for typical instances of the class, this loop:
* A A {@code Scanner} breaks its input into tokens using a
* delimiter pattern, which by default matches whitespace. The resulting
* tokens may then be converted into values of different types using the
- * various next methods.
+ * various {@code next} methods.
*
* For example, this code allows a user to read a number from
- * System.in:
+ * {@code System.in}:
* As another example, this code allows As another example, this code allows {@code long} types to be
+ * assigned from entries in a file {@code myNumbers}:
* The {@link #next} and {@link #hasNext} methods and their
* primitive-type companion methods (such as {@link #nextInt} and
* {@link #hasNextInt}) first skip any input that matches the delimiter
- * pattern, and then attempt to return the next token. Both hasNext
- * and next methods may block waiting for further input. Whether a
- * hasNext method blocks has no connection to whether or not its
- * associated next method will block.
+ * pattern, and then attempt to return the next token. Both {@code hasNext}
+ * and {@code next} methods may block waiting for further input. Whether a
+ * {@code hasNext} method blocks has no connection to whether or not its
+ * associated {@code next} method will block.
*
* The {@link #findInLine}, {@link #findWithinHorizon}, and {@link #skip}
* methods operate independently of the delimiter pattern. These methods will
@@ -122,32 +122,32 @@
* retrieved or skipped via some other method.
*
* Depending upon the type of delimiting pattern, empty tokens may be
- * returned. For example, the pattern "\\s+" will return no empty
+ * returned. For example, the pattern {@code "\\s+"} will return no empty
* tokens since it matches multiple instances of the delimiter. The delimiting
- * pattern "\\s" could return empty tokens since it only passes one
+ * pattern {@code "\\s"} could return empty tokens since it only passes one
* space at a time.
*
* A scanner can read text from any object which implements the {@link
* java.lang.Readable} interface. If an invocation of the underlying
* readable's {@link java.lang.Readable#read} method throws an {@link
* java.io.IOException} then the scanner assumes that the end of the input
- * has been reached. The most recent IOException thrown by the
+ * has been reached. The most recent {@code IOException} thrown by the
* underlying readable can be retrieved via the {@link #ioException} method.
*
- * When a When a {@code Scanner} is closed, it will close its input source
* if the source implements the {@link java.io.Closeable} interface.
*
- * A A {@code Scanner} is not safe for multithreaded use without
* external synchronization.
*
- * Unless otherwise mentioned, passing a Unless otherwise mentioned, passing a {@code null} parameter into
+ * any method of a {@code Scanner} will cause a
+ * {@code NullPointerException} to be thrown.
*
* A scanner will default to interpreting numbers as decimal unless a
* different radix has been set by using the {@link #useRadix} method. The
* {@link #reset} method will reset the value of the scanner's radix to
- * The localized formats are defined in terms of the following parameters,
* which for a particular locale are taken from that locale's {@link
- * java.text.DecimalFormat DecimalFormat} object, df, and its and
+ * java.text.DecimalFormat DecimalFormat} object, {@code df}, and its and
* {@link java.text.DecimalFormatSymbols DecimalFormatSymbols} object,
- * dfs.
+ * {@code dfs}.
*
* Whitespace is not significant in the above regular expressions.
@@ -521,7 +521,7 @@
// Constructors
/**
- * Constructs a If this scanner has not yet been closed then if its underlying
* {@linkplain java.lang.Readable readable} also implements the {@link
- * java.io.Closeable} interface then the readable's close method
+ * java.io.Closeable} interface then the readable's {@code close} method
* will be invoked. If this scanner is already closed then invoking this
* method will have no effect.
*
@@ -1101,9 +1101,9 @@
}
/**
- * Returns the An invocation of this method of the form
- * useDelimiter(pattern) behaves in exactly the same way as the
- * invocation useDelimiter(Pattern.compile(pattern)).
+ * {@code useDelimiter(pattern)} behaves in exactly the same way as the
+ * invocation {@code useDelimiter(Pattern.compile(pattern))}.
*
* Invoking the {@link #reset} method will set the scanner's delimiter
* to the default.
@@ -1236,12 +1236,12 @@
* number matching regular expressions; see
* localized numbers above.
*
- * If the radix is less than If the radix is less than {@code Character.MIN_RADIX}
+ * or greater than {@code Character.MAX_RADIX}, then an
+ * {@code IllegalArgumentException} is thrown.
*
* Invoking the {@link #reset} method will set the scanner's radix to
- * The various The various {@code next}methods of {@code Scanner}
* make a match result available if they complete without throwing an
* exception. For instance, after an invocation of the {@link #nextInt}
* method that returned an int, this method returns a
- * Returns the string representation of this Returns the string representation of this {@code Scanner}. The
+ * string representation of a {@code Scanner} contains information
* that may be useful for debugging. The exact format is unspecified.
*
* @return The string representation of this scanner
@@ -1347,7 +1347,7 @@
* A complete token is preceded and followed by input that matches
* the delimiter pattern. This method may block while waiting for input
* to scan, even if a previous invocation of {@link #hasNext} returned
- * An invocation of this method of the form hasNext(pattern)
+ * An invocation of this method of the form {@code hasNext(pattern)}
* behaves in exactly the same way as the invocation
- * hasNext(Pattern.compile(pattern)).
+ * {@code hasNext(Pattern.compile(pattern))}.
*
* @param pattern a string specifying the pattern to scan
* @return true if and only if this scanner has another token matching
@@ -1405,9 +1405,9 @@
* specified string. If the match is successful, the scanner advances
* past the input that matched the pattern.
*
- * An invocation of this method of the form next(pattern)
+ * An invocation of this method of the form {@code next(pattern)}
* behaves in exactly the same way as the invocation
- * next(Pattern.compile(pattern)).
+ * {@code next(Pattern.compile(pattern))}.
*
* @param pattern a string specifying the pattern to scan
* @return the next token
@@ -1452,7 +1452,7 @@
/**
* Returns the next token if it matches the specified pattern. This
* method may block while waiting for input to scan, even if a previous
- * invocation of {@link #hasNext(Pattern)} returned An invocation of this method of the form findInLine(pattern)
+ * An invocation of this method of the form {@code findInLine(pattern)}
* behaves in exactly the same way as the invocation
- * findInLine(Pattern.compile(pattern)).
+ * {@code findInLine(Pattern.compile(pattern))}.
*
* @param pattern a string specifying the pattern to search for
* @return the text that matched the specified pattern
@@ -1572,7 +1572,7 @@
* scanner advances past the input that matched and returns the string that
* matched the pattern.
* If no such pattern is detected in the input up to the next line
- * separator, then An invocation of this method of the form
- * findWithinHorizon(pattern) behaves in exactly the same way as
+ * {@code findWithinHorizon(pattern)} behaves in exactly the same way as
* the invocation
- * findWithinHorizon(Pattern.compile(pattern, horizon)).
+ * {@code findWithinHorizon(Pattern.compile(pattern, horizon))}.
*
* @param pattern a string specifying the pattern to search for
* @param horizon the search horizon
@@ -1645,14 +1645,14 @@
* null is returned and the scanner's position remains unchanged. This
* method may block waiting for input that matches the pattern.
*
- * A scanner will never search more than A scanner will never search more than {@code horizon} code
* points beyond its current position. Note that a match may be clipped
* by the horizon; that is, an arbitrary match result may have been
* different if the horizon had been larger. The scanner treats the
* horizon as a transparent, non-anchoring bound (see {@link
* Matcher#useTransparentBounds} and {@link Matcher#useAnchoringBounds}).
*
- * If horizon is If horizon is {@code 0}, then the horizon is ignored and
* this method continues to search through the input looking for the
* specified pattern without bound. In this case it may buffer all of
* the input searching for the pattern.
@@ -1696,7 +1696,7 @@
*
* If a match to the specified pattern is not found at the
* current position, then no input is skipped and a
- * NoSuchElementException is thrown.
+ * {@code NoSuchElementException} is thrown.
*
* Since this method seeks to match the specified pattern starting at
* the scanner's current position, patterns that can match a lot of
@@ -1704,8 +1704,8 @@
* amount of input.
*
* Note that it is possible to skip something without risking a
- * An invocation of this method of the form skip(pattern)
+ * An invocation of this method of the form {@code skip(pattern)}
* behaves in exactly the same way as the invocation
- * skip(Pattern.compile(pattern)).
+ * {@code skip(Pattern.compile(pattern))}.
*
* @param pattern a string specifying the pattern to skip over
* @return this scanner
@@ -1767,7 +1767,7 @@
/**
* Scans the next token of the input into a boolean value and returns
- * that value. This method will throw An invocation of this method of the form
- * nextByte() behaves in exactly the same way as the
- * invocation nextByte(radix), where If the next token matches the Integer regular expression defined
- * above then the token is converted into a byte value as if by
+ * above then the token is converted into a {@code byte} value as if by
* removing all locale specific prefixes, group separators, and locale
* specific suffixes, then mapping non-ASCII digits into ASCII
* digits via {@link Character#digit Character.digit}, prepending a
@@ -1859,7 +1859,7 @@
* specified radix.
*
* @param radix the radix used to interpret the token as a byte value
- * @return the byte scanned from the input
+ * @return the {@code byte} scanned from the input
* @throws InputMismatchException
* if the next token does not match the Integer
* regular expression, or is out of range
@@ -1928,14 +1928,14 @@
}
/**
- * Scans the next token of the input as a short.
+ * Scans the next token of the input as a {@code short}.
*
* An invocation of this method of the form
- * nextShort() behaves in exactly the same way as the
- * invocation nextShort(radix), where If the next token matches the Integer regular expression defined
- * above then the token is converted into a short value as if by
+ * above then the token is converted into a {@code short} value as if by
* removing all locale specific prefixes, group separators, and locale
* specific suffixes, then mapping non-ASCII digits into ASCII
* digits via {@link Character#digit Character.digit}, prepending a
@@ -1965,7 +1965,7 @@
* specified radix.
*
* @param radix the radix used to interpret the token as a short value
- * @return the short scanned from the input
+ * @return the {@code short} scanned from the input
* @throws InputMismatchException
* if the next token does not match the Integer
* regular expression, or is out of range
@@ -2058,14 +2058,14 @@
}
/**
- * Scans the next token of the input as an int.
+ * Scans the next token of the input as an {@code int}.
*
* An invocation of this method of the form
- * nextInt() behaves in exactly the same way as the
- * invocation nextInt(radix), where If the next token matches the Integer regular expression defined
- * above then the token is converted into an int value as if by
+ * above then the token is converted into an {@code int} value as if by
* removing all locale specific prefixes, group separators, and locale
* specific suffixes, then mapping non-ASCII digits into ASCII
* digits via {@link Character#digit Character.digit}, prepending a
@@ -2095,7 +2095,7 @@
* specified radix.
*
* @param radix the radix used to interpret the token as an int value
- * @return the int scanned from the input
+ * @return the {@code int} scanned from the input
* @throws InputMismatchException
* if the next token does not match the Integer
* regular expression, or is out of range
@@ -2164,14 +2164,14 @@
}
/**
- * Scans the next token of the input as a long.
+ * Scans the next token of the input as a {@code long}.
*
* An invocation of this method of the form
- * nextLong() behaves in exactly the same way as the
- * invocation nextLong(radix), where If the next token matches the Integer regular expression defined
- * above then the token is converted into a long value as if by
+ * above then the token is converted into a {@code long} value as if by
* removing all locale specific prefixes, group separators, and locale
* specific suffixes, then mapping non-ASCII digits into ASCII
* digits via {@link Character#digit Character.digit}, prepending a
@@ -2201,7 +2201,7 @@
* specified radix.
*
* @param radix the radix used to interpret the token as an int value
- * @return the long scanned from the input
+ * @return the {@code long} scanned from the input
* @throws InputMismatchException
* if the next token does not match the Integer
* regular expression, or is out of range
@@ -2306,15 +2306,15 @@
}
/**
- * Scans the next token of the input as a float.
- * This method will throw If the next token matches the Float regular expression defined above
- * then the token is converted into a float value as if by
+ * then the token is converted into a {@code float} value as if by
* removing all locale specific prefixes, group separators, and locale
* specific suffixes, then mapping non-ASCII digits into ASCII
* digits via {@link Character#digit Character.digit}, prepending a
@@ -2325,7 +2325,7 @@
* is passed to {@link Float#parseFloat(String) Float.parseFloat} as
* appropriate.
*
- * @return the float scanned from the input
+ * @return the {@code float} scanned from the input
* @throws InputMismatchException
* if the next token does not match the Float
* regular expression, or is out of range
@@ -2373,15 +2373,15 @@
}
/**
- * Scans the next token of the input as a double.
- * This method will throw If the next token matches the Float regular expression defined above
- * then the token is converted into a double value as if by
+ * then the token is converted into a {@code double} value as if by
* removing all locale specific prefixes, group separators, and locale
* specific suffixes, then mapping non-ASCII digits into ASCII
* digits via {@link Character#digit Character.digit}, prepending a
@@ -2392,7 +2392,7 @@
* is passed to {@link Double#parseDouble(String) Double.parseDouble} as
* appropriate.
*
- * @return the double scanned from the input
+ * @return the {@code double} scanned from the input
* @throws InputMismatchException
* if the next token does not match the Float
* regular expression, or is out of range
@@ -2421,12 +2421,12 @@
/**
* Returns true if the next token in this scanner's input can be
- * interpreted as a An invocation of this method of the form
- * nextBigInteger() behaves in exactly the same way as the
- * invocation nextBigInteger(radix), where If the next token matches the Integer regular expression defined
- * above then the token is converted into a BigInteger value as if
+ * above then the token is converted into a {@code BigInteger} value as if
* by removing all group separators, mapping non-ASCII digits into ASCII
* digits via the {@link Character#digit Character.digit}, and passing the
* resulting string to the {@link
@@ -2494,7 +2494,7 @@
* BigInteger(String, int)} constructor with the specified radix.
*
* @param radix the radix used to interpret the token
- * @return the BigInteger scanned from the input
+ * @return the {@code BigInteger} scanned from the input
* @throws InputMismatchException
* if the next token does not match the Integer
* regular expression, or is out of range
@@ -2525,12 +2525,12 @@
/**
* Returns true if the next token in this scanner's input can be
- * interpreted as a If the next token matches the Decimal regular expression defined
- * above then the token is converted into a BigDecimal value as if
+ * above then the token is converted into a {@code BigDecimal} value as if
* by removing all group separators, mapping non-ASCII digits into ASCII
* digits via the {@link Character#digit Character.digit}, and passing the
* resulting string to the {@link
* java.math.BigDecimal#BigDecimal(java.lang.String) BigDecimal(String)}
* constructor.
*
- * @return the BigDecimal scanned from the input
+ * @return the {@code BigDecimal} scanned from the input
* @throws InputMismatchException
* if the next token does not match the Decimal
* regular expression, or is out of range
@@ -2594,7 +2594,7 @@
* #useDelimiter}, {@link #useLocale}, or {@link #useRadix}.
*
* An invocation of this method of the form
- * scanner.reset() behaves in exactly the same way as the
+ * {@code scanner.reset()} behaves in exactly the same way as the
* invocation
*
* The Set interface places additional stipulations, beyond those
- * inherited from the Collection interface, on the contracts of all
- * constructors and on the contracts of the add, equals and
- * hashCode methods. Declarations for other inherited methods are
+ * The {@code Set} interface places additional stipulations, beyond those
+ * inherited from the {@code Collection} interface, on the contracts of all
+ * constructors and on the contracts of the {@code add}, {@code equals} and
+ * {@code hashCode} methods. Declarations for other inherited methods are
* also included here for convenience. (The specifications accompanying these
- * declarations have been tailored to the Set interface, but they do
+ * declarations have been tailored to the {@code Set} interface, but they do
* not contain any additional stipulations.)
*
* The additional stipulation on constructors is, not surprisingly,
@@ -45,7 +45,7 @@
*
* Note: Great care must be exercised if mutable objects are used as set
* elements. The behavior of a set is not specified if the value of an object
- * is changed in a manner that affects equals comparisons while the
+ * is changed in a manner that affects {@code equals} comparisons while the
* object is an element in the set. A special case of this prohibition is
* that it is not permissible for a set to contain itself as an element.
*
@@ -53,7 +53,7 @@
* they may contain. For example, some implementations prohibit null elements,
* and some have restrictions on the types of their elements. Attempting to
* add an ineligible element throws an unchecked exception, typically
- * NullPointerException or ClassCastException. Attempting
+ * {@code NullPointerException} or {@code ClassCastException}. Attempting
* to query the presence of an ineligible element may throw an exception,
* or it may simply return false; some implementations will exhibit the former
* behavior and some will exhibit the latter. More generally, attempting an
@@ -87,28 +87,28 @@
/**
* Returns the number of elements in this set (its cardinality). If this
- * set contains more than Integer.MAX_VALUE elements, returns
- * Integer.MAX_VALUE.
+ * set contains more than {@code Integer.MAX_VALUE} elements, returns
+ * {@code Integer.MAX_VALUE}.
*
* @return the number of elements in this set (its cardinality)
*/
int size();
/**
- * Returns true if this set contains no elements.
+ * Returns {@code true} if this set contains no elements.
*
- * @return true if this set contains no elements
+ * @return {@code true} if this set contains no elements
*/
boolean isEmpty();
/**
- * Returns true if this set contains the specified element.
- * More formally, returns true if and only if this set
- * contains an element e such that
- * (o==null ? e==null : o.equals(e)).
+ * Returns {@code true} if this set contains the specified element.
+ * More formally, returns {@code true} if and only if this set
+ * contains an element {@code e} such that
+ * {@code Objects.equals(o, e)}.
*
* @param o element whose presence in this set is to be tested
- * @return true if this set contains the specified element
+ * @return {@code true} if this set contains the specified element
* @throws ClassCastException if the type of the specified element
* is incompatible with this set
* (optional)
@@ -155,7 +155,7 @@
* If this set fits in the specified array with room to spare
* (i.e., the array has more elements than this set), the element in
* the array immediately following the end of the set is set to
- * null. (This is useful in determining the length of this
+ * {@code null}. (This is useful in determining the length of this
* set only if the caller knows that this set does not contain
* any null elements.)
*
@@ -168,15 +168,15 @@
* precise control over the runtime type of the output array, and may,
* under certain circumstances, be used to save allocation costs.
*
- * Suppose x is a set known to contain only strings.
+ * Suppose {@code x} is a set known to contain only strings.
* The following code can be used to dump the set into a newly allocated
- * array of String:
+ * array of {@code String}:
*
* The stipulation above does not imply that sets must accept all
* elements; sets may refuse to add any particular element, including
- * null, and throw an exception, as described in the
+ * {@code null}, and throw an exception, as described in the
* specification for {@link Collection#add Collection.add}.
* Individual set implementations should clearly document any
* restrictions on the elements that they may contain.
*
* @param e element to be added to this set
- * @return true if this set did not already contain the specified
+ * @return {@code true} if this set did not already contain the specified
* element
- * @throws UnsupportedOperationException if the add operation
+ * @throws UnsupportedOperationException if the {@code add} operation
* is not supported by this set
* @throws ClassCastException if the class of the specified element
* prevents it from being added to this set
@@ -227,23 +227,23 @@
/**
* Removes the specified element from this set if it is present
- * (optional operation). More formally, removes an element e
+ * (optional operation). More formally, removes an element {@code e}
* such that
- * (o==null ? e==null : o.equals(e)), if
- * this set contains such an element. Returns true if this set
+ * {@code Objects.equals(o, e)}, if
+ * this set contains such an element. Returns {@code true} if this set
* contained the element (or equivalently, if this set changed as a
* result of the call). (This set will not contain the element once the
* call returns.)
*
* @param o object to be removed from this set, if present
- * @return true if this set contained the specified element
+ * @return {@code true} if this set contained the specified element
* @throws ClassCastException if the type of the specified element
* is incompatible with this set
* (optional)
* @throws NullPointerException if the specified element is null and this
* set does not permit null elements
* (optional)
- * @throws UnsupportedOperationException if the remove operation
+ * @throws UnsupportedOperationException if the {@code remove} operation
* is not supported by this set
*/
boolean remove(Object o);
@@ -252,12 +252,12 @@
// Bulk Operations
/**
- * Returns true if this set contains all of the elements of the
+ * Returns {@code true} if this set contains all of the elements of the
* specified collection. If the specified collection is also a set, this
- * method returns true if it is a subset of this set.
+ * method returns {@code true} if it is a subset of this set.
*
* @param c collection to be checked for containment in this set
- * @return true if this set contains all of the elements of the
+ * @return {@code true} if this set contains all of the elements of the
* specified collection
* @throws ClassCastException if the types of one or more elements
* in the specified collection are incompatible with this
@@ -275,15 +275,15 @@
/**
* Adds all of the elements in the specified collection to this set if
* they're not already present (optional operation). If the specified
- * collection is also a set, the addAll operation effectively
+ * collection is also a set, the {@code addAll} operation effectively
* modifies this set so that its value is the union of the two
* sets. The behavior of this operation is undefined if the specified
* collection is modified while the operation is in progress.
*
* @param c collection containing elements to be added to this set
- * @return true if this set changed as a result of the call
+ * @return {@code true} if this set changed as a result of the call
*
- * @throws UnsupportedOperationException if the addAll operation
+ * @throws UnsupportedOperationException if the {@code addAll} operation
* is not supported by this set
* @throws ClassCastException if the class of an element of the
* specified collection prevents it from being added to this set
@@ -305,8 +305,8 @@
* intersection of the two sets.
*
* @param c collection containing elements to be retained in this set
- * @return true if this set changed as a result of the call
- * @throws UnsupportedOperationException if the retainAll operation
+ * @return {@code true} if this set changed as a result of the call
+ * @throws UnsupportedOperationException if the {@code retainAll} operation
* is not supported by this set
* @throws ClassCastException if the class of an element of this set
* is incompatible with the specified collection
@@ -327,8 +327,8 @@
* the two sets.
*
* @param c collection containing elements to be removed from this set
- * @return true if this set changed as a result of the call
- * @throws UnsupportedOperationException if the removeAll operation
+ * @return {@code true} if this set changed as a result of the call
+ * @throws UnsupportedOperationException if the {@code removeAll} operation
* is not supported by this set
* @throws ClassCastException if the class of an element of this set
* is incompatible with the specified collection
@@ -346,7 +346,7 @@
* Removes all of the elements from this set (optional operation).
* The set will be empty after this call returns.
*
- * @throws UnsupportedOperationException if the clear method
+ * @throws UnsupportedOperationException if the {@code clear} method
* is not supported by this set
*/
void clear();
@@ -356,7 +356,7 @@
/**
* Compares the specified object with this set for equality. Returns
- * true if the specified object is also a set, the two sets
+ * {@code true} if the specified object is also a set, the two sets
* have the same size, and every member of the specified set is
* contained in this set (or equivalently, every member of this set is
* contained in the specified set). This definition ensures that the
@@ -364,17 +364,17 @@
* set interface.
*
* @param o object to be compared for equality with this set
- * @return true if the specified object is equal to this set
+ * @return {@code true} if the specified object is equal to this set
*/
boolean equals(Object o);
/**
* Returns the hash code value for this set. The hash code of a set is
* defined to be the sum of the hash codes of the elements in the set,
- * where the hash code of a null element is defined to be zero.
- * This ensures that s1.equals(s2) implies that
- * s1.hashCode()==s2.hashCode() for any two sets s1
- * and s2, as required by the general contract of
+ * where the hash code of a {@code null} element is defined to be zero.
+ * This ensures that {@code s1.equals(s2)} implies that
+ * {@code s1.hashCode()==s2.hashCode()} for any two sets {@code s1}
+ * and {@code s2}, as required by the general contract of
* {@link Object#hashCode}.
*
* @return the hash code value for this set
diff -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/share/classes/java/util/SortedSet.java
--- a/jdk/src/java.base/share/classes/java/util/SortedSet.java Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/util/SortedSet.java Wed Jul 05 20:45:35 2017 +0200
@@ -34,38 +34,38 @@
* to take advantage of the ordering. (This interface is the set
* analogue of {@link SortedMap}.)
*
- * All elements inserted into a sorted set must implement the Comparable
+ * All elements inserted into a sorted set must implement the {@code Comparable}
* interface (or be accepted by the specified comparator). Furthermore, all
- * such elements must be mutually comparable: e1.compareTo(e2)
- * (or comparator.compare(e1, e2)) must not throw a
- * ClassCastException for any elements e1 and e2 in
+ * such elements must be mutually comparable: {@code e1.compareTo(e2)}
+ * (or {@code comparator.compare(e1, e2)}) must not throw a
+ * {@code ClassCastException} for any elements {@code e1} and {@code e2} in
* the sorted set. Attempts to violate this restriction will cause the
* offending method or constructor invocation to throw a
- * ClassCastException.
+ * {@code ClassCastException}.
*
* Note that the ordering maintained by a sorted set (whether or not an
* explicit comparator is provided) must be consistent with equals if
- * the sorted set is to correctly implement the Set interface. (See
- * the Comparable interface or Comparator interface for a
+ * the sorted set is to correctly implement the {@code Set} interface. (See
+ * the {@code Comparable} interface or {@code Comparator} interface for a
* precise definition of consistent with equals.) This is so because
- * the Set interface is defined in terms of the equals
+ * the {@code Set} interface is defined in terms of the {@code equals}
* operation, but a sorted set performs all element comparisons using its
- * compareTo (or compare) method, so two elements that are
+ * {@code compareTo} (or {@code compare}) method, so two elements that are
* deemed equal by this method are, from the standpoint of the sorted set,
* equal. The behavior of a sorted set is well-defined even if its
* ordering is inconsistent with equals; it just fails to obey the general
- * contract of the Set interface.
+ * contract of the {@code Set} interface.
*
* All general-purpose sorted set implementation classes should
* provide four "standard" constructors: 1) A void (no arguments)
* constructor, which creates an empty sorted set sorted according to
* the natural ordering of its elements. 2) A constructor with a
- * single argument of type Comparator, which creates an empty
+ * single argument of type {@code Comparator}, which creates an empty
* sorted set sorted according to the specified comparator. 3) A
- * constructor with a single argument of type Collection,
+ * constructor with a single argument of type {@code Collection},
* which creates a new sorted set with the same elements as its
* argument, sorted according to the natural ordering of the elements.
- * 4) A constructor with a single argument of type SortedSet,
+ * 4) A constructor with a single argument of type {@code SortedSet},
* which creates a new sorted set with the same elements and the same
* ordering as the input sorted set. There is no way to enforce this
* recommendation, as interfaces cannot contain constructors.
@@ -75,17 +75,17 @@
* endpoint but not their high endpoint (where applicable).
* If you need a closed range (which includes both endpoints), and
* the element type allows for calculation of the successor of a given
- * value, merely request the subrange from lowEndpoint to
- * successor(highEndpoint). For example, suppose that s
+ * value, merely request the subrange from {@code lowEndpoint} to
+ * {@code successor(highEndpoint)}. For example, suppose that {@code s}
* is a sorted set of strings. The following idiom obtains a view
- * containing all of the strings in s from low to
- * high, inclusive: This interface is a member of the
@@ -108,98 +108,98 @@
public interface SortedSet The returned set will throw an IllegalArgumentException
+ * The returned set will throw an {@code IllegalArgumentException}
* on an attempt to insert an element outside its range.
*
* @param fromElement low endpoint (inclusive) of the returned set
* @param toElement high endpoint (exclusive) of the returned set
* @return a view of the portion of this set whose elements range from
- * fromElement, inclusive, to toElement, exclusive
- * @throws ClassCastException if fromElement and
- * toElement cannot be compared to one another using this
+ * {@code fromElement}, inclusive, to {@code toElement}, exclusive
+ * @throws ClassCastException if {@code fromElement} and
+ * {@code toElement} cannot be compared to one another using this
* set's comparator (or, if the set has no comparator, using
* natural ordering). Implementations may, but are not required
- * to, throw this exception if fromElement or
- * toElement cannot be compared to elements currently in
+ * to, throw this exception if {@code fromElement} or
+ * {@code toElement} cannot be compared to elements currently in
* the set.
- * @throws NullPointerException if fromElement or
- * toElement is null and this set does not permit null
+ * @throws NullPointerException if {@code fromElement} or
+ * {@code toElement} is null and this set does not permit null
* elements
- * @throws IllegalArgumentException if fromElement is
- * greater than toElement; or if this set itself
- * has a restricted range, and fromElement or
- * toElement lies outside the bounds of the range
+ * @throws IllegalArgumentException if {@code fromElement} is
+ * greater than {@code toElement}; or if this set itself
+ * has a restricted range, and {@code fromElement} or
+ * {@code toElement} lies outside the bounds of the range
*/
SortedSet The returned set will throw an IllegalArgumentException
+ * The returned set will throw an {@code IllegalArgumentException}
* on an attempt to insert an element outside its range.
*
* @param toElement high endpoint (exclusive) of the returned set
* @return a view of the portion of this set whose elements are strictly
- * less than toElement
- * @throws ClassCastException if toElement is not compatible
+ * less than {@code toElement}
+ * @throws ClassCastException if {@code toElement} is not compatible
* with this set's comparator (or, if the set has no comparator,
- * if toElement does not implement {@link Comparable}).
+ * if {@code toElement} does not implement {@link Comparable}).
* Implementations may, but are not required to, throw this
- * exception if toElement cannot be compared to elements
+ * exception if {@code toElement} cannot be compared to elements
* currently in the set.
- * @throws NullPointerException if toElement is null and
+ * @throws NullPointerException if {@code toElement} is null and
* this set does not permit null elements
* @throws IllegalArgumentException if this set itself has a
- * restricted range, and toElement lies outside the
+ * restricted range, and {@code toElement} lies outside the
* bounds of the range
*/
SortedSet The returned set will throw an IllegalArgumentException
+ * The returned set will throw an {@code IllegalArgumentException}
* on an attempt to insert an element outside its range.
*
* @param fromElement low endpoint (inclusive) of the returned set
* @return a view of the portion of this set whose elements are greater
- * than or equal to fromElement
- * @throws ClassCastException if fromElement is not compatible
+ * than or equal to {@code fromElement}
+ * @throws ClassCastException if {@code fromElement} is not compatible
* with this set's comparator (or, if the set has no comparator,
- * if fromElement does not implement {@link Comparable}).
+ * if {@code fromElement} does not implement {@link Comparable}).
* Implementations may, but are not required to, throw this
- * exception if fromElement cannot be compared to elements
+ * exception if {@code fromElement} cannot be compared to elements
* currently in the set.
- * @throws NullPointerException if fromElement is null
+ * @throws NullPointerException if {@code fromElement} is null
* and this set does not permit null elements
* @throws IllegalArgumentException if this set itself has a
- * restricted range, and fromElement lies outside the
+ * restricted range, and {@code fromElement} lies outside the
* bounds of the range
*/
SortedSet
* When a stack is first created, it contains no items.
@@ -60,7 +60,7 @@
* addElement(item)
* The set of delimiters (the characters that separate tokens) may
* be specified either at creation time or on a per-token basis.
*
- * An instance of
- * A StringTokenizer object internally maintains a current
+ * A {@code StringTokenizer} object internally maintains a current
* position within the string to be tokenized. Some operations advance this
* current position past the characters processed.
* A token is returned by taking a substring of the string that was used to
- * create the StringTokenizer object.
+ * create the {@code StringTokenizer} object.
*
* The following is one example of the use of the tokenizer. The code:
*
- * StringTokenizer is a legacy class that is retained for
+ * {@code StringTokenizer} is a legacy class that is retained for
* compatibility reasons although its use is discouraged in new code. It is
- * recommended that anyone seeking this functionality use the split
- * method of String or the java.util.regex package instead.
+ * recommended that anyone seeking this functionality use the {@code split}
+ * method of {@code String} or the java.util.regex package instead.
*
- * The following example illustrates how the String.split
+ * The following example illustrates how the {@code String.split}
* method can be used to break up a string into its basic tokens:
*
- * If the
- * Note that if delim is null, this constructor does
+ * Note that if {@code delim} is {@code null}, this constructor does
* not throw an exception. However, trying to invoke other methods on the
- * resulting StringTokenizer may result in a
- * NullPointerException.
+ * resulting {@code StringTokenizer} may result in a
+ * {@code NullPointerException}.
*
* @param str a string to be parsed.
* @param delim the delimiters.
* @param returnDelims flag indicating whether to return the delimiters
* as tokens.
- * @exception NullPointerException if str is
- * Note that if delim is null, this constructor does
+ * Note that if {@code delim} is {@code null}, this constructor does
* not throw an exception. However, trying to invoke other methods on the
- * resulting StringTokenizer may result in a
- * NullPointerException.
+ * resulting {@code StringTokenizer} may result in a
+ * {@code NullPointerException}.
*
* @param str a string to be parsed.
* @param delim the delimiters.
- * @exception NullPointerException if str is Corresponding to each Timer object is a single background
+ * Corresponding to each {@code Timer} object is a single background
* thread that is used to execute all of the timer's tasks, sequentially.
* Timer tasks should complete quickly. If a timer task takes excessive time
* to complete, it "hogs" the timer's task execution thread. This can, in
@@ -40,26 +40,26 @@
* execute in rapid succession when (and if) the offending task finally
* completes.
*
- * After the last live reference to a Timer object goes away
+ * After the last live reference to a {@code Timer} object goes away
* and all outstanding tasks have completed execution, the timer's task
* execution thread terminates gracefully (and becomes subject to garbage
* collection). However, this can take arbitrarily long to occur. By
* default, the task execution thread does not run as a daemon thread,
* so it is capable of keeping an application from terminating. If a caller
* wants to terminate a timer's task execution thread rapidly, the caller
- * should invoke the timer's cancel method.
+ * should invoke the timer's {@code cancel} method.
*
* If the timer's task execution thread terminates unexpectedly, for
- * example, because its stop method is invoked, any further
+ * example, because its {@code stop} method is invoked, any further
* attempt to schedule a task on the timer will result in an
- * IllegalStateException, as if the timer's cancel
+ * {@code IllegalStateException}, as if the timer's {@code cancel}
* method had been invoked.
*
* This class is thread-safe: multiple threads can share a single
- * Timer object without the need for external synchronization.
+ * {@code Timer} object without the need for external synchronization.
*
* This class does not offer real-time guarantees: it schedules
- * tasks using the Object.wait(long) method.
+ * tasks using the {@code Object.wait(long)} method.
*
* Java 5.0 introduced the {@code java.util.concurrent} package and
* one of the concurrency utilities therein is the {@link
@@ -181,8 +181,8 @@
*
* @param task task to be scheduled.
* @param delay delay in milliseconds before task is to be executed.
- * @throws IllegalArgumentException if delay is negative, or
- * delay + System.currentTimeMillis() is negative.
+ * @throws IllegalArgumentException if {@code delay} is negative, or
+ * {@code delay + System.currentTimeMillis()} is negative.
* @throws IllegalStateException if task was already scheduled or
* cancelled, timer was cancelled, or timer thread terminated.
* @throws NullPointerException if {@code task} is null
@@ -199,7 +199,7 @@
*
* @param task task to be scheduled.
* @param time time at which task is to be executed.
- * @throws IllegalArgumentException if time.getTime() is negative.
+ * @throws IllegalArgumentException if {@code time.getTime()} is negative.
* @throws IllegalStateException if task was already scheduled or
* cancelled, timer was cancelled, or timer thread terminated.
* @throws NullPointerException if {@code task} or {@code time} is null
@@ -219,7 +219,7 @@
* background activity), subsequent executions will be delayed as well.
* In the long run, the frequency of execution will generally be slightly
* lower than the reciprocal of the specified period (assuming the system
- * clock underlying Object.wait(long) is accurate).
+ * clock underlying {@code Object.wait(long)} is accurate).
*
* Fixed-delay execution is appropriate for recurring activities
* that require "smoothness." In other words, it is appropriate for
@@ -259,7 +259,7 @@
* background activity), subsequent executions will be delayed as well.
* In the long run, the frequency of execution will generally be slightly
* lower than the reciprocal of the specified period (assuming the system
- * clock underlying Object.wait(long) is accurate). As a
+ * clock underlying {@code Object.wait(long)} is accurate). As a
* consequence of the above, if the scheduled first time is in the past,
* it is scheduled for immediate execution.
*
@@ -298,7 +298,7 @@
* activity), two or more executions will occur in rapid succession to
* "catch up." In the long run, the frequency of execution will be
* exactly the reciprocal of the specified period (assuming the system
- * clock underlying Object.wait(long) is accurate).
+ * clock underlying {@code Object.wait(long)} is accurate).
*
* Fixed-rate execution is appropriate for recurring activities that
* are sensitive to absolute time, such as ringing a chime every
@@ -339,7 +339,7 @@
* activity), two or more executions will occur in rapid succession to
* "catch up." In the long run, the frequency of execution will be
* exactly the reciprocal of the specified period (assuming the system
- * clock underlying Object.wait(long) is accurate). As a
+ * clock underlying {@code Object.wait(long)} is accurate). As a
* consequence of the above, if the scheduled first time is in the past,
* then any "missed" executions will be scheduled for immediate "catch up"
* execution.
@@ -378,7 +378,7 @@
* in Date.getTime() format. This method checks timer state, task state,
* and initial execution time, but not period.
*
- * @throws IllegalArgumentException if time is negative.
+ * @throws IllegalArgumentException if {@code time} is negative.
* @throws IllegalStateException if task was already scheduled or
* cancelled, timer was cancelled, or timer thread terminated.
* @throws NullPointerException if {@code task} is null
diff -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/share/classes/java/util/TimerTask.java
--- a/jdk/src/java.base/share/classes/java/util/TimerTask.java Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/util/TimerTask.java Wed Jul 05 20:45:35 2017 +0200
@@ -102,7 +102,7 @@
* will never run again. (If the task is running when this call occurs,
* the task will run to completion, but will never run again.)
*
- * Note that calling this method from within the run method of
+ * Note that calling this method from within the {@code run} method of
* a repeating timer task absolutely guarantees that the timer task will
* not run again.
*
@@ -114,7 +114,7 @@
* Returns false if the task was scheduled for one-time execution
* and has already run, or if the task was never scheduled, or if
* the task was already cancelled. (Loosely speaking, this method
- * returns true if it prevents one or more scheduled
+ * returns {@code true} if it prevents one or more scheduled
* executions from taking place.)
*/
public boolean cancel() {
diff -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/share/classes/java/util/TreeSet.java
--- a/jdk/src/java.base/share/classes/java/util/TreeSet.java Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/util/TreeSet.java Wed Jul 05 20:45:35 2017 +0200
@@ -220,7 +220,7 @@
* Returns {@code true} if this set contains the specified element.
* More formally, returns {@code true} if and only if this set
* contains an element {@code e} such that
- * (o==null ? e==null : o.equals(e)).
+ * {@code Objects.equals(o, e)}.
*
* @param o object to be checked for containment in this set
* @return {@code true} if this set contains the specified element
@@ -238,7 +238,7 @@
* Adds the specified element to this set if it is not already present.
* More formally, adds the specified element {@code e} to this set if
* the set contains no element {@code e2} such that
- * (e==null ? e2==null : e.equals(e2)).
+ * {@code Objects.equals(e, e2)}.
* If this set already contains the element, the call leaves the set
* unchanged and returns {@code false}.
*
@@ -258,7 +258,7 @@
/**
* Removes the specified element from this set if it is present.
* More formally, removes an element {@code e} such that
- * (o==null ? e==null : o.equals(e)),
+ * {@code Objects.equals(o, e)},
* if this set contains such an element. Returns {@code true} if
* this set contained the element (or equivalently, if this set
* changed as a result of the call). (This set will not contain the
diff -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/share/classes/java/util/UnknownFormatConversionException.java
--- a/jdk/src/java.base/share/classes/java/util/UnknownFormatConversionException.java Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/util/UnknownFormatConversionException.java Wed Jul 05 20:45:35 2017 +0200
@@ -28,7 +28,7 @@
/**
* Unchecked exception thrown when an unknown conversion is given.
*
- * Unless otherwise specified, passing a null argument to
+ * 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 -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/share/classes/java/util/UnknownFormatFlagsException.java
--- a/jdk/src/java.base/share/classes/java/util/UnknownFormatFlagsException.java Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/util/UnknownFormatFlagsException.java Wed Jul 05 20:45:35 2017 +0200
@@ -28,7 +28,7 @@
/**
* Unchecked exception thrown when an unknown flag is given.
*
- * 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 -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/share/classes/java/util/Vector.java
--- a/jdk/src/java.base/share/classes/java/util/Vector.java Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/util/Vector.java Wed Jul 05 20:45:35 2017 +0200
@@ -365,7 +365,7 @@
* Returns {@code true} if this vector contains the specified element.
* More formally, returns {@code true} if and only if this vector
* contains at least one element {@code e} such that
- * (o==null ? e==null : o.equals(e)).
+ * {@code Objects.equals(o, e)}.
*
* @param o element whose presence in this vector is to be tested
* @return {@code true} if this vector contains the specified element
@@ -378,7 +378,7 @@
* Returns the index of the first occurrence of the specified element
* in this vector, or -1 if this vector does not contain the element.
* More formally, returns the lowest index {@code i} such that
- * (o==null ? get(i)==null : o.equals(get(i))),
+ * {@code Objects.equals(o, get(i))},
* or -1 if there is no such index.
*
* @param o element to search for
@@ -394,7 +394,7 @@
* this vector, searching forwards from {@code index}, or returns -1 if
* the element is not found.
* More formally, returns the lowest index {@code i} such that
- * (i >= index && (o==null ? get(i)==null : o.equals(get(i)))),
+ * {@code (i >= index && Objects.equals(o, get(i)))},
* or -1 if there is no such index.
*
* @param o element to search for
@@ -422,7 +422,7 @@
* Returns the index of the last occurrence of the specified element
* in this vector, or -1 if this vector does not contain the element.
* More formally, returns the highest index {@code i} such that
- * (o==null ? get(i)==null : o.equals(get(i))),
+ * {@code Objects.equals(o, get(i))},
* or -1 if there is no such index.
*
* @param o element to search for
@@ -438,7 +438,7 @@
* this vector, searching backwards from {@code index}, or returns -1 if
* the element is not found.
* More formally, returns the highest index {@code i} such that
- * (i <= index && (o==null ? get(i)==null : o.equals(get(i)))),
+ * {@code (i <= index && Objects.equals(o, get(i)))},
* or -1 if there is no such index.
*
* @param o element to search for
@@ -798,7 +798,7 @@
* Removes the first occurrence of the specified element in this Vector
* If the Vector does not contain the element, it is unchanged. More
* formally, removes the element with the lowest index i such that
- * {@code (o==null ? get(i)==null : o.equals(get(i)))} (if such
+ * {@code Objects.equals(o, get(i))} (if such
* an element exists).
*
* @param o element to be removed from this Vector, if present
@@ -991,8 +991,8 @@
* true if and only if the specified Object is also a List, both Lists
* have the same size, and all corresponding pairs of elements in the two
* Lists are equal. (Two elements {@code e1} and
- * {@code e2} are equal if {@code (e1==null ? e2==null :
- * e1.equals(e2))}.) In other words, two Lists are defined to be
+ * {@code e2} are equal if {@code Objects.equals(e1, e2)}.)
+ * In other words, two Lists are defined to be
* equal if they contain the same elements in the same order.
*
* @param o the Object to be compared for equality with this Vector
diff -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/share/classes/java/util/WeakHashMap.java
--- a/jdk/src/java.base/share/classes/java/util/WeakHashMap.java Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/util/WeakHashMap.java Wed Jul 05 20:45:35 2017 +0200
@@ -34,79 +34,79 @@
/**
- * Hash table based implementation of the Map interface, with
+ * Hash table based implementation of the {@code Map} interface, with
* weak keys.
- * An entry in a WeakHashMap will automatically be removed when
+ * An entry in a {@code WeakHashMap} will automatically be removed when
* its key is no longer in ordinary use. More precisely, the presence of a
* mapping for a given key will not prevent the key from being discarded by the
* garbage collector, that is, made finalizable, finalized, and then reclaimed.
* When a key has been discarded its entry is effectively removed from the map,
- * so this class behaves somewhat differently from other Map
+ * so this class behaves somewhat differently from other {@code Map}
* implementations.
*
* Both null values and the null key are supported. This class has
- * performance characteristics similar to those of the HashMap
+ * performance characteristics similar to those of the {@code HashMap}
* class, and has the same efficiency parameters of initial capacity
* and load factor.
*
* Like most collection classes, this class is not synchronized.
- * A synchronized WeakHashMap may be constructed using the
+ * A synchronized {@code WeakHashMap} may be constructed using the
* {@link Collections#synchronizedMap Collections.synchronizedMap}
* method.
*
* This class is intended primarily for use with key objects whose
- * equals methods test for object identity using the
- * == operator. Once such a key is discarded it can never be
+ * {@code equals} methods test for object identity using the
+ * {@code ==} operator. Once such a key is discarded it can never be
* recreated, so it is impossible to do a lookup of that key in a
- * WeakHashMap at some later time and be surprised that its entry
+ * {@code WeakHashMap} at some later time and be surprised that its entry
* has been removed. This class will work perfectly well with key objects
- * whose equals methods are not based upon object identity, such
- * as String instances. With such recreatable key objects,
- * however, the automatic removal of WeakHashMap entries whose
+ * whose {@code equals} methods are not based upon object identity, such
+ * as {@code String} instances. With such recreatable key objects,
+ * however, the automatic removal of {@code WeakHashMap} entries whose
* keys have been discarded may prove to be confusing.
*
- * The behavior of the WeakHashMap class depends in part upon
+ * The behavior of the {@code WeakHashMap} class depends in part upon
* the actions of the garbage collector, so several familiar (though not
- * required) Map invariants do not hold for this class. Because
+ * required) {@code Map} invariants do not hold for this class. Because
* the garbage collector may discard keys at any time, a
- * WeakHashMap may behave as though an unknown thread is silently
+ * {@code WeakHashMap} may behave as though an unknown thread is silently
* removing entries. In particular, even if you synchronize on a
- * WeakHashMap instance and invoke none of its mutator methods, it
- * is possible for the size method to return smaller values over
- * time, for the isEmpty method to return false and
- * then true, for the containsKey method to return
- * true and later false for a given key, for the
- * get method to return a value for a given key but later return
- * null, for the put method to return
- * null and the remove method to return
- * false for a key that previously appeared to be in the map, and
+ * {@code WeakHashMap} instance and invoke none of its mutator methods, it
+ * is possible for the {@code size} method to return smaller values over
+ * time, for the {@code isEmpty} method to return {@code false} and
+ * then {@code true}, for the {@code containsKey} method to return
+ * {@code true} and later {@code false} for a given key, for the
+ * {@code get} method to return a value for a given key but later return
+ * {@code null}, for the {@code put} method to return
+ * {@code null} and the {@code remove} method to return
+ * {@code false} for a key that previously appeared to be in the map, and
* for successive examinations of the key set, the value collection, and
* the entry set to yield successively smaller numbers of elements.
*
- * Each key object in a WeakHashMap is stored indirectly as
+ * Each key object in a {@code WeakHashMap} is stored indirectly as
* the referent of a weak reference. Therefore a key will automatically be
* removed only after the weak references to it, both inside and outside of the
* map, have been cleared by the garbage collector.
*
* Implementation note: The value objects in a
- * WeakHashMap are held by ordinary strong references. Thus care
+ * {@code WeakHashMap} are held by ordinary strong references. Thus care
* should be taken to ensure that value objects do not strongly refer to their
* own keys, either directly or indirectly, since that will prevent the keys
* from being discarded. Note that a value object may refer indirectly to its
- * key via the WeakHashMap itself; that is, a value object may
+ * key via the {@code WeakHashMap} itself; that is, a value object may
* strongly refer to some other key object whose associated value object, in
* turn, strongly refers to the key of the first value object. If the values
* in the map do not rely on the map holding strong references to them, one way
* to deal with this is to wrap values themselves within
- * WeakReferences before
- * inserting, as in: m.put(key, new WeakReference(value)),
- * and then unwrapping upon each get.
+ * {@code WeakReferences} before
+ * inserting, as in: {@code m.put(key, new WeakReference(value))},
+ * and then unwrapping upon each {@code get}.
*
- * The iterators returned by the iterator method of the collections
+ * The iterators returned by the {@code iterator} method of the collections
* 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 {@link
+ * {@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 future.
@@ -114,7 +114,7 @@
* 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.
@@ -196,11 +196,11 @@
}
/**
- * Constructs a new, empty WeakHashMap with the given initial
+ * Constructs a new, empty {@code WeakHashMap} with the given initial
* capacity and the given load factor.
*
- * @param initialCapacity The initial capacity of the WeakHashMap
- * @param loadFactor The load factor of the WeakHashMap
+ * @param initialCapacity The initial capacity of the {@code WeakHashMap}
+ * @param loadFactor The load factor of the {@code WeakHashMap}
* @throws IllegalArgumentException if the initial capacity is negative,
* or if the load factor is nonpositive.
*/
@@ -223,10 +223,10 @@
}
/**
- * Constructs a new, empty WeakHashMap with the given initial
+ * Constructs a new, empty {@code WeakHashMap} with the given initial
* capacity and the default load factor (0.75).
*
- * @param initialCapacity The initial capacity of the WeakHashMap
+ * @param initialCapacity The initial capacity of the {@code WeakHashMap}
* @throws IllegalArgumentException if the initial capacity is negative
*/
public WeakHashMap(int initialCapacity) {
@@ -234,7 +234,7 @@
}
/**
- * Constructs a new, empty WeakHashMap with the default initial
+ * Constructs a new, empty {@code WeakHashMap} with the default initial
* capacity (16) and load factor (0.75).
*/
public WeakHashMap() {
@@ -242,8 +242,8 @@
}
/**
- * Constructs a new WeakHashMap with the same mappings as the
- * specified map. The WeakHashMap is created with the default
+ * Constructs a new {@code WeakHashMap} with the same mappings as the
+ * specified map. The {@code WeakHashMap} is created with the default
* load factor (0.75) and an initial capacity sufficient to hold the
* mappings in the specified map.
*
@@ -365,7 +365,7 @@
}
/**
- * Returns true if this map contains no key-value mappings.
+ * Returns {@code true} if this map contains no key-value mappings.
* This result is a snapshot, and may not reflect unprocessed
* entries that will be removed before next attempted access
* because they are no longer referenced.
@@ -379,8 +379,9 @@
* or {@code null} if this map contains no mapping for the key.
*
* More formally, if this map contains a mapping from a key
- * {@code k} to a value {@code v} such that {@code (key==null ? k==null :
- * key.equals(k))}, then this method returns {@code v}; otherwise
+ * {@code k} to a value {@code v} such that
+ * {@code Objects.equals(key, k)},
+ * then this method returns {@code v}; otherwise
* it returns {@code null}. (There can be at most one such mapping.)
*
* A return value of {@code null} does not necessarily
@@ -406,12 +407,12 @@
}
/**
- * Returns true if this map contains a mapping for the
+ * Returns {@code true} if this map contains a mapping for the
* specified key.
*
* @param key The key whose presence in this map is to be tested
- * @return true if there is a mapping for key;
- * false otherwise
+ * @return {@code true} if there is a mapping for {@code key};
+ * {@code false} otherwise
*/
public boolean containsKey(Object key) {
return getEntry(key) != null;
@@ -439,10 +440,10 @@
*
* @param key key with which the specified value is to be associated.
* @param value value to be associated with the specified key.
- * @return the previous value associated with key, or
- * null if there was no mapping for key.
- * (A null return can also indicate that the map
- * previously associated null with key.)
+ * @return the previous value associated with {@code key}, or
+ * {@code null} if there was no mapping for {@code key}.
+ * (A {@code null} return can also indicate that the map
+ * previously associated {@code null} with {@code key}.)
*/
public V put(K key, V value) {
Object k = maskNull(key);
@@ -568,23 +569,23 @@
/**
* Removes the mapping for a key from this weak hash map if it is present.
- * More formally, if this map contains a mapping from key k to
- * value v such that Returns the value to which this map previously associated the key,
- * or null if the map contained no mapping for the key. A
- * return value of null does not necessarily indicate
+ * or {@code null} if the map contained no mapping for the key. A
+ * return value of {@code null} does not necessarily indicate
* that the map contained no mapping for the key; it's also possible
- * that the map explicitly mapped the key to null.
+ * that the map explicitly mapped the key to {@code null}.
*
* The map will not contain a mapping for the specified key once the
* call returns.
*
* @param key key whose mapping is to be removed from the map
- * @return the previous value associated with key, or
- * null if there was no mapping for key
+ * @return the previous value associated with {@code key}, or
+ * {@code null} if there was no mapping for {@code key}
*/
public V remove(Object key) {
Object k = maskNull(key);
@@ -664,11 +665,11 @@
}
/**
- * Returns true if this map maps one or more keys to the
+ * Returns {@code true} if this map maps one or more keys to the
* specified value.
*
* @param value value whose presence in this map is to be tested
- * @return true if this map maps one or more keys to the
+ * @return {@code true} if this map maps one or more keys to the
* specified value
*/
public boolean containsValue(Object value) {
@@ -855,12 +856,12 @@
* The set is backed by the map, so changes to the map are
* reflected in the set, and vice-versa. If the map is modified
* while an iteration over the set is in progress (except through
- * the iterator's own remove operation), the results of
+ * the iterator's own {@code remove} operation), the results of
* the iteration are undefined. The set supports element removal,
* which removes the corresponding mapping from the map, via the
- * Iterator.remove, Set.remove,
- * removeAll, retainAll, and clear
- * operations. It does not support the add or addAll
+ * {@code Iterator.remove}, {@code Set.remove},
+ * {@code removeAll}, {@code retainAll}, and {@code clear}
+ * operations. It does not support the {@code add} or {@code addAll}
* operations.
*/
public Set This interface contains query methods used to determine the
* results of a match against a regular expression. The match boundaries,
* groups and group boundaries can be seen but not modified through
- * a Capturing groups are indexed from left
* to right, starting at one. Group zero denotes the entire pattern, so
- * the expression m.start(0) is equivalent to
- * m.start(). Capturing groups are indexed from left
* to right, starting at one. Group zero denotes the entire pattern, so
- * the expression m.end(0) is equivalent to
- * m.end(). For a matcher m with input sequence s,
- * the expressions m.group() and
- * s.substring(m.start(), m.end())
+ * the expressions m.{@code group()} and
+ * s.{@code substring(}m.{@code start(),} m.{@code end())}
* are equivalent. Note that some patterns, for example a*, match the empty
+ * Note that some patterns, for example {@code a*}, match the empty
* string. This method will return the empty string when the pattern
* successfully matches the empty string in the input. For a matcher m, input sequence s, and group index
- * g, the expressions m.group(g) and
- * s.substring(m.start(g), m.end(g))
+ * g, the expressions m.{@code group(}g{@code )} and
+ * s.{@code substring(}m.{@code start(}g{@code
+ * ),} m.{@code end(}g{@code ))}
* are equivalent. Capturing groups are indexed from left
* to right, starting at one. Group zero denotes the entire pattern, so
- * the expression m.group(0) is equivalent to m.group().
+ * the expression {@code m.group(0)} is equivalent to {@code m.group()}.
* If the match was successful but the group specified failed to match
- * any part of the input sequence, then null is returned. Note
- * that some groups, for example (a*), match the empty string.
+ * any part of the input sequence, then {@code null} is returned. Note
+ * that some groups, for example {@code (a*)}, match the empty string.
* This method will return the empty string when such a group successfully
* matches the empty string in the input. This method causes this matcher to lose information
@@ -359,7 +359,7 @@
* The new pattern used by this matcher
* @return This matcher
* @throws IllegalArgumentException
- * If newPattern is null
+ * If newPattern is {@code null}
* @since 1.5
*/
public Matcher usePattern(Pattern newPattern) {
@@ -444,14 +444,14 @@
*
* Capturing groups are indexed from left
* to right, starting at one. Group zero denotes the entire pattern, so
- * the expression m.start(0) is equivalent to
- * m.start(). Capturing groups are indexed from left
* to right, starting at one. Group zero denotes the entire pattern, so
- * the expression m.end(0) is equivalent to
- * m.end(). For a matcher m with input sequence s,
- * the expressions m.group() and
- * s.substring(m.start(), m.end())
+ * the expressions m.{@code group()} and
+ * s.{@code substring(}m.{@code start(),} m.{@code end())}
* are equivalent. Note that some patterns, for example a*, match the empty
+ * Note that some patterns, for example {@code a*}, match the empty
* string. This method will return the empty string when the pattern
* successfully matches the empty string in the input. For a matcher m, input sequence s, and group index
- * g, the expressions m.group(g) and
- * s.substring(m.start(g), m.end(g))
+ * g, the expressions m.{@code group(}g{@code )} and
+ * s.{@code substring(}m.{@code start(}g{@code
+ * ),} m.{@code end(}g{@code ))}
* are equivalent. Capturing groups are indexed from left
* to right, starting at one. Group zero denotes the entire pattern, so
- * the expression m.group(0) is equivalent to m.group().
+ * the expression {@code m.group(0)} is equivalent to {@code m.group()}.
* If the match was successful but the group specified failed to match
- * any part of the input sequence, then null is returned. Note
- * that some groups, for example (a*), match the empty string.
+ * any part of the input sequence, then {@code null} is returned. Note
+ * that some groups, for example {@code (a*)}, match the empty string.
* This method will return the empty string when such a group successfully
* matches the empty string in the input. If the match was successful but the group specified failed to match
- * any part of the input sequence, then null is returned. Note
- * that some groups, for example (a*), match the empty string.
+ * any part of the input sequence, then {@code null} is returned. Note
+ * that some groups, for example {@code (a*)}, match the empty string.
* This method will return the empty string when such a group successfully
* matches the empty string in the input. If the match succeeds then more information can be obtained via the
- * start, end, and group methods. If the match succeeds then more information can be obtained via the
- * start, end, and group methods. If the match succeeds then more information can be obtained via the
- * start, end, and group methods, and subsequent
+ * {@code start}, {@code end}, and {@code group} methods, and subsequent
* invocations of the {@link #find()} method will start at the first
* character not matched by this match. If the match succeeds then more information can be obtained via the
- * start, end, and group methods. It appends the given replacement string to the string buffer.
* The replacement string may contain references to subsequences
* captured during the previous match: Each occurrence of
- * ${name} or $g
+ * Note that backslashes (\) and dollar signs ($) in
+ * Note that backslashes ({@code \}) and dollar signs ({@code $}) in
* the replacement string may cause the results to be different than if it
* were being treated as a literal replacement string. Dollar signs may be
* treated as references to captured subsequences as described above, and
@@ -852,8 +853,8 @@
*
* This method is intended to be used in a loop together with the
* {@link #appendTail appendTail} and {@link #find find} methods. The
- * following code, for example, writes one dog two dogs in the
- * yard to the standard-output stream: It appends the given replacement string to the string builder.
* The replacement string may contain references to subsequences
* captured during the previous match: Each occurrence of
- * $g will be replaced by the result of
- * evaluating {@link #group(int) group}(g).
- * The first number after the $ is always treated as part of
+ * {@code $}g will be replaced by the result of
+ * evaluating {@link #group(int) group}{@code (}g{@code )}.
+ * The first number after the {@code $} is always treated as part of
* the group reference. Subsequent numbers are incorporated into g if
* they would form a legal group reference. Only the numerals '0'
* through '9' are considered as potential components of the group
- * reference. If the second group matched the string "foo", for
- * example, then passing the replacement string "$2bar" would
- * cause "foobar" to be appended to the string builder. A dollar
- * sign ($) may be included as a literal in the replacement
- * string by preceding it with a backslash (\$).
+ * reference. If the second group matched the string {@code "foo"}, for
+ * example, then passing the replacement string {@code "$2bar"} would
+ * cause {@code "foobar"} to be appended to the string builder. A dollar
+ * sign ({@code $}) may be included as a literal in the replacement
+ * string by preceding it with a backslash ({@code \$}).
*
- * Note that backslashes (\) and dollar signs ($) in
+ * Note that backslashes ({@code \}) and dollar signs ({@code $}) in
* the replacement string may cause the results to be different than if it
* were being treated as a literal replacement string. Dollar signs may be
* treated as references to captured subsequences as described above, and
@@ -945,8 +946,8 @@
*
* This method is intended to be used in a loop together with the
* {@link #appendTail appendTail} and {@link #find find} methods. The
- * following code, for example, writes one dog two dogs in the
- * yard to the standard-output stream: Note that backslashes (\) and dollar signs ($) in
+ * Note that backslashes ({@code \}) and dollar signs ({@code $}) in
* the replacement string may cause the results to be different than if it
* were being treated as a literal replacement string. Dollar signs may be
* treated as references to captured subsequences as described above, and
* backslashes are used to escape literal characters in the replacement
* string.
*
- * Given the regular expression a*b, the input
- * "aabfooaabfooabfoob", and the replacement string
- * "-", an invocation of this method on a matcher for that
- * expression would yield the string "-foo-foo-foo-".
+ * Given the regular expression {@code a*b}, the input
+ * {@code "aabfooaabfooabfoob"}, and the replacement string
+ * {@code "-"}, an invocation of this method on a matcher for that
+ * expression would yield the string {@code "-foo-foo-foo-"}.
*
* Invoking this method changes this matcher's state. If the matcher
* is to be used in further matching operations then it should first be
@@ -1186,18 +1187,18 @@
* references to captured subsequences as in the {@link #appendReplacement
* appendReplacement} method.
*
- * Note that backslashes (\) and dollar signs ($) in
+ * Note that backslashes ({@code \}) and dollar signs ({@code $}) in
* a replacement string may cause the results to be different than if it
* were being treated as a literal replacement string. Dollar signs may be
* treated as references to captured subsequences as described above, and
* backslashes are used to escape literal characters in the replacement
* string.
*
- * Given the regular expression dog, the input
- * "zzzdogzzzdogzzz", and the function
+ * Given the regular expression {@code dog}, the input
+ * {@code "zzzdogzzzdogzzz"}, and the function
* {@code mr -> mr.group().toUpperCase()}, an invocation of this method on
* a matcher for that expression would yield the string
- * "zzzDOGzzzDOGzzz".
+ * {@code "zzzDOGzzzDOGzzz"}.
*
* Invoking this method changes this matcher's state. If the matcher
* is to be used in further matching operations then it should first be
@@ -1360,17 +1361,17 @@
* string may contain references to captured subsequences as in the {@link
* #appendReplacement appendReplacement} method.
*
- * Note that backslashes (\) and dollar signs ($) in
+ * Note that backslashes ({@code \}) and dollar signs ({@code $}) in
* the replacement string may cause the results to be different than if it
* were being treated as a literal replacement string. Dollar signs may be
* treated as references to captured subsequences as described above, and
* backslashes are used to escape literal characters in the replacement
* string.
*
- * Given the regular expression dog, the input
- * "zzzdogzzzdogzzz", and the replacement string
- * "cat", an invocation of this method on a matcher for that
- * expression would yield the string "zzzcatzzzdogzzz". Given the regular expression {@code dog}, the input
+ * {@code "zzzdogzzzdogzzz"}, and the replacement string
+ * {@code "cat"}, an invocation of this method on a matcher for that
+ * expression would yield the string {@code "zzzcatzzzdogzzz"}. Invoking this method changes this matcher's state. If the matcher
* is to be used in further matching operations then it should first be
@@ -1408,18 +1409,18 @@
* references to captured subsequences as in the {@link #appendReplacement
* appendReplacement} method.
*
- * Note that backslashes (\) and dollar signs ($) in
+ * Note that backslashes ({@code \}) and dollar signs ({@code $}) in
* the replacement string may cause the results to be different than if it
* were being treated as a literal replacement string. Dollar signs may be
* treated as references to captured subsequences as described above, and
* backslashes are used to escape literal characters in the replacement
* string.
*
- * Given the regular expression dog, the input
- * "zzzdogzzzdogzzz", and the function
+ * Given the regular expression {@code dog}, the input
+ * {@code "zzzdogzzzdogzzz"}, and the function
* {@code mr -> mr.group().toUpperCase()}, an invocation of this method on
* a matcher for that expression would yield the string
- * "zzzDOGzzzdogzzz".
+ * {@code "zzzDOGzzzdogzzz"}.
*
* Invoking this method changes this matcher's state. If the matcher
* is to be used in further matching operations then it should first be
@@ -1471,8 +1472,8 @@
* Sets the limits of this matcher's region. The region is the part of the
* input sequence that will be searched to find a match. Invoking this
* method resets the matcher, and then sets the region to start at the
- * index specified by the Depending on the transparency and anchoring being used (see
* {@link #useTransparentBounds useTransparentBounds} and
@@ -1534,8 +1535,8 @@
/**
* Queries the transparency of region bounds for this matcher.
*
- * This method returns true if this matcher uses
- * transparent bounds, false if it uses opaque
+ * This method returns {@code true} if this matcher uses
+ * transparent bounds, {@code false} if it uses opaque
* bounds.
*
* See {@link #useTransparentBounds useTransparentBounds} for a
@@ -1543,8 +1544,8 @@
*
* By default, a matcher uses opaque region boundaries.
*
- * @return true iff this matcher is using transparent bounds,
- * false otherwise.
+ * @return {@code true} iff this matcher is using transparent bounds,
+ * {@code false} otherwise.
* @see java.util.regex.Matcher#useTransparentBounds(boolean)
* @since 1.5
*/
@@ -1555,9 +1556,9 @@
/**
* Sets the transparency of region bounds for this matcher.
*
- * Invoking this method with an argument of true will set this
+ * Invoking this method with an argument of {@code true} will set this
* matcher to use transparent bounds. If the boolean
- * argument is false, then opaque bounds will be used.
+ * argument is {@code false}, then opaque bounds will be used.
*
* Using transparent bounds, the boundaries of this
* matcher's region are transparent to lookahead, lookbehind,
@@ -1586,16 +1587,16 @@
/**
* Queries the anchoring of region bounds for this matcher.
*
- * This method returns true if this matcher uses
- * anchoring bounds, false otherwise.
+ * This method returns {@code true} if this matcher uses
+ * anchoring bounds, {@code false} otherwise.
*
* See {@link #useAnchoringBounds useAnchoringBounds} for a
* description of anchoring bounds.
*
* By default, a matcher uses anchoring region boundaries.
*
- * @return true iff this matcher is using anchoring bounds,
- * false otherwise.
+ * @return {@code true} iff this matcher is using anchoring bounds,
+ * {@code false} otherwise.
* @see java.util.regex.Matcher#useAnchoringBounds(boolean)
* @since 1.5
*/
@@ -1606,9 +1607,9 @@
/**
* Sets the anchoring of region bounds for this matcher.
*
- * Invoking this method with an argument of true will set this
+ * Invoking this method with an argument of {@code true} will set this
* matcher to use anchoring bounds. If the boolean
- * argument is false, then non-anchoring bounds will be
+ * argument is {@code false}, then non-anchoring bounds will be
* used.
*
* Using anchoring bounds, the boundaries of this
@@ -1631,7 +1632,7 @@
/**
* Returns the string representation of this matcher. The
- * string representation of a The backslash character ('\') serves to introduce escaped
+ * The backslash character ({@code '\'}) serves to introduce escaped
* constructs, as defined in the table above, as well as to quote characters
* that otherwise would be interpreted as unescaped constructs. Thus the
- * expression \\ matches a single backslash and \{ matches a
+ * expression {@code \\} matches a single backslash and It is an error to use a backslash prior to any alphabetic character that
@@ -396,18 +396,18 @@
* It is therefore necessary to double backslashes in string
* literals that represent regular expressions to protect them from
* interpretation by the Java bytecode compiler. The string literal
- * "\b", for example, matches a single backspace character when
- * interpreted as a regular expression, while "\\b" matches a
- * word boundary. The string literal "\(hello\)" is illegal
+ * Character classes may appear within other character classes, and
* may be composed by the union operator (implicit) and the intersection
- * operator (&&).
+ * operator ({@code &&}).
* The union operator denotes a class that contains every character that is
* in at least one of its operand classes. The intersection operator
* denotes a class that contains every character that is in both of its
@@ -420,16 +420,16 @@
* summary="Precedence of character class operators.">
* Note that a different set of metacharacters are in effect inside
* a character class than outside a character class. For instance, the
- * regular expression . loses its special meaning inside a
- * character class, while the expression - becomes a range
+ * regular expression {@code .} loses its special meaning inside a
+ * character class, while the expression {@code -} becomes a range
* forming metacharacter.
*
* If {@link #UNIX_LINES} mode is activated, then the only line terminators
* recognized are newline characters.
*
- * The regular expression . matches any character except a line
+ * The regular expression {@code .} matches any character except a line
* terminator unless the {@link #DOTALL} flag is specified.
*
- * By default, the regular expressions ^ and $ ignore
+ * By default, the regular expressions {@code ^} and {@code $} ignore
* line terminators and only match at the beginning and the end, respectively,
* of the entire input sequence. If {@link #MULTILINE} mode is activated then
- * ^ matches at the beginning of input and after any line terminator
- * except at the end of input. When in {@link #MULTILINE} mode $
+ * {@code ^} matches at the beginning of input and after any line terminator
+ * except at the end of input. When in {@link #MULTILINE} mode {@code $}
* matches just before a line terminator or the end of the input sequence.
*
* Capturing groups are numbered by counting their opening parentheses from
- * left to right. In the expression ((A)(B(C))), for example, there
+ * left to right. In the expression {@code ((A)(B(C)))}, for example, there
* are four such groups: Group zero always stands for the entire expression.
@@ -502,31 +502,31 @@
* may also be retrieved from the matcher once the match operation is complete.
*
* A capturing group can also be assigned a "name", a named-capturing group,
+ * A capturing group can also be assigned a "name", a {@code named-capturing group},
* and then be back-referenced later by the "name". Group names are composed of
- * the following characters. The first character must be a letter.
+ * the following characters. The first character must be a {@code letter}.
*
* A named-capturing group is still numbered as described in
+ * A {@code named-capturing group} is still numbered as described in
* Group number.
*
* The captured input associated with a group is always the subsequence
* that the group most recently matched. If a group is evaluated a second time
* because of quantification then its previously-captured value, if any, will
* be retained if the second evaluation fails. Matching the string
- * "aba" against the expression (a(b)?)+, for example, leaves
- * group two set to "b". All captured input is discarded at the
+ * {@code "aba"} against the expression {@code (a(b)?)+}, for example, leaves
+ * group two set to {@code "b"}. All captured input is discarded at the
* beginning of each match.
*
- * Groups beginning with (? are either pure, non-capturing groups
+ * Groups beginning with {@code (?} are either pure, non-capturing groups
* that do not capture text and do not count towards the group total, or
* named-capturing group.
*
@@ -537,26 +537,26 @@
* Standard #18: Unicode Regular Expression, plus RL2.1
* Canonical Equivalents.
*
- * Unicode escape sequences such as \u2014 in Java source code
+ * Unicode escape sequences such as
* A Unicode character can also be represented in a regular-expression by
* using its Hex notation(hexadecimal code point value) directly as described in construct
- * \x{...}, for example a supplementary character U+2011F
- * can be specified as \x{2011F}, instead of two consecutive
+ *
* Unicode scripts, blocks, categories and binary properties are written with
- * the \p and \P constructs as in Perl.
- * \p{prop} matches if
- * the input has the property prop, while \P{prop}
+ * the {@code \p} and {@code \P} constructs as in Perl.
+ *
* Scripts, blocks, categories and binary properties can be used both inside
@@ -567,7 +567,7 @@
* {@code IsHiragana}, or by using the {@code script} keyword (or its short
* form {@code sc}) as in {@code script=Hiragana} or {@code sc=Hiragana}.
*
- * The script names supported by
- * The block names supported by
@@ -595,7 +595,7 @@
*
*
* Binary properties are specified with the prefix {@code Is}, as in
- * {@code IsAlphabetic}. The supported binary properties by
*
* Categories that behave like the java.lang.Character
* boolean ismethodname methods (except for the deprecated ones) are
- * available through the same \p{prop} syntax where
- * the specified property has the name javamethodname.
+ * available through the same The The {@code Pattern} engine performs traditional NFA-based matching
* with ordered alternation as occurs in Perl 5.
*
* Perl constructs not supported by this class: Predefined character classes (Unicode character)
- * \X Match Unicode
+ * The backreference constructs, \g{n} for
+ * The backreference constructs, The named character construct, \N{name}
+ * The named character construct, The conditional constructs
- * (?(condition)X) and
- * (?(condition)X|Y),
+ * {@code (?(}condition{@code )}X{@code )} and
+ * {@code (?(}condition{@code )}X{@code |}Y{@code )},
* The embedded code constructs (?{code})
- * and (??{code}), The embedded code constructs The embedded comment syntax (?#comment), and The embedded comment syntax {@code (?#comment)}, and The preprocessing operations \l \u,
- * \L, and \U. The preprocessing operations {@code \l} In Perl, \1 through \9 are always interpreted
- * as back references; a backslash-escaped number greater than 9 is
+ * In Perl, {@code \1} through {@code \9} are always interpreted
+ * as back references; a backslash-escaped number greater than {@code 9} is
* treated as a back reference if at least that many subexpressions exist,
* otherwise it is interpreted, if possible, as an octal escape. In this
* class octal escapes must always begin with a zero. In this class,
- * \1 through \9 are always interpreted as back
+ * {@code \1} through {@code \9} are always interpreted as back
* references, and a larger number is accepted as a back reference if at
* least that many subexpressions exist at that point in the regular
* expression, otherwise the parser will drop digits until the number is
* smaller or equal to the existing number of groups or it is one digit.
* Perl uses the g flag to request a match that resumes
+ * Perl uses the {@code g} flag to request a match that resumes
* where the last match left off. This functionality is provided implicitly
* by the {@link Matcher} class: Repeated invocations of the {@link
* Matcher#find find} method will resume where the last match left off,
@@ -786,11 +786,11 @@
/**
* Enables Unix lines mode.
*
- * In this mode, only the '\n' line terminator is recognized
- * in the behavior of ., ^, and $.
+ * In this mode, only the {@code '\n'} line terminator is recognized
+ * in the behavior of {@code .}, {@code ^}, and {@code $}.
*
* Unix lines mode can also be enabled via the embedded flag
- * expression (?d).
+ * expression {@code (?d)}.
*/
public static final int UNIX_LINES = 0x01;
@@ -803,7 +803,7 @@
* #UNICODE_CASE} flag in conjunction with this flag.
*
* Case-insensitive matching can also be enabled via the embedded flag
- * expression (?i).
+ * expression {@code (?i)}.
*
* Specifying this flag may impose a slight performance penalty. In this mode, whitespace is ignored, and embedded comments starting
- * with # are ignored until the end of a line.
+ * with {@code #} are ignored until the end of a line.
*
* Comments mode can also be enabled via the embedded flag
- * expression (?x).
+ * expression {@code (?x)}.
*/
public static final int COMMENTS = 0x04;
/**
* Enables multiline mode.
*
- * In multiline mode the expressions ^ and $ match
+ * In multiline mode the expressions {@code ^} and {@code $} match
* just after or just before, respectively, a line terminator or the end of
* the input sequence. By default these expressions only match at the
* beginning and the end of the entire input sequence.
*
* Multiline mode can also be enabled via the embedded flag
- * expression (?m). In dotall mode, the expression . matches any character,
+ * In dotall mode, the expression {@code .} matches any character,
* including a line terminator. By default this expression does not match
* line terminators.
*
* Dotall mode can also be enabled via the embedded flag
- * expression (?s). (The s is a mnemonic for
+ * expression {@code (?s)}. (The {@code s} is a mnemonic for
* "single-line" mode, which is what this is called in Perl.) Unicode-aware case folding can also be enabled via the embedded flag
- * expression (?u).
+ * expression {@code (?u)}.
*
* Specifying this flag may impose a performance penalty. When this flag is specified then two characters will be considered
* to match if, and only if, their full canonical decompositions match.
- * The expression "a\u030A", for example, will match the
- * string "\u00E5" when this flag is specified. By default,
+ * The expression There is no embedded flag character for enabling canonical
@@ -907,7 +907,7 @@
* Annex C: Compatibility Properties.
*
* The UNICODE_CHARACTER_CLASS mode can also be enabled via the embedded
- * flag expression (?U).
+ * flag expression {@code (?U)}.
*
* The flag implies UNICODE_CASE, that is, it enables Unicode-aware case
* folding.
@@ -1052,7 +1052,7 @@
* @return the given regular expression compiled into a pattern with the given flags
* @throws IllegalArgumentException
* If bit values other than those corresponding to the defined
- * match flags are set in flags
+ * match flags are set in {@code flags}
*
* @throws PatternSyntaxException
* If the expression's syntax is invalid
@@ -1158,7 +1158,7 @@
* of the resulting array. A zero-width match at the beginning however
* never produces such empty leading substring.
*
- * The limit parameter controls the number of times the
+ * The {@code limit} parameter controls the number of times the
* pattern is applied and therefore affects the length of the resulting
* array. If the limit n is greater than zero then the pattern
* will be applied at most n - 1 times, the array's
@@ -1169,7 +1169,7 @@
* the pattern will be applied as many times as possible, the array can
* have any length, and trailing empty strings will be discarded.
*
- * The input "boo:and:foo", for example, yields the following
+ * The input {@code "boo:and:foo"}, for example, yields the following
* results with these parameters:
*
* The input "boo:and:foo", for example, yields the following
+ * The input {@code "boo:and:foo"}, for example, yields the following
* results with these expressions:
*
* This method produces a This method produces a {@code String} that can be used to
+ * create a {@code Pattern} that would match the string
+ * {@code s} as if it were a literal pattern. Unless otherwise noted, passing a null argument to a
+ * Unless otherwise noted, passing a The target name is the name of a security configuration parameter
- * (see below). Currently the AuthPermission object is used to
- * guard access to the Policy, Subject, LoginContext,
- * and Configuration objects.
+ * (see below). Currently the {@code AuthPermission} object is used to
+ * guard access to the {@link Policy}, {@link Subject},
+ * {@link javax.security.auth.login.LoginContext}, and
+ * {@link javax.security.auth.login.Configuration} objects.
*
- * The possible target names for an Authentication Permission are:
+ * The standard target names for an Authentication Permission are:
*
*
*
- * For example, the Zip/Jar code supports {@link java.io.InputStream InputStreams}.
- * To make the Zip code use {@link java.nio.MappedByteBuffer MappedByteBuffers} as
+ * For example, the Zip/Jar code supports {@link java.io.InputStream InputStreams}.
+ * To make the Zip code use {@link java.nio.MappedByteBuffer MappedByteBuffers} as
* the underlying data structure, it can create a class of InputStream that wraps the ByteBuffer,
* and implements the ByteBuffered interface. A co-operating class several layers
* away can ask the InputStream if it is an instance of ByteBuffered, then
@@ -42,12 +42,12 @@
public interface ByteBuffered {
/**
- * Returns the ByteBuffer behind this object, if this particular
- * instance has one. An implementation of getByteBuffer() is allowed
- * to return null for any reason.
+ * Returns the {@code ByteBuffer} behind this object, if this particular
+ * instance has one. An implementation of {@code getByteBuffer()} is allowed
+ * to return {@code null} for any reason.
*
- * @return The ByteBuffer, if this particular instance has one,
- * or null otherwise.
+ * @return The {@code ByteBuffer}, if this particular instance has one,
+ * or {@code null} otherwise.
*
* @throws IOException
* If the ByteBuffer is no longer valid.
diff -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/share/classes/sun/nio/ch/AllocatedNativeObject.java
--- a/jdk/src/java.base/share/classes/sun/nio/ch/AllocatedNativeObject.java Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.base/share/classes/sun/nio/ch/AllocatedNativeObject.java Wed Jul 05 20:45:35 2017 +0200
@@ -36,14 +36,14 @@
{
/**
- * Allocates a memory area of at least size bytes outside of the
+ * Allocates a memory area of at least {@code size} bytes outside of the
* Java heap and creates a native object for that area.
*
* @param size
* Number of bytes to allocate
*
* @param pageAligned
- * If true then the area will be aligned on a hardware
+ * If {@code true} then the area will be aligned on a hardware
* page boundary
*
* @throws OutOfMemoryError
diff -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/share/conf/security/java.policy
--- a/jdk/src/java.base/share/conf/security/java.policy Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.base/share/conf/security/java.policy Wed Jul 05 20:45:35 2017 +0200
@@ -23,6 +23,14 @@
permission java.security.AllPermission;
};
+grant codeBase "jrt:/jdk.scripting.nashorn.shell" {
+ permission java.security.AllPermission;
+};
+
+grant codeBase "jrt:/jdk.internal.le" {
+ permission java.security.AllPermission;
+};
+
grant codeBase "jrt:/jdk.crypto.ucrypto" {
permission java.lang.RuntimePermission "accessClassInPackage.sun.security.*";
permission java.lang.RuntimePermission "accessClassInPackage.sun.nio.ch";
diff -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/share/native/libnio/nio_util.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/java.base/share/native/libnio/nio_util.c Wed Jul 05 20:45:35 2017 +0200
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+#include "jni.h"
+#include "jvm.h"
+#include "jni_util.h"
+
+JNIEXPORT jint JNICALL
+JNI_OnLoad(JavaVM *vm, void *reserved)
+{
+ JNIEnv *env;
+
+ if ((*vm)->GetEnv(vm, (void**) &env, JNI_VERSION_1_2) != JNI_OK) {
+ return JNI_EVERSION; /* JNI version not supported */
+ }
+
+ return JNI_VERSION_1_2;
+}
diff -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/unix/classes/sun/nio/fs/GnomeFileTypeDetector.java
--- a/jdk/src/java.base/unix/classes/sun/nio/fs/GnomeFileTypeDetector.java Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.base/unix/classes/sun/nio/fs/GnomeFileTypeDetector.java Wed Jul 05 20:45:35 2017 +0200
@@ -67,7 +67,7 @@
// GIO
private static native boolean initializeGio();
- private static native byte[] probeGio(long pathAddress);
+ private static synchronized native byte[] probeGio(long pathAddress);
static {
AccessController.doPrivileged(new PrivilegedAction<>() {
diff -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/unix/classes/sun/nio/fs/MimeTypesFileTypeDetector.java
--- a/jdk/src/java.base/unix/classes/sun/nio/fs/MimeTypesFileTypeDetector.java Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.base/unix/classes/sun/nio/fs/MimeTypesFileTypeDetector.java Wed Jul 05 20:45:35 2017 +0200
@@ -159,7 +159,7 @@
final String EXTEQUAL = "exts=";
String extRegex = "\\b" + EXTEQUAL +
- "(\"[\\p{Graph}|\\p{Blank}]+?\"|\\p{Graph}+\\b)";
+ "(\"[\\p{Graph}\\p{Blank}]+?\"|\\p{Graph}+\\b)";
Pattern extPattern = Pattern.compile(extRegex);
Matcher extMatcher = extPattern.matcher(entry);
@@ -169,7 +169,7 @@
if (exts.charAt(0) == '"') {
exts = exts.substring(1, exts.length() - 1);
}
- String[] extList = exts.split("[\\p{Blank}|\\p{Punct}]+");
+ String[] extList = exts.split("[\\p{Blank}\\p{Punct}]+");
for (String ext : extList) {
putIfAbsent(ext, type);
}
diff -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/windows/native/libjava/WinNTFileSystem_md.c
--- a/jdk/src/java.base/windows/native/libjava/WinNTFileSystem_md.c Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.base/windows/native/libjava/WinNTFileSystem_md.c Wed Jul 05 20:45:35 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -233,10 +233,13 @@
if (GetFileAttributesExW(path, GetFileExInfoStandard, &wfad)) {
attr = getFinalAttributesIfReparsePoint(path, wfad.dwFileAttributes);
- } else if (GetLastError() == ERROR_SHARING_VIOLATION &&
- (h = FindFirstFileW(path, &wfd)) != INVALID_HANDLE_VALUE) {
- attr = getFinalAttributesIfReparsePoint(path, wfd.dwFileAttributes);
- FindClose(h);
+ } else {
+ DWORD lerr = GetLastError();
+ if ((lerr == ERROR_SHARING_VIOLATION || lerr == ERROR_ACCESS_DENIED) &&
+ (h = FindFirstFileW(path, &wfd)) != INVALID_HANDLE_VALUE) {
+ attr = getFinalAttributesIfReparsePoint(path, wfd.dwFileAttributes);
+ FindClose(h);
+ }
}
return attr;
}
diff -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/CFRetainedResource.m
--- a/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/CFRetainedResource.m Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/CFRetainedResource.m Wed Jul 05 20:45:35 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
@@ -40,10 +40,17 @@
if (releaseOnAppKitThread) {
// Releasing resources on the main AppKit message loop only
// Releasing resources on the nested loops may cause dangling
- // pointers after the nested loop is exited
- [NSApp postRunnableEvent:^(){
- CFRelease(jlong_to_ptr(ptr));
- }];
+ // pointers after the nested loop is exited
+ if ([NSApp respondsToSelector:@selector(postRunnableEvent:)]) {
+ [NSApp postRunnableEvent:^() {
+ CFRelease(jlong_to_ptr(ptr));
+ }];
+ } else {
+ // could happen if we are embedded inside SWT/FX application,
+ [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^() {
+ CFRelease(jlong_to_ptr(ptr));
+ }];
+ }
} else {
JNF_COCOA_ENTER(env);
diff -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.desktop/share/classes/com/sun/beans/introspect/PropertyInfo.java
--- a/jdk/src/java.desktop/share/classes/com/sun/beans/introspect/PropertyInfo.java Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.desktop/share/classes/com/sun/beans/introspect/PropertyInfo.java Wed Jul 05 20:45:35 2017 +0200
@@ -40,7 +40,7 @@
import static com.sun.beans.finder.ClassFinder.findClass;
public final class PropertyInfo {
- public enum Name {bound, expert, hidden, preferred, visualUpdate, description, enumerationValues}
+ public enum Name {bound, expert, hidden, preferred, required, visualUpdate, description, enumerationValues}
private static final String VETO_EXCEPTION_NAME = "java.beans.PropertyVetoException";
private static final Class> VETO_EXCEPTION;
@@ -120,6 +120,7 @@
put(Name.bound, Boolean.FALSE);
}
put(Name.expert, annotation.expert());
+ put(Name.required, annotation.required());
put(Name.hidden, annotation.hidden());
put(Name.preferred, annotation.preferred());
put(Name.visualUpdate, annotation.visualUpdate());
diff -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.desktop/share/classes/com/sun/media/sound/AiffFileReader.java
--- a/jdk/src/java.desktop/share/classes/com/sun/media/sound/AiffFileReader.java Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.desktop/share/classes/com/sun/media/sound/AiffFileReader.java Wed Jul 05 20:45:35 2017 +0200
@@ -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
@@ -27,19 +27,14 @@
import java.io.DataInputStream;
import java.io.DataOutputStream;
-import java.io.File;
-import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
-import java.net.URL;
import javax.sound.sampled.AudioFileFormat;
import javax.sound.sampled.AudioFormat;
-import javax.sound.sampled.AudioInputStream;
import javax.sound.sampled.AudioSystem;
import javax.sound.sampled.UnsupportedAudioFileException;
-
/**
* AIFF file reader and writer.
*
@@ -49,177 +44,10 @@
*/
public final class AiffFileReader extends SunFileReader {
- private static final int MAX_READ_LENGTH = 8;
-
- // METHODS TO IMPLEMENT AudioFileReader
-
- /**
- * Obtains the audio file format of the input stream provided. The stream must
- * point to valid audio file data. In general, audio file providers may
- * need to read some data from the stream before determining whether they
- * support it. These parsers must
- * be able to mark the stream, read enough data to determine whether they
- * support the stream, and, if not, reset the stream's read pointer to its original
- * position. If the input stream does not support this, this method may fail
- * with an IOException.
- * @param stream the input stream from which file format information should be
- * extracted
- * @return an
* If a system property named {@code "java.awt.headless"} is set
* to {@code true} then the headless implementation
- * of {@code Toolkit} is used.
- *
- * If there is no {@code "java.awt.headless"} or it is set to
- * {@code false} and there is a system property named
- * {@code "awt.toolkit"},
- * that property is treated as the name of a class that is a subclass
- * of {@code Toolkit};
+ * of {@code Toolkit} is used,
* otherwise the default platform-specific implementation of
* {@code Toolkit} is used.
*
diff -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.desktop/share/classes/java/beans/PropertyDescriptor.java
--- a/jdk/src/java.desktop/share/classes/java/beans/PropertyDescriptor.java Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.desktop/share/classes/java/beans/PropertyDescriptor.java Wed Jul 05 20:45:35 2017 +0200
@@ -160,21 +160,23 @@
setPropertyType(info.getPropertyType());
setConstrained(info.isConstrained());
setBound(bound && info.is(PropertyInfo.Name.bound));
- if (info.is(PropertyInfo.Name.expert)) {
- setValue(PropertyInfo.Name.expert.name(), Boolean.TRUE); // compatibility
- setExpert(true);
- }
- if (info.is(PropertyInfo.Name.hidden)) {
- setValue(PropertyInfo.Name.hidden.name(), Boolean.TRUE); // compatibility
- setHidden(true);
- }
- if (info.is(PropertyInfo.Name.preferred)) {
- setPreferred(true);
- }
- Object visual = info.get(PropertyInfo.Name.visualUpdate);
- if (visual != null) {
- setValue(PropertyInfo.Name.visualUpdate.name(), visual);
- }
+
+ boolean isExpert = info.is(PropertyInfo.Name.expert);
+ setValue(PropertyInfo.Name.expert.name(), isExpert); // compatibility
+ setExpert(isExpert);
+
+ boolean isHidden = info.is(PropertyInfo.Name.hidden);
+ setValue(PropertyInfo.Name.hidden.name(), isHidden); // compatibility
+ setHidden(isHidden);
+
+ setPreferred(info.is(PropertyInfo.Name.preferred));
+
+ boolean isRequired = info.is(PropertyInfo.Name.required);
+ setValue(PropertyInfo.Name.required.name(), isRequired);
+
+ boolean visual = info.is(PropertyInfo.Name.visualUpdate);
+ setValue(PropertyInfo.Name.visualUpdate.name(), visual);
+
Object description = info.get(PropertyInfo.Name.description);
if (description != null) {
setShortDescription(description.toString());
diff -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.desktop/share/classes/javax/swing/JInternalFrame.java
--- a/jdk/src/java.desktop/share/classes/javax/swing/JInternalFrame.java Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/swing/JInternalFrame.java Wed Jul 05 20:45:35 2017 +0200
@@ -1247,6 +1247,7 @@
*
* @param layer an This implementation returns the longest non-breakable area within
@@ -561,11 +550,13 @@
*/
@Override
public float getMinimumSpan(int axis) {
+ int w = getResizeWeight(axis);
+ if (w == 0) {
+ // can't resize
+ return getPreferredSpan(axis);
+ }
switch (axis) {
case View.X_AXIS:
- if (getResizeWeight(X_AXIS) == 0) {
- return getPreferredSpan(X_AXIS);
- }
if (minimumSpan < 0) {
minimumSpan = 0;
int p0 = getStartOffset();
diff -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.desktop/share/classes/sun/applet/AppletPanel.java
--- a/jdk/src/java.desktop/share/classes/sun/applet/AppletPanel.java Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.desktop/share/classes/sun/applet/AppletPanel.java Wed Jul 05 20:45:35 2017 +0200
@@ -687,12 +687,7 @@
if (toFocus != null) {
if (parent instanceof EmbeddedFrame) {
- // JDK-8056915: Try to request focus to the embedder first and
- // activate the embedded frame through it
- if (!((EmbeddedFrame) parent).requestFocusToEmbedder()) {
- // Otherwise activate the embedded frame directly
- ((EmbeddedFrame) parent).synthesizeWindowActivation(true);
- }
+ ((EmbeddedFrame) parent).synthesizeWindowActivation(true);
}
// EmbeddedFrame might have focus before the applet was added.
// Thus after its activation the most recent focus owner will be
diff -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.desktop/share/classes/sun/awt/EmbeddedFrame.java
--- a/jdk/src/java.desktop/share/classes/sun/awt/EmbeddedFrame.java Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.desktop/share/classes/sun/awt/EmbeddedFrame.java Wed Jul 05 20:45:35 2017 +0200
@@ -357,15 +357,6 @@
public void synthesizeWindowActivation(boolean doActivate) {}
/**
- * Requests the focus to the embedder.
- *
- * @return {@code true} if focus request was successful, and {@code false} otherwise.
- */
- public boolean requestFocusToEmbedder() {
- return false;
- }
-
- /**
* Moves this embedded frame to a new location. The top-left corner of
* the new location is specified by the 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 {@link #send send} or {@link #receive receive}
@@ -711,9 +711,9 @@
* Returns an operation set identifying this channel's supported operations.
*
* SCTP channels support connecting, reading, and writing, so this
- * method returns ({@link SelectionKey#OP_CONNECT}
- * | {@link SelectionKey#OP_READ} | {@link
- * SelectionKey#OP_WRITE}). /
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 -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/share/classes/java/nio/file/FileSystems.java
--- a/jdk/src/java.base/share/classes/java/nio/file/FileSystems.java Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/nio/file/FileSystems.java Wed Jul 05 20:45:35 2017 +0200
@@ -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 @@
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 @@
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 -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/share/classes/java/nio/file/Paths.java
--- a/jdk/src/java.base/share/classes/java/nio/file/Paths.java Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/nio/file/Paths.java Wed Jul 05 20:45:35 2017 +0200
@@ -103,9 +103,9 @@
*
- * 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 -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/share/classes/java/nio/file/attribute/AclFileAttributeView.java
--- a/jdk/src/java.base/share/classes/java/nio/file/attribute/AclFileAttributeView.java Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/nio/file/attribute/AclFileAttributeView.java Wed Jul 05 20:45:35 2017 +0200
@@ -165,7 +165,7 @@
* 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 @@
* 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 -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/share/classes/java/nio/file/attribute/FileOwnerAttributeView.java
--- a/jdk/src/java.base/share/classes/java/nio/file/attribute/FileOwnerAttributeView.java Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/nio/file/attribute/FileOwnerAttributeView.java Wed Jul 05 20:45:35 2017 +0200
@@ -69,7 +69,7 @@
* @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 @@
* @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 -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/share/classes/java/nio/file/attribute/PosixFileAttributeView.java
--- a/jdk/src/java.base/share/classes/java/nio/file/attribute/PosixFileAttributeView.java Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/nio/file/attribute/PosixFileAttributeView.java Wed Jul 05 20:45:35 2017 +0200
@@ -149,7 +149,8 @@
* @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 @@
* 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 @@
* 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 -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/share/classes/java/nio/file/attribute/UserDefinedFileAttributeView.java
--- a/jdk/src/java.base/share/classes/java/nio/file/attribute/UserDefinedFileAttributeView.java Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/nio/file/attribute/UserDefinedFileAttributeView.java Wed Jul 05 20:45:35 2017 +0200
@@ -89,7 +89,7 @@
* @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 @@
* @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 @@
* @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 @@
* @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 @@
* @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 -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/share/classes/java/nio/file/attribute/UserPrincipalLookupService.java
--- a/jdk/src/java.base/share/classes/java/nio/file/attribute/UserPrincipalLookupService.java Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/nio/file/attribute/UserPrincipalLookupService.java Wed Jul 05 20:45:35 2017 +0200
@@ -72,7 +72,8 @@
* 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 @@
* 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 -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/share/classes/java/nio/file/attribute/UserPrincipalNotFoundException.java
--- a/jdk/src/java.base/share/classes/java/nio/file/attribute/UserPrincipalNotFoundException.java Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/nio/file/attribute/UserPrincipalNotFoundException.java Wed Jul 05 20:45:35 2017 +0200
@@ -54,7 +54,7 @@
/**
* 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 -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/share/classes/java/nio/file/attribute/package-info.java
--- a/jdk/src/java.base/share/classes/java/nio/file/attribute/package-info.java Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/nio/file/attribute/package-info.java Wed Jul 05 20:45:35 2017 +0200
@@ -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 -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/share/classes/java/util/AbstractCollection.java
--- a/jdk/src/java.base/share/classes/java/util/AbstractCollection.java Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/util/AbstractCollection.java Wed Jul 05 20:45:35 2017 +0200
@@ -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 @@
*
* 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 -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/share/classes/java/util/AbstractSet.java
--- a/jdk/src/java.base/share/classes/java/util/AbstractSet.java Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/util/AbstractSet.java Wed Jul 05 20:45:35 2017 +0200
@@ -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 @@
* @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 @@
*
* @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 @@
*
* @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 @@
* @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 @@
* @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 @@
* @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 @@
*
* 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 @@
*
*
* @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 @@
* @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 @@
* to, or greater than the second.
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 -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/share/classes/java/util/Dictionary.java
--- a/jdk/src/java.base/share/classes/java/util/Dictionary.java Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/util/Dictionary.java Wed Jul 05 20:45:35 2017 +0200
@@ -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 @@
/**
* Returns an enumeration of the values in this dictionary. The general
- * contract for the elements method is that an
- * Enumeration is returned that will generate all the elements
+ * contract for the {@code elements} method is that an
+ * {@code Enumeration} is returned that will generate all the elements
* contained in entries in this dictionary.
*
* @return an enumeration of the values in this dictionary.
@@ -98,58 +98,58 @@
/**
* Returns the value to which the key is mapped in this dictionary.
- * The general contract for the isEmpty method is that if this
+ * The general contract for the {@code isEmpty} method is that if this
* dictionary contains an entry for the specified key, the associated
- * value is returned; otherwise, null is returned.
+ * value is returned; otherwise, {@code null} is returned.
*
* @return the value to which the key is mapped in this dictionary;
* @param key a key in this dictionary.
- * null
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 -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/share/classes/java/util/DuplicateFormatFlagsException.java
--- a/jdk/src/java.base/share/classes/java/util/DuplicateFormatFlagsException.java Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/util/DuplicateFormatFlagsException.java Wed Jul 05 20:45:35 2017 +0200
@@ -29,7 +29,7 @@
* 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 @@
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 -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/share/classes/java/util/EnumMap.java
--- a/jdk/src/java.base/share/classes/java/util/EnumMap.java Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/util/EnumMap.java Wed Jul 05 20:45:35 2017 +0200
@@ -50,7 +50,7 @@
* 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 @@
* 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 @@
/**
* Tests if this enumeration contains more elements.
*
- * @return true
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 -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/share/classes/java/util/FormatFlagsConversionMismatchException.java
--- a/jdk/src/java.base/share/classes/java/util/FormatFlagsConversionMismatchException.java Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/util/FormatFlagsConversionMismatchException.java Wed Jul 05 20:45:35 2017 +0200
@@ -28,7 +28,7 @@
/**
* 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 -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/share/classes/java/util/FormattableFlags.java
--- a/jdk/src/java.base/share/classes/java/util/FormattableFlags.java Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/util/FormattableFlags.java Wed Jul 05 20:45:35 2017 +0200
@@ -39,12 +39,12 @@
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 @@
/**
* 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 -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/share/classes/java/util/Formatter.java
--- a/jdk/src/java.base/share/classes/java/util/Formatter.java Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/util/Formatter.java Wed Jul 05 20:45:35 2017 +0200
@@ -267,7 +267,7 @@
* {@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 @@
* "{@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 @@
*
*
*
@@ -758,15 +758,15 @@
* {@code 'b'}
- * '\u0062'
+ * '\u0062'
* Produces either "{@code true}" or "{@code false}" as returned by
* {@link Boolean#toString(boolean)}.
*
@@ -715,11 +715,11 @@
* 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 @@
* ' '
('\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 @@
*
*
*
@@ -859,7 +859,7 @@
* 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 @@
* 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 @@
* 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 @@
*
*
*
*
@@ -980,24 +980,24 @@
* {@code 'd'}
- * '\u0064'
+ * '\u0064'
* Formats the argument as a decimal integer. The localization algorithm is applied.
*
@@ -911,7 +911,7 @@
* 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 @@
* thrown.
*
* {@code 'x'}
- * '\u0078'
+ * '\u0078'
* Formats the argument as an integer in base sixteen. No
* localization is applied.
*
@@ -951,17 +951,17 @@
* 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 @@
*
* {@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 @@
* {@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 @@
*
*
*
*
@@ -1152,7 +1152,7 @@
* {@code 'd'}
- * '\u0064'
+ * '\u0064'
* Requires the output to be formatted as a decimal integer. The localization algorithm is applied.
*
@@ -1066,18 +1066,18 @@
* 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 @@
* 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 @@
* 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 @@
* 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 @@
* 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 @@
* appropriate.
*
* {@code 'a'}
- * '\u0061'
+ * '\u0061'
* Requires the output to be formatted in hexadecimal exponential
* form. No localization is applied.
*
@@ -1274,11 +1274,11 @@
* (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 @@
* 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 @@
*
*
*
{@code 'e'}
- * '\u0065'
+ * '\u0065'
* Requires the output to be formatted using computerized scientific notation. The localization algorithm is applied.
@@ -1409,7 +1409,7 @@
* 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 @@
* 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 @@
* 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 @@
*
*
*
@@ -1530,52 +1530,52 @@
* {@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 @@
* 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 @@
* 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 @@
* 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 @@
*
*
*
{@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 @@
*
*
*
* {@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 @@
* '\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 @@
*
*
*
@@ -377,10 +377,10 @@
*
*
*
* {@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 @@
*
*
* '\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 -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/share/classes/java/util/FormatterClosedException.java
--- a/jdk/src/java.base/share/classes/java/util/FormatterClosedException.java Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/util/FormatterClosedException.java Wed Jul 05 20:45:35 2017 +0200
@@ -28,7 +28,7 @@
/**
* Unchecked exception thrown when the formatter has been closed.
*
- *
* Set s = Collections.synchronizedSet(new HashSet(...));
*
- * null
object can be used as a key or as a value. hashCode
- * method and the equals
method. Hashtable
has two parameters that affect its
+ * An instance of {@code Hashtable} 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
@@ -53,16 +53,16 @@
* Generally, the default load factor (.75) offers a good tradeoff between
* time and space costs. Higher values decrease the space overhead but
* increase the time cost to look up an entry (which is reflected in most
- * Hashtable operations, including get and put).rehash
operations, which are time-consuming.
- * No rehash
operations will ever occur if the initial
+ * need for {@code rehash} operations, which are time-consuming.
+ * No {@code rehash} operations will ever occur if the initial
* capacity is greater than the maximum number of entries the
- * Hashtable will contain divided by its load factor. However,
+ * {@code Hashtable} will contain divided by its load factor. However,
* setting the initial capacity too high can waste space.Hashtable
,
+ * If many entries are to be made into a {@code Hashtable},
* creating it with a sufficiently large capacity may allow the
* entries to be inserted more efficiently than letting it perform
* automatic rehashing as needed to grow the table. true
if this hashtable maps no keys to values;
- * false
otherwise.
+ * @return {@code true} if this hashtable maps no keys to values;
+ * {@code false} otherwise.
*/
public synchronized boolean isEmpty() {
return count == 0;
@@ -290,11 +290,11 @@
* {@link Map} interface in the collections framework).
*
* @param value a value to search for
- * @return true
if and only if some key maps to the
- * value
argument in this hashtable as
- * determined by the equals method;
- * false
otherwise.
- * @exception NullPointerException if the value is null
+ * @return {@code true} if and only if some key maps to the
+ * {@code value} argument in this hashtable as
+ * determined by the {@code equals} method;
+ * {@code false} otherwise.
+ * @exception NullPointerException if the value is {@code null}
*/
public synchronized boolean contains(Object value) {
if (value == null) {
@@ -319,9 +319,9 @@
* #contains contains} (which predates the {@link Map} interface).
*
* @param value value whose presence in this hashtable is to be tested
- * @return true if this map maps one or more keys to the
+ * @return {@code true} if this map maps one or more keys to the
* specified value
- * @throws NullPointerException if the value is null
+ * @throws NullPointerException if the value is {@code null}
* @since 1.2
*/
public boolean containsValue(Object value) {
@@ -332,10 +332,10 @@
* Tests if the specified object is a key in this hashtable.
*
* @param key possible key
- * @return true
if and only if the specified object
+ * @return {@code true} if and only if the specified object
* is a key in this hashtable, as determined by the
- * equals method; false
otherwise.
- * @throws NullPointerException if the key is null
+ * {@code equals} method; {@code false} otherwise.
+ * @throws NullPointerException if the key is {@code null}
* @see #contains(Object)
*/
public synchronized boolean containsKey(Object key) {
@@ -444,19 +444,19 @@
}
/**
- * Maps the specified key
to the specified
- * value
in this hashtable. Neither the key nor the
- * value can be null
. get
method
+ * The value can be retrieved by calling the {@code get} method
* with a key that is equal to the original key.
*
* @param key the hashtable key
* @param value the value
* @return the previous value of the specified key in this hashtable,
- * or null
if it did not have one
+ * or {@code null} if it did not have one
* @exception NullPointerException if the key or value is
- * null
+ * {@code null}
* @see Object#equals(Object)
* @see #get(Object)
*/
@@ -490,8 +490,8 @@
*
* @param key the key that needs to be removed
* @return the value to which the key had been mapped in this hashtable,
- * or null
if the key did not have a mapping
- * @throws NullPointerException if the key is null
+ * or {@code null} if the key did not have a mapping
+ * @throws NullPointerException if the key is {@code null}
*/
public synchronized V remove(Object key) {
Entry,?> tab[] = table;
@@ -568,11 +568,11 @@
}
/**
- * Returns a string representation of this Hashtable object
+ * Returns a string representation of this {@code Hashtable} object
* in the form of a set of entries, enclosed in braces and separated
- * by the ASCII characters ", " (comma and space). Each
- * entry is rendered as the key, an equals sign =, and the
- * associated element, where the toString method is used to
+ * by the ASCII characters " ,
" (comma and space). Each
+ * entry is rendered as the key, an equals sign {@code =}, and the
+ * associated element, where the {@code toString} method is used to
* convert the key and element to strings.
*
* @return a string representation of this hashtable
@@ -633,12 +633,12 @@
* The set is backed by the map, so changes to the map are
* reflected in the set, and vice-versa. If the map is modified
* while an iteration over the set is in progress (except through
- * the iterator's own remove operation), the results of
+ * the iterator's own {@code remove} operation), the results of
* the iteration are undefined. The set supports element removal,
* which removes the corresponding mapping from the map, via the
- * Iterator.remove, Set.remove,
- * removeAll, retainAll, and clear
- * operations. It does not support the add or addAll
+ * {@code Iterator.remove}, {@code Set.remove},
+ * {@code removeAll}, {@code retainAll}, and {@code clear}
+ * operations. It does not support the {@code add} or {@code addAll}
* operations.
*
* @since 1.2
@@ -672,14 +672,14 @@
* The set is backed by the map, so changes to the map are
* reflected in the set, and vice-versa. If the map is modified
* while an iteration over the set is in progress (except through
- * the iterator's own remove operation, or through the
- * setValue operation on a map entry returned by the
+ * the iterator's own {@code remove} operation, or through the
+ * {@code setValue} operation on a map entry returned by the
* iterator) the results of the iteration are undefined. The set
* supports element removal, which removes the corresponding
- * mapping from the map, via the Iterator.remove,
- * Set.remove, removeAll, retainAll and
- * clear operations. It does not support the
- * add or addAll operations.
+ * mapping from the map, via the {@code Iterator.remove},
+ * {@code Set.remove}, {@code removeAll}, {@code retainAll} and
+ * {@code clear} operations. It does not support the
+ * {@code add} or {@code addAll} operations.
*
* @since 1.2
*/
@@ -754,13 +754,13 @@
* The collection is backed by the map, so changes to the map are
* reflected in the collection, and vice-versa. If the map is
* modified while an iteration over the collection is in progress
- * (except through the iterator's own remove operation),
+ * (except through the iterator's own {@code remove} operation),
* the results of the iteration are undefined. The collection
* supports element removal, which removes the corresponding
- * mapping from the map, via the Iterator.remove,
- * Collection.remove, removeAll,
- * retainAll and clear operations. It does not
- * support the add or addAll operations.
+ * mapping from the map, via the {@code Iterator.remove},
+ * {@code Collection.remove}, {@code removeAll},
+ * {@code retainAll} and {@code clear} operations. It does not
+ * support the {@code add} or {@code addAll} operations.
*
* @since 1.2
*/
diff -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/share/classes/java/util/IdentityHashMap.java
--- a/jdk/src/java.base/share/classes/java/util/IdentityHashMap.java Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/util/IdentityHashMap.java Wed Jul 05 20:45:35 2017 +0200
@@ -31,18 +31,18 @@
import java.util.function.Consumer;
/**
- * This class implements the Map interface with a hash table, using
+ * This class implements the {@code Map} interface with a hash table, using
* reference-equality in place of object-equality when comparing keys (and
- * values). In other words, in an IdentityHashMap, two keys
- * k1 and k2 are considered equal if and only if
- * (k1==k2). (In normal Map implementations (like
- * HashMap) two keys k1 and k2 are considered equal
- * if and only if (k1==null ? k2==null : k1.equals(k2)).)
+ * values). In other words, in an {@code IdentityHashMap}, two keys
+ * {@code k1} and {@code k2} are considered equal if and only if
+ * {@code (k1==k2)}. (In normal {@code Map} implementations (like
+ * {@code HashMap}) two keys {@code k1} and {@code k2} are considered equal
+ * if and only if {@code (k1==null ? k2==null : k1.equals(k2))}.)
*
- *
* Map m = Collections.synchronizedMap(new IdentityHashMap(...));
*
- * true
if the specified object reference is a key
+ * @return {@code true} if the specified object reference is a key
* in this map
* @see #containsValue(Object)
*/
@@ -365,7 +365,7 @@
* hash map.
*
* @param value value whose presence in this map is to be tested
- * @return true if this map maps one or more keys to the
+ * @return {@code true} if this map maps one or more keys to the
* specified object reference
* @see #containsKey(Object)
*/
@@ -383,7 +383,7 @@
*
* @param key possible key
* @param value possible value
- * @return true
if and only if the specified key-value
+ * @return {@code true} if and only if the specified key-value
* mapping is in the map
*/
private boolean containsMapping(Object key, Object value) {
@@ -408,10 +408,10 @@
*
* @param key the key with which the specified value is to be associated
* @param value the value to be associated with the specified key
- * @return the previous value associated with key, or
- * null if there was no mapping for key.
- * (A null return can also indicate that the map
- * previously associated null with key.)
+ * @return the previous value associated with {@code key}, or
+ * {@code null} if there was no mapping for {@code key}.
+ * (A {@code null} return can also indicate that the map
+ * previously associated {@code null} with {@code key}.)
* @see Object#equals(Object)
* @see #get(Object)
* @see #containsKey(Object)
@@ -510,10 +510,10 @@
* Removes the mapping for this key from this map if present.
*
* @param key key whose mapping is to be removed from the map
- * @return the previous value associated with key, or
- * null if there was no mapping for key.
- * (A null return can also indicate that the map
- * previously associated null with key.)
+ * @return the previous value associated with {@code key}, or
+ * {@code null} if there was no mapping for {@code key}.
+ * (A {@code null} return can also indicate that the map
+ * previously associated {@code null} with {@code key}.)
*/
public V remove(Object key) {
Object k = maskNull(key);
@@ -544,7 +544,7 @@
*
* @param key possible key
* @param value possible value
- * @return true
if and only if the specified key-value
+ * @return {@code true} if and only if the specified key-value
* mapping was in the map
*/
private boolean removeMapping(Object key, Object value) {
@@ -621,19 +621,19 @@
/**
* Compares the specified object with this map for equality. Returns
- * true if the given object is also a map and the two maps
+ * {@code true} if the given object is also a map and the two maps
* represent identical object-reference mappings. More formally, this
- * map is equal to another map m if and only if
- * this.entrySet().equals(m.entrySet()).
+ * map is equal to another map {@code m} if and only if
+ * {@code this.entrySet().equals(m.entrySet())}.
*
* Scanner
to indicate that the token
+ * Thrown by a {@code Scanner} to indicate that the token
* retrieved does not match the pattern for the expected type, or
* that the token is out of range for the expected type.
*
@@ -39,7 +39,7 @@
private static final long serialVersionUID = 8811230760997066428L;
/**
- * Constructs an InputMismatchException
with null
+ * Constructs an {@code InputMismatchException} with {@code null}
* as its error message string.
*/
public InputMismatchException() {
@@ -47,9 +47,9 @@
}
/**
- * Constructs an InputMismatchException
, saving a reference
- * to the error message string s for later retrieval by the
- * getMessage method.
+ * Constructs an {@code InputMismatchException}, saving a reference
+ * to the error message string {@code s} for later retrieval by the
+ * {@code getMessage} method.
*
* @param s the detail message.
*/
diff -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/share/classes/java/util/JumboEnumSet.java
--- a/jdk/src/java.base/share/classes/java/util/JumboEnumSet.java Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/util/JumboEnumSet.java Wed Jul 05 20:45:35 2017 +0200
@@ -163,19 +163,19 @@
}
/**
- * Returns true if this set contains no elements.
+ * Returns {@code true} if this set contains no elements.
*
- * @return true if this set contains no elements
+ * @return {@code true} if this set contains no elements
*/
public boolean isEmpty() {
return size == 0;
}
/**
- * Returns true if this set contains the specified element.
+ * Returns {@code true} if this set contains the specified element.
*
* @param e element to be checked for containment in this collection
- * @return true if this set contains the specified element
+ * @return {@code true} if this set contains the specified element
*/
public boolean contains(Object e) {
if (e == null)
@@ -194,9 +194,9 @@
* Adds the specified element to this set if it is not already present.
*
* @param e element to be added to this set
- * @return true if the set changed as a result of the call
+ * @return {@code true} if the set changed as a result of the call
*
- * @throws NullPointerException if e is null
+ * @throws NullPointerException if {@code e} is null
*/
public boolean add(E e) {
typeCheck(e);
@@ -216,7 +216,7 @@
* Removes the specified element from this set if it is present.
*
* @param e element to be removed from this set, if present
- * @return true if the set contained the specified element
+ * @return {@code true} if the set contained the specified element
*/
public boolean remove(Object e) {
if (e == null)
@@ -238,11 +238,11 @@
// Bulk Operations
/**
- * Returns true if this set contains all of the elements
+ * Returns {@code true} if this set contains all of the elements
* in the specified collection.
*
* @param c collection to be checked for containment in this set
- * @return true if this set contains all of the elements
+ * @return {@code true} if this set contains all of the elements
* in the specified collection
* @throws NullPointerException if the specified collection is null
*/
@@ -264,7 +264,7 @@
* Adds all of the elements in the specified collection to this set.
*
* @param c collection whose elements are to be added to this set
- * @return true if this set changed as a result of the call
+ * @return {@code true} if this set changed as a result of the call
* @throws NullPointerException if the specified collection or any of
* its elements are null
*/
@@ -291,7 +291,7 @@
* the specified collection.
*
* @param c elements to be removed from this set
- * @return true if this set changed as a result of the call
+ * @return {@code true} if this set changed as a result of the call
* @throws NullPointerException if the specified collection is null
*/
public boolean removeAll(Collection> c) {
@@ -312,7 +312,7 @@
* specified collection.
*
* @param c elements to be retained in this set
- * @return true if this set changed as a result of the call
+ * @return {@code true} if this set changed as a result of the call
* @throws NullPointerException if the specified collection is null
*/
public boolean retainAll(Collection> c) {
@@ -341,12 +341,12 @@
/**
* Compares the specified object with this set for equality. Returns
- * true if the given object is also a set, the two sets have
+ * {@code true} if the given object is also a set, the two sets have
* the same size, and every member of the given set is contained in
* this set.
*
* @param o object to be compared for equality with this set
- * @return true if the specified object is equal to this set
+ * @return {@code true} if the specified object is equal to this set
*/
public boolean equals(Object o) {
if (!(o instanceof JumboEnumSet))
diff -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/share/classes/java/util/LinkedHashMap.java
--- a/jdk/src/java.base/share/classes/java/util/LinkedHashMap.java Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/util/LinkedHashMap.java Wed Jul 05 20:45:35 2017 +0200
@@ -31,15 +31,15 @@
import java.io.IOException;
/**
- *
* Set s = Collections.synchronizedSet(new LinkedHashSet(...));
*
- * {@code
* 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 a the array into which the elements of this list are to
* be stored, if it is big enough; otherwise, a new array of the
@@ -225,8 +225,8 @@
* on what elements may be added.
*
* @param e element to be appended to this list
- * @return true (as specified by {@link Collection#add})
- * @throws UnsupportedOperationException if the add operation
+ * @return {@code true} (as specified by {@link Collection#add})
+ * @throws UnsupportedOperationException if the {@code add} operation
* is not supported by this list
* @throws ClassCastException if the class of the specified element
* prevents it from being added to this list
@@ -241,21 +241,21 @@
* Removes the first occurrence of the specified element from this list,
* if it is present (optional operation). If this list does not contain
* the element, it is unchanged. More formally, removes the element with
- * the lowest index i such that
- * (o==null ? get(i)==null : o.equals(get(i)))
- * (if such an element exists). Returns true if this list
+ * the lowest index {@code i} such that
+ * {@code Objects.equals(o, get(i))}
+ * (if such an element exists). Returns {@code true} if this list
* contained the specified element (or equivalently, if this list changed
* as a result of the call).
*
* @param o element to be removed from this list, if present
- * @return true if this list contained the specified element
+ * @return {@code true} if this list contained the specified element
* @throws ClassCastException if the type of the specified element
* is incompatible with this list
* (optional)
* @throws NullPointerException if the specified element is null and this
* list does not permit null elements
* (optional)
- * @throws UnsupportedOperationException if the remove operation
+ * @throws UnsupportedOperationException if the {@code remove} operation
* is not supported by this list
*/
boolean remove(Object o);
@@ -264,11 +264,11 @@
// Bulk Modification Operations
/**
- * Returns true if this list contains all of the elements of the
+ * Returns {@code true} if this list contains all of the elements of the
* specified collection.
*
* @param c collection to be checked for containment in this list
- * @return true if this list contains all of the elements of the
+ * @return {@code true} if this list contains all of the elements of the
* specified collection
* @throws ClassCastException if the types of one or more elements
* in the specified collection are incompatible with this
@@ -292,8 +292,8 @@
* specified collection is this list, and it's nonempty.)
*
* @param c collection containing elements to be added to this list
- * @return true if this list changed as a result of the call
- * @throws UnsupportedOperationException if the addAll operation
+ * @return {@code true} if this list changed as a result of the call
+ * @throws UnsupportedOperationException if the {@code addAll} operation
* is not supported by this list
* @throws ClassCastException if the class of an element of the specified
* collection prevents it from being added to this list
@@ -320,8 +320,8 @@
* @param index index at which to insert the first element from the
* specified collection
* @param c collection containing elements to be added to this list
- * @return true if this list changed as a result of the call
- * @throws UnsupportedOperationException if the addAll operation
+ * @return {@code true} if this list changed as a result of the call
+ * @throws UnsupportedOperationException if the {@code addAll} operation
* is not supported by this list
* @throws ClassCastException if the class of an element of the specified
* collection prevents it from being added to this list
@@ -331,7 +331,7 @@
* @throws IllegalArgumentException if some property of an element of the
* specified collection prevents it from being added to this list
* @throws IndexOutOfBoundsException if the index is out of range
- * (index < 0 || index > size())
+ * ({@code index < 0 || index > size()})
*/
boolean addAll(int index, Collection extends E> c);
@@ -340,8 +340,8 @@
* specified collection (optional operation).
*
* @param c collection containing elements to be removed from this list
- * @return true if this list changed as a result of the call
- * @throws UnsupportedOperationException if the removeAll operation
+ * @return {@code true} if this list changed as a result of the call
+ * @throws UnsupportedOperationException if the {@code removeAll} operation
* is not supported by this list
* @throws ClassCastException if the class of an element of this list
* is incompatible with the specified collection
@@ -362,8 +362,8 @@
* specified collection.
*
* @param c collection containing elements to be retained in this list
- * @return true if this list changed as a result of the call
- * @throws UnsupportedOperationException if the retainAll operation
+ * @return {@code true} if this list changed as a result of the call
+ * @throws UnsupportedOperationException if the {@code retainAll} operation
* is not supported by this list
* @throws ClassCastException if the class of an element of this list
* is incompatible with the specified collection
@@ -487,7 +487,7 @@
* Removes all of the elements from this list (optional operation).
* The list will be empty after this call returns.
*
- * @throws UnsupportedOperationException if the clear operation
+ * @throws UnsupportedOperationException if the {@code clear} operation
* is not supported by this list
*/
void clear();
@@ -497,17 +497,17 @@
/**
* Compares the specified object with this list for equality. Returns
- * true if and only if the specified object is also a list, both
+ * {@code true} if and only if the specified object is also a list, both
* lists have the same size, and all corresponding pairs of elements in
- * the two lists are equal. (Two elements e1 and
- * e2 are equal if (e1==null ? e2==null :
- * e1.equals(e2)).) In other words, two lists are defined to be
+ * the two lists are equal. (Two elements {@code e1} and
+ * {@code e2} are equal if {@code Objects.equals(e1, e2)}.)
+ * In other words, two lists are defined to be
* equal if they contain the same elements in the same order. This
* definition ensures that the equals method works properly across
- * different implementations of the List interface.
+ * different implementations of the {@code List} interface.
*
* @param o the object to be compared for equality with this list
- * @return true if the specified object is equal to this list
+ * @return {@code true} if the specified object is equal to this list
*/
boolean equals(Object o);
@@ -519,9 +519,9 @@
* for (E e : list)
* hashCode = 31*hashCode + (e==null ? 0 : e.hashCode());
* }
- * This ensures that list1.equals(list2) implies that
- * list1.hashCode()==list2.hashCode() for any two lists,
- * list1 and list2, as required by the general
+ * This ensures that {@code list1.equals(list2)} implies that
+ * {@code list1.hashCode()==list2.hashCode()} for any two lists,
+ * {@code list1} and {@code list2}, as required by the general
* contract of {@link Object#hashCode}.
*
* @return the hash code value for this list
@@ -539,7 +539,7 @@
* @param index index of the element to return
* @return the element at the specified position in this list
* @throws IndexOutOfBoundsException if the index is out of range
- * (index < 0 || index >= size())
+ * ({@code index < 0 || index >= size()})
*/
E get(int index);
@@ -550,7 +550,7 @@
* @param index index of the element to replace
* @param element element to be stored at the specified position
* @return the element previously at the specified position
- * @throws UnsupportedOperationException if the set operation
+ * @throws UnsupportedOperationException if the {@code set} operation
* is not supported by this list
* @throws ClassCastException if the class of the specified element
* prevents it from being added to this list
@@ -559,7 +559,7 @@
* @throws IllegalArgumentException if some property of the specified
* element prevents it from being added to this list
* @throws IndexOutOfBoundsException if the index is out of range
- * (index < 0 || index >= size())
+ * ({@code index < 0 || index >= size()})
*/
E set(int index, E element);
@@ -571,7 +571,7 @@
*
* @param index index at which the specified element is to be inserted
* @param element element to be inserted
- * @throws UnsupportedOperationException if the add operation
+ * @throws UnsupportedOperationException if the {@code add} operation
* is not supported by this list
* @throws ClassCastException if the class of the specified element
* prevents it from being added to this list
@@ -580,7 +580,7 @@
* @throws IllegalArgumentException if some property of the specified
* element prevents it from being added to this list
* @throws IndexOutOfBoundsException if the index is out of range
- * (index < 0 || index > size())
+ * ({@code index < 0 || index > size()})
*/
void add(int index, E element);
@@ -592,10 +592,10 @@
*
* @param index the index of the element to be removed
* @return the element previously at the specified position
- * @throws UnsupportedOperationException if the remove operation
+ * @throws UnsupportedOperationException if the {@code remove} operation
* is not supported by this list
* @throws IndexOutOfBoundsException if the index is out of range
- * (index < 0 || index >= size())
+ * ({@code index < 0 || index >= size()})
*/
E remove(int index);
@@ -605,8 +605,8 @@
/**
* Returns the index of the first occurrence of the specified element
* in this list, or -1 if this list does not contain the element.
- * More formally, returns the lowest index i such that
- * (o==null ? get(i)==null : o.equals(get(i))),
+ * More formally, returns the lowest index {@code i} such that
+ * {@code Objects.equals(o, get(i))},
* or -1 if there is no such index.
*
* @param o element to search for
@@ -624,8 +624,8 @@
/**
* Returns the index of the last occurrence of the specified element
* in this list, or -1 if this list does not contain the element.
- * More formally, returns the highest index i such that
- * (o==null ? get(i)==null : o.equals(get(i))),
+ * More formally, returns the highest index {@code i} such that
+ * {@code Objects.equals(o, get(i))},
* or -1 if there is no such index.
*
* @param o element to search for
@@ -673,8 +673,8 @@
/**
* Returns a view of the portion of this list between the specified
- * fromIndex, inclusive, and toIndex, exclusive. (If
- * fromIndex and toIndex are equal, the returned list is
+ * {@code fromIndex}, inclusive, and {@code toIndex}, exclusive. (If
+ * {@code fromIndex} and {@code toIndex} are equal, the returned list is
* empty.) The returned list is backed by this list, so non-structural
* changes in the returned list are reflected in this list, and vice-versa.
* The returned list supports all of the optional list operations supported
@@ -688,9 +688,9 @@
* {@code
* list.subList(from, to).clear();
* }
- * Similar idioms may be constructed for indexOf and
- * lastIndexOf, and all of the algorithms in the
- * Collections class can be applied to a subList.Legacy language codes
*
*
- *
+ * (key==null ? k==null : key.equals(k))
, that mapping
+ * from key {@code k} to value {@code v} such that
+ * {@code Objects.equals(key, k)}, that mapping
* is removed. (The map can contain at most one such mapping.)
*
*
* (e1.getKey()==null ?
* e2.getKey()==null : e1.getKey().equals(e2.getKey())) &&
* (e1.getValue()==null ?
* e2.getValue()==null : e1.getValue().equals(e2.getValue()))
*
- * This ensures that the equals method works properly across
- * different implementations of the Map.Entry interface.
+ * This ensures that the {@code equals} method works properly across
+ * different implementations of the {@code Map.Entry} interface.
*
* @param o object to be compared for equality with this map entry
- * @return true if the specified object is equal to this map
+ * @return {@code true} if the specified object is equal to this map
* entry
*/
boolean equals(Object o);
/**
* Returns the hash code value for this map entry. The hash code
- * of a map entry e is defined to be:
+ * of a map entry {@code e} is defined to be:
*
*
* (e.getKey()==null ? 0 : e.getKey().hashCode()) ^
* (e.getValue()==null ? 0 : e.getValue().hashCode())
*
- * This ensures that e1.equals(e2) implies that
- * e1.hashCode()==e2.hashCode() for any two Entries
- * e1 and e2, as required by the general
- * contract of Object.hashCode.
+ * This ensures that {@code e1.equals(e2)} implies that
+ * {@code e1.hashCode()==e2.hashCode()} for any two Entries
+ * {@code e1} and {@code e2}, as required by the general
+ * contract of {@code Object.hashCode}.
*
* @return the hash code value for this map entry
* @see Object#hashCode()
@@ -532,24 +533,24 @@
/**
* Compares the specified object with this map for equality. Returns
- * true if the given object is also a map and the two maps
- * represent the same mappings. More formally, two maps m1 and
- * m2 represent the same mappings if
- * m1.entrySet().equals(m2.entrySet()). This ensures that the
- * equals method works properly across different implementations
- * of the Map interface.
+ * {@code true} if the given object is also a map and the two maps
+ * represent the same mappings. More formally, two maps {@code m1} and
+ * {@code m2} represent the same mappings if
+ * {@code m1.entrySet().equals(m2.entrySet())}. This ensures that the
+ * {@code equals} method works properly across different implementations
+ * of the {@code Map} interface.
*
* @param o object to be compared for equality with this map
- * @return true if the specified object is equal to this map
+ * @return {@code true} if the specified object is equal to this map
*/
boolean equals(Object o);
/**
* Returns the hash code value for this map. The hash code of a map is
* defined to be the sum of the hash codes of each entry in the map's
- * entrySet() view. This ensures that m1.equals(m2)
- * implies that m1.hashCode()==m2.hashCode() for any two maps
- * m1 and m2, as required by the general contract of
+ * {@code entrySet()} view. This ensures that {@code m1.equals(m2)}
+ * implies that {@code m1.hashCode()==m2.hashCode()} for any two maps
+ * {@code m1} and {@code m2}, as required by the general contract of
* {@link Object#hashCode}.
*
* @return the hash code value for this map
diff -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/share/classes/java/util/MissingFormatArgumentException.java
--- a/jdk/src/java.base/share/classes/java/util/MissingFormatArgumentException.java Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/util/MissingFormatArgumentException.java Wed Jul 05 20:45:35 2017 +0200
@@ -30,7 +30,7 @@
* have a corresponding argument or if an argument index refers to an argument
* that does not exist.
*
- * MissingResourceException
with
- * message
, className
, key
,
- * and cause
. This constructor is package private for
- * use by ResourceBundle.getBundle
.
+ * Constructs a {@code MissingResourceException} with
+ * {@code message}, {@code className}, {@code key},
+ * and {@code cause}. This constructor is package private for
+ * use by {@code ResourceBundle.getBundle}.
*
* @param message
* the detail message
diff -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/share/classes/java/util/NoSuchElementException.java
--- a/jdk/src/java.base/share/classes/java/util/NoSuchElementException.java Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/util/NoSuchElementException.java Wed Jul 05 20:45:35 2017 +0200
@@ -39,7 +39,7 @@
private static final long serialVersionUID = 6769829250639411880L;
/**
- * Constructs a NoSuchElementException
with null
+ * Constructs a {@code NoSuchElementException} with {@code null}
* as its error message string.
*/
public NoSuchElementException() {
@@ -47,9 +47,9 @@
}
/**
- * Constructs a NoSuchElementException
, saving a reference
- * to the error message string s for later retrieval by the
- * getMessage method.
+ * Constructs a {@code NoSuchElementException}, saving a reference
+ * to the error message string {@code s} for later retrieval by the
+ * {@code getMessage} method.
*
* @param s the detail message.
*/
diff -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/share/classes/java/util/Observable.java
--- a/jdk/src/java.base/share/classes/java/util/Observable.java Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/util/Observable.java Wed Jul 05 20:45:35 2017 +0200
@@ -31,11 +31,11 @@
* object that the application wants to have observed.
* Observable
's notifyObservers
method
+ * {@code Observable}'s {@code notifyObservers} method
* causes all of its observers to be notified of the change by a call
- * to their update
method.
+ * to their {@code update} method.
* null
to this method will have no effect.
+ * Passing {@code null} to this method will have no effect.
* @param o the observer to be deleted.
*/
public synchronized void deleteObserver(Observer o) {
@@ -97,15 +97,15 @@
/**
* If this object has changed, as indicated by the
- * hasChanged
method, then notify all of its observers
- * and then call the clearChanged
method to
+ * {@code hasChanged} method, then notify all of its observers
+ * and then call the {@code clearChanged} method to
* indicate that this object has no longer changed.
* update
method called with two
- * arguments: this observable object and null
. In other
+ * Each observer has its {@code update} method called with two
+ * arguments: this observable object and {@code null}. In other
* words, this method is equivalent to:
- *
- * notifyObservers(null)
+ * {@code
+ * notifyObservers(null)}
*
* @see java.util.Observable#clearChanged()
* @see java.util.Observable#hasChanged()
@@ -117,12 +117,12 @@
/**
* If this object has changed, as indicated by the
- * hasChanged
method, then notify all of its observers
- * and then call the clearChanged
method to indicate
+ * {@code hasChanged} method, then notify all of its observers
+ * and then call the {@code clearChanged} method to indicate
* that this object has no longer changed.
* update
method called with two
- * arguments: this observable object and the arg
argument.
+ * Each observer has its {@code update} method called with two
+ * arguments: this observable object and the {@code arg} argument.
*
* @param arg any object.
* @see java.util.Observable#clearChanged()
@@ -167,8 +167,8 @@
}
/**
- * Marks this Observable object as having been changed; the
- * hasChanged method will now return true.
+ * Marks this {@code Observable} object as having been changed; the
+ * {@code hasChanged} method will now return {@code true}.
*/
protected synchronized void setChanged() {
changed = true;
@@ -177,9 +177,9 @@
/**
* Indicates that this object has no longer changed, or that it has
* already notified all of its observers of its most recent change,
- * so that the hasChanged method will now return false.
+ * so that the {@code hasChanged} method will now return {@code false}.
* This method is called automatically by the
- * notifyObservers
methods.
+ * {@code notifyObservers} methods.
*
* @see java.util.Observable#notifyObservers()
* @see java.util.Observable#notifyObservers(java.lang.Object)
@@ -191,10 +191,10 @@
/**
* Tests if this object has changed.
*
- * @return true
if and only if the setChanged
+ * @return {@code true} if and only if the {@code setChanged}
* method has been called more recently than the
- * clearChanged
method on this object;
- * false
otherwise.
+ * {@code clearChanged} method on this object;
+ * {@code false} otherwise.
* @see java.util.Observable#clearChanged()
* @see java.util.Observable#setChanged()
*/
@@ -203,7 +203,7 @@
}
/**
- * Returns the number of observers of this Observable object.
+ * Returns the number of observers of this {@code Observable} object.
*
* @return the number of observers of this object.
*/
diff -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/share/classes/java/util/Observer.java
--- a/jdk/src/java.base/share/classes/java/util/Observer.java Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/util/Observer.java Wed Jul 05 20:45:35 2017 +0200
@@ -25,7 +25,7 @@
package java.util;
/**
- * A class can implement the Observer
interface when it
+ * A class can implement the {@code Observer} interface when it
* wants to be informed of changes in observable objects.
*
* @author Chris Warth
@@ -35,12 +35,12 @@
public interface Observer {
/**
* This method is called whenever the observed object is changed. An
- * application calls an Observable object's
- * notifyObservers
method to have all the object's
+ * application calls an {@code Observable} object's
+ * {@code notifyObservers} method to have all the object's
* observers notified of the change.
*
* @param o the observable object.
- * @param arg an argument passed to the notifyObservers
+ * @param arg an argument passed to the {@code notifyObservers}
* method.
*/
void update(Observable o, Object arg);
diff -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/share/classes/java/util/Properties.java
--- a/jdk/src/java.base/share/classes/java/util/Properties.java Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/util/Properties.java Wed Jul 05 20:45:35 2017 +0200
@@ -60,12 +60,12 @@
* object that contains a non-{@code String} key.
*
*
* for (int i=0, n=list.size(); i < n; i++)
diff -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/share/classes/java/util/RegularEnumSet.java
--- a/jdk/src/java.base/share/classes/java/util/RegularEnumSet.java Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/util/RegularEnumSet.java Wed Jul 05 20:45:35 2017 +0200
@@ -123,19 +123,19 @@
}
/**
- * Returns true if this set contains no elements.
+ * Returns {@code true} if this set contains no elements.
*
- * @return true if this set contains no elements
+ * @return {@code true} if this set contains no elements
*/
public boolean isEmpty() {
return elements == 0;
}
/**
- * Returns true if this set contains the specified element.
+ * Returns {@code true} if this set contains the specified element.
*
* @param e element to be checked for containment in this collection
- * @return true if this set contains the specified element
+ * @return {@code true} if this set contains the specified element
*/
public boolean contains(Object e) {
if (e == null)
@@ -153,9 +153,9 @@
* Adds the specified element to this set if it is not already present.
*
* @param e element to be added to this set
- * @return true if the set changed as a result of the call
+ * @return {@code true} if the set changed as a result of the call
*
- * @throws NullPointerException if e is null
+ * @throws NullPointerException if {@code e} is null
*/
public boolean add(E e) {
typeCheck(e);
@@ -169,7 +169,7 @@
* Removes the specified element from this set if it is present.
*
* @param e element to be removed from this set, if present
- * @return true if the set contained the specified element
+ * @return {@code true} if the set contained the specified element
*/
public boolean remove(Object e) {
if (e == null)
@@ -186,11 +186,11 @@
// Bulk Operations
/**
- * Returns true if this set contains all of the elements
+ * Returns {@code true} if this set contains all of the elements
* in the specified collection.
*
* @param c collection to be checked for containment in this set
- * @return true if this set contains all of the elements
+ * @return {@code true} if this set contains all of the elements
* in the specified collection
* @throws NullPointerException if the specified collection is null
*/
@@ -209,7 +209,7 @@
* Adds all of the elements in the specified collection to this set.
*
* @param c collection whose elements are to be added to this set
- * @return true if this set changed as a result of the call
+ * @return {@code true} if this set changed as a result of the call
* @throws NullPointerException if the specified collection or any
* of its elements are null
*/
@@ -236,7 +236,7 @@
* the specified collection.
*
* @param c elements to be removed from this set
- * @return true if this set changed as a result of the call
+ * @return {@code true} if this set changed as a result of the call
* @throws NullPointerException if the specified collection is null
*/
public boolean removeAll(Collection> c) {
@@ -257,7 +257,7 @@
* specified collection.
*
* @param c elements to be retained in this set
- * @return true if this set changed as a result of the call
+ * @return {@code true} if this set changed as a result of the call
* @throws NullPointerException if the specified collection is null
*/
public boolean retainAll(Collection> c) {
@@ -285,12 +285,12 @@
/**
* Compares the specified object with this set for equality. Returns
- * true if the given object is also a set, the two sets have
+ * {@code true} if the given object is also a set, the two sets have
* the same size, and every member of the given set is contained in
* this set.
*
* @param o object to be compared for equality with this set
- * @return true if the specified object is equal to this set
+ * @return {@code true} if the specified object is equal to this set
*/
public boolean equals(Object o) {
if (!(o instanceof RegularEnumSet))
diff -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/share/classes/java/util/Scanner.java
--- a/jdk/src/java.base/share/classes/java/util/Scanner.java Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/util/Scanner.java Wed Jul 05 20:45:35 2017 +0200
@@ -42,20 +42,20 @@
* A simple text scanner which can parse primitive types and strings using
* regular expressions.
*
- *
Scanner
breaks its input into tokens using a
+ *
*
- * {@code
* Scanner sc = new Scanner(System.in);
* int i = sc.nextInt();
* }
long
types to be
- * assigned from entries in a file myNumbers
:
+ * {@code
* Scanner sc = new Scanner(new File("myNumbers"));
* while (sc.hasNextLong()) {
@@ -106,10 +106,10 @@
*
Scanner
is closed, it will close its input source
+ * Scanner
is not safe for multithreaded use without
+ * null
parameter into
- * any method of a Scanner
will cause a
- * NullPointerException
to be thrown.
+ * 10
regardless of whether it was previously changed.
+ * {@code 10} regardless of whether it was previously changed.
*
* Localized numbers
*
@@ -162,50 +162,50 @@
*
*
@@ -219,82 +219,82 @@
*
*
*
* (
Non0Digit
+ * Digit{@code ?
+ * }Digit{@code ?}
+ * (
LocalGroupSeparator
* Digit
* Digit
- * Digit )+ )
+ * Digit{@code )+ )}
*
* Scanner
that returns values scanned
+ * Constructs a {@code Scanner} that returns values scanned
* from the specified source delimited by the specified pattern.
*
* @param source A character source implementing the Readable interface
@@ -541,7 +541,7 @@
}
/**
- * Constructs a new Scanner
that produces values scanned
+ * Constructs a new {@code Scanner} that produces values scanned
* from the specified source.
*
* @param source A character source implementing the {@link Readable}
@@ -552,7 +552,7 @@
}
/**
- * Constructs a new Scanner
that produces values scanned
+ * Constructs a new {@code Scanner} that produces values scanned
* from the specified input stream. Bytes from the stream are converted
* into characters using the underlying platform's
* {@linkplain java.nio.charset.Charset#defaultCharset() default charset}.
@@ -564,7 +564,7 @@
}
/**
- * Constructs a new Scanner
that produces values scanned
+ * Constructs a new {@code Scanner} that produces values scanned
* from the specified input stream. Bytes from the stream are converted
* into characters using the specified charset.
*
@@ -599,7 +599,7 @@
}
/**
- * Constructs a new Scanner
that produces values scanned
+ * Constructs a new {@code Scanner} that produces values scanned
* from the specified file. Bytes from the file are converted into
* characters using the underlying platform's
* {@linkplain java.nio.charset.Charset#defaultCharset() default charset}.
@@ -612,7 +612,7 @@
}
/**
- * Constructs a new Scanner
that produces values scanned
+ * Constructs a new {@code Scanner} that produces values scanned
* from the specified file. Bytes from the file are converted into
* characters using the specified charset.
*
@@ -650,7 +650,7 @@
}
/**
- * Constructs a new Scanner
that produces values scanned
+ * Constructs a new {@code Scanner} that produces values scanned
* from the specified file. Bytes from the file are converted into
* characters using the underlying platform's
* {@linkplain java.nio.charset.Charset#defaultCharset() default charset}.
@@ -669,7 +669,7 @@
}
/**
- * Constructs a new Scanner
that produces values scanned
+ * Constructs a new {@code Scanner} that produces values scanned
* from the specified file. Bytes from the file are converted into
* characters using the specified charset.
*
@@ -693,7 +693,7 @@
}
/**
- * Constructs a new Scanner
that produces values scanned
+ * Constructs a new {@code Scanner} that produces values scanned
* from the specified string.
*
* @param source A string to scan
@@ -703,7 +703,7 @@
}
/**
- * Constructs a new Scanner
that produces values scanned
+ * Constructs a new {@code Scanner} that produces values scanned
* from the specified channel. Bytes from the source are converted into
* characters using the underlying platform's
* {@linkplain java.nio.charset.Charset#defaultCharset() default charset}.
@@ -720,7 +720,7 @@
}
/**
- * Constructs a new Scanner
that produces values scanned
+ * Constructs a new {@code Scanner} that produces values scanned
* from the specified channel. Bytes from the source are converted into
* characters using the specified charset.
*
@@ -1077,7 +1077,7 @@
*
* IOException
last thrown by this
- * Scanner
's underlying Readable
. This method
- * returns null
if no such exception exists.
+ * Returns the {@code IOException} last thrown by this
+ * {@code Scanner}'s underlying {@code Readable}. This method
+ * returns {@code null} if no such exception exists.
*
* @return the last exception thrown by this scanner's readable
*/
@@ -1112,7 +1112,7 @@
}
/**
- * Returns the Pattern
this Scanner
is currently
+ * Returns the {@code Pattern} this {@code Scanner} is currently
* using to match delimiters.
*
* @return this scanner's delimiting pattern.
@@ -1134,11 +1134,11 @@
/**
* Sets this scanner's delimiting pattern to a pattern constructed from
- * the specified String
.
+ * the specified {@code String}.
*
* Character.MIN_RADIX
- * or greater than Character.MAX_RADIX
, then an
- * IllegalArgumentException
is thrown.
+ * 10
.
+ * {@code 10}.
*
* @param radix The radix to use when scanning numbers
* @return this scanner
@@ -1271,15 +1271,15 @@
/**
* Returns the match result of the last scanning operation performed
- * by this scanner. This method throws IllegalStateException
+ * by this scanner. This method throws {@code IllegalStateException}
* if no match has been performed, or if the last match was
* not successful.
*
- * next
methods of Scanner
+ * MatchResult
for the search of the
+ * {@code MatchResult} for the search of the
* Integer regular expression
* defined above. Similarly the {@link #findInLine},
* {@link #findWithinHorizon}, and {@link #skip} methods will make a
@@ -1295,8 +1295,8 @@
}
/**
- * Scanner
. The
- * string representation of a Scanner
contains information
+ * true
.
+ * {@code true}.
*
* @return the next token
* @throws NoSuchElementException if no more tokens are available
@@ -1374,7 +1374,7 @@
/**
* The remove operation is not supported by this implementation of
- * Iterator
.
+ * {@code Iterator}.
*
* @throws UnsupportedOperationException if this method is invoked.
* @see java.util.Iterator
@@ -1387,9 +1387,9 @@
* Returns true if the next token matches the pattern constructed from the
* specified string. The scanner does not advance past any input.
*
- * true
.
+ * invocation of {@link #hasNext(Pattern)} returned {@code true}.
* If the match is successful, the scanner advances past the input that
* matched the pattern.
*
@@ -1554,9 +1554,9 @@
* Attempts to find the next occurrence of a pattern constructed from the
* specified string, ignoring delimiters.
*
- * null
is returned and the scanner's
+ * separator, then {@code null} is returned and the scanner's
* position is unchanged. This method may block waiting for input that
* matches the pattern.
*
@@ -1621,9 +1621,9 @@
* specified string, ignoring delimiters.
*
* horizon
code
+ * 0
, then the horizon is ignored and
+ * NoSuchElementException
by using a pattern that can
- * match nothing, e.g., sc.skip("[ \t]*")
.
+ * {@code NoSuchElementException} by using a pattern that can
+ * match nothing, e.g., {@code sc.skip("[ \t]*")}.
*
* @param pattern a string specifying the pattern to skip over
* @return this scanner
@@ -1737,9 +1737,9 @@
* Skips input that matches a pattern constructed from the specified
* string.
*
- * InputMismatchException
+ * that value. This method will throw {@code InputMismatchException}
* if the next token cannot be translated into a valid boolean value.
* If the match is successful, the scanner advances past the input that
* matched.
@@ -1822,14 +1822,14 @@
}
/**
- * Scans the next token of the input as a byte.
+ * Scans the next token of the input as a {@code byte}.
*
* radix
+ * {@code nextByte()} behaves in exactly the same way as the
+ * invocation {@code nextByte(radix)}, where {@code radix}
* is the default radix of this scanner.
*
- * @return the byte scanned from the input
+ * @return the {@code byte} scanned from the input
* @throws InputMismatchException
* if the next token does not match the Integer
* regular expression, or is out of range
@@ -1841,15 +1841,15 @@
}
/**
- * Scans the next token of the input as a byte.
- * This method will throw InputMismatchException
+ * Scans the next token of the input as a {@code byte}.
+ * This method will throw {@code InputMismatchException}
* if the next token cannot be translated into a valid byte value as
* described below. If the translation is successful, the scanner advances
* past the input that matched.
*
* radix
+ * {@code nextShort()} behaves in exactly the same way as the
+ * invocation {@code nextShort(radix)}, where {@code radix}
* is the default radix of this scanner.
*
- * @return the short scanned from the input
+ * @return the {@code short} scanned from the input
* @throws InputMismatchException
* if the next token does not match the Integer
* regular expression, or is out of range
@@ -1947,15 +1947,15 @@
}
/**
- * Scans the next token of the input as a short.
- * This method will throw InputMismatchException
+ * Scans the next token of the input as a {@code short}.
+ * This method will throw {@code InputMismatchException}
* if the next token cannot be translated into a valid short value as
* described below. If the translation is successful, the scanner advances
* past the input that matched.
*
* radix
+ * {@code nextInt()} behaves in exactly the same way as the
+ * invocation {@code nextInt(radix)}, where {@code radix}
* is the default radix of this scanner.
*
- * @return the int scanned from the input
+ * @return the {@code int} scanned from the input
* @throws InputMismatchException
* if the next token does not match the Integer
* regular expression, or is out of range
@@ -2077,15 +2077,15 @@
}
/**
- * Scans the next token of the input as an int.
- * This method will throw InputMismatchException
+ * Scans the next token of the input as an {@code int}.
+ * This method will throw {@code InputMismatchException}
* if the next token cannot be translated into a valid int value as
* described below. If the translation is successful, the scanner advances
* past the input that matched.
*
* radix
+ * {@code nextLong()} behaves in exactly the same way as the
+ * invocation {@code nextLong(radix)}, where {@code radix}
* is the default radix of this scanner.
*
- * @return the long scanned from the input
+ * @return the {@code long} scanned from the input
* @throws InputMismatchException
* if the next token does not match the Integer
* regular expression, or is out of range
@@ -2183,15 +2183,15 @@
}
/**
- * Scans the next token of the input as a long.
- * This method will throw InputMismatchException
+ * Scans the next token of the input as a {@code long}.
+ * This method will throw {@code InputMismatchException}
* if the next token cannot be translated into a valid long value as
* described below. If the translation is successful, the scanner advances
* past the input that matched.
*
* InputMismatchException
+ * Scans the next token of the input as a {@code float}.
+ * This method will throw {@code InputMismatchException}
* if the next token cannot be translated into a valid float value as
* described below. If the translation is successful, the scanner advances
* past the input that matched.
*
* InputMismatchException
+ * Scans the next token of the input as a {@code double}.
+ * This method will throw {@code InputMismatchException}
* if the next token cannot be translated into a valid double value.
* If the translation is successful, the scanner advances past the input
* that matched.
*
* BigInteger
in the default radix using the
+ * interpreted as a {@code BigInteger} in the default radix using the
* {@link #nextBigInteger} method. The scanner does not advance past any
* input.
*
* @return true if and only if this scanner's next token is a valid
- * BigInteger
+ * {@code BigInteger}
* @throws IllegalStateException if this scanner is closed
*/
public boolean hasNextBigInteger() {
@@ -2435,13 +2435,13 @@
/**
* Returns true if the next token in this scanner's input can be
- * interpreted as a BigInteger
in the specified radix using
+ * interpreted as a {@code BigInteger} in the specified radix using
* the {@link #nextBigInteger} method. The scanner does not advance past
* any input.
*
* @param radix the radix used to interpret the token as an integer
* @return true if and only if this scanner's next token is a valid
- * BigInteger
+ * {@code BigInteger}
* @throws IllegalStateException if this scanner is closed
*/
public boolean hasNextBigInteger(int radix) {
@@ -2465,11 +2465,11 @@
* BigInteger}.
*
* radix
+ * {@code nextBigInteger()} behaves in exactly the same way as the
+ * invocation {@code nextBigInteger(radix)}, where {@code radix}
* is the default radix of this scanner.
*
- * @return the BigInteger scanned from the input
+ * @return the {@code BigInteger} scanned from the input
* @throws InputMismatchException
* if the next token does not match the Integer
* regular expression, or is out of range
@@ -2486,7 +2486,7 @@
*
* BigDecimal
using the
+ * interpreted as a {@code BigDecimal} using the
* {@link #nextBigDecimal} method. The scanner does not advance past any
* input.
*
* @return true if and only if this scanner's next token is a valid
- * BigDecimal
+ * {@code BigDecimal}
* @throws IllegalStateException if this scanner is closed
*/
public boolean hasNextBigDecimal() {
@@ -2553,14 +2553,14 @@
*
*
*
* @param item the item to be pushed onto this stack.
- * @return the {@code
diff -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/share/classes/java/util/ServiceConfigurationError.java
--- a/jdk/src/java.base/share/classes/java/util/ServiceConfigurationError.java Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/util/ServiceConfigurationError.java Wed Jul 05 20:45:35 2017 +0200
@@ -65,7 +65,7 @@
/**
* Constructs a new instance with the specified message.
*
- * @param msg The message, or null if there is no message
+ * @param msg The message, or {@code null} if there is no message
*
*/
public ServiceConfigurationError(String msg) {
@@ -75,9 +75,9 @@
/**
* Constructs a new instance with the specified message and cause.
*
- * @param msg The message, or null if there is no message
+ * @param msg The message, or {@code null} if there is no message
*
- * @param cause The cause, or null if the cause is nonexistent
+ * @param cause The cause, or {@code null} if the cause is nonexistent
* or unknown
*/
public ServiceConfigurationError(String msg, Throwable cause) {
diff -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/share/classes/java/util/Set.java
--- a/jdk/src/java.base/share/classes/java/util/Set.java Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/util/Set.java Wed Jul 05 20:45:35 2017 +0200
@@ -27,16 +27,16 @@
/**
* A collection that contains no duplicate elements. More formally, sets
- * contain no pair of elements
e1
and e2
such that
- * e1.equals(e2)
, and at most one null element. As implied by
+ * contain no pair of elements {@code e1} and {@code e2} such that
+ * {@code e1.equals(e2)}, and at most one null element. As implied by
* its name, this interface models the mathematical set abstraction.
*
- *
* 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 a the array into which the elements of this set are to be
* stored, if it is big enough; otherwise, a new array of the same
@@ -195,25 +195,25 @@
/**
* Adds the specified element to this set if it is not already present
* (optional operation). More formally, adds the specified element
- * e to this set if the set contains no element e2
+ * {@code e} to this set if the set contains no element {@code e2}
* such that
- * (e==null ? e2==null : e.equals(e2)).
+ * {@code Objects.equals(e, e2)}.
* If this set already contains the element, the call leaves the set
- * unchanged and returns false. In combination with the
+ * unchanged and returns {@code false}. In combination with the
* restriction on constructors, this ensures that sets never contain
* duplicate elements.
*
*
+ * containing all of the strings in {@code s} from {@code low} to
+ * {@code high}, inclusive:
* SortedSet<String> sub = s.subSet(low, high+"\0");
*
* A similar technique can be used to generate an open range (which
* contains neither endpoint). The following idiom obtains a view
- * containing all of the Strings in s from low to
- * high, exclusive:
+ * containing all of the Strings in {@code s} from {@code low} to
+ * {@code high}, exclusive:
* SortedSet<String> sub = s.subSet(low+"\0", high);
*
* Stack
class represents a last-in-first-out
- * (LIFO) stack of objects. It extends class Vector with five
+ * The {@code Stack} class represents a last-in-first-out
+ * (LIFO) stack of objects. It extends class {@code Vector} with five
* operations that allow a vector to be treated as a stack. The usual
- * push and pop operations are provided, as well as a
- * method to peek at the top item on the stack, a method to test
- * for whether the stack is empty, and a method to search
+ * {@code push} and {@code pop} operations are provided, as well as a
+ * method to {@code peek} at the top item on the stack, a method to test
+ * for whether the stack is {@code empty}, and a method to {@code search}
* the stack for an item and discover how far it is from the top.
* item
argument.
+ * @return the {@code item} argument.
* @see java.util.Vector#addElement
*/
public E push(E item) {
@@ -74,7 +74,7 @@
* object as the value of this function.
*
* @return The object at the top of this stack (the last item
- * of the Vector object).
+ * of the {@code Vector} object).
* @throws EmptyStackException if this stack is empty.
*/
public synchronized E pop() {
@@ -92,7 +92,7 @@
* from the stack.
*
* @return the object at the top of this stack (the last item
- * of the Vector object).
+ * of the {@code Vector} object).
* @throws EmptyStackException if this stack is empty.
*/
public synchronized E peek() {
@@ -106,8 +106,8 @@
/**
* Tests if this stack is empty.
*
- * @return true
if and only if this stack contains
- * no items; false
otherwise.
+ * @return {@code true} if and only if this stack contains
+ * no items; {@code false} otherwise.
*/
public boolean empty() {
return size() == 0;
@@ -115,16 +115,16 @@
/**
* Returns the 1-based position where an object is on this stack.
- * If the object o occurs as an item in this stack, this
+ * If the object {@code o} occurs as an item in this stack, this
* method returns the distance from the top of the stack of the
* occurrence nearest the top of the stack; the topmost item on the
- * stack is considered to be at distance 1. The equals
- * method is used to compare o to the
+ * stack is considered to be at distance {@code 1}. The {@code equals}
+ * method is used to compare {@code o} to the
* items in this stack.
*
* @param o the desired object.
* @return the 1-based position from the top of the stack where
- * the object is located; the return value -1
+ * the object is located; the return value {@code -1}
* indicates that the object is not on the stack.
*/
public synchronized int search(Object o) {
diff -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/share/classes/java/util/StringTokenizer.java
--- a/jdk/src/java.base/share/classes/java/util/StringTokenizer.java Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/util/StringTokenizer.java Wed Jul 05 20:45:35 2017 +0200
@@ -30,32 +30,32 @@
/**
* The string tokenizer class allows an application to break a
* string into tokens. The tokenization method is much simpler than
- * the one used by the StreamTokenizer
class. The
- * StringTokenizer
methods do not distinguish among
+ * the one used by the {@code StreamTokenizer} class. The
+ * {@code StringTokenizer} methods do not distinguish among
* identifiers, numbers, and quoted strings, nor do they recognize
* and skip comments.
* StringTokenizer
behaves in one of two
+ * An instance of {@code StringTokenizer} behaves in one of two
* ways, depending on whether it was created with the
- * returnDelims
flag having the value true
- * or false
:
+ * {@code returnDelims} flag having the value {@code true}
+ * or {@code false}:
*
- *
false
, delimiter characters serve to
+ * true
, delimiter characters are themselves
+ *
*
*
@@ -74,12 +74,12 @@
*
* String[] result = "this is a test".split("\\s");
@@ -171,25 +171,25 @@
/**
* Constructs a string tokenizer for the specified string. All
- * characters in the
delim
argument are the delimiters
+ * characters in the {@code delim} argument are the delimiters
* for separating tokens.
* returnDelims
flag is true
, then
+ * If the {@code returnDelims} flag is {@code true}, then
* the delimiter characters are also returned as tokens. Each
* delimiter is returned as a string of length one. If the flag is
- * false
, the delimiter characters are skipped and only
+ * {@code false}, the delimiter characters are skipped and only
* serve as separators between tokens.
* null
+ * @exception NullPointerException if str is {@code null}
*/
public StringTokenizer(String str, String delim, boolean returnDelims) {
currentPosition = 0;
@@ -204,18 +204,18 @@
/**
* Constructs a string tokenizer for the specified string. The
- * characters in the delim
argument are the delimiters
+ * characters in the {@code delim} argument are the delimiters
* for separating tokens. Delimiter characters themselves will not
* be treated as tokens.
* null
+ * @exception NullPointerException if str is {@code null}
*/
public StringTokenizer(String str, String delim) {
this(str, delim, false);
@@ -230,7 +230,7 @@
* not be treated as tokens.
*
* @param str a string to be parsed.
- * @exception NullPointerException if str is null
+ * @exception NullPointerException if str is {@code null}
*/
public StringTokenizer(String str) {
this(str, " \t\n\r\f", false);
@@ -307,11 +307,11 @@
/**
* Tests if there are more tokens available from this tokenizer's string.
- * If this method returns true, then a subsequent call to
- * nextToken with no argument will successfully return a token.
+ * If this method returns {@code true}, then a subsequent call to
+ * {@code nextToken} with no argument will successfully return a token.
*
- * @return true
if and only if there is at least one token
- * in the string after the current position; false
+ * @return {@code true} if and only if there is at least one token
+ * in the string after the current position; {@code false}
* otherwise.
*/
public boolean hasMoreTokens() {
@@ -355,8 +355,8 @@
/**
* Returns the next token in this string tokenizer's string. First,
* the set of characters considered to be delimiters by this
- * StringTokenizer object is changed to be the characters in
- * the string delim. Then the next token in the string
+ * {@code StringTokenizer} object is changed to be the characters in
+ * the string {@code delim}. Then the next token in the string
* after the current position is returned. The current position is
* advanced beyond the recognized token. The new delimiter set
* remains the default after this call.
@@ -365,7 +365,7 @@
* @return the next token, after switching to the new delimiter set.
* @exception NoSuchElementException if there are no more tokens in this
* tokenizer's string.
- * @exception NullPointerException if delim is null
+ * @exception NullPointerException if delim is {@code null}
*/
public String nextToken(String delim) {
delimiters = delim;
@@ -378,12 +378,12 @@
}
/**
- * Returns the same value as the hasMoreTokens
+ * Returns the same value as the {@code hasMoreTokens}
* method. It exists so that this class can implement the
- * Enumeration
interface.
+ * {@code Enumeration} interface.
*
- * @return true
if there are more tokens;
- * false
otherwise.
+ * @return {@code true} if there are more tokens;
+ * {@code false} otherwise.
* @see java.util.Enumeration
* @see java.util.StringTokenizer#hasMoreTokens()
*/
@@ -392,10 +392,10 @@
}
/**
- * Returns the same value as the nextToken
method,
- * except that its declared return value is Object
rather than
- * String
. It exists so that this class can implement the
- * Enumeration
interface.
+ * Returns the same value as the {@code nextToken} method,
+ * except that its declared return value is {@code Object} rather than
+ * {@code String}. It exists so that this class can implement the
+ * {@code Enumeration} interface.
*
* @return the next token in the string.
* @exception NoSuchElementException if there are no more tokens in this
@@ -409,7 +409,7 @@
/**
* Calculates the number of times that this tokenizer's
- * nextToken
method can be called before it generates an
+ * {@code nextToken} method can be called before it generates an
* exception. The current position is not advanced.
*
* @return the number of tokens remaining in the string using the current
diff -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/share/classes/java/util/Timer.java
--- a/jdk/src/java.base/share/classes/java/util/Timer.java Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/util/Timer.java Wed Jul 05 20:45:35 2017 +0200
@@ -32,7 +32,7 @@
* background thread. Tasks may be scheduled for one-time execution, or for
* repeated execution at regular intervals.
*
- * (key==null ? k==null :
+ * More formally, if this map contains a mapping from key {@code k} to
+ * value {@code v} such that
(key==null ? k==null :
* key.equals(k))
, that mapping is removed. (The map can contain
* at most one such mapping.)
*
* MatchResult
.
+ * a {@code MatchResult}.
*
* @author Michael McCloskey
* @see Matcher
@@ -56,14 +56,14 @@
*
* MatchResult
with the state of this matcher
+ * @return a {@code MatchResult} with the state of this matcher
* @since 1.5
*/
public MatchResult toMatchResult() {
@@ -347,7 +347,7 @@
}
/**
- * Changes the Pattern that this Matcher uses to
+ * Changes the {@code Pattern} that this {@code Matcher} uses to
* find matches with.
*
* String
for the specified
- * String
.
+ * Returns a literal replacement {@code String} for the specified
+ * {@code String}.
*
- * This method produces a String
that will work
- * as a literal replacement s
in the
- * appendReplacement
method of the {@link Matcher} class.
- * The String
produced will match the sequence of characters
- * in s
treated as a literal sequence. Slashes ('\') and
+ * This method produces a {@code String} that will work
+ * as a literal replacement {@code s} in the
+ * {@code appendReplacement} method of the {@link Matcher} class.
+ * The {@code String} produced will match the sequence of characters
+ * in {@code s} treated as a literal sequence. Slashes ('\') and
* dollar signs ('$') will be given no special meaning.
*
* @param s The string to be literalized
@@ -816,7 +817,7 @@
* append position, and appends them to the given string buffer. It
* stops after reading the last character preceding the previous match,
* that is, the character at index {@link
- * #start()} - 1. ${
name}
or {@code $}g
* will be replaced by the result of evaluating the corresponding
* {@link #group(String) group(name)} or {@link #group(int) group(g)}
- * respectively. For $g,
- * the first number after the $ is always treated as part of
+ * respectively. For {@code $}g,
+ * the first number after the {@code $} is always treated as part of
* the group reference. Subsequent numbers are incorporated into g if
* they would form a legal group reference. Only the numerals '0'
* through '9' are considered as potential components of the group
- * reference. If the second group matched the string "foo", for
- * example, then passing the replacement string "$2bar" would
- * cause "foobar" to be appended to the string buffer. A dollar
- * sign ($) may be included as a literal in the replacement
- * string by preceding it with a backslash (\$).
+ * reference. If the second group matched the string {@code "foo"}, for
+ * example, then passing the replacement string {@code "$2bar"} would
+ * cause {@code "foobar"} to be appended to the string buffer. A dollar
+ * sign ({@code $}) may be included as a literal in the replacement
+ * string by preceding it with a backslash ({@code \$}).
*
- *
* Pattern p = Pattern.compile("cat");
@@ -911,7 +912,7 @@
* append position, and appends them to the given string builder. It
* stops after reading the last character preceding the previous match,
* that is, the character at index {@link
- * #start()} - 1.
+ * #start()} {@code -} {@code 1}.
*
*
* Pattern p = Pattern.compile("cat");
@@ -1134,17 +1135,17 @@
* string may contain references to captured subsequences as in the {@link
* #appendReplacement appendReplacement} method.
*
- *
start
parameter and end at the
- * index specified by the end
parameter.
+ * index specified by the {@code start} parameter and end at the
+ * index specified by the {@code end} parameter.
*
* Matcher
contains information
+ * string representation of a {@code Matcher} contains information
* that may be useful for debugging. The exact format is unspecified.
*
* @return The string representation of this matcher
diff -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/share/classes/java/util/regex/Pattern.java
--- a/jdk/src/java.base/share/classes/java/util/regex/Pattern.java Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/util/regex/Pattern.java Wed Jul 05 20:45:35 2017 +0200
@@ -88,40 +88,40 @@
*
*
- * x
* The character x \\
+ *
- * {@code \\}
* The backslash character
- * \0n
- * The character with octal value 0n
- * (0 <= n <= 7)
- * \0nn
- * The character with octal value 0nn
- * (0 <= n <= 7)
- * \0mnn
- * The character with octal value 0mnn
- * (0 <= m <= 3,
- * 0 <= n <= 7)
- * \xhh
- * The character with hexadecimal value 0xhh
- * \uhhhh
- * The character with hexadecimal value 0xhhhh \x{h...h}
- * The character with hexadecimal value 0xh...h
+ *
+ * {@code \0}n
+ * The character with octal value {@code 0}n
+ * (0 {@code <=} n {@code <=} 7)
+ * {@code \0}nn
+ * The character with octal value {@code 0}nn
+ * (0 {@code <=} n {@code <=} 7)
+ * {@code \0}mnn
+ * The character with octal value {@code 0}mnn
+ * (0 {@code <=} m {@code <=} 3,
+ * 0 {@code <=} n {@code <=} 7)
+ * {@code \x}hh
+ * The character with hexadecimal value {@code 0x}hh
+ *
+ * \u
hhhhThe character with hexadecimal value {@code 0x}hhhh
- *
+ * \x
{h...h}The character with hexadecimal value {@code 0x}h...h
* ({@link java.lang.Character#MIN_CODE_POINT Character.MIN_CODE_POINT}
- * <= 0xh...h <=
+ * <= {@code 0x}h...h <=
* {@link java.lang.Character#MAX_CODE_POINT Character.MAX_CODE_POINT})
- * \t
- * The tab character ('\u0009')
- * \n
- * The newline (line feed) character ('\u000A')
- * \r
- * The carriage-return character ('\u000D')
- * \f
- * The form-feed character ('\u000C')
- * \a
- * The alert (bell) character ('\u0007')
- * \e
- * The escape character ('\u001B') \cx
+ *
+ * {@code \t}
+ * The tab character ( '\u0009'
)
+ * {@code \n}
+ * The newline (line feed) character ( '\u000A'
)
+ * {@code \r}
+ * The carriage-return character ( '\u000D'
)
+ * {@code \f}
+ * The form-feed character ( '\u000C'
)
+ * {@code \a}
+ * The alert (bell) character ( '\u0007'
)
+ * {@code \e}
+ * The escape character ( '\u001B'
)
*
* {@code \c}x
* The control character corresponding to x
@@ -149,30 +149,30 @@
*
*
*
- * Predefined character classes .
+ *
- * {@code .}
* Any character (may or may not match line terminators)
- * \d
- * A digit: [0-9]
- * \D
- * A non-digit: [^0-9] \h
+ *
+ * {@code \d}
+ * A digit: {@code [0-9]}
+ * {@code \D}
+ * A non-digit: {@code [^0-9]}
- * {@code \h}
* A horizontal whitespace character:
- * [ \t\xA0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000]
- * \H
- * A non-horizontal whitespace character: [^\h]
- * \s
- * A whitespace character: [ \t\n\x0B\f\r]
- * \S
- * A non-whitespace character: [^\s]
+ * \v
- * A vertical whitespace character: [\n\x0B\f\r\x85\u2028\u2029]
+ * [ \t\xA0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000]
+ * {@code \H}
+ * A non-horizontal whitespace character: {@code [^\h]}
+ * {@code \s}
+ * A whitespace character: {@code [ \t\n\x0B\f\r]}
+ * {@code \S}
+ * A non-whitespace character: {@code [^\s]}
- * {@code \v}
+ * A vertical whitespace character: [\n\x0B\f\r\x85\u2028\u2029]
*
- * \V
- * A non-vertical whitespace character: [^\v]
- * \w
- * A word character: [a-zA-Z_0-9]
+ * \W
- * A non-word character: [^\w]
+ * {@code \V}
+ * A non-vertical whitespace character: {@code [^\v]}
+ * {@code \w}
+ * A word character: {@code [a-zA-Z_0-9]}
* {@code \W}
+ * A non-word character: {@code [^\w]}
*
*
@@ -208,13 +208,13 @@
* POSIX character classes (US-ASCII only)
*
*
- * java.lang.Character classes (simple java character type) \p{javaLowerCase}
+ *
- * {@code \p{javaLowerCase}}
* Equivalent to java.lang.Character.isLowerCase() \p{javaUpperCase}
+ *
- * {@code \p{javaUpperCase}}
* Equivalent to java.lang.Character.isUpperCase() \p{javaWhitespace}
+ *
- * {@code \p{javaWhitespace}}
* Equivalent to java.lang.Character.isWhitespace() \p{javaMirrored}
+ *
*
* {@code \p{javaMirrored}}
* Equivalent to java.lang.Character.isMirrored()
@@ -237,77 +237,77 @@
*
*
*
- * Boundary matchers ^
+ *
- * {@code ^}
* The beginning of a line $
+ *
- * {@code $}
* The end of a line \b
+ *
- * {@code \b}
* A word boundary \B
+ *
- * {@code \B}
* A non-word boundary \A
+ *
- * {@code \A}
* The beginning of the input \G
+ *
- * {@code \G}
* The end of the previous match \Z
+ *
- * {@code \Z}
* The end of the input but for the final
* terminator, if any \z
+ *
*
* {@code \z}
* The end of the input
*
- * Linebreak matcher \R
+ *
+ * {@code \R}
* Any Unicode linebreak sequence, is equivalent to
- * \u000D\u000A|[\u000A\u000B\u000C\u000D\u0085\u2028\u2029]
- * \u000D\u000A|[\u000A\u000B\u000C\u000D\u0085\u2028\u2029]
+ *
*
*
- * Greedy quantifiers X?
+ *
- * X{@code ?}
* X, once or not at all X*
+ *
- * X{@code *}
* X, zero or more times X+
+ *
- * X{@code +}
* X, one or more times X{n}
+ *
- * X
* {
n}
X, exactly n times X{n,}
+ *
- * X
* {
n{@code ,}}X, at least n times X{n,m}
+ *
*
* X
* {
n{@code ,}m}
X, at least n but not more than m times
*
*
- * Reluctant quantifiers X??
+ *
- * X{@code ??}
* X, once or not at all X*?
+ *
- * X{@code *?}
* X, zero or more times X+?
+ *
- * X{@code +?}
* X, one or more times X{n}?
+ *
- * X
* {
n}?
X, exactly n times X{n,}?
+ *
- * X
* {
n,}?
X, at least n times X{n,m}?
+ *
*
* X
* {
n{@code ,}m}?
X, at least n but not more than m times
*
*
- * Possessive quantifiers X?+
+ *
- * X{@code ?+}
* X, once or not at all X*+
+ *
- * X{@code *+}
* X, zero or more times X++
+ *
- * X{@code ++}
* X, one or more times X{n}+
+ *
- * X
* {
n}+
X, exactly n times X{n,}+
+ *
- * X
* {
n,}+
X, at least n times X{n,m}+
+ *
*
* X
* {
n{@code ,}m}+
X, at least n but not more than m times
@@ -315,59 +315,59 @@
*
*
- * XY
* X followed by Y X|Y
+ *
- * X{@code |}Y
* Either X or Y (X)
+ *
*
* {@code (}X{@code )}
* X, as a capturing group
*
*
- * Back references \n
+ *
*
- * {@code \}n
* Whatever the nth
* capturing group matched \k<name>
+ *
*
* {@code \}k<name>
* Whatever the
* named-capturing group "name" matched
*
*
- * Quotation \
+ *
- * {@code \}
* Nothing, but quotes the following character
- * \Q
- * Nothing, but quotes all characters until \E
+ * \E
- * Nothing, but ends quoting started by \Q
+ * {@code \Q}
+ * Nothing, but quotes all characters until {@code \E}
*
*
* {@code \E}
+ * Nothing, but ends quoting started by {@code \Q}
*
*
- * Special constructs (named-capturing and non-capturing) (?<name>X)
+ *
- *
* (?<name>
X{@code )}X, as a named-capturing group (?:X)
+ *
- * {@code (?:}X{@code )}
* X, as a non-capturing group (?idmsuxU-idmsuxU)
+ *
- *
* (?idmsuxU-idmsuxU)
Nothing, but turns match flags i
* d m s
* u x U
* on - off (?idmsux-idmsux:X)
+ *
- *
* (?idmsux-idmsux:
X{@code )} X, as a non-capturing group with the
* given flags i d
* m s u
* x on - off (?=X)
+ *
- * {@code (?=}X{@code )}
* X, via zero-width positive lookahead (?!X)
+ *
- * {@code (?!}X{@code )}
* X, via zero-width negative lookahead (?<=X)
+ *
- * {@code (?<=}X{@code )}
* X, via zero-width positive lookbehind (?<!X)
+ *
- * {@code (?X{@code )}
* X, via zero-width negative lookbehind (?>X)
+ *
*
* {@code (?>}X{@code )}
* X, as an independent, non-capturing group Backslashes, escapes, and quoting
*
- * \{
matches a
* left brace.
*
* "\b"
, for example, matches a single backspace character when
+ * interpreted as a regular expression, while {@code "\\b"} matches a
+ * word boundary. The string literal {@code "\(hello\)"} is illegal
* and leads to a compile-time error; in order to match the string
- * (hello) the string literal "\\(hello\\)"
+ * {@code (hello)} the string literal {@code "\\(hello\\)"}
* must be used.
*
* Character Classes
*
*
+ * 1
* Literal escape
- * \x {@code \x}
*
+ * 2
* Grouping
- * [...] {@code [...]}
*
+ * 3
* Range
- * a-z {@code a-z}
*
+ * 4
* Union
- * [a-e][i-u] {@code [a-e][i-u]}
*
@@ -437,8 +437,8 @@
*
* 5
* Intersection
* {@code [a-z&&[aeiou]]} Line terminators
@@ -449,49 +449,49 @@
*
*
*
- *
* '\u0085'
),
*
- * '\u2028'
), or
*
- * '\u2029
).
*
* Groups and capturing
*
* Group number
*
*
*
*
+ * 1
- * ((A)(B(C))) {@code ((A)(B(C)))}
*
+ * 2
- * (A) {@code (A)}
*
+ * 3
- * (B(C)) {@code (B(C))}
*
+ * 4
- * (C) {@code (C)}
* Group name
- *
- *
*
- * '\u0041'
through '\u005a'
),
+ * '\u0061'
through '\u007a'
),
+ * '\u0030'
through '\u0039'
),
* \u2014
in Java source code
* are processed as described in section 3.3 of
* The Java™ Language Specification.
* Such escape sequences are also implemented directly by the regular-expression
* parser so that Unicode escapes can be used in expressions that are read from
- * files or from the keyboard. Thus the strings "\u2014" and
- * "\\u2014", while not equal, compile into the same pattern, which
- * matches the character with hexadecimal value 0x2014.
+ * files or from the keyboard. Thus the strings "\u2014"
and
+ * {@code "\\u2014"}, while not equal, compile into the same pattern, which
+ * matches the character with hexadecimal value {@code 0x2014}.
* \x{...}
, for example a supplementary character U+2011F
+ * can be specified as \x{2011F}
, instead of two consecutive
* Unicode escape sequences of the surrogate pair
- * \uD840\uDD1F.
+ * \uD840
\uDD1F
.
* \p{
prop}
matches if
+ * the input has the property prop, while \P{
prop}
* does not match if the input has that property.
* Pattern
are the valid script names
+ * The script names supported by {@code Pattern} are the valid script names
* accepted and defined by
* {@link java.lang.Character.UnicodeScript#forName(String) UnicodeScript.forName}.
*
@@ -576,7 +576,7 @@
* {@code InMongolian}, or by using the keyword {@code block} (or its short
* form {@code blk}) as in {@code block=Mongolian} or {@code blk=Mongolian}.
* Pattern
are the valid block names
+ * The block names supported by {@code Pattern} are the valid block names
* accepted and defined by
* {@link java.lang.Character.UnicodeBlock#forName(String) UnicodeBlock.forName}.
* Pattern
+ * {@code IsAlphabetic}. The supported binary properties by {@code Pattern}
* are
*
*
Classes
* Matches
*
- *
- * \p{Lower}
- * A lowercase character:\p{IsLowercase}
- * \p{Upper}
- * An uppercase character:\p{IsUppercase}
- * \p{ASCII}
- * All ASCII:[\x00-\x7F]
- * \p{Alpha}
- * An alphabetic character:\p{IsAlphabetic}
- * \p{Digit}
- * A decimal digit character:p{IsDigit}
- * \p{Alnum}
- * An alphanumeric character:[\p{IsAlphabetic}\p{IsDigit}]
- * \p{Punct}
- * A punctuation character:p{IsPunctuation}
- * \p{Graph}
- * A visible character: [^\p{IsWhite_Space}\p{gc=Cc}\p{gc=Cs}\p{gc=Cn}] \p{Print}
+ *
+ * {@code \p{Lower}}
+ * A lowercase character:{@code \p{IsLowercase}}
+ * {@code \p{Upper}}
+ * An uppercase character:{@code \p{IsUppercase}}
+ * {@code \p{ASCII}}
+ * All ASCII:{@code [\x00-\x7F]}
+ * {@code \p{Alpha}}
+ * An alphabetic character:{@code \p{IsAlphabetic}}
+ * {@code \p{Digit}}
+ * A decimal digit character:{@code p{IsDigit}}
+ * {@code \p{Alnum}}
+ * An alphanumeric character:{@code [\p{IsAlphabetic}\p{IsDigit}]}
+ * {@code \p{Punct}}
+ * A punctuation character:{@code p{IsPunctuation}}
+ * {@code \p{Graph}}
+ * A visible character: {@code [^\p{IsWhite_Space}\p{gc=Cc}\p{gc=Cs}\p{gc=Cn}]}
- * {@code \p{Print}}
* A printable character: {@code [\p{Graph}\p{Blank}&&[^\p{Cntrl}]]} \p{Blank}
+ *
- * {@code \p{Blank}}
* A space or a tab: {@code [\p{IsWhite_Space}&&[^\p{gc=Zl}\p{gc=Zp}\x0a\x0b\x0c\x0d\x85]]}
- * \p{Cntrl}
- * A control character: \p{gc=Cc}
- * \p{XDigit}
- * A hexadecimal digit: [\p{gc=Nd}\p{IsHex_Digit}]
- * \p{Space}
- * A whitespace character:\p{IsWhite_Space}
- * \d
- * A digit: \p{IsDigit}
- * \D
- * A non-digit: [^\d]
- * \s
- * A whitespace character: \p{IsWhite_Space}
- * \S
- * A non-whitespace character: [^\s]
- * \w
- * A word character: [\p{Alpha}\p{gc=Mn}\p{gc=Me}\p{gc=Mc}\p{Digit}\p{gc=Pc}\p{IsJoin_Control}]
+ * \W
- * A non-word character: [^\w]
+ * {@code \p{Cntrl}}
+ * A control character: {@code \p{gc=Cc}}
+ * {@code \p{XDigit}}
+ * A hexadecimal digit: {@code [\p{gc=Nd}\p{IsHex_Digit}]}
+ * {@code \p{Space}}
+ * A whitespace character:{@code \p{IsWhite_Space}}
+ * {@code \d}
+ * A digit: {@code \p{IsDigit}}
+ * {@code \D}
+ * A non-digit: {@code [^\d]}
+ * {@code \s}
+ * A whitespace character: {@code \p{IsWhite_Space}}
+ * {@code \S}
+ * A non-whitespace character: {@code [^\s]}
+ * {@code \w}
+ * A word character: {@code [\p{Alpha}\p{gc=Mn}\p{gc=Me}\p{gc=Mc}\p{Digit}\p{gc=Pc}\p{IsJoin_Control}]}
* {@code \W}
+ * A non-word character: {@code [^\w]} \p{
prop}
syntax where
+ * the specified property has the name javamethodname
.
*
* Comparison to Perl 5
*
- * Pattern
engine performs traditional NFA-based matching
+ *
*
*
@@ -723,19 +723,19 @@
*
* \X
Match Unicode
*
* extended grapheme cluster
* \g{
n}
for
* the nthcapturing group and
- * \g{name} for
+ * \g{
name}
for
* named-capturing group.
* \N{
name}
* for a Unicode character by its name.
* (?{
code})
+ * and (??{
code})
,\u
,
+ * {@code \L}, and {@code \U}.
*
- *
"a\u030A"
, for example, will match the
+ * string "\u00E5"
when this flag is specified. By default,
* matching does not take canonical equivalence into account.
*
*
*
* @param input
@@ -1256,7 +1256,7 @@
* sequence and a limit argument of zero. Trailing empty strings are
* therefore not included in the resulting array.
*
- * Result
*
+ * :
* 2
- * { "boo", "and:foo" } {@code { "boo", "and:foo" }}
*
+ * :
* 5
- * { "boo", "and", "foo" } {@code { "boo", "and", "foo" }}
*
+ * :
* -2
- * { "boo", "and", "foo" } {@code { "boo", "and", "foo" }}
*
+ * o
* 5
- * { "b", "", ":and:f", "", "" } {@code { "b", "", ":and:f", "", "" }}
*
+ * o
* -2
- * { "b", "", ":and:f", "", "" } {@code { "b", "", ":and:f", "", "" }}
*
+ * o
* 0
- * { "b", "", ":and:f" } {@code { "b", "", ":and:f" }}
*
*
*
@@ -1281,12 +1281,12 @@
}
/**
- * Returns a literal pattern Regex
* Result
*
+ * :
- * { "boo", "and", "foo" } {@code { "boo", "and", "foo" }}
*
+ * o
- * { "b", "", ":and:f" } {@code { "b", "", ":and:f" }}
* String
for the specified
- * String
.
+ * Returns a literal pattern {@code String} for the specified
+ * {@code String}.
*
- * String
that can be used to
- * create a Pattern
that would match the string
- * s
as if it were a literal pattern.null
argument to a
* method in any class or interface in this package will cause a
* {@link java.lang.NullPointerException NullPointerException} to be
* thrown.
diff -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/share/classes/javax/security/auth/AuthPermission.java
--- a/jdk/src/java.base/share/classes/javax/security/auth/AuthPermission.java Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.base/share/classes/javax/security/auth/AuthPermission.java Wed Jul 05 20:45:35 2017 +0200
@@ -26,18 +26,17 @@
package javax.security.auth;
/**
- * This class is for authentication permissions.
- * An AuthPermission contains a name
- * (also referred to as a "target name")
- * but no actions list; you either have the named permission
- * or you don't.
+ * This class is for authentication permissions. An {@code AuthPermission}
+ * contains a name (also referred to as a "target name") but no actions
+ * list; you either have the named permission or you don't.
*
*
* doAs - allow the caller to invoke the
@@ -125,6 +124,9 @@
* Subject-based access control policy.
*
*
+ * @implNote
+ * Implementations may define additional target names, but should use naming
+ * conventions such as reverse domain name notation to avoid name clashes.
*/
public final class AuthPermission extends
java.security.BasicPermission {
diff -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.base/share/classes/sun/nio/ByteBuffered.java
--- a/jdk/src/java.base/share/classes/sun/nio/ByteBuffered.java Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.base/share/classes/sun/nio/ByteBuffered.java Wed Jul 05 20:45:35 2017 +0200
@@ -29,11 +29,11 @@
import java.io.IOException;
/** This is an interface to adapt existing APIs to use {@link java.nio.ByteBuffer
- * ByteBuffers} as the underlying
+ * ByteBuffers} as the underlying
* data format. Only the initial producer and final consumer have to be changed.AudioFileFormat
object describing the audio file format
- * @throws UnsupportedAudioFileException if the stream does not point to valid audio
- * file data recognized by the system
- * @throws IOException if an I/O exception occurs
- * @see InputStream#markSupported
- * @see InputStream#mark
- */
- public AudioFileFormat getAudioFileFormat(InputStream stream) throws UnsupportedAudioFileException, IOException {
- // fix for 4489272: AudioSystem.getAudioFileFormat() fails for InputStream, but works for URL
- AudioFileFormat aff = getCOMM(stream, true);
- // the following is not strictly necessary - but was implemented like that in 1.3.0 - 1.4.1
- // so I leave it as it was. May remove this for 1.5.0
- stream.reset();
- return aff;
- }
-
-
- /**
- * Obtains the audio file format of the URL provided. The URL must
- * point to valid audio file data.
- * @param url the URL from which file format information should be
- * extracted
- * @return an AudioFileFormat
object describing the audio file format
- * @throws UnsupportedAudioFileException if the URL does not point to valid audio
- * file data recognized by the system
- * @throws IOException if an I/O exception occurs
- */
- public AudioFileFormat getAudioFileFormat(URL url) throws UnsupportedAudioFileException, IOException {
- AudioFileFormat fileFormat = null;
- InputStream urlStream = url.openStream(); // throws IOException
- try {
- fileFormat = getCOMM(urlStream, false);
- } finally {
- urlStream.close();
- }
- return fileFormat;
- }
-
-
- /**
- * Obtains the audio file format of the File provided. The File must
- * point to valid audio file data.
- * @param file the File from which file format information should be
- * extracted
- * @return an AudioFileFormat
object describing the audio file format
- * @throws UnsupportedAudioFileException if the File does not point to valid audio
- * file data recognized by the system
- * @throws IOException if an I/O exception occurs
- */
- public AudioFileFormat getAudioFileFormat(File file) throws UnsupportedAudioFileException, IOException {
- AudioFileFormat fileFormat = null;
- FileInputStream fis = new FileInputStream(file); // throws IOException
- // part of fix for 4325421
- try {
- fileFormat = getCOMM(fis, false);
- } finally {
- fis.close();
- }
-
- return fileFormat;
- }
-
-
-
-
- /**
- * Obtains an audio stream from the input stream provided. The stream must
- * point to valid audio file data. In general, audio file providers may
- * need to read some data from the stream before determining whether they
- * support it. These parsers must
- * be able to mark the stream, read enough data to determine whether they
- * support the stream, and, if not, reset the stream's read pointer to its original
- * position. If the input stream does not support this, this method may fail
- * with an IOException.
- * @param stream the input stream from which the AudioInputStream
should be
- * constructed
- * @return an AudioInputStream
object based on the audio file data contained
- * in the input stream.
- * @throws UnsupportedAudioFileException if the stream does not point to valid audio
- * file data recognized by the system
- * @throws IOException if an I/O exception occurs
- * @see InputStream#markSupported
- * @see InputStream#mark
- */
- public AudioInputStream getAudioInputStream(InputStream stream) throws UnsupportedAudioFileException, IOException {
- // getCOMM leaves the input stream at the beginning of the audio data
- AudioFileFormat fileFormat = getCOMM(stream, true); // throws UnsupportedAudioFileException, IOException
-
- // we've got everything, and the stream is at the
- // beginning of the audio data, so return an AudioInputStream.
- return new AudioInputStream(stream, fileFormat.getFormat(), fileFormat.getFrameLength());
- }
-
-
- /**
- * Obtains an audio stream from the URL provided. The URL must
- * point to valid audio file data.
- * @param url the URL for which the AudioInputStream
should be
- * constructed
- * @return an AudioInputStream
object based on the audio file data pointed
- * to by the URL
- * @throws UnsupportedAudioFileException if the URL does not point to valid audio
- * file data recognized by the system
- * @throws IOException if an I/O exception occurs
- */
- public AudioInputStream getAudioInputStream(URL url) throws UnsupportedAudioFileException, IOException {
- InputStream urlStream = url.openStream(); // throws IOException
- AudioFileFormat fileFormat = null;
- try {
- fileFormat = getCOMM(urlStream, false);
- } finally {
- if (fileFormat == null) {
- urlStream.close();
- }
- }
- return new AudioInputStream(urlStream, fileFormat.getFormat(), fileFormat.getFrameLength());
- }
-
-
- /**
- * Obtains an audio stream from the File provided. The File must
- * point to valid audio file data.
- * @param file the File for which the AudioInputStream
should be
- * constructed
- * @return an AudioInputStream
object based on the audio file data pointed
- * to by the File
- * @throws UnsupportedAudioFileException if the File does not point to valid audio
- * file data recognized by the system
- * @throws IOException if an I/O exception occurs
- */
- public AudioInputStream getAudioInputStream(File file)
- throws UnsupportedAudioFileException, IOException {
-
- FileInputStream fis = new FileInputStream(file); // throws IOException
- AudioFileFormat fileFormat = null;
- // part of fix for 4325421
- try {
- fileFormat = getCOMM(fis, false);
- } finally {
- if (fileFormat == null) {
- fis.close();
- }
- }
- return new AudioInputStream(fis, fileFormat.getFormat(), fileFormat.getFrameLength());
- }
-
- //--------------------------------------------------------------------
-
- private AudioFileFormat getCOMM(InputStream is, boolean doReset)
- throws UnsupportedAudioFileException, IOException {
-
- DataInputStream dis = new DataInputStream(is);
-
- if (doReset) {
- dis.mark(MAX_READ_LENGTH);
- }
+ @Override
+ AudioFileFormat getAudioFileFormatImpl(final InputStream stream)
+ throws UnsupportedAudioFileException, IOException {
+ DataInputStream dis = new DataInputStream(stream);
// assumes a stream at the beginning of the file which has already
// passed the magic number test...
@@ -234,9 +62,6 @@
// $$fb: fix for 4369044: javax.sound.sampled.AudioSystem.getAudioInputStream() works wrong with Cp037
if (magic != AiffFileFormat.AIFF_MAGIC) {
// not AIFF, throw exception
- if (doReset) {
- dis.reset();
- }
throw new UnsupportedAudioFileException("not an AIFF file");
}
diff -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.desktop/share/classes/com/sun/media/sound/AuFileReader.java
--- a/jdk/src/java.desktop/share/classes/com/sun/media/sound/AuFileReader.java Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.desktop/share/classes/com/sun/media/sound/AuFileReader.java Wed Jul 05 20:45:35 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2013, 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
@@ -25,21 +25,15 @@
package com.sun.media.sound;
-import java.io.BufferedInputStream;
import java.io.DataInputStream;
-import java.io.File;
-import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
-import java.net.URL;
import javax.sound.sampled.AudioFileFormat;
import javax.sound.sampled.AudioFormat;
-import javax.sound.sampled.AudioInputStream;
import javax.sound.sampled.AudioSystem;
import javax.sound.sampled.UnsupportedAudioFileException;
-
/**
* AU file reader.
*
@@ -49,33 +43,10 @@
*/
public final class AuFileReader extends SunFileReader {
- // METHODS TO IMPLEMENT AudioFileReader
-
- /**
- * Obtains the audio file format of the input stream provided. The stream must
- * point to valid audio file data. In general, audio file providers may
- * need to read some data from the stream before determining whether they
- * support it. These parsers must
- * be able to mark the stream, read enough data to determine whether they
- * support the stream, and, if not, reset the stream's read pointer to its original
- * position. If the input stream does not support this, this method may fail
- * with an IOException.
- * @param stream the input stream from which file format information should be
- * extracted
- * @return an AudioFileFormat
object describing the audio file format
- * @throws UnsupportedAudioFileException if the stream does not point to valid audio
- * file data recognized by the system
- * @throws IOException if an I/O exception occurs
- * @see InputStream#markSupported
- * @see InputStream#mark
- */
- public AudioFileFormat getAudioFileFormat(InputStream stream) throws UnsupportedAudioFileException, IOException {
-
- AudioFormat format = null;
- AuFileFormat fileFormat = null;
- int maxReadLength = 28;
+ @Override
+ public AudioFileFormat getAudioFileFormatImpl(final InputStream stream)
+ throws UnsupportedAudioFileException, IOException {
boolean bigendian = false;
- int magic = -1;
int headerSize = -1;
int dataSize = -1;
int encoding_local = -1;
@@ -90,15 +61,12 @@
DataInputStream dis = new DataInputStream( stream );
- dis.mark(maxReadLength);
-
- magic = dis.readInt();
+ final int magic = dis.readInt(); nread += 4;
if (! (magic == AuFileFormat.AU_SUN_MAGIC) || (magic == AuFileFormat.AU_DEC_MAGIC) ||
(magic == AuFileFormat.AU_SUN_INV_MAGIC) || (magic == AuFileFormat.AU_DEC_INV_MAGIC) ) {
- // not AU, reset the stream, place into exception, throw exception
- dis.reset();
+ // not AU, throw exception
throw new UnsupportedAudioFileException("not an AU file");
}
@@ -112,7 +80,6 @@
sampleRate = (bigendian==true ? dis.readInt() : rllong(dis) ); nread += 4;
channels = (bigendian==true ? dis.readInt() : rllong(dis) ); nread += 4;
if (channels <= 0) {
- dis.reset();
throw new UnsupportedAudioFileException("Invalid number of channels");
}
@@ -172,7 +139,6 @@
*/
default:
// unsupported filetype, throw exception
- dis.reset();
throw new UnsupportedAudioFileException("not a valid AU file");
}
@@ -184,189 +150,13 @@
//$$fb 2003-10-20: fix for 4940459: AudioInputStream.getFrameLength() returns 0 instead of NOT_SPECIFIED
length = dataSize / frameSize;
}
-
- format = new AudioFormat( encoding, (float)sampleRate, sampleSizeInBits,
- channels, frameSize, (float)frameRate, bigendian);
-
- fileFormat = new AuFileFormat( AudioFileFormat.Type.AU, dataSize+headerSize,
- format, length);
-
- dis.reset(); // Throws IOException
- return fileFormat;
-
- }
-
-
- /**
- * Obtains the audio file format of the URL provided. The URL must
- * point to valid audio file data.
- * @param url the URL from which file format information should be
- * extracted
- * @return an AudioFileFormat
object describing the audio file format
- * @throws UnsupportedAudioFileException if the URL does not point to valid audio
- * file data recognized by the system
- * @throws IOException if an I/O exception occurs
- */
- public AudioFileFormat getAudioFileFormat(URL url) throws UnsupportedAudioFileException, IOException {
-
- InputStream urlStream = null;
- BufferedInputStream bis = null;
- AudioFileFormat fileFormat = null;
- AudioFormat format = null;
-
- urlStream = url.openStream(); // throws IOException
-
- try {
- bis = new BufferedInputStream( urlStream, bisBufferSize );
-
- fileFormat = getAudioFileFormat( bis ); // throws UnsupportedAudioFileException
- } finally {
- urlStream.close();
- }
-
- return fileFormat;
- }
-
-
- /**
- * Obtains the audio file format of the File provided. The File must
- * point to valid audio file data.
- * @param file the File from which file format information should be
- * extracted
- * @return an AudioFileFormat
object describing the audio file format
- * @throws UnsupportedAudioFileException if the File does not point to valid audio
- * file data recognized by the system
- * @throws IOException if an I/O exception occurs
- */
- public AudioFileFormat getAudioFileFormat(File file) throws UnsupportedAudioFileException, IOException {
-
- FileInputStream fis = null;
- BufferedInputStream bis = null;
- AudioFileFormat fileFormat = null;
- AudioFormat format = null;
-
- fis = new FileInputStream( file ); // throws IOException
- // part of fix for 4325421
- try {
- bis = new BufferedInputStream( fis, bisBufferSize );
- fileFormat = getAudioFileFormat( bis ); // throws UnsupportedAudioFileException
- } finally {
- fis.close();
- }
-
- return fileFormat;
- }
-
-
- /**
- * Obtains an audio stream from the input stream provided. The stream must
- * point to valid audio file data. In general, audio file providers may
- * need to read some data from the stream before determining whether they
- * support it. These parsers must
- * be able to mark the stream, read enough data to determine whether they
- * support the stream, and, if not, reset the stream's read pointer to its original
- * position. If the input stream does not support this, this method may fail
- * with an IOException.
- * @param stream the input stream from which the AudioInputStream
should be
- * constructed
- * @return an AudioInputStream
object based on the audio file data contained
- * in the input stream.
- * @throws UnsupportedAudioFileException if the stream does not point to valid audio
- * file data recognized by the system
- * @throws IOException if an I/O exception occurs
- * @see InputStream#markSupported
- * @see InputStream#mark
- */
- public AudioInputStream getAudioInputStream(InputStream stream) throws UnsupportedAudioFileException, IOException {
-
- DataInputStream dis = null;
- int headerSize;
- AudioFileFormat fileFormat = null;
- AudioFormat format = null;
-
-
- fileFormat = getAudioFileFormat( stream ); // throws UnsupportedAudioFileException, IOException
-
- // if we passed this call, we have an AU file.
-
- format = fileFormat.getFormat();
-
- dis = new DataInputStream(stream);
-
// now seek past the header
-
- dis.readInt(); // magic
- headerSize = (format.isBigEndian()==true ? dis.readInt() : rllong(dis) );
- dis.skipBytes( headerSize - 8 );
-
-
- // we've got everything, and the stream should be at the
- // beginning of the data chunk, so return an AudioInputStream.
-
- return new AudioInputStream(dis, format, fileFormat.getFrameLength());
- }
-
-
- /**
- * Obtains an audio stream from the URL provided. The URL must
- * point to valid audio file data.
- * @param url the URL for which the AudioInputStream
should be
- * constructed
- * @return an AudioInputStream
object based on the audio file data pointed
- * to by the URL
- * @throws UnsupportedAudioFileException if the URL does not point to valid audio
- * file data recognized by the system
- * @throws IOException if an I/O exception occurs
- */
- public AudioInputStream getAudioInputStream(URL url) throws UnsupportedAudioFileException, IOException {
-
- InputStream urlStream = null;
- BufferedInputStream bis = null;
- AudioFileFormat fileFormat = null;
-
- urlStream = url.openStream(); // throws IOException
- AudioInputStream result = null;
- try {
- bis = new BufferedInputStream( urlStream, bisBufferSize );
- result = getAudioInputStream( (InputStream)bis );
- } finally {
- if (result == null) {
- urlStream.close();
- }
- }
- return result;
- }
-
-
- /**
- * Obtains an audio stream from the File provided. The File must
- * point to valid audio file data.
- * @param file the File for which the AudioInputStream
should be
- * constructed
- * @return an AudioInputStream
object based on the audio file data pointed
- * to by the File
- * @throws UnsupportedAudioFileException if the File does not point to valid audio
- * file data recognized by the system
- * @throws IOException if an I/O exception occurs
- */
- public AudioInputStream getAudioInputStream(File file) throws UnsupportedAudioFileException, IOException {
-
- FileInputStream fis = null;
- BufferedInputStream bis = null;
- AudioFileFormat fileFormat = null;
-
- fis = new FileInputStream( file ); // throws IOException
- AudioInputStream result = null;
- // part of fix for 4325421
- try {
- bis = new BufferedInputStream( fis, bisBufferSize );
- result = getAudioInputStream( (InputStream)bis );
- } finally {
- if (result == null) {
- fis.close();
- }
- }
-
- return result;
+ dis.skipBytes(headerSize - nread);
+ AudioFormat format = new AudioFormat(encoding, sampleRate,
+ sampleSizeInBits, channels,
+ frameSize, (float) frameRate,
+ bigendian);
+ return new AuFileFormat(AudioFileFormat.Type.AU, dataSize + headerSize,
+ format, length);
}
}
diff -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.desktop/share/classes/com/sun/media/sound/SunFileReader.java
--- a/jdk/src/java.desktop/share/classes/com/sun/media/sound/SunFileReader.java Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.desktop/share/classes/com/sun/media/sound/SunFileReader.java Wed Jul 05 20:45:35 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2013, 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
@@ -25,10 +25,12 @@
package com.sun.media.sound;
+import java.io.BufferedInputStream;
+import java.io.DataInputStream;
import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
import java.io.InputStream;
-import java.io.IOException;
-import java.io.DataInputStream;
import java.net.URL;
import javax.sound.sampled.AudioFileFormat;
@@ -36,8 +38,6 @@
import javax.sound.sampled.UnsupportedAudioFileException;
import javax.sound.sampled.spi.AudioFileReader;
-
-
/**
* Abstract File Reader class.
*
@@ -45,118 +45,109 @@
*/
abstract class SunFileReader extends AudioFileReader {
- // buffer size for temporary input streams
- protected static final int bisBufferSize = 4096;
+ @Override
+ public final AudioFileFormat getAudioFileFormat(final InputStream stream)
+ throws UnsupportedAudioFileException, IOException {
+ stream.mark(200); // The biggest value which was historically used
+ try {
+ return getAudioFileFormatImpl(stream);
+ } finally {
+ // According to specification the following is not strictly
+ // necessary, if we got correct format. But it was implemented like
+ // that in 1.3.0 - 1.8. So I leave it as it was, but it seems
+ // specification should be updated.
+ stream.reset();
+ }
+ }
- /**
- * Constructs a new SunFileReader object.
- */
- SunFileReader() {
+ @Override
+ public final AudioFileFormat getAudioFileFormat(final URL url)
+ throws UnsupportedAudioFileException, IOException {
+ try (InputStream is = url.openStream()) {
+ return getAudioFileFormatImpl(new BufferedInputStream(is));
+ }
+ }
+
+ @Override
+ public final AudioFileFormat getAudioFileFormat(final File file)
+ throws UnsupportedAudioFileException, IOException {
+ try (InputStream is = new FileInputStream(file)) {
+ return getAudioFileFormatImpl(new BufferedInputStream(is));
+ }
}
-
- // METHODS TO IMPLEMENT AudioFileReader
+ @Override
+ public AudioInputStream getAudioInputStream(final InputStream stream)
+ throws UnsupportedAudioFileException, IOException {
+ stream.mark(200); // The biggest value which was historically used
+ try {
+ final AudioFileFormat fileFormat = getAudioFileFormatImpl(stream);
+ // we've got everything, the stream is supported and it is at the
+ // beginning of the audio data, so return an AudioInputStream
+ return new AudioInputStream(stream, fileFormat.getFormat(),
+ fileFormat.getFrameLength());
+ } catch (final UnsupportedAudioFileException e) {
+ stream.reset();
+ throw e;
+ }
+ }
- /**
- * Obtains the audio file format of the input stream provided. The stream must
- * point to valid audio file data. In general, audio file providers may
- * need to read some data from the stream before determining whether they
- * support it. These parsers must
- * be able to mark the stream, read enough data to determine whether they
- * support the stream, and, if not, reset the stream's read pointer to its original
- * position. If the input stream does not support this, this method may fail
- * with an IOException.
- * @param stream the input stream from which file format information should be
- * extracted
- * @return an AudioFileFormat
object describing the audio file format
- * @throws UnsupportedAudioFileException if the stream does not point to valid audio
- * file data recognized by the system
- * @throws IOException if an I/O exception occurs
- * @see InputStream#markSupported
- * @see InputStream#mark
- */
- abstract public AudioFileFormat getAudioFileFormat(InputStream stream) throws UnsupportedAudioFileException, IOException;
+ @Override
+ public final AudioInputStream getAudioInputStream(final URL url)
+ throws UnsupportedAudioFileException, IOException {
+ final InputStream urlStream = url.openStream();
+ try {
+ return getAudioInputStream(new BufferedInputStream(urlStream));
+ } catch (final Throwable e) {
+ closeSilently(urlStream);
+ throw e;
+ }
+ }
-
- /**
- * Obtains the audio file format of the URL provided. The URL must
- * point to valid audio file data.
- * @param url the URL from which file format information should be
- * extracted
- * @return an AudioFileFormat
object describing the audio file format
- * @throws UnsupportedAudioFileException if the URL does not point to valid audio
- * file data recognized by the system
- * @throws IOException if an I/O exception occurs
- */
- abstract public AudioFileFormat getAudioFileFormat(URL url) throws UnsupportedAudioFileException, IOException;
-
+ @Override
+ public final AudioInputStream getAudioInputStream(final File file)
+ throws UnsupportedAudioFileException, IOException {
+ final InputStream fileStream = new FileInputStream(file);
+ try {
+ return getAudioInputStream(new BufferedInputStream(fileStream));
+ } catch (final Throwable e) {
+ closeSilently(fileStream);
+ throw e;
+ }
+ }
/**
- * Obtains the audio file format of the File provided. The File must
- * point to valid audio file data.
- * @param file the File from which file format information should be
- * extracted
- * @return an AudioFileFormat
object describing the audio file format
- * @throws UnsupportedAudioFileException if the File does not point to valid audio
- * file data recognized by the system
+ * Obtains the audio file format of the input stream provided. The stream
+ * must point to valid audio file data. Note that default implementation of
+ * {@link #getAudioInputStream(InputStream)} assume that this method leaves
+ * the input stream at the beginning of the audio data.
+ *
+ * @param stream the input stream from which file format information should
+ * be extracted
+ * @return an {@code AudioFileFormat} object describing the audio file
+ * format
+ * @throws UnsupportedAudioFileException if the stream does not point to
+ * valid audio file data recognized by the system
* @throws IOException if an I/O exception occurs
*/
- abstract public AudioFileFormat getAudioFileFormat(File file) throws UnsupportedAudioFileException, IOException;
-
-
- /**
- * Obtains an audio stream from the input stream provided. The stream must
- * point to valid audio file data. In general, audio file providers may
- * need to read some data from the stream before determining whether they
- * support it. These parsers must
- * be able to mark the stream, read enough data to determine whether they
- * support the stream, and, if not, reset the stream's read pointer to its original
- * position. If the input stream does not support this, this method may fail
- * with an IOException.
- * @param stream the input stream from which the AudioInputStream
should be
- * constructed
- * @return an AudioInputStream
object based on the audio file data contained
- * in the input stream.
- * @throws UnsupportedAudioFileException if the stream does not point to valid audio
- * file data recognized by the system
- * @throws IOException if an I/O exception occurs
- * @see InputStream#markSupported
- * @see InputStream#mark
- */
- abstract public AudioInputStream getAudioInputStream(InputStream stream) throws UnsupportedAudioFileException, IOException;
-
-
- /**
- * Obtains an audio stream from the URL provided. The URL must
- * point to valid audio file data.
- * @param url the URL for which the AudioInputStream
should be
- * constructed
- * @return an AudioInputStream
object based on the audio file data pointed
- * to by the URL
- * @throws UnsupportedAudioFileException if the URL does not point to valid audio
- * file data recognized by the system
- * @throws IOException if an I/O exception occurs
- */
- abstract public AudioInputStream getAudioInputStream(URL url) throws UnsupportedAudioFileException, IOException;
-
-
- /**
- * Obtains an audio stream from the File provided. The File must
- * point to valid audio file data.
- * @param file the File for which the AudioInputStream
should be
- * constructed
- * @return an AudioInputStream
object based on the audio file data pointed
- * to by the File
- * @throws UnsupportedAudioFileException if the File does not point to valid audio
- * file data recognized by the system
- * @throws IOException if an I/O exception occurs
- */
- abstract public AudioInputStream getAudioInputStream(File file) throws UnsupportedAudioFileException, IOException;
-
+ abstract AudioFileFormat getAudioFileFormatImpl(InputStream stream)
+ throws UnsupportedAudioFileException, IOException;
// HELPER METHODS
-
+ /**
+ * Closes the InputStream when we have read all necessary data from it, and
+ * ignores an IOException.
+ *
+ * @param is the InputStream which should be closed
+ */
+ private static void closeSilently(final InputStream is) {
+ try {
+ is.close();
+ } catch (final IOException ignored) {
+ // IOException is ignored
+ }
+ }
/**
* rllong
diff -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.desktop/share/classes/com/sun/media/sound/WaveExtensibleFileReader.java
--- a/jdk/src/java.desktop/share/classes/com/sun/media/sound/WaveExtensibleFileReader.java Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.desktop/share/classes/com/sun/media/sound/WaveExtensibleFileReader.java Wed Jul 05 20:45:35 2017 +0200
@@ -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
@@ -22,55 +22,40 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package com.sun.media.sound;
-import java.io.BufferedInputStream;
-import java.io.File;
-import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
-import java.net.URL;
import java.util.HashMap;
import java.util.Map;
import javax.sound.sampled.AudioFileFormat;
import javax.sound.sampled.AudioFormat;
+import javax.sound.sampled.AudioFormat.Encoding;
import javax.sound.sampled.AudioInputStream;
import javax.sound.sampled.AudioSystem;
import javax.sound.sampled.UnsupportedAudioFileException;
-import javax.sound.sampled.AudioFormat.Encoding;
-import javax.sound.sampled.spi.AudioFileReader;
/**
* WAVE file reader for files using format WAVE_FORMAT_EXTENSIBLE (0xFFFE).
*
* @author Karl Helgason
*/
-public final class WaveExtensibleFileReader extends AudioFileReader {
-
- static private class GUID {
- long i1;
-
- int s1;
-
- int s2;
-
- int x1;
-
- int x2;
+public final class WaveExtensibleFileReader extends SunFileReader {
- int x3;
-
- int x4;
-
- int x5;
-
- int x6;
-
- int x7;
-
- int x8;
-
+ private static class GUID {
+ private long i1;
+ private int s1;
+ private int s2;
+ private int x1;
+ private int x2;
+ private int x3;
+ private int x4;
+ private int x5;
+ private int x6;
+ private int x7;
+ private int x8;
private GUID() {
}
@@ -105,10 +90,12 @@
return d;
}
+ @Override
public int hashCode() {
return (int) i1;
}
+ @Override
public boolean equals(Object obj) {
if (!(obj instanceof GUID))
return false;
@@ -161,7 +148,7 @@
private static final GUID SUBTYPE_IEEE_FLOAT = new GUID(0x00000003, 0x0000,
0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
- private String decodeChannelMask(long channelmask) {
+ private static String decodeChannelMask(long channelmask) {
StringBuilder sb = new StringBuilder();
long m = 1;
for (int i = 0; i < allchannelnames.length; i++) {
@@ -180,20 +167,8 @@
}
- public AudioFileFormat getAudioFileFormat(InputStream stream)
- throws UnsupportedAudioFileException, IOException {
-
- stream.mark(200);
- AudioFileFormat format;
- try {
- format = internal_getAudioFileFormat(stream);
- } finally {
- stream.reset();
- }
- return format;
- }
-
- private AudioFileFormat internal_getAudioFileFormat(InputStream stream)
+ @Override
+ AudioFileFormat getAudioFileFormatImpl(final InputStream stream)
throws UnsupportedAudioFileException, IOException {
RIFFReader riffiterator = new RIFFReader(stream);
@@ -244,12 +219,9 @@
break;
}
}
-
- if (!fmt_found)
+ if (!fmt_found || !data_found) {
throw new UnsupportedAudioFileException();
- if (!data_found)
- throw new UnsupportedAudioFileException();
-
+ }
MapAudioFileFormat
object describing the audio file format
- * @throws UnsupportedAudioFileException if the stream does not point to valid audio
- * file data recognized by the system
- * @throws IOException if an I/O exception occurs
- * @see InputStream#markSupported
- * @see InputStream#mark
- */
- public AudioFileFormat getAudioFileFormat(InputStream stream) throws UnsupportedAudioFileException, IOException {
- // fix for 4489272: AudioSystem.getAudioFileFormat() fails for InputStream, but works for URL
- AudioFileFormat aff = getFMT(stream, true);
- // the following is not strictly necessary - but was implemented like that in 1.3.0 - 1.4.1
- // so I leave it as it was. May remove this for 1.5.0
- stream.reset();
- return aff;
- }
-
-
- /**
- * Obtains the audio file format of the URL provided. The URL must
- * point to valid audio file data.
- * @param url the URL from which file format information should be
- * extracted
- * @return an AudioFileFormat
object describing the audio file format
- * @throws UnsupportedAudioFileException if the URL does not point to valid audio
- * file data recognized by the system
- * @throws IOException if an I/O exception occurs
- */
- public AudioFileFormat getAudioFileFormat(URL url) throws UnsupportedAudioFileException, IOException {
- InputStream urlStream = url.openStream(); // throws IOException
- AudioFileFormat fileFormat = null;
- try {
- fileFormat = getFMT(urlStream, false);
- } finally {
- urlStream.close();
- }
- return fileFormat;
- }
-
-
- /**
- * Obtains the audio file format of the File provided. The File must
- * point to valid audio file data.
- * @param file the File from which file format information should be
- * extracted
- * @return an AudioFileFormat
object describing the audio file format
- * @throws UnsupportedAudioFileException if the File does not point to valid audio
- * file data recognized by the system
- * @throws IOException if an I/O exception occurs
- */
- public AudioFileFormat getAudioFileFormat(File file) throws UnsupportedAudioFileException, IOException {
- AudioFileFormat fileFormat = null;
- FileInputStream fis = new FileInputStream(file); // throws IOException
- // part of fix for 4325421
- try {
- fileFormat = getFMT(fis, false);
- } finally {
- fis.close();
- }
-
- return fileFormat;
- }
-
-
- /**
- * Obtains an audio stream from the input stream provided. The stream must
- * point to valid audio file data. In general, audio file providers may
- * need to read some data from the stream before determining whether they
- * support it. These parsers must
- * be able to mark the stream, read enough data to determine whether they
- * support the stream, and, if not, reset the stream's read pointer to its original
- * position. If the input stream does not support this, this method may fail
- * with an IOException.
- * @param stream the input stream from which the AudioInputStream
should be
- * constructed
- * @return an AudioInputStream
object based on the audio file data contained
- * in the input stream.
- * @throws UnsupportedAudioFileException if the stream does not point to valid audio
- * file data recognized by the system
- * @throws IOException if an I/O exception occurs
- * @see InputStream#markSupported
- * @see InputStream#mark
- */
- public AudioInputStream getAudioInputStream(InputStream stream) throws UnsupportedAudioFileException, IOException {
- // getFMT leaves the input stream at the beginning of the audio data
- AudioFileFormat fileFormat = getFMT(stream, true); // throws UnsupportedAudioFileException, IOException
-
- // we've got everything, and the stream is at the
- // beginning of the audio data, so return an AudioInputStream.
- return new AudioInputStream(stream, fileFormat.getFormat(), fileFormat.getFrameLength());
- }
-
-
- /**
- * Obtains an audio stream from the URL provided. The URL must
- * point to valid audio file data.
- * @param url the URL for which the AudioInputStream
should be
- * constructed
- * @return an AudioInputStream
object based on the audio file data pointed
- * to by the URL
- * @throws UnsupportedAudioFileException if the URL does not point to valid audio
- * file data recognized by the system
- * @throws IOException if an I/O exception occurs
- */
- public AudioInputStream getAudioInputStream(URL url) throws UnsupportedAudioFileException, IOException {
- InputStream urlStream = url.openStream(); // throws IOException
- AudioFileFormat fileFormat = null;
- try {
- fileFormat = getFMT(urlStream, false);
- } finally {
- if (fileFormat == null) {
- urlStream.close();
- }
- }
- return new AudioInputStream(urlStream, fileFormat.getFormat(), fileFormat.getFrameLength());
- }
-
-
- /**
- * Obtains an audio stream from the File provided. The File must
- * point to valid audio file data.
- * @param file the File for which the AudioInputStream
should be
- * constructed
- * @return an AudioInputStream
object based on the audio file data pointed
- * to by the File
- * @throws UnsupportedAudioFileException if the File does not point to valid audio
- * file data recognized by the system
- * @throws IOException if an I/O exception occurs
- */
- public AudioInputStream getAudioInputStream(File file) throws UnsupportedAudioFileException, IOException {
- FileInputStream fis = new FileInputStream(file); // throws IOException
- AudioFileFormat fileFormat = null;
- // part of fix for 4325421
- try {
- fileFormat = getFMT(fis, false);
- } finally {
- if (fileFormat == null) {
- fis.close();
- }
- }
- return new AudioInputStream(fis, fileFormat.getFormat(), fileFormat.getFrameLength());
- }
-
-
- //--------------------------------------------------------------------
-
-
- private AudioFileFormat getFMT(InputStream stream, boolean doReset) throws UnsupportedAudioFileException, IOException {
+ @Override
+ AudioFileFormat getAudioFileFormatImpl(final InputStream stream)
+ throws UnsupportedAudioFileException, IOException {
// assumes sream is rewound
- int bytesRead;
int nread = 0;
int fmt;
int length = 0;
@@ -227,10 +63,6 @@
DataInputStream dis = new DataInputStream( stream );
- if (doReset) {
- dis.mark(MAX_READ_LENGTH);
- }
-
int magic = dis.readInt();
int fileLength = rllong(dis);
int waveMagic = dis.readInt();
@@ -244,9 +76,6 @@
if ((magic != WaveFileFormat.RIFF_MAGIC) || (waveMagic != WaveFileFormat.WAVE_MAGIC)) {
// not WAVE, throw UnsupportedAudioFileException
- if (doReset) {
- dis.reset();
- }
throw new UnsupportedAudioFileException("not a WAVE file");
}
diff -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.desktop/share/classes/com/sun/media/sound/WaveFloatFileReader.java
--- a/jdk/src/java.desktop/share/classes/com/sun/media/sound/WaveFloatFileReader.java Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.desktop/share/classes/com/sun/media/sound/WaveFloatFileReader.java Wed Jul 05 20:45:35 2017 +0200
@@ -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
@@ -22,14 +22,11 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package com.sun.media.sound;
-import java.io.BufferedInputStream;
-import java.io.File;
-import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
-import java.net.URL;
import javax.sound.sampled.AudioFileFormat;
import javax.sound.sampled.AudioFormat;
@@ -37,29 +34,16 @@
import javax.sound.sampled.AudioInputStream;
import javax.sound.sampled.AudioSystem;
import javax.sound.sampled.UnsupportedAudioFileException;
-import javax.sound.sampled.spi.AudioFileReader;
/**
* Floating-point encoded (format 3) WAVE file loader.
*
* @author Karl Helgason
*/
-public final class WaveFloatFileReader extends AudioFileReader {
-
- public AudioFileFormat getAudioFileFormat(InputStream stream)
- throws UnsupportedAudioFileException, IOException {
+public final class WaveFloatFileReader extends SunFileReader {
- stream.mark(200);
- AudioFileFormat format;
- try {
- format = internal_getAudioFileFormat(stream);
- } finally {
- stream.reset();
- }
- return format;
- }
-
- private AudioFileFormat internal_getAudioFileFormat(InputStream stream)
+ @Override
+ AudioFileFormat getAudioFileFormatImpl(final InputStream stream)
throws UnsupportedAudioFileException, IOException {
RIFFReader riffiterator = new RIFFReader(stream);
@@ -96,30 +80,25 @@
break;
}
}
-
- if (!fmt_found)
+ if (!fmt_found || !data_found) {
throw new UnsupportedAudioFileException();
- if (!data_found)
- throw new UnsupportedAudioFileException();
-
+ }
AudioFormat audioformat = new AudioFormat(
Encoding.PCM_FLOAT, samplerate, bits, channels,
framesize, samplerate, false);
- AudioFileFormat fileformat = new AudioFileFormat(
- AudioFileFormat.Type.WAVE, audioformat,
- AudioSystem.NOT_SPECIFIED);
- return fileformat;
+ return new AudioFileFormat(AudioFileFormat.Type.WAVE, audioformat,
+ AudioSystem.NOT_SPECIFIED);
}
- public AudioInputStream getAudioInputStream(InputStream stream)
+ @Override
+ public AudioInputStream getAudioInputStream(final InputStream stream)
throws UnsupportedAudioFileException, IOException {
AudioFileFormat format = getAudioFileFormat(stream);
+ // we've got everything, the stream is supported and it is at the
+ // beginning of the header, so find the data chunk again and return an
+ // AudioInputStream
RIFFReader riffiterator = new RIFFReader(stream);
- if (!riffiterator.getFormat().equals("RIFF"))
- throw new UnsupportedAudioFileException();
- if (!riffiterator.getType().equals("WAVE"))
- throw new UnsupportedAudioFileException();
while (riffiterator.hasNextChunk()) {
RIFFReader chunk = riffiterator.nextChunk();
if (chunk.getFormat().equals("data")) {
@@ -129,39 +108,4 @@
}
throw new UnsupportedAudioFileException();
}
-
- public AudioFileFormat getAudioFileFormat(URL url)
- throws UnsupportedAudioFileException, IOException {
- InputStream stream = url.openStream();
- AudioFileFormat format;
- try {
- format = getAudioFileFormat(new BufferedInputStream(stream));
- } finally {
- stream.close();
- }
- return format;
- }
-
- public AudioFileFormat getAudioFileFormat(File file)
- throws UnsupportedAudioFileException, IOException {
- InputStream stream = new FileInputStream(file);
- AudioFileFormat format;
- try {
- format = getAudioFileFormat(new BufferedInputStream(stream));
- } finally {
- stream.close();
- }
- return format;
- }
-
- public AudioInputStream getAudioInputStream(URL url)
- throws UnsupportedAudioFileException, IOException {
- return getAudioInputStream(new BufferedInputStream(url.openStream()));
- }
-
- public AudioInputStream getAudioInputStream(File file)
- throws UnsupportedAudioFileException, IOException {
- return getAudioInputStream(new BufferedInputStream(new FileInputStream(
- file)));
- }
}
diff -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.desktop/share/classes/java/awt/MenuBar.java
--- a/jdk/src/java.desktop/share/classes/java/awt/MenuBar.java Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.desktop/share/classes/java/awt/MenuBar.java Wed Jul 05 20:45:35 2017 +0200
@@ -229,9 +229,11 @@
if (m.peer == null) {
m.addNotify();
}
+ menus.addElement(m);
peer.addMenu(m);
+ } else {
+ menus.addElement(m);
}
- menus.addElement(m);
return m;
}
}
diff -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.desktop/share/classes/java/awt/Toolkit.java
--- a/jdk/src/java.desktop/share/classes/java/awt/Toolkit.java Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.desktop/share/classes/java/awt/Toolkit.java Wed Jul 05 20:45:35 2017 +0200
@@ -519,13 +519,7 @@
* Integer
object specifying this
* frame's desktop layer
+ * @throws NullPointerException if {@code layer} is {@code null}
* @see JLayeredPane
* @beaninfo
* expert: true
diff -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.desktop/share/classes/javax/swing/TimerQueue.java
--- a/jdk/src/java.desktop/share/classes/javax/swing/TimerQueue.java Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/swing/TimerQueue.java Wed Jul 05 20:45:35 2017 +0200
@@ -94,6 +94,9 @@
void startIfNeeded() {
if (! running) {
runningLock.lock();
+ if (running) {
+ return;
+ }
try {
final ThreadGroup threadGroup = AppContext.getAppContext().getThreadGroup();
AccessController.doPrivileged((PrivilegedActionx
and y
* parameters relative to the native parent component.
diff -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.desktop/share/classes/sun/awt/image/MultiResolutionCachedImage.java
--- a/jdk/src/java.desktop/share/classes/sun/awt/image/MultiResolutionCachedImage.java Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.desktop/share/classes/sun/awt/image/MultiResolutionCachedImage.java Wed Jul 05 20:45:35 2017 +0200
@@ -86,19 +86,24 @@
@Override
public int getWidth(ImageObserver observer) {
updateInfo(observer, ImageObserver.WIDTH);
- return super.getWidth(observer);
+ return baseImageWidth;
}
@Override
public int getHeight(ImageObserver observer) {
updateInfo(observer, ImageObserver.HEIGHT);
- return super.getHeight(observer);
+ return baseImageHeight;
}
@Override
public Object getProperty(String name, ImageObserver observer) {
updateInfo(observer, ImageObserver.PROPERTIES);
- return super.getProperty(name, observer);
+ return Image.UndefinedProperty;
+ }
+
+ @Override
+ public Image getScaledInstance(int width, int height, int hints) {
+ return getResolutionVariant(width, height);
}
@Override
diff -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.desktop/share/native/libjsound/PortMixer.c
--- a/jdk/src/java.desktop/share/native/libjsound/PortMixer.c Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.desktop/share/native/libjsound/PortMixer.c Wed Jul 05 20:45:35 2017 +0200
@@ -272,7 +272,7 @@
}
void* PORT_NewFloatControl(void* creatorV, void* controlID, char* type,
- float min, float max, float precision, char* units) {
+ float min, float max, float precision, const char* units) {
ControlCreatorJNI* creator = (ControlCreatorJNI*) creatorV;
jobject ctrl = NULL;
jstring unitsString;
diff -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.desktop/share/native/libjsound/Ports.h
--- a/jdk/src/java.desktop/share/native/libjsound/Ports.h Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.desktop/share/native/libjsound/Ports.h Wed Jul 05 20:45:35 2017 +0200
@@ -93,7 +93,7 @@
* returns an opaque pointer to the created control
*/
typedef void* (*PORT_NewFloatControlPtr)(void* creator, void* controlID, char* type,
- float min, float max, float precision, char* units);
+ float min, float max, float precision, const char* units);
/* control: The control to add to current port
* creator: pointer to the creator struct provided by PORT_GetControls
diff -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.desktop/unix/classes/sun/awt/X11/GtkFileDialogPeer.java
--- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/GtkFileDialogPeer.java Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/GtkFileDialogPeer.java Wed Jul 05 20:45:35 2017 +0200
@@ -42,6 +42,8 @@
// A pointer to the native GTK FileChooser widget
private volatile long widget = 0L;
+ private long standaloneWindow;
+ private volatile boolean quit;
GtkFileDialogPeer(FileDialog fd) {
super(fd);
@@ -111,9 +113,11 @@
public void setVisible(boolean b) {
XToolkit.awtLock();
try {
+ quit = !b;
if (b) {
Runnable task = () -> {
showNativeDialog();
+ standaloneWindow = 0;
fd.setVisible(false);
};
new ManagedLocalsThread(task).start();
@@ -128,7 +132,14 @@
@Override
public void dispose() {
- quit();
+ XToolkit.awtLock();
+ try {
+ quit = true;
+ quit();
+ }
+ finally {
+ XToolkit.awtUnlock();
+ }
super.dispose();
}
@@ -144,6 +155,17 @@
// have delegated to FileDialog#setFile
}
+ protected void requestXFocus(long time, boolean timeProvided) {
+ if(standaloneWindow == 0) {
+ super.requestXFocus(time, timeProvided);
+ return;
+ }
+ XNETProtocol net_protocol = XWM.getWM().getNETProtocol();
+ if (net_protocol != null) {
+ net_protocol.setActiveWindow(standaloneWindow);
+ }
+ }
+
@Override
public void setFilenameFilter(FilenameFilter filter) {
// We do not implement this method because we
@@ -170,7 +192,21 @@
dirname = file.getParent();
}
}
- run(fd.getTitle(), fd.getMode(), dirname, filename,
- fd.getFilenameFilter(), fd.isMultipleMode(), fd.getX(), fd.getY());
+ if (!quit) {
+ run(fd.getTitle(), fd.getMode(), dirname, filename,
+ fd.getFilenameFilter(), fd.isMultipleMode(), fd.getX(), fd.getY());
+ }
+ }
+
+ /**
+ * Called by native code when GTK dialog is created.
+ */
+ boolean setWindow(long xid) {
+ if (!quit && widget != 0) {
+ standaloneWindow = xid;
+ requestXFocus();
+ return true;
+ }
+ return false;
}
}
diff -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.desktop/unix/classes/sun/awt/X11/XFramePeer.java
--- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XFramePeer.java Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XFramePeer.java Wed Jul 05 20:45:35 2017 +0200
@@ -289,7 +289,7 @@
XNETProtocol net_protocol = XWM.getWM().getNETProtocol();
if (net_protocol != null) {
- net_protocol.setActiveWindow(this);
+ net_protocol.setActiveWindow(getWindow());
}
xSetVisible(true);
}
diff -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.desktop/unix/classes/sun/awt/X11/XNETProtocol.java
--- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XNETProtocol.java Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XNETProtocol.java Wed Jul 05 20:45:35 2017 +0200
@@ -326,7 +326,7 @@
return res;
}
- public void setActiveWindow(XWindow window) {
+ public void setActiveWindow(long window) {
if (!active() || !checkProtocol(XA_NET_SUPPORTED, XA_NET_ACTIVE_WINDOW)) {
return;
}
@@ -336,7 +336,7 @@
msg.set_type(XConstants.ClientMessage);
msg.set_message_type(XA_NET_ACTIVE_WINDOW.getAtom());
msg.set_display(XToolkit.getDisplay());
- msg.set_window(window.getWindow());
+ msg.set_window(window);
msg.set_format(32);
msg.set_data(0, 1);
msg.set_data(1, XToolkit.getCurrentServerTime());
diff -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.desktop/unix/classes/sun/awt/X11GraphicsDevice.java
--- a/jdk/src/java.desktop/unix/classes/sun/awt/X11GraphicsDevice.java Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11GraphicsDevice.java Wed Jul 05 20:45:35 2017 +0200
@@ -316,6 +316,7 @@
@Override
public boolean isDisplayChangeSupported() {
return (isFullScreenSupported()
+ && (getFullScreenWindow() != null)
&& !((X11GraphicsEnvironment) GraphicsEnvironment
.getLocalGraphicsEnvironment()).runningXinerama());
}
diff -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.desktop/unix/classes/sun/java2d/xr/XRDrawImage.java
--- a/jdk/src/java.desktop/unix/classes/sun/java2d/xr/XRDrawImage.java Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.desktop/unix/classes/sun/java2d/xr/XRDrawImage.java Wed Jul 05 20:45:35 2017 +0200
@@ -46,24 +46,28 @@
SurfaceData dstData = sg.surfaceData;
SurfaceData srcData = dstData.getSourceSurfaceData(img,
SunGraphics2D.TRANSFORM_GENERIC, sg.imageComp, bgColor);
- int compRule = ((AlphaComposite) sg.composite).getRule();
- float extraAlpha = ((AlphaComposite) sg.composite).getAlpha();
- if (srcData != null && !isBgOperation(srcData, bgColor)
+ if (sg.composite instanceof AlphaComposite) {
+ int compRule = ((AlphaComposite) sg.composite).getRule();
+ float extraAlpha = ((AlphaComposite) sg.composite).getAlpha();
+
+ if (srcData != null && !isBgOperation(srcData, bgColor)
&& interpType <= AffineTransformOp.TYPE_BILINEAR
&& (XRUtils.isMaskEvaluated(XRUtils.j2dAlphaCompToXR(compRule))
- || (XRUtils.isTransformQuadrantRotated(tx)) && extraAlpha == 1.0f))
- {
- SurfaceType srcType = srcData.getSurfaceType();
- SurfaceType dstType = dstData.getSurfaceType();
+ || (XRUtils.isTransformQuadrantRotated(tx))
+ && extraAlpha == 1.0f))
+ {
+ SurfaceType srcType = srcData.getSurfaceType();
+ SurfaceType dstType = dstData.getSurfaceType();
- TransformBlit blit = TransformBlit.getFromCache(srcType,
- sg.imageComp, dstType);
- if (blit != null) {
- blit.Transform(srcData, dstData, sg.composite,
- sg.getCompClip(), tx, interpType, sx1, sy1, 0, 0, sx2
+ TransformBlit blit = TransformBlit.getFromCache(srcType,
+ sg.imageComp, dstType);
+ if (blit != null) {
+ blit.Transform(srcData, dstData, sg.composite,
+ sg.getCompClip(), tx, interpType, sx1, sy1, 0, 0, sx2
- sx1, sy2 - sy1);
return;
+ }
}
}
diff -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.desktop/unix/native/common/awt/awt.h
--- a/jdk/src/java.desktop/unix/native/common/awt/awt.h Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.desktop/unix/native/common/awt/awt.h Wed Jul 05 20:45:35 2017 +0200
@@ -82,7 +82,12 @@
} while (0)
#define AWT_LOCK_IMPL() \
- (*env)->CallStaticVoidMethod(env, tkClass, awtLockMID)
+ do { \
+ (*env)->CallStaticVoidMethod(env, tkClass, awtLockMID); \
+ if ((*env)->ExceptionCheck(env)) { \
+ (*env)->ExceptionClear(env); \
+ } \
+ } while(0)
#define AWT_NOFLUSH_UNLOCK_IMPL() \
do { \
@@ -91,11 +96,10 @@
(*env)->ExceptionClear(env); \
} \
(*env)->CallStaticVoidMethod(env, tkClass, awtUnlockMID); \
+ if ((*env)->ExceptionCheck(env)) { \
+ (*env)->ExceptionClear(env); \
+ } \
if (pendingException) { \
- if ((*env)->ExceptionCheck(env)) { \
- (*env)->ExceptionDescribe(env); \
- (*env)->ExceptionClear(env); \
- } \
(*env)->Throw(env, pendingException); \
} \
} while (0)
diff -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.desktop/unix/native/libawt/awt/awt_LoadLibrary.c
--- a/jdk/src/java.desktop/unix/native/libawt/awt/awt_LoadLibrary.c Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.desktop/unix/native/libawt/awt/awt_LoadLibrary.c Wed Jul 05 20:45:35 2017 +0200
@@ -71,6 +71,10 @@
}
isHeadless = (*env)->CallStaticBooleanMethod(env, graphicsEnvClass,
headlessFn);
+ if ((*env)->ExceptionCheck(env)) {
+ (*env)->ExceptionClear(env);
+ return JNI_TRUE;
+ }
}
return isHeadless;
}
diff -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.desktop/unix/native/libawt_xawt/awt/HPkeysym.h
--- a/jdk/src/java.desktop/unix/native/libawt_xawt/awt/HPkeysym.h Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.desktop/unix/native/libawt_xawt/awt/HPkeysym.h Wed Jul 05 20:45:35 2017 +0200
@@ -58,7 +58,7 @@
#ifndef _HPKEYSYM_H
-#define _HPKEYSYM
+#define _HPKEYSYM_H
#define hpXK_ClearLine 0x1000FF6F
#define hpXK_InsertLine 0x1000FF70
diff -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.desktop/unix/native/libawt_xawt/awt/awt_Event.h
--- a/jdk/src/java.desktop/unix/native/libawt_xawt/awt/awt_Event.h Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.desktop/unix/native/libawt_xawt/awt/awt_Event.h Wed Jul 05 20:45:35 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -28,7 +28,7 @@
***
***/
#ifndef _AWT_EVENT_H_
-#define _AWT_EVENT_H
+#define _AWT_EVENT_H_
#include "jni_util.h"
diff -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.desktop/unix/native/libawt_xawt/awt/awt_GraphicsEnv.c
--- a/jdk/src/java.desktop/unix/native/libawt_xawt/awt/awt_GraphicsEnv.c Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.desktop/unix/native/libawt_xawt/awt/awt_GraphicsEnv.c Wed Jul 05 20:45:35 2017 +0200
@@ -1564,6 +1564,9 @@
for (i = 0; i < visScreenInfo->count; i++) {
XdbeVisualInfo* visInfo = visScreenInfo->visinfo;
(*env)->CallVoidMethod(env, this, midAddVisual, (visInfo[i]).visual);
+ if ((*env)->ExceptionCheck(env)) {
+ break;
+ }
}
#endif /* !HEADLESS */
}
diff -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.desktop/unix/native/libawt_xawt/awt/awt_util.c
--- a/jdk/src/java.desktop/unix/native/libawt_xawt/awt/awt_util.c Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.desktop/unix/native/libawt_xawt/awt/awt_util.c Wed Jul 05 20:45:35 2017 +0200
@@ -98,5 +98,8 @@
(*env)->CallStaticVoidMethod(env, threadClass, yieldMethodID);
DASSERT(!((*env)->ExceptionOccurred(env)));
+ if ((*env)->ExceptionCheck(env)) {
+ return JNI_FALSE;
+ }
return JNI_TRUE;
} /* awtJNI_ThreadYield() */
diff -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.desktop/unix/native/libawt_xawt/awt/gtk2_interface.c
--- a/jdk/src/java.desktop/unix/native/libawt_xawt/awt/gtk2_interface.c Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.desktop/unix/native/libawt_xawt/awt/gtk2_interface.c Wed Jul 05 20:45:35 2017 +0200
@@ -576,6 +576,7 @@
fp_gtk_file_chooser_get_filenames = dl_symbol(
"gtk_file_chooser_get_filenames");
fp_gtk_g_slist_length = dl_symbol("g_slist_length");
+ fp_gdk_x11_drawable_get_xid = dl_symbol("gdk_x11_drawable_get_xid");
}
gboolean gtk2_load(JNIEnv *env)
@@ -904,6 +905,10 @@
// Init the thread system to use GLib in a thread-safe mode
(*env)->CallStaticVoidMethod(env, clazz, mid_lock);
+ if ((*env)->ExceptionCheck(env)) {
+ AWT_UNLOCK();
+ return FALSE;
+ }
// Calling g_thread_init() multiple times leads to crash on GLib < 2.24
// We can use g_thread_get_initialized () but it is available only for
@@ -922,7 +927,22 @@
//called before gtk_init() or gtk_init_check()
fp_gdk_threads_init();
}
+ jthrowable pendExcpn = NULL;
+ // Exception raised during mid_getAndSetInitializationNeededFlag
+ // call is saved and error handling is done
+ // after unlock method is called
+ if ((pendExcpn = (*env)->ExceptionOccurred(env)) != NULL) {
+ (*env)->ExceptionClear(env);
+ }
(*env)->CallStaticVoidMethod(env, clazz, mid_unlock);
+ if (pendExcpn != NULL) {
+ (*env)->Throw(env, pendExcpn);
+ }
+ // check if any exception occured during mid_unlock call
+ if ((*env)->ExceptionCheck(env)) {
+ AWT_UNLOCK();
+ return FALSE;
+ }
}
result = (*fp_gtk_init_check)(NULL, NULL);
diff -r 23662c20a442 -r 2f4e33b3de4e jdk/src/java.desktop/unix/native/libawt_xawt/awt/gtk2_interface.h
--- a/jdk/src/java.desktop/unix/native/libawt_xawt/awt/gtk2_interface.h Thu Aug 13 14:15:11 2015 -0700
+++ b/jdk/src/java.desktop/unix/native/libawt_xawt/awt/gtk2_interface.h Wed Jul 05 20:45:35 2017 +0200
@@ -27,6 +27,7 @@
#include