mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-21 19:44:41 +02:00
Merge
This commit is contained in:
commit
78839115a6
483 changed files with 4880 additions and 1891 deletions
|
@ -260,3 +260,4 @@ ab55a18a95e1990a588929d5d29db3eb9985fea0 jdk9-b11
|
||||||
b114474fb25af4e73cb7219f7c04bd8994da03a5 jdk9-b15
|
b114474fb25af4e73cb7219f7c04bd8994da03a5 jdk9-b15
|
||||||
cf22a728521f91a4692b433d39d730a0a1b23155 jdk9-b16
|
cf22a728521f91a4692b433d39d730a0a1b23155 jdk9-b16
|
||||||
24152ee0ee1abef54a8bab04c099261dba7bcca5 jdk9-b17
|
24152ee0ee1abef54a8bab04c099261dba7bcca5 jdk9-b17
|
||||||
|
65abab59f783fcf02ff8e133431c252f9e5f07d5 jdk9-b18
|
||||||
|
|
|
@ -260,3 +260,4 @@ a2b82f863ba95a596da555a4c1b871c404863e7e jdk9-b14
|
||||||
e54022d0dd92106fff7f7fe670010cd7e6517ee3 jdk9-b15
|
e54022d0dd92106fff7f7fe670010cd7e6517ee3 jdk9-b15
|
||||||
422ef9d29d84f571453f015c4cb8713c3af70ee4 jdk9-b16
|
422ef9d29d84f571453f015c4cb8713c3af70ee4 jdk9-b16
|
||||||
4c75c2ca7cf3e0618315879acf17f42c8fcd0c09 jdk9-b17
|
4c75c2ca7cf3e0618315879acf17f42c8fcd0c09 jdk9-b17
|
||||||
|
77565aaaa2bb814e94817e92d680168052a25395 jdk9-b18
|
||||||
|
|
|
@ -420,3 +420,4 @@ bd333491bb6c012d7b606939406d0fa9a5ac7ffd jdk9-b14
|
||||||
170f6d733d7aec062f743a6b8c1cce940a7a984a jdk9-b15
|
170f6d733d7aec062f743a6b8c1cce940a7a984a jdk9-b15
|
||||||
b14e7c0b7d3ec04127f565cda1d84122e205680c jdk9-b16
|
b14e7c0b7d3ec04127f565cda1d84122e205680c jdk9-b16
|
||||||
14b656df31c2cb09c505921061e79977823de71a jdk9-b17
|
14b656df31c2cb09c505921061e79977823de71a jdk9-b17
|
||||||
|
871fd128548480095e0dc3fc34c422666baeec75 jdk9-b18
|
||||||
|
|
|
@ -74,19 +74,21 @@ $(UNIVERSAL_COPY_LIST):
|
||||||
|
|
||||||
|
|
||||||
# Replace arch specific binaries with universal binaries
|
# Replace arch specific binaries with universal binaries
|
||||||
|
# Do not touch jre/lib/{client,server}/libjsig.$(LIBRARY_SUFFIX)
|
||||||
|
# That symbolic link belongs to the 'jdk' build.
|
||||||
export_universal:
|
export_universal:
|
||||||
$(RM) -r $(EXPORT_PATH)/jre/lib/{i386,amd64}
|
$(RM) -r $(EXPORT_PATH)/jre/lib/{i386,amd64}
|
||||||
$(RM) -r $(JDK_IMAGE_DIR)/jre/lib/{i386,amd64}
|
$(RM) -r $(JDK_IMAGE_DIR)/jre/lib/{i386,amd64}
|
||||||
$(RM) $(JDK_IMAGE_DIR)/jre/lib/{client,server}/libjsig.$(LIBRARY_SUFFIX)
|
|
||||||
($(CD) $(EXPORT_PATH) && \
|
($(CD) $(EXPORT_PATH) && \
|
||||||
$(TAR) -cf - *) | \
|
$(TAR) -cf - *) | \
|
||||||
($(CD) $(JDK_IMAGE_DIR) && $(TAR) -xpf -)
|
($(CD) $(JDK_IMAGE_DIR) && $(TAR) -xpf -)
|
||||||
|
|
||||||
|
|
||||||
# Overlay universal binaries
|
# Overlay universal binaries
|
||||||
|
# Do not touch jre/lib/{client,server}/libjsig.$(LIBRARY_SUFFIX)
|
||||||
|
# That symbolic link belongs to the 'jdk' build.
|
||||||
copy_universal:
|
copy_universal:
|
||||||
$(RM) -r $(JDK_IMAGE_DIR)$(COPY_SUBDIR)/jre/lib/{i386,amd64}
|
$(RM) -r $(JDK_IMAGE_DIR)$(COPY_SUBDIR)/jre/lib/{i386,amd64}
|
||||||
$(RM) $(JDK_IMAGE_DIR)$(COPY_SUBDIR)/jre/lib/{client,server}/libjsig.$(LIBRARY_SUFFIX)
|
|
||||||
($(CD) $(EXPORT_PATH)$(COPY_SUBDIR) && \
|
($(CD) $(EXPORT_PATH)$(COPY_SUBDIR) && \
|
||||||
$(TAR) -cf - *) | \
|
$(TAR) -cf - *) | \
|
||||||
($(CD) $(JDK_IMAGE_DIR)$(COPY_SUBDIR) && $(TAR) -xpf -)
|
($(CD) $(JDK_IMAGE_DIR)$(COPY_SUBDIR) && $(TAR) -xpf -)
|
||||||
|
|
|
@ -4359,9 +4359,15 @@ void ClassFileParser::set_precomputed_flags(instanceKlassHandle k) {
|
||||||
Method* m = k->lookup_method(vmSymbols::finalize_method_name(),
|
Method* m = k->lookup_method(vmSymbols::finalize_method_name(),
|
||||||
vmSymbols::void_method_signature());
|
vmSymbols::void_method_signature());
|
||||||
if (m != NULL && !m->is_empty_method()) {
|
if (m != NULL && !m->is_empty_method()) {
|
||||||
f = true;
|
f = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Spec doesn't prevent agent from redefinition of empty finalizer.
|
||||||
|
// Despite the fact that it's generally bad idea and redefined finalizer
|
||||||
|
// will not work as expected we shouldn't abort vm in this case
|
||||||
|
if (!k->has_redefined_this_or_super()) {
|
||||||
|
assert(f == k->has_finalizer(), "inconsistent has_finalizer");
|
||||||
}
|
}
|
||||||
assert(f == k->has_finalizer(), "inconsistent has_finalizer");
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Check if this klass supports the java.lang.Cloneable interface
|
// Check if this klass supports the java.lang.Cloneable interface
|
||||||
|
|
|
@ -1181,7 +1181,7 @@ public:
|
||||||
static oop target( oop site) { return site->obj_field( _target_offset); }
|
static oop target( oop site) { return site->obj_field( _target_offset); }
|
||||||
static void set_target( oop site, oop target) { site->obj_field_put( _target_offset, target); }
|
static void set_target( oop site, oop target) { site->obj_field_put( _target_offset, target); }
|
||||||
|
|
||||||
static volatile oop target_volatile(oop site) { return site->obj_field_volatile( _target_offset); }
|
static volatile oop target_volatile(oop site) { return oop((oopDesc *)(site->obj_field_volatile(_target_offset))); }
|
||||||
static void set_target_volatile(oop site, oop target) { site->obj_field_put_volatile(_target_offset, target); }
|
static void set_target_volatile(oop site, oop target) { site->obj_field_put_volatile(_target_offset, target); }
|
||||||
|
|
||||||
// Testers
|
// Testers
|
||||||
|
|
|
@ -311,8 +311,7 @@ void CMSCollector::ref_processor_init() {
|
||||||
_cmsGen->refs_discovery_is_mt(), // mt discovery
|
_cmsGen->refs_discovery_is_mt(), // mt discovery
|
||||||
(int) MAX2(ConcGCThreads, ParallelGCThreads), // mt discovery degree
|
(int) MAX2(ConcGCThreads, ParallelGCThreads), // mt discovery degree
|
||||||
_cmsGen->refs_discovery_is_atomic(), // discovery is not atomic
|
_cmsGen->refs_discovery_is_atomic(), // discovery is not atomic
|
||||||
&_is_alive_closure, // closure for liveness info
|
&_is_alive_closure); // closure for liveness info
|
||||||
false); // next field updates do not need write barrier
|
|
||||||
// Initialize the _ref_processor field of CMSGen
|
// Initialize the _ref_processor field of CMSGen
|
||||||
_cmsGen->set_ref_processor(_ref_processor);
|
_cmsGen->set_ref_processor(_ref_processor);
|
||||||
|
|
||||||
|
|
|
@ -2246,12 +2246,9 @@ void G1CollectedHeap::ref_processing_init() {
|
||||||
// degree of mt discovery
|
// degree of mt discovery
|
||||||
false,
|
false,
|
||||||
// Reference discovery is not atomic
|
// Reference discovery is not atomic
|
||||||
&_is_alive_closure_cm,
|
&_is_alive_closure_cm);
|
||||||
// is alive closure
|
// is alive closure
|
||||||
// (for efficiency/performance)
|
// (for efficiency/performance)
|
||||||
true);
|
|
||||||
// Setting next fields of discovered
|
|
||||||
// lists requires a barrier.
|
|
||||||
|
|
||||||
// STW ref processor
|
// STW ref processor
|
||||||
_ref_processor_stw =
|
_ref_processor_stw =
|
||||||
|
@ -2266,12 +2263,9 @@ void G1CollectedHeap::ref_processing_init() {
|
||||||
// degree of mt discovery
|
// degree of mt discovery
|
||||||
true,
|
true,
|
||||||
// Reference discovery is atomic
|
// Reference discovery is atomic
|
||||||
&_is_alive_closure_stw,
|
&_is_alive_closure_stw);
|
||||||
// is alive closure
|
// is alive closure
|
||||||
// (for efficiency/performance)
|
// (for efficiency/performance)
|
||||||
false);
|
|
||||||
// Setting next fields of discovered
|
|
||||||
// lists does not require a barrier.
|
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t G1CollectedHeap::capacity() const {
|
size_t G1CollectedHeap::capacity() const {
|
||||||
|
|
|
@ -1636,8 +1636,7 @@ void ParNewGeneration::ref_processor_init() {
|
||||||
refs_discovery_is_mt(), // mt discovery
|
refs_discovery_is_mt(), // mt discovery
|
||||||
(int) ParallelGCThreads, // mt discovery degree
|
(int) ParallelGCThreads, // mt discovery degree
|
||||||
refs_discovery_is_atomic(), // atomic_discovery
|
refs_discovery_is_atomic(), // atomic_discovery
|
||||||
NULL, // is_alive_non_header
|
NULL); // is_alive_non_header
|
||||||
false); // write barrier for next field updates
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -854,8 +854,7 @@ void PSParallelCompact::post_initialize() {
|
||||||
true, // mt discovery
|
true, // mt discovery
|
||||||
(int) ParallelGCThreads, // mt discovery degree
|
(int) ParallelGCThreads, // mt discovery degree
|
||||||
true, // atomic_discovery
|
true, // atomic_discovery
|
||||||
&_is_alive_closure, // non-header is alive closure
|
&_is_alive_closure); // non-header is alive closure
|
||||||
false); // write barrier for next field updates
|
|
||||||
_counters = new CollectorCounters("PSParallelCompact", 1);
|
_counters = new CollectorCounters("PSParallelCompact", 1);
|
||||||
|
|
||||||
// Initialize static fields in ParCompactionManager.
|
// Initialize static fields in ParCompactionManager.
|
||||||
|
|
|
@ -864,8 +864,7 @@ void PSScavenge::initialize() {
|
||||||
true, // mt discovery
|
true, // mt discovery
|
||||||
(int) ParallelGCThreads, // mt discovery degree
|
(int) ParallelGCThreads, // mt discovery degree
|
||||||
true, // atomic_discovery
|
true, // atomic_discovery
|
||||||
NULL, // header provides liveness info
|
NULL); // header provides liveness info
|
||||||
false); // next field updates do not need write barrier
|
|
||||||
|
|
||||||
// Cache the cardtable
|
// Cache the cardtable
|
||||||
BarrierSet* bs = Universe::heap()->barrier_set();
|
BarrierSet* bs = Universe::heap()->barrier_set();
|
||||||
|
|
|
@ -563,6 +563,7 @@ void* Arena::grow(size_t x, AllocFailType alloc_failmode) {
|
||||||
_chunk = new (alloc_failmode, len) Chunk(len);
|
_chunk = new (alloc_failmode, len) Chunk(len);
|
||||||
|
|
||||||
if (_chunk == NULL) {
|
if (_chunk == NULL) {
|
||||||
|
_chunk = k; // restore the previous value of _chunk
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
if (k) k->set_next(_chunk); // Append new chunk to end of linked list
|
if (k) k->set_next(_chunk); // Append new chunk to end of linked list
|
||||||
|
|
|
@ -1423,6 +1423,17 @@ size_t MetaspaceGC::dec_capacity_until_GC(size_t v) {
|
||||||
return (size_t)Atomic::add_ptr(-(intptr_t)v, &_capacity_until_GC);
|
return (size_t)Atomic::add_ptr(-(intptr_t)v, &_capacity_until_GC);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MetaspaceGC::initialize() {
|
||||||
|
// Set the high-water mark to MaxMetapaceSize during VM initializaton since
|
||||||
|
// we can't do a GC during initialization.
|
||||||
|
_capacity_until_GC = MaxMetaspaceSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
void MetaspaceGC::post_initialize() {
|
||||||
|
// Reset the high-water mark once the VM initialization is done.
|
||||||
|
_capacity_until_GC = MAX2(MetaspaceAux::committed_bytes(), MetaspaceSize);
|
||||||
|
}
|
||||||
|
|
||||||
bool MetaspaceGC::can_expand(size_t word_size, bool is_class) {
|
bool MetaspaceGC::can_expand(size_t word_size, bool is_class) {
|
||||||
// Check if the compressed class space is full.
|
// Check if the compressed class space is full.
|
||||||
if (is_class && Metaspace::using_class_space()) {
|
if (is_class && Metaspace::using_class_space()) {
|
||||||
|
@ -1443,21 +1454,13 @@ bool MetaspaceGC::can_expand(size_t word_size, bool is_class) {
|
||||||
|
|
||||||
size_t MetaspaceGC::allowed_expansion() {
|
size_t MetaspaceGC::allowed_expansion() {
|
||||||
size_t committed_bytes = MetaspaceAux::committed_bytes();
|
size_t committed_bytes = MetaspaceAux::committed_bytes();
|
||||||
|
|
||||||
size_t left_until_max = MaxMetaspaceSize - committed_bytes;
|
|
||||||
|
|
||||||
// Always grant expansion if we are initiating the JVM,
|
|
||||||
// or if the GC_locker is preventing GCs.
|
|
||||||
if (!is_init_completed() || GC_locker::is_active_and_needs_gc()) {
|
|
||||||
return left_until_max / BytesPerWord;
|
|
||||||
}
|
|
||||||
|
|
||||||
size_t capacity_until_gc = capacity_until_GC();
|
size_t capacity_until_gc = capacity_until_GC();
|
||||||
|
|
||||||
if (capacity_until_gc <= committed_bytes) {
|
assert(capacity_until_gc >= committed_bytes,
|
||||||
return 0;
|
err_msg("capacity_until_gc: " SIZE_FORMAT " < committed_bytes: " SIZE_FORMAT,
|
||||||
}
|
capacity_until_gc, committed_bytes));
|
||||||
|
|
||||||
|
size_t left_until_max = MaxMetaspaceSize - committed_bytes;
|
||||||
size_t left_until_GC = capacity_until_gc - committed_bytes;
|
size_t left_until_GC = capacity_until_gc - committed_bytes;
|
||||||
size_t left_to_commit = MIN2(left_until_GC, left_until_max);
|
size_t left_to_commit = MIN2(left_until_GC, left_until_max);
|
||||||
|
|
||||||
|
@ -1469,7 +1472,15 @@ void MetaspaceGC::compute_new_size() {
|
||||||
uint current_shrink_factor = _shrink_factor;
|
uint current_shrink_factor = _shrink_factor;
|
||||||
_shrink_factor = 0;
|
_shrink_factor = 0;
|
||||||
|
|
||||||
const size_t used_after_gc = MetaspaceAux::capacity_bytes();
|
// Using committed_bytes() for used_after_gc is an overestimation, since the
|
||||||
|
// chunk free lists are included in committed_bytes() and the memory in an
|
||||||
|
// un-fragmented chunk free list is available for future allocations.
|
||||||
|
// However, if the chunk free lists becomes fragmented, then the memory may
|
||||||
|
// not be available for future allocations and the memory is therefore "in use".
|
||||||
|
// Including the chunk free lists in the definition of "in use" is therefore
|
||||||
|
// necessary. Not including the chunk free lists can cause capacity_until_GC to
|
||||||
|
// shrink below committed_bytes() and this has caused serious bugs in the past.
|
||||||
|
const size_t used_after_gc = MetaspaceAux::committed_bytes();
|
||||||
const size_t capacity_until_GC = MetaspaceGC::capacity_until_GC();
|
const size_t capacity_until_GC = MetaspaceGC::capacity_until_GC();
|
||||||
|
|
||||||
const double minimum_free_percentage = MinMetaspaceFreeRatio / 100.0;
|
const double minimum_free_percentage = MinMetaspaceFreeRatio / 100.0;
|
||||||
|
@ -3094,6 +3105,8 @@ void Metaspace::ergo_initialize() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Metaspace::global_initialize() {
|
void Metaspace::global_initialize() {
|
||||||
|
MetaspaceGC::initialize();
|
||||||
|
|
||||||
// Initialize the alignment for shared spaces.
|
// Initialize the alignment for shared spaces.
|
||||||
int max_alignment = os::vm_allocation_granularity();
|
int max_alignment = os::vm_allocation_granularity();
|
||||||
size_t cds_total = 0;
|
size_t cds_total = 0;
|
||||||
|
@ -3201,10 +3214,13 @@ void Metaspace::global_initialize() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MetaspaceGC::initialize();
|
|
||||||
_tracer = new MetaspaceTracer();
|
_tracer = new MetaspaceTracer();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Metaspace::post_initialize() {
|
||||||
|
MetaspaceGC::post_initialize();
|
||||||
|
}
|
||||||
|
|
||||||
Metachunk* Metaspace::get_initialization_chunk(MetadataType mdtype,
|
Metachunk* Metaspace::get_initialization_chunk(MetadataType mdtype,
|
||||||
size_t chunk_word_size,
|
size_t chunk_word_size,
|
||||||
size_t chunk_bunch) {
|
size_t chunk_bunch) {
|
||||||
|
|
|
@ -208,6 +208,7 @@ class Metaspace : public CHeapObj<mtClass> {
|
||||||
|
|
||||||
static void ergo_initialize();
|
static void ergo_initialize();
|
||||||
static void global_initialize();
|
static void global_initialize();
|
||||||
|
static void post_initialize();
|
||||||
|
|
||||||
static size_t first_chunk_word_size() { return _first_chunk_word_size; }
|
static size_t first_chunk_word_size() { return _first_chunk_word_size; }
|
||||||
static size_t first_class_chunk_word_size() { return _first_class_chunk_word_size; }
|
static size_t first_class_chunk_word_size() { return _first_class_chunk_word_size; }
|
||||||
|
@ -398,7 +399,8 @@ class MetaspaceGC : AllStatic {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
static void initialize() { _capacity_until_GC = MetaspaceSize; }
|
static void initialize();
|
||||||
|
static void post_initialize();
|
||||||
|
|
||||||
static size_t capacity_until_GC();
|
static size_t capacity_until_GC();
|
||||||
static size_t inc_capacity_until_GC(size_t v);
|
static size_t inc_capacity_until_GC(size_t v);
|
||||||
|
|
|
@ -96,12 +96,10 @@ ReferenceProcessor::ReferenceProcessor(MemRegion span,
|
||||||
bool mt_discovery,
|
bool mt_discovery,
|
||||||
uint mt_discovery_degree,
|
uint mt_discovery_degree,
|
||||||
bool atomic_discovery,
|
bool atomic_discovery,
|
||||||
BoolObjectClosure* is_alive_non_header,
|
BoolObjectClosure* is_alive_non_header) :
|
||||||
bool discovered_list_needs_post_barrier) :
|
|
||||||
_discovering_refs(false),
|
_discovering_refs(false),
|
||||||
_enqueuing_is_done(false),
|
_enqueuing_is_done(false),
|
||||||
_is_alive_non_header(is_alive_non_header),
|
_is_alive_non_header(is_alive_non_header),
|
||||||
_discovered_list_needs_post_barrier(discovered_list_needs_post_barrier),
|
|
||||||
_processing_is_mt(mt_processing),
|
_processing_is_mt(mt_processing),
|
||||||
_next_id(0)
|
_next_id(0)
|
||||||
{
|
{
|
||||||
|
@ -340,10 +338,18 @@ void ReferenceProcessor::enqueue_discovered_reflist(DiscoveredList& refs_list,
|
||||||
// (java.lang.ref.Reference.discovered), self-loop their "next" field
|
// (java.lang.ref.Reference.discovered), self-loop their "next" field
|
||||||
// thus distinguishing them from active References, then
|
// thus distinguishing them from active References, then
|
||||||
// prepend them to the pending list.
|
// prepend them to the pending list.
|
||||||
|
//
|
||||||
|
// The Java threads will see the Reference objects linked together through
|
||||||
|
// the discovered field. Instead of trying to do the write barrier updates
|
||||||
|
// in all places in the reference processor where we manipulate the discovered
|
||||||
|
// field we make sure to do the barrier here where we anyway iterate through
|
||||||
|
// all linked Reference objects. Note that it is important to not dirty any
|
||||||
|
// cards during reference processing since this will cause card table
|
||||||
|
// verification to fail for G1.
|
||||||
|
//
|
||||||
// BKWRD COMPATIBILITY NOTE: For older JDKs (prior to the fix for 4956777),
|
// BKWRD COMPATIBILITY NOTE: For older JDKs (prior to the fix for 4956777),
|
||||||
// the "next" field is used to chain the pending list, not the discovered
|
// the "next" field is used to chain the pending list, not the discovered
|
||||||
// field.
|
// field.
|
||||||
|
|
||||||
if (TraceReferenceGC && PrintGCDetails) {
|
if (TraceReferenceGC && PrintGCDetails) {
|
||||||
gclog_or_tty->print_cr("ReferenceProcessor::enqueue_discovered_reflist list "
|
gclog_or_tty->print_cr("ReferenceProcessor::enqueue_discovered_reflist list "
|
||||||
INTPTR_FORMAT, (address)refs_list.head());
|
INTPTR_FORMAT, (address)refs_list.head());
|
||||||
|
@ -365,15 +371,15 @@ void ReferenceProcessor::enqueue_discovered_reflist(DiscoveredList& refs_list,
|
||||||
assert(java_lang_ref_Reference::next(obj) == NULL,
|
assert(java_lang_ref_Reference::next(obj) == NULL,
|
||||||
"Reference not active; should not be discovered");
|
"Reference not active; should not be discovered");
|
||||||
// Self-loop next, so as to make Ref not active.
|
// Self-loop next, so as to make Ref not active.
|
||||||
// Post-barrier not needed when looping to self.
|
|
||||||
java_lang_ref_Reference::set_next_raw(obj, obj);
|
java_lang_ref_Reference::set_next_raw(obj, obj);
|
||||||
if (next_d == obj) { // obj is last
|
if (next_d != obj) {
|
||||||
|
oopDesc::bs()->write_ref_field(java_lang_ref_Reference::discovered_addr(obj), next_d);
|
||||||
|
} else {
|
||||||
|
// This is the last object.
|
||||||
// Swap refs_list into pending_list_addr and
|
// Swap refs_list into pending_list_addr and
|
||||||
// set obj's discovered to what we read from pending_list_addr.
|
// set obj's discovered to what we read from pending_list_addr.
|
||||||
oop old = oopDesc::atomic_exchange_oop(refs_list.head(), pending_list_addr);
|
oop old = oopDesc::atomic_exchange_oop(refs_list.head(), pending_list_addr);
|
||||||
// Need post-barrier on pending_list_addr above;
|
// Need post-barrier on pending_list_addr. See enqueue_discovered_ref_helper() above.
|
||||||
// see special post-barrier code at the end of
|
|
||||||
// enqueue_discovered_reflists() further below.
|
|
||||||
java_lang_ref_Reference::set_discovered_raw(obj, old); // old may be NULL
|
java_lang_ref_Reference::set_discovered_raw(obj, old); // old may be NULL
|
||||||
oopDesc::bs()->write_ref_field(java_lang_ref_Reference::discovered_addr(obj), old);
|
oopDesc::bs()->write_ref_field(java_lang_ref_Reference::discovered_addr(obj), old);
|
||||||
}
|
}
|
||||||
|
@ -496,20 +502,15 @@ void DiscoveredListIterator::remove() {
|
||||||
// pre-barrier here because we know the Reference has already been found/marked,
|
// pre-barrier here because we know the Reference has already been found/marked,
|
||||||
// that's how it ended up in the discovered list in the first place.
|
// that's how it ended up in the discovered list in the first place.
|
||||||
oop_store_raw(_prev_next, new_next);
|
oop_store_raw(_prev_next, new_next);
|
||||||
if (_discovered_list_needs_post_barrier && _prev_next != _refs_list.adr_head()) {
|
|
||||||
// Needs post-barrier and this is not the list head (which is not on the heap)
|
|
||||||
oopDesc::bs()->write_ref_field(_prev_next, new_next);
|
|
||||||
}
|
|
||||||
NOT_PRODUCT(_removed++);
|
NOT_PRODUCT(_removed++);
|
||||||
_refs_list.dec_length(1);
|
_refs_list.dec_length(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Make the Reference object active again.
|
// Make the Reference object active again.
|
||||||
void DiscoveredListIterator::make_active() {
|
void DiscoveredListIterator::make_active() {
|
||||||
// For G1 we don't want to use set_next - it
|
// The pre barrier for G1 is probably just needed for the old
|
||||||
// will dirty the card for the next field of
|
// reference processing behavior. Should we guard this with
|
||||||
// the reference object and will fail
|
// ReferenceProcessor::pending_list_uses_discovered_field() ?
|
||||||
// CT verification.
|
|
||||||
if (UseG1GC) {
|
if (UseG1GC) {
|
||||||
HeapWord* next_addr = java_lang_ref_Reference::next_addr(_ref);
|
HeapWord* next_addr = java_lang_ref_Reference::next_addr(_ref);
|
||||||
if (UseCompressedOops) {
|
if (UseCompressedOops) {
|
||||||
|
@ -517,10 +518,8 @@ void DiscoveredListIterator::make_active() {
|
||||||
} else {
|
} else {
|
||||||
oopDesc::bs()->write_ref_field_pre((oop*)next_addr, NULL);
|
oopDesc::bs()->write_ref_field_pre((oop*)next_addr, NULL);
|
||||||
}
|
}
|
||||||
java_lang_ref_Reference::set_next_raw(_ref, NULL);
|
|
||||||
} else {
|
|
||||||
java_lang_ref_Reference::set_next(_ref, NULL);
|
|
||||||
}
|
}
|
||||||
|
java_lang_ref_Reference::set_next_raw(_ref, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DiscoveredListIterator::clear_referent() {
|
void DiscoveredListIterator::clear_referent() {
|
||||||
|
@ -546,7 +545,7 @@ ReferenceProcessor::process_phase1(DiscoveredList& refs_list,
|
||||||
OopClosure* keep_alive,
|
OopClosure* keep_alive,
|
||||||
VoidClosure* complete_gc) {
|
VoidClosure* complete_gc) {
|
||||||
assert(policy != NULL, "Must have a non-NULL policy");
|
assert(policy != NULL, "Must have a non-NULL policy");
|
||||||
DiscoveredListIterator iter(refs_list, keep_alive, is_alive, _discovered_list_needs_post_barrier);
|
DiscoveredListIterator iter(refs_list, keep_alive, is_alive);
|
||||||
// Decide which softly reachable refs should be kept alive.
|
// Decide which softly reachable refs should be kept alive.
|
||||||
while (iter.has_next()) {
|
while (iter.has_next()) {
|
||||||
iter.load_ptrs(DEBUG_ONLY(!discovery_is_atomic() /* allow_null_referent */));
|
iter.load_ptrs(DEBUG_ONLY(!discovery_is_atomic() /* allow_null_referent */));
|
||||||
|
@ -586,7 +585,7 @@ ReferenceProcessor::pp2_work(DiscoveredList& refs_list,
|
||||||
BoolObjectClosure* is_alive,
|
BoolObjectClosure* is_alive,
|
||||||
OopClosure* keep_alive) {
|
OopClosure* keep_alive) {
|
||||||
assert(discovery_is_atomic(), "Error");
|
assert(discovery_is_atomic(), "Error");
|
||||||
DiscoveredListIterator iter(refs_list, keep_alive, is_alive, _discovered_list_needs_post_barrier);
|
DiscoveredListIterator iter(refs_list, keep_alive, is_alive);
|
||||||
while (iter.has_next()) {
|
while (iter.has_next()) {
|
||||||
iter.load_ptrs(DEBUG_ONLY(false /* allow_null_referent */));
|
iter.load_ptrs(DEBUG_ONLY(false /* allow_null_referent */));
|
||||||
DEBUG_ONLY(oop next = java_lang_ref_Reference::next(iter.obj());)
|
DEBUG_ONLY(oop next = java_lang_ref_Reference::next(iter.obj());)
|
||||||
|
@ -623,7 +622,7 @@ ReferenceProcessor::pp2_work_concurrent_discovery(DiscoveredList& refs_list,
|
||||||
OopClosure* keep_alive,
|
OopClosure* keep_alive,
|
||||||
VoidClosure* complete_gc) {
|
VoidClosure* complete_gc) {
|
||||||
assert(!discovery_is_atomic(), "Error");
|
assert(!discovery_is_atomic(), "Error");
|
||||||
DiscoveredListIterator iter(refs_list, keep_alive, is_alive, _discovered_list_needs_post_barrier);
|
DiscoveredListIterator iter(refs_list, keep_alive, is_alive);
|
||||||
while (iter.has_next()) {
|
while (iter.has_next()) {
|
||||||
iter.load_ptrs(DEBUG_ONLY(true /* allow_null_referent */));
|
iter.load_ptrs(DEBUG_ONLY(true /* allow_null_referent */));
|
||||||
HeapWord* next_addr = java_lang_ref_Reference::next_addr(iter.obj());
|
HeapWord* next_addr = java_lang_ref_Reference::next_addr(iter.obj());
|
||||||
|
@ -666,7 +665,7 @@ ReferenceProcessor::process_phase3(DiscoveredList& refs_list,
|
||||||
OopClosure* keep_alive,
|
OopClosure* keep_alive,
|
||||||
VoidClosure* complete_gc) {
|
VoidClosure* complete_gc) {
|
||||||
ResourceMark rm;
|
ResourceMark rm;
|
||||||
DiscoveredListIterator iter(refs_list, keep_alive, is_alive, _discovered_list_needs_post_barrier);
|
DiscoveredListIterator iter(refs_list, keep_alive, is_alive);
|
||||||
while (iter.has_next()) {
|
while (iter.has_next()) {
|
||||||
iter.update_discovered();
|
iter.update_discovered();
|
||||||
iter.load_ptrs(DEBUG_ONLY(false /* allow_null_referent */));
|
iter.load_ptrs(DEBUG_ONLY(false /* allow_null_referent */));
|
||||||
|
@ -782,13 +781,6 @@ private:
|
||||||
bool _clear_referent;
|
bool _clear_referent;
|
||||||
};
|
};
|
||||||
|
|
||||||
void ReferenceProcessor::set_discovered(oop ref, oop value) {
|
|
||||||
java_lang_ref_Reference::set_discovered_raw(ref, value);
|
|
||||||
if (_discovered_list_needs_post_barrier) {
|
|
||||||
oopDesc::bs()->write_ref_field(java_lang_ref_Reference::discovered_addr(ref), value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Balances reference queues.
|
// Balances reference queues.
|
||||||
// Move entries from all queues[0, 1, ..., _max_num_q-1] to
|
// Move entries from all queues[0, 1, ..., _max_num_q-1] to
|
||||||
// queues[0, 1, ..., _num_q-1] because only the first _num_q
|
// queues[0, 1, ..., _num_q-1] because only the first _num_q
|
||||||
|
@ -846,9 +838,9 @@ void ReferenceProcessor::balance_queues(DiscoveredList ref_lists[])
|
||||||
// Add the chain to the to list.
|
// Add the chain to the to list.
|
||||||
if (ref_lists[to_idx].head() == NULL) {
|
if (ref_lists[to_idx].head() == NULL) {
|
||||||
// to list is empty. Make a loop at the end.
|
// to list is empty. Make a loop at the end.
|
||||||
set_discovered(move_tail, move_tail);
|
java_lang_ref_Reference::set_discovered_raw(move_tail, move_tail);
|
||||||
} else {
|
} else {
|
||||||
set_discovered(move_tail, ref_lists[to_idx].head());
|
java_lang_ref_Reference::set_discovered_raw(move_tail, ref_lists[to_idx].head());
|
||||||
}
|
}
|
||||||
ref_lists[to_idx].set_head(move_head);
|
ref_lists[to_idx].set_head(move_head);
|
||||||
ref_lists[to_idx].inc_length(refs_to_move);
|
ref_lists[to_idx].inc_length(refs_to_move);
|
||||||
|
@ -982,7 +974,7 @@ void ReferenceProcessor::clean_up_discovered_references() {
|
||||||
|
|
||||||
void ReferenceProcessor::clean_up_discovered_reflist(DiscoveredList& refs_list) {
|
void ReferenceProcessor::clean_up_discovered_reflist(DiscoveredList& refs_list) {
|
||||||
assert(!discovery_is_atomic(), "Else why call this method?");
|
assert(!discovery_is_atomic(), "Else why call this method?");
|
||||||
DiscoveredListIterator iter(refs_list, NULL, NULL, _discovered_list_needs_post_barrier);
|
DiscoveredListIterator iter(refs_list, NULL, NULL);
|
||||||
while (iter.has_next()) {
|
while (iter.has_next()) {
|
||||||
iter.load_ptrs(DEBUG_ONLY(true /* allow_null_referent */));
|
iter.load_ptrs(DEBUG_ONLY(true /* allow_null_referent */));
|
||||||
oop next = java_lang_ref_Reference::next(iter.obj());
|
oop next = java_lang_ref_Reference::next(iter.obj());
|
||||||
|
@ -1071,16 +1063,6 @@ ReferenceProcessor::add_to_discovered_list_mt(DiscoveredList& refs_list,
|
||||||
// The last ref must have its discovered field pointing to itself.
|
// The last ref must have its discovered field pointing to itself.
|
||||||
oop next_discovered = (current_head != NULL) ? current_head : obj;
|
oop next_discovered = (current_head != NULL) ? current_head : obj;
|
||||||
|
|
||||||
// Note: In the case of G1, this specific pre-barrier is strictly
|
|
||||||
// not necessary because the only case we are interested in
|
|
||||||
// here is when *discovered_addr is NULL (see the CAS further below),
|
|
||||||
// so this will expand to nothing. As a result, we have manually
|
|
||||||
// elided this out for G1, but left in the test for some future
|
|
||||||
// collector that might have need for a pre-barrier here, e.g.:-
|
|
||||||
// oopDesc::bs()->write_ref_field_pre((oop* or narrowOop*)discovered_addr, next_discovered);
|
|
||||||
assert(!_discovered_list_needs_post_barrier || UseG1GC,
|
|
||||||
"Need to check non-G1 collector: "
|
|
||||||
"may need a pre-write-barrier for CAS from NULL below");
|
|
||||||
oop retest = oopDesc::atomic_compare_exchange_oop(next_discovered, discovered_addr,
|
oop retest = oopDesc::atomic_compare_exchange_oop(next_discovered, discovered_addr,
|
||||||
NULL);
|
NULL);
|
||||||
if (retest == NULL) {
|
if (retest == NULL) {
|
||||||
|
@ -1089,9 +1071,6 @@ ReferenceProcessor::add_to_discovered_list_mt(DiscoveredList& refs_list,
|
||||||
// is necessary.
|
// is necessary.
|
||||||
refs_list.set_head(obj);
|
refs_list.set_head(obj);
|
||||||
refs_list.inc_length(1);
|
refs_list.inc_length(1);
|
||||||
if (_discovered_list_needs_post_barrier) {
|
|
||||||
oopDesc::bs()->write_ref_field((void*)discovered_addr, next_discovered);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (TraceReferenceGC) {
|
if (TraceReferenceGC) {
|
||||||
gclog_or_tty->print_cr("Discovered reference (mt) (" INTPTR_FORMAT ": %s)",
|
gclog_or_tty->print_cr("Discovered reference (mt) (" INTPTR_FORMAT ": %s)",
|
||||||
|
@ -1242,24 +1221,14 @@ bool ReferenceProcessor::discover_reference(oop obj, ReferenceType rt) {
|
||||||
if (_discovery_is_mt) {
|
if (_discovery_is_mt) {
|
||||||
add_to_discovered_list_mt(*list, obj, discovered_addr);
|
add_to_discovered_list_mt(*list, obj, discovered_addr);
|
||||||
} else {
|
} else {
|
||||||
// If "_discovered_list_needs_post_barrier", we do write barriers when
|
// We do a raw store here: the field will be visited later when processing
|
||||||
// updating the discovered reference list. Otherwise, we do a raw store
|
// the discovered references.
|
||||||
// here: the field will be visited later when processing the discovered
|
|
||||||
// references.
|
|
||||||
oop current_head = list->head();
|
oop current_head = list->head();
|
||||||
// The last ref must have its discovered field pointing to itself.
|
// The last ref must have its discovered field pointing to itself.
|
||||||
oop next_discovered = (current_head != NULL) ? current_head : obj;
|
oop next_discovered = (current_head != NULL) ? current_head : obj;
|
||||||
|
|
||||||
// As in the case further above, since we are over-writing a NULL
|
|
||||||
// pre-value, we can safely elide the pre-barrier here for the case of G1.
|
|
||||||
// e.g.:- oopDesc::bs()->write_ref_field_pre((oop* or narrowOop*)discovered_addr, next_discovered);
|
|
||||||
assert(discovered == NULL, "control point invariant");
|
assert(discovered == NULL, "control point invariant");
|
||||||
assert(!_discovered_list_needs_post_barrier || UseG1GC,
|
|
||||||
"For non-G1 collector, may need a pre-write-barrier for CAS from NULL below");
|
|
||||||
oop_store_raw(discovered_addr, next_discovered);
|
oop_store_raw(discovered_addr, next_discovered);
|
||||||
if (_discovered_list_needs_post_barrier) {
|
|
||||||
oopDesc::bs()->write_ref_field((void*)discovered_addr, next_discovered);
|
|
||||||
}
|
|
||||||
list->set_head(obj);
|
list->set_head(obj);
|
||||||
list->inc_length(1);
|
list->inc_length(1);
|
||||||
|
|
||||||
|
@ -1353,7 +1322,7 @@ ReferenceProcessor::preclean_discovered_reflist(DiscoveredList& refs_list,
|
||||||
OopClosure* keep_alive,
|
OopClosure* keep_alive,
|
||||||
VoidClosure* complete_gc,
|
VoidClosure* complete_gc,
|
||||||
YieldClosure* yield) {
|
YieldClosure* yield) {
|
||||||
DiscoveredListIterator iter(refs_list, keep_alive, is_alive, _discovered_list_needs_post_barrier);
|
DiscoveredListIterator iter(refs_list, keep_alive, is_alive);
|
||||||
while (iter.has_next()) {
|
while (iter.has_next()) {
|
||||||
iter.load_ptrs(DEBUG_ONLY(true /* allow_null_referent */));
|
iter.load_ptrs(DEBUG_ONLY(true /* allow_null_referent */));
|
||||||
oop obj = iter.obj();
|
oop obj = iter.obj();
|
||||||
|
|
|
@ -99,7 +99,6 @@ private:
|
||||||
oop _referent;
|
oop _referent;
|
||||||
OopClosure* _keep_alive;
|
OopClosure* _keep_alive;
|
||||||
BoolObjectClosure* _is_alive;
|
BoolObjectClosure* _is_alive;
|
||||||
bool _discovered_list_needs_post_barrier;
|
|
||||||
|
|
||||||
DEBUG_ONLY(
|
DEBUG_ONLY(
|
||||||
oop _first_seen; // cyclic linked list check
|
oop _first_seen; // cyclic linked list check
|
||||||
|
@ -113,8 +112,7 @@ private:
|
||||||
public:
|
public:
|
||||||
inline DiscoveredListIterator(DiscoveredList& refs_list,
|
inline DiscoveredListIterator(DiscoveredList& refs_list,
|
||||||
OopClosure* keep_alive,
|
OopClosure* keep_alive,
|
||||||
BoolObjectClosure* is_alive,
|
BoolObjectClosure* is_alive):
|
||||||
bool discovered_list_needs_post_barrier = false):
|
|
||||||
_refs_list(refs_list),
|
_refs_list(refs_list),
|
||||||
_prev_next(refs_list.adr_head()),
|
_prev_next(refs_list.adr_head()),
|
||||||
_prev(NULL),
|
_prev(NULL),
|
||||||
|
@ -128,8 +126,7 @@ public:
|
||||||
#endif
|
#endif
|
||||||
_next(NULL),
|
_next(NULL),
|
||||||
_keep_alive(keep_alive),
|
_keep_alive(keep_alive),
|
||||||
_is_alive(is_alive),
|
_is_alive(is_alive)
|
||||||
_discovered_list_needs_post_barrier(discovered_list_needs_post_barrier)
|
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
// End Of List.
|
// End Of List.
|
||||||
|
@ -230,14 +227,6 @@ class ReferenceProcessor : public CHeapObj<mtGC> {
|
||||||
// other collectors in configuration
|
// other collectors in configuration
|
||||||
bool _discovery_is_mt; // true if reference discovery is MT.
|
bool _discovery_is_mt; // true if reference discovery is MT.
|
||||||
|
|
||||||
// If true, setting "next" field of a discovered refs list requires
|
|
||||||
// write post barrier. (Must be true if used in a collector in which
|
|
||||||
// elements of a discovered list may be moved during discovery: for
|
|
||||||
// example, a collector like Garbage-First that moves objects during a
|
|
||||||
// long-term concurrent marking phase that does weak reference
|
|
||||||
// discovery.)
|
|
||||||
bool _discovered_list_needs_post_barrier;
|
|
||||||
|
|
||||||
bool _enqueuing_is_done; // true if all weak references enqueued
|
bool _enqueuing_is_done; // true if all weak references enqueued
|
||||||
bool _processing_is_mt; // true during phases when
|
bool _processing_is_mt; // true during phases when
|
||||||
// reference processing is MT.
|
// reference processing is MT.
|
||||||
|
@ -382,11 +371,6 @@ class ReferenceProcessor : public CHeapObj<mtGC> {
|
||||||
void enqueue_discovered_reflists(HeapWord* pending_list_addr, AbstractRefProcTaskExecutor* task_executor);
|
void enqueue_discovered_reflists(HeapWord* pending_list_addr, AbstractRefProcTaskExecutor* task_executor);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Set the 'discovered' field of the given reference to
|
|
||||||
// the given value - emitting post barriers depending upon
|
|
||||||
// the value of _discovered_list_needs_post_barrier.
|
|
||||||
void set_discovered(oop ref, oop value);
|
|
||||||
|
|
||||||
// "Preclean" the given discovered reference list
|
// "Preclean" the given discovered reference list
|
||||||
// by removing references with strongly reachable referents.
|
// by removing references with strongly reachable referents.
|
||||||
// Currently used in support of CMS only.
|
// Currently used in support of CMS only.
|
||||||
|
@ -427,8 +411,7 @@ class ReferenceProcessor : public CHeapObj<mtGC> {
|
||||||
bool mt_processing = false, uint mt_processing_degree = 1,
|
bool mt_processing = false, uint mt_processing_degree = 1,
|
||||||
bool mt_discovery = false, uint mt_discovery_degree = 1,
|
bool mt_discovery = false, uint mt_discovery_degree = 1,
|
||||||
bool atomic_discovery = true,
|
bool atomic_discovery = true,
|
||||||
BoolObjectClosure* is_alive_non_header = NULL,
|
BoolObjectClosure* is_alive_non_header = NULL);
|
||||||
bool discovered_list_needs_post_barrier = false);
|
|
||||||
|
|
||||||
// RefDiscoveryPolicy values
|
// RefDiscoveryPolicy values
|
||||||
enum DiscoveryPolicy {
|
enum DiscoveryPolicy {
|
||||||
|
|
|
@ -1501,6 +1501,21 @@ Method* InstanceKlass::uncached_lookup_method(Symbol* name, Symbol* signature, M
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef ASSERT
|
||||||
|
// search through class hierarchy and return true if this class or
|
||||||
|
// one of the superclasses was redefined
|
||||||
|
bool InstanceKlass::has_redefined_this_or_super() const {
|
||||||
|
const InstanceKlass* klass = this;
|
||||||
|
while (klass != NULL) {
|
||||||
|
if (klass->has_been_redefined()) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
klass = InstanceKlass::cast(klass->super());
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// lookup a method in the default methods list then in all transitive interfaces
|
// lookup a method in the default methods list then in all transitive interfaces
|
||||||
// Do NOT return private or static methods
|
// Do NOT return private or static methods
|
||||||
Method* InstanceKlass::lookup_method_in_ordered_interfaces(Symbol* name,
|
Method* InstanceKlass::lookup_method_in_ordered_interfaces(Symbol* name,
|
||||||
|
|
|
@ -754,6 +754,11 @@ class InstanceKlass: public Klass {
|
||||||
bool implements_interface(Klass* k) const;
|
bool implements_interface(Klass* k) const;
|
||||||
bool is_same_or_direct_interface(Klass* k) const;
|
bool is_same_or_direct_interface(Klass* k) const;
|
||||||
|
|
||||||
|
#ifdef ASSERT
|
||||||
|
// check whether this class or one of its superclasses was redefined
|
||||||
|
bool has_redefined_this_or_super() const;
|
||||||
|
#endif
|
||||||
|
|
||||||
// Access to the implementor of an interface.
|
// Access to the implementor of an interface.
|
||||||
Klass* implementor() const
|
Klass* implementor() const
|
||||||
{
|
{
|
||||||
|
@ -811,8 +816,8 @@ class InstanceKlass: public Klass {
|
||||||
|
|
||||||
// Casting from Klass*
|
// Casting from Klass*
|
||||||
static InstanceKlass* cast(Klass* k) {
|
static InstanceKlass* cast(Klass* k) {
|
||||||
assert(k->is_klass(), "must be");
|
assert(k == NULL || k->is_klass(), "must be");
|
||||||
assert(k->oop_is_instance(), "cast to InstanceKlass");
|
assert(k == NULL || k->oop_is_instance(), "cast to InstanceKlass");
|
||||||
return (InstanceKlass*) k;
|
return (InstanceKlass*) k;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
@ -112,9 +112,7 @@ public:
|
||||||
|
|
||||||
// Assignment
|
// Assignment
|
||||||
oop& operator=(const oop& o) { _o = o.obj(); return *this; }
|
oop& operator=(const oop& o) { _o = o.obj(); return *this; }
|
||||||
#ifndef SOLARIS
|
|
||||||
volatile oop& operator=(const oop& o) volatile { _o = o.obj(); return *this; }
|
volatile oop& operator=(const oop& o) volatile { _o = o.obj(); return *this; }
|
||||||
#endif
|
|
||||||
volatile oop& operator=(const volatile oop& o) volatile { _o = o.obj(); return *this; }
|
volatile oop& operator=(const volatile oop& o) volatile { _o = o.obj(); return *this; }
|
||||||
|
|
||||||
// Explict user conversions
|
// Explict user conversions
|
||||||
|
@ -123,11 +121,10 @@ public:
|
||||||
operator void* () const volatile { return (void *)obj(); }
|
operator void* () const volatile { return (void *)obj(); }
|
||||||
#endif
|
#endif
|
||||||
operator HeapWord* () const { return (HeapWord*)obj(); }
|
operator HeapWord* () const { return (HeapWord*)obj(); }
|
||||||
operator oopDesc* () const { return obj(); }
|
operator oopDesc* () const volatile { return obj(); }
|
||||||
operator intptr_t* () const { return (intptr_t*)obj(); }
|
operator intptr_t* () const { return (intptr_t*)obj(); }
|
||||||
operator PromotedObject* () const { return (PromotedObject*)obj(); }
|
operator PromotedObject* () const { return (PromotedObject*)obj(); }
|
||||||
operator markOop () const { return markOop(obj()); }
|
operator markOop () const { return markOop(obj()); }
|
||||||
|
|
||||||
operator address () const { return (address)obj(); }
|
operator address () const { return (address)obj(); }
|
||||||
|
|
||||||
// from javaCalls.cpp
|
// from javaCalls.cpp
|
||||||
|
@ -161,11 +158,10 @@ public:
|
||||||
oop::operator=(o); \
|
oop::operator=(o); \
|
||||||
return *this; \
|
return *this; \
|
||||||
} \
|
} \
|
||||||
NOT_SOLARIS( \
|
|
||||||
volatile type##Oop& operator=(const type##Oop& o) volatile { \
|
volatile type##Oop& operator=(const type##Oop& o) volatile { \
|
||||||
(void)const_cast<oop&>(oop::operator=(o)); \
|
(void)const_cast<oop&>(oop::operator=(o)); \
|
||||||
return *this; \
|
return *this; \
|
||||||
}) \
|
} \
|
||||||
volatile type##Oop& operator=(const volatile type##Oop& o) volatile {\
|
volatile type##Oop& operator=(const volatile type##Oop& o) volatile {\
|
||||||
(void)const_cast<oop&>(oop::operator=(o)); \
|
(void)const_cast<oop&>(oop::operator=(o)); \
|
||||||
return *this; \
|
return *this; \
|
||||||
|
|
|
@ -280,10 +280,10 @@ void mutex_init() {
|
||||||
|
|
||||||
#ifdef INCLUDE_TRACE
|
#ifdef INCLUDE_TRACE
|
||||||
def(JfrMsg_lock , Monitor, leaf, true);
|
def(JfrMsg_lock , Monitor, leaf, true);
|
||||||
def(JfrBuffer_lock , Mutex, nonleaf+1, true);
|
def(JfrBuffer_lock , Mutex, leaf, true);
|
||||||
def(JfrThreadGroups_lock , Mutex, nonleaf+1, true);
|
def(JfrThreadGroups_lock , Mutex, leaf, true);
|
||||||
def(JfrStream_lock , Mutex, nonleaf+2, true);
|
def(JfrStream_lock , Mutex, nonleaf, true);
|
||||||
def(JfrStacktrace_lock , Mutex, special, true );
|
def(JfrStacktrace_lock , Mutex, special, true);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -385,6 +385,15 @@ void ATTR ObjectMonitor::enter(TRAPS) {
|
||||||
jt->java_suspend_self();
|
jt->java_suspend_self();
|
||||||
}
|
}
|
||||||
Self->set_current_pending_monitor(NULL);
|
Self->set_current_pending_monitor(NULL);
|
||||||
|
|
||||||
|
// We cleared the pending monitor info since we've just gotten past
|
||||||
|
// the enter-check-for-suspend dance and we now own the monitor free
|
||||||
|
// and clear, i.e., it is no longer pending. The ThreadBlockInVM
|
||||||
|
// destructor can go to a safepoint at the end of this block. If we
|
||||||
|
// do a thread dump during that safepoint, then this thread will show
|
||||||
|
// as having "-locked" the monitor, but the OS and java.lang.Thread
|
||||||
|
// states will still report that the thread is blocked trying to
|
||||||
|
// acquire it.
|
||||||
}
|
}
|
||||||
|
|
||||||
Atomic::dec_ptr(&_count);
|
Atomic::dec_ptr(&_count);
|
||||||
|
|
|
@ -1434,7 +1434,7 @@ void JavaThread::initialize() {
|
||||||
_in_deopt_handler = 0;
|
_in_deopt_handler = 0;
|
||||||
_doing_unsafe_access = false;
|
_doing_unsafe_access = false;
|
||||||
_stack_guard_state = stack_guard_unused;
|
_stack_guard_state = stack_guard_unused;
|
||||||
(void)const_cast<oop&>(_exception_oop = NULL);
|
(void)const_cast<oop&>(_exception_oop = oop(NULL));
|
||||||
_exception_pc = 0;
|
_exception_pc = 0;
|
||||||
_exception_handler_pc = 0;
|
_exception_handler_pc = 0;
|
||||||
_is_method_handle_return = 0;
|
_is_method_handle_return = 0;
|
||||||
|
@ -3543,6 +3543,8 @@ jint Threads::create_vm(JavaVMInitArgs* args, bool* canTryAgain) {
|
||||||
// debug stuff, that does not work until all basic classes have been initialized.
|
// debug stuff, that does not work until all basic classes have been initialized.
|
||||||
set_init_completed();
|
set_init_completed();
|
||||||
|
|
||||||
|
Metaspace::post_initialize();
|
||||||
|
|
||||||
HOTSPOT_VM_INIT_END();
|
HOTSPOT_VM_INIT_END();
|
||||||
|
|
||||||
// record VM initialization completion time
|
// record VM initialization completion time
|
||||||
|
|
|
@ -199,6 +199,7 @@ void javaVFrame::print_lock_info_on(outputStream* st, int frame_count) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (monitor->owner() != NULL) {
|
if (monitor->owner() != NULL) {
|
||||||
|
// the monitor is associated with an object, i.e., it is locked
|
||||||
|
|
||||||
// First, assume we have the monitor locked. If we haven't found an
|
// First, assume we have the monitor locked. If we haven't found an
|
||||||
// owned monitor before and this is the first frame, then we need to
|
// owned monitor before and this is the first frame, then we need to
|
||||||
|
@ -209,7 +210,11 @@ void javaVFrame::print_lock_info_on(outputStream* st, int frame_count) {
|
||||||
if (!found_first_monitor && frame_count == 0) {
|
if (!found_first_monitor && frame_count == 0) {
|
||||||
markOop mark = monitor->owner()->mark();
|
markOop mark = monitor->owner()->mark();
|
||||||
if (mark->has_monitor() &&
|
if (mark->has_monitor() &&
|
||||||
mark->monitor() == thread()->current_pending_monitor()) {
|
( // we have marked ourself as pending on this monitor
|
||||||
|
mark->monitor() == thread()->current_pending_monitor() ||
|
||||||
|
// we are not the owner of this monitor
|
||||||
|
!mark->monitor()->is_entered(thread())
|
||||||
|
)) {
|
||||||
lock_state = "waiting to lock";
|
lock_state = "waiting to lock";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -162,10 +162,7 @@ static jint jcmd(AttachOperation* op, outputStream* out) {
|
||||||
java_lang_Throwable::print(PENDING_EXCEPTION, out);
|
java_lang_Throwable::print(PENDING_EXCEPTION, out);
|
||||||
out->cr();
|
out->cr();
|
||||||
CLEAR_PENDING_EXCEPTION;
|
CLEAR_PENDING_EXCEPTION;
|
||||||
// The exception has been printed on the output stream
|
return JNI_ERR;
|
||||||
// If the JVM returns JNI_ERR, the attachAPI throws a generic I/O
|
|
||||||
// exception and the content of the output stream is not processed.
|
|
||||||
// By returning JNI_OK, the exception will be displayed on the client side
|
|
||||||
}
|
}
|
||||||
return JNI_OK;
|
return JNI_OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
@ -39,7 +39,7 @@
|
||||||
|
|
||||||
MemoryManager::MemoryManager() {
|
MemoryManager::MemoryManager() {
|
||||||
_num_pools = 0;
|
_num_pools = 0;
|
||||||
(void)const_cast<instanceOop&>(_memory_mgr_obj = NULL);
|
(void)const_cast<instanceOop&>(_memory_mgr_obj = instanceOop(NULL));
|
||||||
}
|
}
|
||||||
|
|
||||||
void MemoryManager::add_pool(MemoryPool* pool) {
|
void MemoryManager::add_pool(MemoryPool* pool) {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
@ -46,7 +46,7 @@ MemoryPool::MemoryPool(const char* name,
|
||||||
_name = name;
|
_name = name;
|
||||||
_initial_size = init_size;
|
_initial_size = init_size;
|
||||||
_max_size = max_size;
|
_max_size = max_size;
|
||||||
(void)const_cast<instanceOop&>(_memory_pool_obj = NULL);
|
(void)const_cast<instanceOop&>(_memory_pool_obj = instanceOop(NULL));
|
||||||
_available_for_allocation = true;
|
_available_for_allocation = true;
|
||||||
_num_managers = 0;
|
_num_managers = 0;
|
||||||
_type = type;
|
_type = type;
|
||||||
|
|
|
@ -263,13 +263,11 @@ void report_untested(const char* file, int line, const char* message) {
|
||||||
|
|
||||||
void report_out_of_shared_space(SharedSpaceType shared_space) {
|
void report_out_of_shared_space(SharedSpaceType shared_space) {
|
||||||
static const char* name[] = {
|
static const char* name[] = {
|
||||||
"native memory for metadata",
|
|
||||||
"shared read only space",
|
"shared read only space",
|
||||||
"shared read write space",
|
"shared read write space",
|
||||||
"shared miscellaneous data space"
|
"shared miscellaneous data space"
|
||||||
};
|
};
|
||||||
static const char* flag[] = {
|
static const char* flag[] = {
|
||||||
"Metaspace",
|
|
||||||
"SharedReadOnlySize",
|
"SharedReadOnlySize",
|
||||||
"SharedReadWriteSize",
|
"SharedReadWriteSize",
|
||||||
"SharedMiscDataSize"
|
"SharedMiscDataSize"
|
||||||
|
|
|
@ -81,6 +81,7 @@ needs_jdk = \
|
||||||
runtime/NMT/ThreadedVirtualAllocTestType.java \
|
runtime/NMT/ThreadedVirtualAllocTestType.java \
|
||||||
runtime/NMT/VirtualAllocTestType.java \
|
runtime/NMT/VirtualAllocTestType.java \
|
||||||
runtime/RedefineObject/TestRedefineObject.java \
|
runtime/RedefineObject/TestRedefineObject.java \
|
||||||
|
runtime/Thread/TestThreadDumpMonitorContention.java \
|
||||||
runtime/XCheckJniJsig/XCheckJSig.java \
|
runtime/XCheckJniJsig/XCheckJSig.java \
|
||||||
serviceability/attach/AttachWithStalePidFile.java \
|
serviceability/attach/AttachWithStalePidFile.java \
|
||||||
serviceability/jvmti/8036666/GetObjectLockCount.java \
|
serviceability/jvmti/8036666/GetObjectLockCount.java \
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
* @ignore 8027915
|
||||||
* @test TestParallelHeapSizeFlags
|
* @test TestParallelHeapSizeFlags
|
||||||
* @key gc
|
* @key gc
|
||||||
* @bug 8006088
|
* @bug 8006088
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
* @ignore 8025645
|
||||||
* @test TestUseCompressedOopsErgo
|
* @test TestUseCompressedOopsErgo
|
||||||
* @key gc
|
* @key gc
|
||||||
* @bug 8010722
|
* @bug 8010722
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @ignore 8041506, 8041946, 8042051
|
||||||
* @test TestHumongousShrinkHeap
|
* @test TestHumongousShrinkHeap
|
||||||
* @bug 8036025
|
* @bug 8036025
|
||||||
* @summary Verify that heap shrinks after GC in the presence of fragmentation due to humongous objects
|
* @summary Verify that heap shrinks after GC in the presence of fragmentation due to humongous objects
|
||||||
|
|
|
@ -294,55 +294,6 @@ class TestStringDeduplicationTools {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class MemoryUsageTest {
|
|
||||||
public static void main(String[] args) {
|
|
||||||
System.out.println("Begin: MemoryUsageTest");
|
|
||||||
|
|
||||||
final boolean useStringDeduplication = Boolean.parseBoolean(args[0]);
|
|
||||||
final int numberOfStrings = LargeNumberOfStrings;
|
|
||||||
final int numberOfUniqueStrings = 1;
|
|
||||||
|
|
||||||
ArrayList<String> list = createStrings(numberOfStrings, numberOfUniqueStrings);
|
|
||||||
forceDeduplication(DefaultAgeThreshold, FullGC);
|
|
||||||
|
|
||||||
if (useStringDeduplication) {
|
|
||||||
verifyStrings(list, numberOfUniqueStrings);
|
|
||||||
}
|
|
||||||
|
|
||||||
System.gc();
|
|
||||||
|
|
||||||
System.out.println("Heap Memory Usage: " + ManagementFactory.getMemoryMXBean().getHeapMemoryUsage().getUsed());
|
|
||||||
System.out.println("Array Header Size: " + unsafe.ARRAY_CHAR_BASE_OFFSET);
|
|
||||||
|
|
||||||
System.out.println("End: MemoryUsageTest");
|
|
||||||
}
|
|
||||||
|
|
||||||
public static OutputAnalyzer run(boolean useStringDeduplication) throws Exception {
|
|
||||||
String[] extraArgs = new String[0];
|
|
||||||
|
|
||||||
if (useStringDeduplication) {
|
|
||||||
extraArgs = new String[] {
|
|
||||||
"-XX:+UseStringDeduplication",
|
|
||||||
"-XX:+PrintStringDeduplicationStatistics",
|
|
||||||
"-XX:StringDeduplicationAgeThreshold=" + DefaultAgeThreshold
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
String[] defaultArgs = new String[] {
|
|
||||||
"-XX:+PrintGC",
|
|
||||||
"-XX:+PrintGCDetails",
|
|
||||||
MemoryUsageTest.class.getName(),
|
|
||||||
"" + useStringDeduplication
|
|
||||||
};
|
|
||||||
|
|
||||||
ArrayList<String> args = new ArrayList<String>();
|
|
||||||
args.addAll(Arrays.asList(extraArgs));
|
|
||||||
args.addAll(Arrays.asList(defaultArgs));
|
|
||||||
|
|
||||||
return runTest(args.toArray(new String[args.size()]));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Tests
|
* Tests
|
||||||
*/
|
*/
|
||||||
|
@ -480,44 +431,4 @@ class TestStringDeduplicationTools {
|
||||||
OutputAnalyzer output = InternedTest.run();
|
OutputAnalyzer output = InternedTest.run();
|
||||||
output.shouldHaveExitValue(0);
|
output.shouldHaveExitValue(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void testMemoryUsage() throws Exception {
|
|
||||||
// Test that memory usage is reduced after deduplication
|
|
||||||
OutputAnalyzer output;
|
|
||||||
final String heapMemoryUsagePattern = "Heap Memory Usage: (\\d+)";
|
|
||||||
final String arrayHeaderSizePattern = "Array Header Size: (\\d+)";
|
|
||||||
|
|
||||||
// Run without deduplication
|
|
||||||
output = MemoryUsageTest.run(false);
|
|
||||||
output.shouldHaveExitValue(0);
|
|
||||||
final long heapMemoryUsageWithoutDedup = Long.parseLong(output.firstMatch(heapMemoryUsagePattern, 1));
|
|
||||||
final long arrayHeaderSizeWithoutDedup = Long.parseLong(output.firstMatch(arrayHeaderSizePattern, 1));
|
|
||||||
|
|
||||||
// Run with deduplication
|
|
||||||
output = MemoryUsageTest.run(true);
|
|
||||||
output.shouldHaveExitValue(0);
|
|
||||||
final long heapMemoryUsageWithDedup = Long.parseLong(output.firstMatch(heapMemoryUsagePattern, 1));
|
|
||||||
final long arrayHeaderSizeWithDedup = Long.parseLong(output.firstMatch(arrayHeaderSizePattern, 1));
|
|
||||||
|
|
||||||
// Sanity check to make sure one instance isn't using compressed class pointers and the other not
|
|
||||||
if (arrayHeaderSizeWithoutDedup != arrayHeaderSizeWithDedup) {
|
|
||||||
throw new Exception("Unexpected difference between array header sizes");
|
|
||||||
}
|
|
||||||
|
|
||||||
// Calculate expected memory usage with deduplication enabled. This calculation does
|
|
||||||
// not take alignment and padding into account, so it's a conservative estimate.
|
|
||||||
final long sizeOfChar = unsafe.ARRAY_CHAR_INDEX_SCALE;
|
|
||||||
final long sizeOfCharArray = StringLength * sizeOfChar + arrayHeaderSizeWithoutDedup;
|
|
||||||
final long bytesSaved = (LargeNumberOfStrings - 1) * sizeOfCharArray;
|
|
||||||
final long heapMemoryUsageWithDedupExpected = heapMemoryUsageWithoutDedup - bytesSaved;
|
|
||||||
|
|
||||||
System.out.println("Memory usage summary:");
|
|
||||||
System.out.println(" heapMemoryUsageWithoutDedup: " + heapMemoryUsageWithoutDedup);
|
|
||||||
System.out.println(" heapMemoryUsageWithDedup: " + heapMemoryUsageWithDedup);
|
|
||||||
System.out.println(" heapMemoryUsageWithDedupExpected: " + heapMemoryUsageWithDedupExpected);
|
|
||||||
|
|
||||||
if (heapMemoryUsageWithDedup > heapMemoryUsageWithDedupExpected) {
|
|
||||||
throw new Exception("Unexpected memory usage, heapMemoryUsageWithDedup should be less or equal to heapMemoryUsageWithDedupExpected");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
@ -21,16 +21,28 @@
|
||||||
* questions.
|
* questions.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
import java.util.ArrayList;
|
||||||
* @test TestStringDeduplicationMemoryUsage
|
|
||||||
* @summary Test string deduplication memory usage
|
|
||||||
* @bug 8029075
|
|
||||||
* @key gc
|
|
||||||
* @library /testlibrary
|
|
||||||
*/
|
|
||||||
|
|
||||||
public class TestStringDeduplicationMemoryUsage {
|
/* @test TestMetaspaceInitialization
|
||||||
public static void main(String[] args) throws Exception {
|
* @bug 8042933
|
||||||
TestStringDeduplicationTools.testMemoryUsage();
|
* @summary Tests to initialize metaspace with a very low MetaspaceSize
|
||||||
|
* @library /testlibrary
|
||||||
|
* @run main/othervm -XX:MetaspaceSize=2m TestMetaspaceInitialization
|
||||||
|
*/
|
||||||
|
public class TestMetaspaceInitialization {
|
||||||
|
private class Internal {
|
||||||
|
public int x;
|
||||||
|
public Internal(int x) {
|
||||||
|
this.x = x;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void test() {
|
||||||
|
ArrayList<Internal> l = new ArrayList<>();
|
||||||
|
l.add(new Internal(17));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
new TestMetaspaceInitialization().test();
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -22,6 +22,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @ignore 8042051
|
||||||
* @test TestDynShrinkHeap
|
* @test TestDynShrinkHeap
|
||||||
* @bug 8016479
|
* @bug 8016479
|
||||||
* @summary Verify that the heap shrinks after full GC according to the current values of the Min/MaxHeapFreeRatio flags
|
* @summary Verify that the heap shrinks after full GC according to the current values of the Min/MaxHeapFreeRatio flags
|
||||||
|
|
|
@ -35,14 +35,14 @@ import com.oracle.java.testlibrary.*;
|
||||||
public class TestHexArguments {
|
public class TestHexArguments {
|
||||||
public static void main(String args[]) throws Exception {
|
public static void main(String args[]) throws Exception {
|
||||||
String[] javaArgs = {"-XX:SharedBaseAddress=0x1D000000", "-version"};
|
String[] javaArgs = {"-XX:SharedBaseAddress=0x1D000000", "-version"};
|
||||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(true, javaArgs);
|
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(javaArgs);
|
||||||
|
|
||||||
OutputAnalyzer output = new OutputAnalyzer(pb.start());
|
OutputAnalyzer output = new OutputAnalyzer(pb.start());
|
||||||
output.shouldNotContain("Could not create the Java Virtual Machine");
|
output.shouldNotContain("Could not create the Java Virtual Machine");
|
||||||
output.shouldHaveExitValue(0);
|
output.shouldHaveExitValue(0);
|
||||||
|
|
||||||
String[] javaArgs1 = {"-XX:SharedBaseAddress=1D000000", "-version"};
|
String[] javaArgs1 = {"-XX:SharedBaseAddress=1D000000", "-version"};
|
||||||
pb = ProcessTools.createJavaProcessBuilder(true, javaArgs1);
|
pb = ProcessTools.createJavaProcessBuilder(javaArgs1);
|
||||||
output = new OutputAnalyzer(pb.start());
|
output = new OutputAnalyzer(pb.start());
|
||||||
output.shouldContain("Could not create the Java Virtual Machine");
|
output.shouldContain("Could not create the Java Virtual Machine");
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,64 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @test
|
||||||
|
* @bug 6904403
|
||||||
|
* @summary Don't assert if we redefine finalize method
|
||||||
|
* @library /testlibrary
|
||||||
|
* @build RedefineClassHelper
|
||||||
|
* @run main RedefineClassHelper
|
||||||
|
* @run main/othervm -javaagent:redefineagent.jar RedefineFinalizer
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Regression test for hitting:
|
||||||
|
*
|
||||||
|
* assert(f == k->has_finalizer()) failed: inconsistent has_finalizer
|
||||||
|
*
|
||||||
|
* when redefining finalizer method
|
||||||
|
*/
|
||||||
|
public class RedefineFinalizer {
|
||||||
|
|
||||||
|
public static String newB =
|
||||||
|
"class RedefineFinalizer$B {" +
|
||||||
|
" protected void finalize() { " +
|
||||||
|
" System.out.println(\"Finalizer called\");" +
|
||||||
|
" }" +
|
||||||
|
"}";
|
||||||
|
|
||||||
|
public static void main(String[] args) throws Exception {
|
||||||
|
RedefineClassHelper.redefineClass(B.class, newB);
|
||||||
|
|
||||||
|
A a = new A();
|
||||||
|
}
|
||||||
|
|
||||||
|
static class A extends B {
|
||||||
|
}
|
||||||
|
|
||||||
|
static class B {
|
||||||
|
protected void finalize() {
|
||||||
|
// should be empty
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
93
hotspot/test/runtime/SharedArchiveFile/LimitSharedSizes.java
Normal file
93
hotspot/test/runtime/SharedArchiveFile/LimitSharedSizes.java
Normal file
|
@ -0,0 +1,93 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* @ignore JDK-8043896
|
||||||
|
* @test LimitSharedSizes
|
||||||
|
* @summary Test handling of limits on shared space size
|
||||||
|
* @library /testlibrary
|
||||||
|
* @run main LimitSharedSizes
|
||||||
|
*/
|
||||||
|
|
||||||
|
import com.oracle.java.testlibrary.*;
|
||||||
|
|
||||||
|
public class LimitSharedSizes {
|
||||||
|
private static class SharedSizeTestData {
|
||||||
|
public String optionName;
|
||||||
|
public String optionValue;
|
||||||
|
public String expectedErrorMsg;
|
||||||
|
|
||||||
|
public SharedSizeTestData(String name, String value, String msg) {
|
||||||
|
optionName = name;
|
||||||
|
optionValue = value;
|
||||||
|
expectedErrorMsg = msg;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final SharedSizeTestData[] testTable = {
|
||||||
|
// values in this part of the test table should cause failure
|
||||||
|
// (shared space sizes are deliberately too small)
|
||||||
|
new SharedSizeTestData("-XX:SharedReadOnlySize", "4M", "read only"),
|
||||||
|
new SharedSizeTestData("-XX:SharedReadWriteSize","4M", "read write"),
|
||||||
|
|
||||||
|
// Known issue, JDK-8038422 (assert() on Windows)
|
||||||
|
// new SharedSizeTestData("-XX:SharedMiscDataSize", "500k", "miscellaneous data"),
|
||||||
|
|
||||||
|
// This will cause a VM crash; commenting out for now; see bug JDK-8038268
|
||||||
|
// @ignore JDK-8038268
|
||||||
|
// new SharedSizeTestData("-XX:SharedMiscCodeSize", "20k", "miscellaneous code"),
|
||||||
|
|
||||||
|
// these values are larger than default ones, but should
|
||||||
|
// be acceptable and not cause failure
|
||||||
|
new SharedSizeTestData("-XX:SharedReadOnlySize", "20M", null),
|
||||||
|
new SharedSizeTestData("-XX:SharedReadWriteSize", "20M", null),
|
||||||
|
new SharedSizeTestData("-XX:SharedMiscDataSize", "20M", null),
|
||||||
|
new SharedSizeTestData("-XX:SharedMiscCodeSize", "20M", null)
|
||||||
|
};
|
||||||
|
|
||||||
|
public static void main(String[] args) throws Exception {
|
||||||
|
String fileName = "test.jsa";
|
||||||
|
|
||||||
|
for (SharedSizeTestData td : testTable) {
|
||||||
|
String option = td.optionName + "=" + td.optionValue;
|
||||||
|
System.out.println("testing option <" + option + ">");
|
||||||
|
|
||||||
|
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
|
||||||
|
"-XX:+UnlockDiagnosticVMOptions",
|
||||||
|
"-XX:SharedArchiveFile=./" + fileName,
|
||||||
|
option,
|
||||||
|
"-Xshare:dump");
|
||||||
|
|
||||||
|
OutputAnalyzer output = new OutputAnalyzer(pb.start());
|
||||||
|
|
||||||
|
if (td.expectedErrorMsg != null) {
|
||||||
|
output.shouldContain("The shared " + td.expectedErrorMsg
|
||||||
|
+ " space is not large enough");
|
||||||
|
|
||||||
|
output.shouldHaveExitValue(2);
|
||||||
|
} else {
|
||||||
|
output.shouldNotContain("space is not large enough");
|
||||||
|
output.shouldHaveExitValue(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,77 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @test SharedBaseAddress
|
||||||
|
* @summary Test variety of values for SharedBaseAddress, making sure
|
||||||
|
* VM handles normal values as well as edge values w/o a crash.
|
||||||
|
* @library /testlibrary
|
||||||
|
* @run main SharedBaseAddress
|
||||||
|
*/
|
||||||
|
|
||||||
|
import com.oracle.java.testlibrary.*;
|
||||||
|
|
||||||
|
public class SharedBaseAddress {
|
||||||
|
|
||||||
|
// shared base address test table
|
||||||
|
private static final String[] testTable = {
|
||||||
|
"1g", "8g", "64g","512g", "4t",
|
||||||
|
"32t", "128t", "0",
|
||||||
|
"1", "64k", "64M"
|
||||||
|
};
|
||||||
|
|
||||||
|
public static void main(String[] args) throws Exception {
|
||||||
|
// Known issue on Solaris-Sparc
|
||||||
|
// @ignore JDK-8044600
|
||||||
|
if (Platform.isSolaris() && Platform.isSparc())
|
||||||
|
return;
|
||||||
|
|
||||||
|
for (String testEntry : testTable) {
|
||||||
|
System.out.println("sharedBaseAddress = " + testEntry);
|
||||||
|
|
||||||
|
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
|
||||||
|
"-XX:+UnlockDiagnosticVMOptions",
|
||||||
|
"-XX:SharedArchiveFile=test.jsa",
|
||||||
|
"-XX:SharedBaseAddress=" + testEntry,
|
||||||
|
"-Xshare:dump");
|
||||||
|
|
||||||
|
OutputAnalyzer output = new OutputAnalyzer(pb.start());
|
||||||
|
|
||||||
|
output.shouldContain("Loading classes to share");
|
||||||
|
|
||||||
|
try {
|
||||||
|
pb = ProcessTools.createJavaProcessBuilder(
|
||||||
|
"-XX:+UnlockDiagnosticVMOptions",
|
||||||
|
"-XX:SharedArchiveFile=test.jsa",
|
||||||
|
"-Xshare:on",
|
||||||
|
"-version");
|
||||||
|
output = new OutputAnalyzer(pb.start());
|
||||||
|
output.shouldContain("sharing");
|
||||||
|
output.shouldHaveExitValue(0);
|
||||||
|
} catch (RuntimeException e) {
|
||||||
|
output.shouldContain("Unable to use shared archive");
|
||||||
|
output.shouldHaveExitValue(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,96 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @test SpaceUtilizationCheck
|
||||||
|
* @summary Check if the space utilization for shared spaces is adequate
|
||||||
|
* @library /testlibrary
|
||||||
|
* @run main SpaceUtilizationCheck
|
||||||
|
*/
|
||||||
|
|
||||||
|
import com.oracle.java.testlibrary.*;
|
||||||
|
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
import java.util.regex.Matcher;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.lang.Integer;
|
||||||
|
|
||||||
|
public class SpaceUtilizationCheck {
|
||||||
|
// Minimum allowed utilization value (percent)
|
||||||
|
// The goal is to have this number to be 50% for RO and RW regions
|
||||||
|
// Once that feature is implemented, increase the MIN_UTILIZATION to 50
|
||||||
|
private static final int MIN_UTILIZATION = 30;
|
||||||
|
|
||||||
|
// Only RO and RW regions are considered for this check, since they
|
||||||
|
// currently account for the bulk of the shared space
|
||||||
|
private static final int NUMBER_OF_CHECKED_SHARED_REGIONS = 2;
|
||||||
|
|
||||||
|
public static void main(String[] args) throws Exception {
|
||||||
|
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
|
||||||
|
"-XX:+UnlockDiagnosticVMOptions",
|
||||||
|
"-XX:SharedArchiveFile=./test.jsa",
|
||||||
|
"-Xshare:dump");
|
||||||
|
|
||||||
|
OutputAnalyzer output = new OutputAnalyzer(pb.start());
|
||||||
|
String stdout = output.getStdout();
|
||||||
|
ArrayList<String> utilization = findUtilization(stdout);
|
||||||
|
|
||||||
|
if (utilization.size() != NUMBER_OF_CHECKED_SHARED_REGIONS )
|
||||||
|
throw new RuntimeException("The output format of sharing summary has changed");
|
||||||
|
|
||||||
|
for(String str : utilization) {
|
||||||
|
int value = Integer.parseInt(str);
|
||||||
|
if (value < MIN_UTILIZATION) {
|
||||||
|
System.out.println(stdout);
|
||||||
|
throw new RuntimeException("Utilization for one of the regions" +
|
||||||
|
"is below a threshold of " + MIN_UTILIZATION + "%");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ArrayList<String> findUtilization(String input) {
|
||||||
|
ArrayList<String> regions = filterRegionsOfInterest(input.split("\n"));
|
||||||
|
return filterByPattern(filterByPattern(regions, "bytes \\[.*% used\\]"), "\\d+");
|
||||||
|
}
|
||||||
|
|
||||||
|
private static ArrayList<String> filterByPattern(Iterable<String> input, String pattern) {
|
||||||
|
ArrayList<String> result = new ArrayList<String>();
|
||||||
|
for (String str : input) {
|
||||||
|
Matcher matcher = Pattern.compile(pattern).matcher(str);
|
||||||
|
if (matcher.find()) {
|
||||||
|
result.add(matcher.group());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static ArrayList<String> filterRegionsOfInterest(String[] inputLines) {
|
||||||
|
ArrayList<String> result = new ArrayList<String>();
|
||||||
|
for (String str : inputLines) {
|
||||||
|
if (str.contains("ro space:") || str.contains("rw space:")) {
|
||||||
|
result.add(str);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
405
hotspot/test/runtime/Thread/TestThreadDumpMonitorContention.java
Normal file
405
hotspot/test/runtime/Thread/TestThreadDumpMonitorContention.java
Normal file
|
@ -0,0 +1,405 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @test
|
||||||
|
* @bug 8036823
|
||||||
|
* @summary Creates two threads contending for the same lock and checks
|
||||||
|
* whether jstack reports "locked" by more than one thread.
|
||||||
|
*
|
||||||
|
* @library /testlibrary
|
||||||
|
* @run main/othervm TestThreadDumpMonitorContention
|
||||||
|
*/
|
||||||
|
|
||||||
|
import java.io.BufferedReader;
|
||||||
|
import java.io.InputStreamReader;
|
||||||
|
import java.lang.management.ManagementFactory;
|
||||||
|
import java.lang.management.RuntimeMXBean;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.regex.Matcher;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
import com.oracle.java.testlibrary.*;
|
||||||
|
|
||||||
|
public class TestThreadDumpMonitorContention {
|
||||||
|
// jstack tends to be closely bound to the VM that we are running
|
||||||
|
// so use getTestJDKTool() instead of getCompileJDKTool() or even
|
||||||
|
// getJDKTool() which can fall back to "compile.jdk".
|
||||||
|
final static String JSTACK = JDKToolFinder.getTestJDKTool("jstack");
|
||||||
|
final static String PID = getPid();
|
||||||
|
|
||||||
|
// looking for header lines with these patterns:
|
||||||
|
// "ContendingThread-1" #19 prio=5 os_prio=64 tid=0x000000000079c000 nid=0x23 runnable [0xffff80ffb8b87000]
|
||||||
|
// "ContendingThread-2" #21 prio=5 os_prio=64 tid=0x0000000000780000 nid=0x2f waiting for monitor entry [0xfffffd7fc1111000]
|
||||||
|
final static Pattern HEADER_PREFIX_PATTERN = Pattern.compile(
|
||||||
|
"^\"ContendingThread-.*");
|
||||||
|
final static Pattern HEADER_WAITING_PATTERN = Pattern.compile(
|
||||||
|
"^\"ContendingThread-.* waiting for monitor entry .*");
|
||||||
|
final static Pattern HEADER_RUNNABLE_PATTERN = Pattern.compile(
|
||||||
|
"^\"ContendingThread-.* runnable .*");
|
||||||
|
|
||||||
|
// looking for thread state lines with these patterns:
|
||||||
|
// java.lang.Thread.State: RUNNABLE
|
||||||
|
// java.lang.Thread.State: BLOCKED (on object monitor)
|
||||||
|
final static Pattern THREAD_STATE_PREFIX_PATTERN = Pattern.compile(
|
||||||
|
" *java\\.lang\\.Thread\\.State: .*");
|
||||||
|
final static Pattern THREAD_STATE_BLOCKED_PATTERN = Pattern.compile(
|
||||||
|
" *java\\.lang\\.Thread\\.State: BLOCKED \\(on object monitor\\)");
|
||||||
|
final static Pattern THREAD_STATE_RUNNABLE_PATTERN = Pattern.compile(
|
||||||
|
" *java\\.lang\\.Thread\\.State: RUNNABLE");
|
||||||
|
|
||||||
|
// looking for duplicates of this pattern:
|
||||||
|
// - locked <0x000000076ac59e20> (a TestThreadDumpMonitorContention$1)
|
||||||
|
final static Pattern LOCK_PATTERN = Pattern.compile(
|
||||||
|
".* locked \\<.*\\(a TestThreadDumpMonitorContention.*");
|
||||||
|
|
||||||
|
// sanity checking header and thread state lines associated
|
||||||
|
// with this pattern:
|
||||||
|
// - waiting to lock <0x000000076ac59e20> (a TestThreadDumpMonitorContention$1)
|
||||||
|
final static Pattern WAITING_PATTERN = Pattern.compile(
|
||||||
|
".* waiting to lock \\<.*\\(a TestThreadDumpMonitorContention.*");
|
||||||
|
|
||||||
|
volatile static boolean done = false;
|
||||||
|
|
||||||
|
static int error_cnt = 0;
|
||||||
|
static String header_line = null;
|
||||||
|
static boolean have_header_line = false;
|
||||||
|
static boolean have_thread_state_line = false;
|
||||||
|
static int match_cnt = 0;
|
||||||
|
static String[] match_list = new String[2];
|
||||||
|
static int n_samples = 15;
|
||||||
|
static String thread_state_line = null;
|
||||||
|
static boolean verbose = false;
|
||||||
|
|
||||||
|
public static void main(String[] args) throws Exception {
|
||||||
|
if (args.length != 0) {
|
||||||
|
int arg_i = 0;
|
||||||
|
if (args[arg_i].equals("-v")) {
|
||||||
|
verbose = true;
|
||||||
|
arg_i++;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
n_samples = Integer.parseInt(args[arg_i]);
|
||||||
|
} catch (NumberFormatException nfe) {
|
||||||
|
System.err.println(nfe);
|
||||||
|
usage();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Runnable runnable = new Runnable() {
|
||||||
|
public void run() {
|
||||||
|
while (!done) {
|
||||||
|
synchronized (this) { }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
Thread[] thread_list = new Thread[2];
|
||||||
|
thread_list[0] = new Thread(runnable, "ContendingThread-1");
|
||||||
|
thread_list[1] = new Thread(runnable, "ContendingThread-2");
|
||||||
|
thread_list[0].start();
|
||||||
|
thread_list[1].start();
|
||||||
|
|
||||||
|
doSamples();
|
||||||
|
|
||||||
|
done = true;
|
||||||
|
|
||||||
|
thread_list[0].join();
|
||||||
|
thread_list[1].join();
|
||||||
|
|
||||||
|
if (error_cnt == 0) {
|
||||||
|
System.out.println("Test PASSED.");
|
||||||
|
} else {
|
||||||
|
System.out.println("Test FAILED.");
|
||||||
|
throw new AssertionError("error_cnt=" + error_cnt);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Reached a blank line which is the end of the
|
||||||
|
// stack trace without matching either LOCK_PATTERN
|
||||||
|
// or WAITING_PATTERN. Rare, but it's not an error.
|
||||||
|
//
|
||||||
|
// Example:
|
||||||
|
// "ContendingThread-1" #21 prio=5 os_prio=64 tid=0x00000000007b9000 nid=0x2f runnable [0xfffffd7fc1111000]
|
||||||
|
// java.lang.Thread.State: RUNNABLE
|
||||||
|
// at TestThreadDumpMonitorContention$1.run(TestThreadDumpMonitorContention.java:67)
|
||||||
|
// at java.lang.Thread.run(Thread.java:745)
|
||||||
|
//
|
||||||
|
static boolean checkBlankLine(String line) {
|
||||||
|
if (line.length() == 0) {
|
||||||
|
have_header_line = false;
|
||||||
|
have_thread_state_line = false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Process the locked line here if we found one.
|
||||||
|
//
|
||||||
|
// Example 1:
|
||||||
|
// "ContendingThread-1" #21 prio=5 os_prio=64 tid=0x00000000007b9000 nid=0x2f runnable [0xfffffd7fc1111000]
|
||||||
|
// java.lang.Thread.State: RUNNABLE
|
||||||
|
// at TestThreadDumpMonitorContention$1.run(TestThreadDumpMonitorContention.java:67)
|
||||||
|
// - locked <0xfffffd7e6a2912f8> (a TestThreadDumpMonitorContention$1)
|
||||||
|
// at java.lang.Thread.run(Thread.java:745)
|
||||||
|
//
|
||||||
|
// Example 2:
|
||||||
|
// "ContendingThread-1" #21 prio=5 os_prio=64 tid=0x00000000007b9000 nid=0x2f waiting for monitor entry [0xfffffd7fc1111000]
|
||||||
|
// java.lang.Thread.State: BLOCKED (on object monitor)
|
||||||
|
// at TestThreadDumpMonitorContention$1.run(TestThreadDumpMonitorContention.java:67)
|
||||||
|
// - locked <0xfffffd7e6a2912f8> (a TestThreadDumpMonitorContention$1)
|
||||||
|
// at java.lang.Thread.run(Thread.java:745)
|
||||||
|
//
|
||||||
|
static boolean checkLockedLine(String line) {
|
||||||
|
Matcher matcher = LOCK_PATTERN.matcher(line);
|
||||||
|
if (matcher.matches()) {
|
||||||
|
if (verbose) {
|
||||||
|
System.out.println("locked_line='" + line + "'");
|
||||||
|
}
|
||||||
|
match_list[match_cnt] = new String(line);
|
||||||
|
match_cnt++;
|
||||||
|
|
||||||
|
matcher = HEADER_RUNNABLE_PATTERN.matcher(header_line);
|
||||||
|
if (!matcher.matches()) {
|
||||||
|
// It's strange, but a locked line can also
|
||||||
|
// match the HEADER_WAITING_PATTERN.
|
||||||
|
matcher = HEADER_WAITING_PATTERN.matcher(header_line);
|
||||||
|
if (!matcher.matches()) {
|
||||||
|
System.err.println();
|
||||||
|
System.err.println("ERROR: header line does " +
|
||||||
|
"not match runnable or waiting patterns.");
|
||||||
|
System.err.println("ERROR: header_line='" +
|
||||||
|
header_line + "'");
|
||||||
|
System.err.println("ERROR: locked_line='" + line + "'");
|
||||||
|
error_cnt++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
matcher = THREAD_STATE_RUNNABLE_PATTERN.matcher(thread_state_line);
|
||||||
|
if (!matcher.matches()) {
|
||||||
|
// It's strange, but a locked line can also
|
||||||
|
// match the THREAD_STATE_BLOCKED_PATTERN.
|
||||||
|
matcher = THREAD_STATE_BLOCKED_PATTERN.matcher(
|
||||||
|
thread_state_line);
|
||||||
|
if (!matcher.matches()) {
|
||||||
|
System.err.println();
|
||||||
|
System.err.println("ERROR: thread state line does not " +
|
||||||
|
"match runnable or waiting patterns.");
|
||||||
|
System.err.println("ERROR: " + "thread_state_line='" +
|
||||||
|
thread_state_line + "'");
|
||||||
|
System.err.println("ERROR: locked_line='" + line + "'");
|
||||||
|
error_cnt++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Have everything we need from this thread stack
|
||||||
|
// that matches the LOCK_PATTERN.
|
||||||
|
have_header_line = false;
|
||||||
|
have_thread_state_line = false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Process the waiting line here if we found one.
|
||||||
|
//
|
||||||
|
// Example:
|
||||||
|
// "ContendingThread-2" #22 prio=5 os_prio=64 tid=0x00000000007b9800 nid=0x30 waiting for monitor entry [0xfffffd7fc1010000]
|
||||||
|
// java.lang.Thread.State: BLOCKED (on object monitor)
|
||||||
|
// at TestThreadDumpMonitorContention$1.run(TestThreadDumpMonitorContention.java:67)
|
||||||
|
// - waiting to lock <0xfffffd7e6a2912f8> (a TestThreadDumpMonitorContention$1)
|
||||||
|
// at java.lang.Thread.run(Thread.java:745)
|
||||||
|
//
|
||||||
|
static boolean checkWaitingLine(String line) {
|
||||||
|
Matcher matcher = WAITING_PATTERN.matcher(line);
|
||||||
|
if (matcher.matches()) {
|
||||||
|
if (verbose) {
|
||||||
|
System.out.println("waiting_line='" + line + "'");
|
||||||
|
}
|
||||||
|
|
||||||
|
matcher = HEADER_WAITING_PATTERN.matcher(header_line);
|
||||||
|
if (!matcher.matches()) {
|
||||||
|
System.err.println();
|
||||||
|
System.err.println("ERROR: header line does " +
|
||||||
|
"not match a waiting pattern.");
|
||||||
|
System.err.println("ERROR: header_line='" + header_line + "'");
|
||||||
|
System.err.println("ERROR: waiting_line='" + line + "'");
|
||||||
|
error_cnt++;
|
||||||
|
}
|
||||||
|
|
||||||
|
matcher = THREAD_STATE_BLOCKED_PATTERN.matcher(thread_state_line);
|
||||||
|
if (!matcher.matches()) {
|
||||||
|
System.err.println();
|
||||||
|
System.err.println("ERROR: thread state line " +
|
||||||
|
"does not match a waiting pattern.");
|
||||||
|
System.err.println("ERROR: thread_state_line='" +
|
||||||
|
thread_state_line + "'");
|
||||||
|
System.err.println("ERROR: waiting_line='" + line + "'");
|
||||||
|
error_cnt++;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Have everything we need from this thread stack
|
||||||
|
// that matches the WAITING_PATTERN.
|
||||||
|
have_header_line = false;
|
||||||
|
have_thread_state_line = false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void doSamples() throws Exception {
|
||||||
|
for (int count = 0; count < n_samples; count++) {
|
||||||
|
match_cnt = 0;
|
||||||
|
// verbose mode or an error has a lot of output so add more space
|
||||||
|
if (verbose || error_cnt > 0) System.out.println();
|
||||||
|
System.out.println("Sample #" + count);
|
||||||
|
|
||||||
|
// We don't use the ProcessTools, OutputBuffer or
|
||||||
|
// OutputAnalyzer classes from the testlibrary because
|
||||||
|
// we have a complicated multi-line parse to perform
|
||||||
|
// on a narrow subset of the JSTACK output.
|
||||||
|
//
|
||||||
|
// - we only care about stack traces that match
|
||||||
|
// HEADER_PREFIX_PATTERN; only two should match
|
||||||
|
// - we care about at most three lines from each stack trace
|
||||||
|
// - if both stack traces match LOCKED_PATTERN, then that's
|
||||||
|
// a failure and we report it
|
||||||
|
// - for a stack trace that matches LOCKED_PATTERN, we verify:
|
||||||
|
// - the header line matches HEADER_RUNNABLE_PATTERN
|
||||||
|
// or HEADER_WAITING_PATTERN
|
||||||
|
// - the thread state line matches THREAD_STATE_BLOCKED_PATTERN
|
||||||
|
// or THREAD_STATE_RUNNABLE_PATTERN
|
||||||
|
// - we report any mismatches as failures
|
||||||
|
// - for a stack trace that matches WAITING_PATTERN, we verify:
|
||||||
|
// - the header line matches HEADER_WAITING_PATTERN
|
||||||
|
// - the thread state line matches THREAD_STATE_BLOCKED_PATTERN
|
||||||
|
// - we report any mismatches as failures
|
||||||
|
// - the stack traces that match HEADER_PREFIX_PATTERN may
|
||||||
|
// not match either LOCKED_PATTERN or WAITING_PATTERN
|
||||||
|
// because we might observe the thread outside of
|
||||||
|
// monitor operations; this is not considered a failure
|
||||||
|
//
|
||||||
|
// When we do observe LOCKED_PATTERN or WAITING_PATTERN,
|
||||||
|
// then we are checking the header and thread state patterns
|
||||||
|
// that occurred earlier in the current stack trace that
|
||||||
|
// matched HEADER_PREFIX_PATTERN. We don't use data from
|
||||||
|
// stack traces that don't match HEADER_PREFIX_PATTERN and
|
||||||
|
// we don't mix data between the two stack traces that do
|
||||||
|
// match HEADER_PREFIX_PATTERN.
|
||||||
|
//
|
||||||
|
Process process = new ProcessBuilder(JSTACK, PID)
|
||||||
|
.redirectErrorStream(true).start();
|
||||||
|
|
||||||
|
BufferedReader reader = new BufferedReader(new InputStreamReader(
|
||||||
|
process.getInputStream()));
|
||||||
|
String line;
|
||||||
|
while ((line = reader.readLine()) != null) {
|
||||||
|
Matcher matcher = null;
|
||||||
|
|
||||||
|
// process the header line here
|
||||||
|
if (!have_header_line) {
|
||||||
|
matcher = HEADER_PREFIX_PATTERN.matcher(line);
|
||||||
|
if (matcher.matches()) {
|
||||||
|
if (verbose) {
|
||||||
|
System.out.println();
|
||||||
|
System.out.println("header='" + line + "'");
|
||||||
|
}
|
||||||
|
header_line = new String(line);
|
||||||
|
have_header_line = true;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
continue; // skip until have a header line
|
||||||
|
}
|
||||||
|
|
||||||
|
// process the thread state line here
|
||||||
|
if (!have_thread_state_line) {
|
||||||
|
matcher = THREAD_STATE_PREFIX_PATTERN.matcher(line);
|
||||||
|
if (matcher.matches()) {
|
||||||
|
if (verbose) {
|
||||||
|
System.out.println("thread_state='" + line + "'");
|
||||||
|
}
|
||||||
|
thread_state_line = new String(line);
|
||||||
|
have_thread_state_line = true;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
continue; // skip until we have a thread state line
|
||||||
|
}
|
||||||
|
|
||||||
|
// process the locked line here if we find one
|
||||||
|
if (checkLockedLine(line)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// process the waiting line here if we find one
|
||||||
|
if (checkWaitingLine(line)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// process the blank line here if we find one
|
||||||
|
if (checkBlankLine(line)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
process.waitFor();
|
||||||
|
|
||||||
|
if (match_cnt == 2) {
|
||||||
|
if (match_list[0].equals(match_list[1])) {
|
||||||
|
System.err.println();
|
||||||
|
System.err.println("ERROR: matching lock lines:");
|
||||||
|
System.err.println("ERROR: line[0]'" + match_list[0] + "'");
|
||||||
|
System.err.println("ERROR: line[1]'" + match_list[1] + "'");
|
||||||
|
error_cnt++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// slight delay between jstack launches
|
||||||
|
Thread.sleep(500);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// This helper relies on RuntimeMXBean.getName() returning a string
|
||||||
|
// that looks like this: 5436@mt-haku
|
||||||
|
//
|
||||||
|
// The testlibrary has tryFindJvmPid(), but that uses a separate
|
||||||
|
// process which is much more expensive for finding out your own PID.
|
||||||
|
//
|
||||||
|
static String getPid() {
|
||||||
|
RuntimeMXBean runtimebean = ManagementFactory.getRuntimeMXBean();
|
||||||
|
String vmname = runtimebean.getName();
|
||||||
|
int i = vmname.indexOf('@');
|
||||||
|
if (i != -1) {
|
||||||
|
vmname = vmname.substring(0, i);
|
||||||
|
}
|
||||||
|
return vmname;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void usage() {
|
||||||
|
System.err.println("Usage: " +
|
||||||
|
"java TestThreadDumpMonitorContention [-v] [n_samples]");
|
||||||
|
System.exit(1);
|
||||||
|
}
|
||||||
|
}
|
|
@ -22,10 +22,10 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @test ParserTest
|
* @test
|
||||||
* @summary Test that the diagnostic command arguemnt parser works
|
* @summary Test that the diagnostic command arguemnt parser works
|
||||||
* @library /testlibrary /testlibrary/whitebox
|
* @library /testlibrary /testlibrary/whitebox
|
||||||
* @build ParserTest
|
* @build ClassFileInstaller sun.hotspot.WhiteBox sun.hotspot.parser.*
|
||||||
* @run main ClassFileInstaller sun.hotspot.WhiteBox
|
* @run main ClassFileInstaller sun.hotspot.WhiteBox
|
||||||
* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI ParserTest
|
* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI ParserTest
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
* @key regression
|
* @key regression
|
||||||
* @summary Regression test for attach issue where stale pid files in /tmp lead to connection issues
|
* @summary Regression test for attach issue where stale pid files in /tmp lead to connection issues
|
||||||
* @library /testlibrary
|
* @library /testlibrary
|
||||||
* @compile AttachWithStalePidFileTarget.java
|
* @build com.oracle.java.testlibrary.* AttachWithStalePidFileTarget
|
||||||
* @run main AttachWithStalePidFile
|
* @run main AttachWithStalePidFile
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ import com.oracle.java.testlibrary.Platform;
|
||||||
* @test
|
* @test
|
||||||
* @summary Test of VM.dynlib diagnostic command via MBean
|
* @summary Test of VM.dynlib diagnostic command via MBean
|
||||||
* @library /testlibrary
|
* @library /testlibrary
|
||||||
* @compile DcmdUtil.java
|
* @build com.oracle.java.testlibrary.* DcmdUtil
|
||||||
* @run main DynLibDcmdTest
|
* @run main DynLibDcmdTest
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ import com.oracle.java.testlibrary.*;
|
||||||
* @test
|
* @test
|
||||||
* @bug 8027230
|
* @bug 8027230
|
||||||
* @library /testlibrary
|
* @library /testlibrary
|
||||||
* @build GetObjectSizeOverflowAgent
|
* @build ClassFileInstaller com.oracle.java.testlibrary.* GetObjectSizeOverflowAgent
|
||||||
* @run main ClassFileInstaller GetObjectSizeOverflowAgent
|
* @run main ClassFileInstaller GetObjectSizeOverflowAgent
|
||||||
* @run main GetObjectSizeOverflow
|
* @run main GetObjectSizeOverflow
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
* @summary Redefine a class with an UnresolvedClass reference in the constant pool.
|
* @summary Redefine a class with an UnresolvedClass reference in the constant pool.
|
||||||
* @bug 8035150
|
* @bug 8035150
|
||||||
* @library /testlibrary
|
* @library /testlibrary
|
||||||
* @build UnresolvedClassAgent com.oracle.java.testlibrary.ProcessTools com.oracle.java.testlibrary.OutputAnalyzer
|
* @build com.oracle.java.testlibrary.* UnresolvedClassAgent
|
||||||
* @run main TestRedefineWithUnresolvedClass
|
* @run main TestRedefineWithUnresolvedClass
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
* @bug 8028623
|
* @bug 8028623
|
||||||
* @summary Test hashing of extended characters in Serviceability Agent.
|
* @summary Test hashing of extended characters in Serviceability Agent.
|
||||||
* @library /testlibrary
|
* @library /testlibrary
|
||||||
|
* @build com.oracle.java.testlibrary.*
|
||||||
* @compile -encoding utf8 Test8028623.java
|
* @compile -encoding utf8 Test8028623.java
|
||||||
* @run main Test8028623
|
* @run main Test8028623
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -44,7 +44,7 @@ import com.oracle.java.testlibrary.ProcessTools;
|
||||||
* @key regression
|
* @key regression
|
||||||
* @summary Regression test for hprof export issue due to large heaps (>2G)
|
* @summary Regression test for hprof export issue due to large heaps (>2G)
|
||||||
* @library /testlibrary
|
* @library /testlibrary
|
||||||
* @compile JMapHProfLargeHeapProc.java
|
* @build com.oracle.java.testlibrary.* JMapHProfLargeHeapProc
|
||||||
* @run main JMapHProfLargeHeapTest
|
* @run main JMapHProfLargeHeapTest
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
79
hotspot/test/testlibrary/RedefineClassHelper.java
Normal file
79
hotspot/test/testlibrary/RedefineClassHelper.java
Normal file
|
@ -0,0 +1,79 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import java.io.PrintWriter;
|
||||||
|
import java.lang.instrument.*;
|
||||||
|
import com.oracle.java.testlibrary.*;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Helper class to write tests that redefine classes.
|
||||||
|
* When main method is run, it will create a redefineagent.jar that can be used
|
||||||
|
* with the -javaagent option to support redefining classes in jtreg tests.
|
||||||
|
*
|
||||||
|
* See sample test in test/testlibrary_tests/RedefineClassTest.java
|
||||||
|
*/
|
||||||
|
public class RedefineClassHelper {
|
||||||
|
|
||||||
|
public static Instrumentation instrumentation;
|
||||||
|
public static void premain(String agentArgs, Instrumentation inst) {
|
||||||
|
instrumentation = inst;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Redefine a class
|
||||||
|
*
|
||||||
|
* @param clazz Class to redefine
|
||||||
|
* @param javacode String with the new java code for the class to be redefined
|
||||||
|
*/
|
||||||
|
public static void redefineClass(Class clazz, String javacode) throws Exception {
|
||||||
|
byte[] bytecode = InMemoryJavaCompiler.compile(clazz.getName(), javacode);
|
||||||
|
redefineClass(clazz, bytecode);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Redefine a class
|
||||||
|
*
|
||||||
|
* @param clazz Class to redefine
|
||||||
|
* @param bytecode byte[] with the new class
|
||||||
|
*/
|
||||||
|
public static void redefineClass(Class clazz, byte[] bytecode) throws Exception {
|
||||||
|
instrumentation.redefineClasses(new ClassDefinition(clazz, bytecode));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Main method to be invoked before test to create the redefineagent.jar
|
||||||
|
*/
|
||||||
|
public static void main(String[] args) throws Exception {
|
||||||
|
ClassFileInstaller.main("RedefineClassHelper");
|
||||||
|
|
||||||
|
PrintWriter pw = new PrintWriter("MANIFEST.MF");
|
||||||
|
pw.println("Premain-Class: RedefineClassHelper");
|
||||||
|
pw.println("Can-Redefine-Classes: true");
|
||||||
|
pw.close();
|
||||||
|
|
||||||
|
sun.tools.jar.Main jarTool = new sun.tools.jar.Main(System.out, System.err, "jar");
|
||||||
|
if (!jarTool.run(new String[] { "-cmf", "MANIFEST.MF", "redefineagent.jar", "RedefineClassHelper.class" })) {
|
||||||
|
throw new Exception("jar operation failed");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -22,10 +22,10 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @test ClassesDirTest
|
* @test
|
||||||
* @bug 8012447
|
* @bug 8012447
|
||||||
* @library /testlibrary /testlibrary/whitebox /testlibrary/ctw/src
|
* @library /testlibrary /testlibrary/whitebox /testlibrary/ctw/src
|
||||||
* @build sun.hotspot.tools.ctw.CompileTheWorld sun.hotspot.WhiteBox ClassesDirTest Foo Bar
|
* @build ClassFileInstaller sun.hotspot.tools.ctw.CompileTheWorld sun.hotspot.WhiteBox Foo Bar
|
||||||
* @run main ClassFileInstaller sun.hotspot.WhiteBox Foo Bar
|
* @run main ClassFileInstaller sun.hotspot.WhiteBox Foo Bar
|
||||||
* @run main ClassesDirTest prepare
|
* @run main ClassesDirTest prepare
|
||||||
* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Dsun.hotspot.tools.ctw.logfile=ctw.log sun.hotspot.tools.ctw.CompileTheWorld classes
|
* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Dsun.hotspot.tools.ctw.logfile=ctw.log sun.hotspot.tools.ctw.CompileTheWorld classes
|
||||||
|
|
|
@ -22,10 +22,10 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @test ClassesListTest
|
* @test
|
||||||
* @bug 8012447
|
* @bug 8012447
|
||||||
* @library /testlibrary /testlibrary/whitebox /testlibrary/ctw/src
|
* @library /testlibrary /testlibrary/whitebox /testlibrary/ctw/src
|
||||||
* @build sun.hotspot.tools.ctw.CompileTheWorld sun.hotspot.WhiteBox ClassesListTest Foo Bar
|
* @build ClassFileInstaller sun.hotspot.tools.ctw.CompileTheWorld sun.hotspot.WhiteBox Foo Bar
|
||||||
* @run main ClassFileInstaller sun.hotspot.WhiteBox Foo Bar
|
* @run main ClassFileInstaller sun.hotspot.WhiteBox Foo Bar
|
||||||
* @run main ClassesListTest prepare
|
* @run main ClassesListTest prepare
|
||||||
* @run main/othervm/timeout=600 -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Dsun.hotspot.tools.ctw.logfile=ctw.log sun.hotspot.tools.ctw.CompileTheWorld classes.lst
|
* @run main/othervm/timeout=600 -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Dsun.hotspot.tools.ctw.logfile=ctw.log sun.hotspot.tools.ctw.CompileTheWorld classes.lst
|
||||||
|
|
|
@ -22,10 +22,10 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @test JarDirTest
|
* @test
|
||||||
* @bug 8012447
|
* @bug 8012447
|
||||||
* @library /testlibrary /testlibrary/whitebox /testlibrary/ctw/src
|
* @library /testlibrary /testlibrary/whitebox /testlibrary/ctw/src
|
||||||
* @build sun.hotspot.tools.ctw.CompileTheWorld sun.hotspot.WhiteBox JarDirTest Foo Bar
|
* @build ClassFileInstaller com.oracle.java.testlibrary.* sun.hotspot.tools.ctw.CompileTheWorld sun.hotspot.WhiteBox Foo Bar
|
||||||
* @run main ClassFileInstaller sun.hotspot.WhiteBox Foo Bar
|
* @run main ClassFileInstaller sun.hotspot.WhiteBox Foo Bar
|
||||||
* @run main JarDirTest prepare
|
* @run main JarDirTest prepare
|
||||||
* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Dsun.hotspot.tools.ctw.logfile=ctw.log sun.hotspot.tools.ctw.CompileTheWorld jars/*
|
* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Dsun.hotspot.tools.ctw.logfile=ctw.log sun.hotspot.tools.ctw.CompileTheWorld jars/*
|
||||||
|
|
|
@ -22,10 +22,10 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @test JarsTest
|
* @test
|
||||||
* @bug 8012447
|
* @bug 8012447
|
||||||
* @library /testlibrary /testlibrary/whitebox /testlibrary/ctw/src
|
* @library /testlibrary /testlibrary/whitebox /testlibrary/ctw/src
|
||||||
* @build sun.hotspot.tools.ctw.CompileTheWorld sun.hotspot.WhiteBox JarsTest Foo Bar
|
* @build ClassFileInstaller com.oracle.java.testlibrary.* sun.hotspot.tools.ctw.CompileTheWorld sun.hotspot.WhiteBox Foo Bar
|
||||||
* @run main ClassFileInstaller sun.hotspot.WhiteBox Foo Bar
|
* @run main ClassFileInstaller sun.hotspot.WhiteBox Foo Bar
|
||||||
* @run main JarsTest prepare
|
* @run main JarsTest prepare
|
||||||
* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Dsun.hotspot.tools.ctw.logfile=ctw.log sun.hotspot.tools.ctw.CompileTheWorld foo.jar bar.jar
|
* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Dsun.hotspot.tools.ctw.logfile=ctw.log sun.hotspot.tools.ctw.CompileTheWorld foo.jar bar.jar
|
||||||
|
|
54
hotspot/test/testlibrary_tests/RedefineClassTest.java
Normal file
54
hotspot/test/testlibrary_tests/RedefineClassTest.java
Normal file
|
@ -0,0 +1,54 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @test
|
||||||
|
* @library /testlibrary
|
||||||
|
* @summary Proof of concept test for RedefineClassHelper
|
||||||
|
* @build RedefineClassHelper
|
||||||
|
* @run main RedefineClassHelper
|
||||||
|
* @run main/othervm -javaagent:redefineagent.jar RedefineClassTest
|
||||||
|
*/
|
||||||
|
|
||||||
|
import static com.oracle.java.testlibrary.Asserts.*;
|
||||||
|
import com.oracle.java.testlibrary.*;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Proof of concept test for the test utility class RedefineClassHelper
|
||||||
|
*/
|
||||||
|
public class RedefineClassTest {
|
||||||
|
|
||||||
|
public static String newClass = "class RedefineClassTest$A { public int Method() { return 2; } }";
|
||||||
|
public static void main(String[] args) throws Exception {
|
||||||
|
A a = new A();
|
||||||
|
assertTrue(a.Method() == 1);
|
||||||
|
RedefineClassHelper.redefineClass(A.class, newClass);
|
||||||
|
assertTrue(a.Method() == 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
static class A {
|
||||||
|
public int Method() {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -260,3 +260,4 @@ c7c8002d02721e02131d104549ebeb8b379fb8d2 jdk9-b13
|
||||||
4537360f09fe23ab339ee588747b657feb12d0c8 jdk9-b15
|
4537360f09fe23ab339ee588747b657feb12d0c8 jdk9-b15
|
||||||
ab7d2c565b0de5bee1361d282d4029371327fc9e jdk9-b16
|
ab7d2c565b0de5bee1361d282d4029371327fc9e jdk9-b16
|
||||||
fd8e675f141b9bdb2f46d1ae8251f4ee3a895d64 jdk9-b17
|
fd8e675f141b9bdb2f46d1ae8251f4ee3a895d64 jdk9-b17
|
||||||
|
6ad17b31f0d30593392b1e8695b9709dbbd7fb70 jdk9-b18
|
||||||
|
|
|
@ -370,7 +370,57 @@ int NET_Accept(int s, struct sockaddr *addr, int *addrlen) {
|
||||||
}
|
}
|
||||||
|
|
||||||
int NET_Connect(int s, struct sockaddr *addr, int addrlen) {
|
int NET_Connect(int s, struct sockaddr *addr, int addrlen) {
|
||||||
BLOCKING_IO_RETURN_INT( s, connect(s, addr, addrlen) );
|
int crc = -1, prc = -1;
|
||||||
|
threadEntry_t self;
|
||||||
|
fdEntry_t* fdEntry = getFdEntry(s);
|
||||||
|
|
||||||
|
if (fdEntry == NULL) {
|
||||||
|
errno = EBADF;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* On AIX, when the system call connect() is interrupted, the connection
|
||||||
|
* is not aborted and it will be established asynchronously by the kernel.
|
||||||
|
* Hence, no need to restart connect() when EINTR is received
|
||||||
|
*/
|
||||||
|
startOp(fdEntry, &self);
|
||||||
|
crc = connect(s, addr, addrlen);
|
||||||
|
endOp(fdEntry, &self);
|
||||||
|
|
||||||
|
if (crc == -1 && errno == EINTR) {
|
||||||
|
struct pollfd s_pollfd;
|
||||||
|
int sockopt_arg = 0;
|
||||||
|
socklen_t len;
|
||||||
|
|
||||||
|
s_pollfd.fd = s;
|
||||||
|
s_pollfd.events = POLLOUT | POLLERR;
|
||||||
|
|
||||||
|
/* poll the file descriptor */
|
||||||
|
do {
|
||||||
|
startOp(fdEntry, &self);
|
||||||
|
prc = poll(&s_pollfd, 1, -1);
|
||||||
|
endOp(fdEntry, &self);
|
||||||
|
} while (prc == -1 && errno == EINTR);
|
||||||
|
|
||||||
|
if (prc < 0)
|
||||||
|
return prc;
|
||||||
|
|
||||||
|
len = sizeof(sockopt_arg);
|
||||||
|
|
||||||
|
/* Check whether the connection has been established */
|
||||||
|
if (getsockopt(s, SOL_SOCKET, SO_ERROR, &sockopt_arg, &len) == -1)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
if (sockopt_arg != 0 ) {
|
||||||
|
errno = sockopt_arg;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return crc;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* At this point, fd is connected. Set successful return code */
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int NET_Poll(struct pollfd *ufds, unsigned int nfds, int timeout) {
|
int NET_Poll(struct pollfd *ufds, unsigned int nfds, int timeout) {
|
||||||
|
|
|
@ -523,7 +523,7 @@ public final class LWCToolkit extends LWToolkit {
|
||||||
* that is used for menu shortcuts on this toolkit.
|
* that is used for menu shortcuts on this toolkit.
|
||||||
* @see java.awt.MenuBar
|
* @see java.awt.MenuBar
|
||||||
* @see java.awt.MenuShortcut
|
* @see java.awt.MenuShortcut
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int getMenuShortcutKeyMask() {
|
public int getMenuShortcutKeyMask() {
|
||||||
|
|
|
@ -839,7 +839,7 @@ class ConstantPool {
|
||||||
return parts;
|
return parts;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @since JDK 7, JSR 292 */
|
/** @since 1.7, JSR 292 */
|
||||||
public static
|
public static
|
||||||
class MethodHandleEntry extends Entry {
|
class MethodHandleEntry extends Entry {
|
||||||
final int refKind;
|
final int refKind;
|
||||||
|
@ -889,7 +889,7 @@ class ConstantPool {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @since JDK 7, JSR 292 */
|
/** @since 1.7, JSR 292 */
|
||||||
public static
|
public static
|
||||||
class MethodTypeEntry extends Entry {
|
class MethodTypeEntry extends Entry {
|
||||||
final SignatureEntry typeRef;
|
final SignatureEntry typeRef;
|
||||||
|
@ -924,7 +924,7 @@ class ConstantPool {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @since JDK 7, JSR 292 */
|
/** @since 1.7, JSR 292 */
|
||||||
public static
|
public static
|
||||||
class InvokeDynamicEntry extends Entry {
|
class InvokeDynamicEntry extends Entry {
|
||||||
final BootstrapMethodEntry bssRef;
|
final BootstrapMethodEntry bssRef;
|
||||||
|
@ -977,7 +977,7 @@ class ConstantPool {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @since JDK 7, JSR 292 */
|
/** @since 1.7, JSR 292 */
|
||||||
public static
|
public static
|
||||||
class BootstrapMethodEntry extends Entry {
|
class BootstrapMethodEntry extends Entry {
|
||||||
final MethodHandleEntry bsmRef;
|
final MethodHandleEntry bsmRef;
|
||||||
|
|
|
@ -97,7 +97,7 @@ http://www.ietf.org/rfc/rfc2616.txt
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<li>
|
<li>
|
||||||
@since JDK1.5.0</li>
|
@since 1.5</li>
|
||||||
|
|
||||||
<br><!-- Put @see and @since tags down here. -->
|
<br><!-- Put @see and @since tags down here. -->
|
||||||
</body>
|
</body>
|
||||||
|
|
|
@ -562,7 +562,7 @@ public class Introspector {
|
||||||
}
|
}
|
||||||
if (readMethod != null) {
|
if (readMethod != null) {
|
||||||
ReflectUtil.checkPackageAccess(readMethod.getDeclaringClass());
|
ReflectUtil.checkPackageAccess(readMethod.getDeclaringClass());
|
||||||
return MethodUtil.invoke(readMethod, complex, new Class[0]);
|
return MethodUtil.invoke(readMethod, complex, new Class<?>[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new AttributeNotFoundException(
|
throw new AttributeNotFoundException(
|
||||||
|
|
|
@ -757,7 +757,7 @@ public class MBeanInstantiator {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void ensureClassAccess(Class clazz)
|
private static void ensureClassAccess(Class<?> clazz)
|
||||||
throws IllegalAccessException
|
throws IllegalAccessException
|
||||||
{
|
{
|
||||||
int mod = clazz.getModifiers();
|
int mod = clazz.getModifiers();
|
||||||
|
|
|
@ -58,7 +58,7 @@ public abstract class ClientNotifForwarder {
|
||||||
|
|
||||||
private final AccessControlContext acc;
|
private final AccessControlContext acc;
|
||||||
|
|
||||||
public ClientNotifForwarder(Map env) {
|
public ClientNotifForwarder(Map<String, ?> env) {
|
||||||
this(null, env);
|
this(null, env);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -310,10 +310,10 @@ public class MBeanServerFileAccessController
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (s == null) return; /* security has not been enabled */
|
if (s == null) return; /* security has not been enabled */
|
||||||
final Set principals = s.getPrincipals();
|
final Set<Principal> principals = s.getPrincipals();
|
||||||
String newPropertyValue = null;
|
String newPropertyValue = null;
|
||||||
for (Iterator i = principals.iterator(); i.hasNext(); ) {
|
for (Iterator<Principal> i = principals.iterator(); i.hasNext(); ) {
|
||||||
final Principal p = (Principal) i.next();
|
final Principal p = i.next();
|
||||||
Access access = accessMap.get(p.getName());
|
Access access = accessMap.get(p.getName());
|
||||||
if (access != null) {
|
if (access != null) {
|
||||||
boolean ok;
|
boolean ok;
|
||||||
|
|
|
@ -535,7 +535,7 @@ final class SnmpRequestTree {
|
||||||
|
|
||||||
// Save old vectors
|
// Save old vectors
|
||||||
SnmpOid[] olde = entryoids;
|
SnmpOid[] olde = entryoids;
|
||||||
Vector[] oldl = entrylists;
|
Vector<SnmpVarBind>[] oldl = entrylists;
|
||||||
boolean[] oldn = isentrynew;
|
boolean[] oldn = isentrynew;
|
||||||
SnmpVarBind[] oldr = rowstatus;
|
SnmpVarBind[] oldr = rowstatus;
|
||||||
|
|
||||||
|
|
|
@ -212,7 +212,7 @@ import javax.management.DynamicMBean;
|
||||||
* {@linkplain javax.management.Notification#getUserData() userData} that
|
* {@linkplain javax.management.Notification#getUserData() userData} that
|
||||||
* is the new {@code MBeanInfo}.
|
* is the new {@code MBeanInfo}.
|
||||||
*
|
*
|
||||||
* @since 8
|
* @since 1.8
|
||||||
*/
|
*/
|
||||||
public interface DiagnosticCommandMBean extends DynamicMBean
|
public interface DiagnosticCommandMBean extends DynamicMBean
|
||||||
{
|
{
|
||||||
|
|
|
@ -7697,7 +7697,7 @@ public class CachedRowSetImpl extends BaseRowSet implements RowSet, RowSetIntern
|
||||||
* @param columnIndex the first column is 1, the second is 2, ...
|
* @param columnIndex the first column is 1, the second is 2, ...
|
||||||
* @return a SQLXML object that maps an SQL XML value
|
* @return a SQLXML object that maps an SQL XML value
|
||||||
* @throws SQLException if a database access error occurs
|
* @throws SQLException if a database access error occurs
|
||||||
* @since 6.0
|
* @since 1.6
|
||||||
*/
|
*/
|
||||||
public SQLXML getSQLXML(int columnIndex) throws SQLException {
|
public SQLXML getSQLXML(int columnIndex) throws SQLException {
|
||||||
throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.opnotysupp").toString());
|
throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.opnotysupp").toString());
|
||||||
|
@ -7723,7 +7723,7 @@ public class CachedRowSetImpl extends BaseRowSet implements RowSet, RowSetIntern
|
||||||
* @return the column value if the value is a SQL <code>NULL</code> the
|
* @return the column value if the value is a SQL <code>NULL</code> the
|
||||||
* value returned is <code>null</code>
|
* value returned is <code>null</code>
|
||||||
* @throws SQLException if a database access error occurs
|
* @throws SQLException if a database access error occurs
|
||||||
* @since 6.0
|
* @since 1.6
|
||||||
*/
|
*/
|
||||||
public RowId getRowId(int columnIndex) throws SQLException {
|
public RowId getRowId(int columnIndex) throws SQLException {
|
||||||
throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.opnotysupp").toString());
|
throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.opnotysupp").toString());
|
||||||
|
@ -7738,7 +7738,7 @@ public class CachedRowSetImpl extends BaseRowSet implements RowSet, RowSetIntern
|
||||||
* @return the column value if the value is a SQL <code>NULL</code> the
|
* @return the column value if the value is a SQL <code>NULL</code> the
|
||||||
* value returned is <code>null</code>
|
* value returned is <code>null</code>
|
||||||
* @throws SQLException if a database access error occurs
|
* @throws SQLException if a database access error occurs
|
||||||
* @since 6.0
|
* @since 1.6
|
||||||
*/
|
*/
|
||||||
public RowId getRowId(String columnName) throws SQLException {
|
public RowId getRowId(String columnName) throws SQLException {
|
||||||
throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.opnotysupp").toString());
|
throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.opnotysupp").toString());
|
||||||
|
@ -7754,7 +7754,7 @@ public class CachedRowSetImpl extends BaseRowSet implements RowSet, RowSetIntern
|
||||||
* @param columnIndex the first column is 1, the second 2, ...
|
* @param columnIndex the first column is 1, the second 2, ...
|
||||||
* @param x the column value
|
* @param x the column value
|
||||||
* @throws SQLException if a database access occurs
|
* @throws SQLException if a database access occurs
|
||||||
* @since 6.0
|
* @since 1.6
|
||||||
*/
|
*/
|
||||||
public void updateRowId(int columnIndex, RowId x) throws SQLException {
|
public void updateRowId(int columnIndex, RowId x) throws SQLException {
|
||||||
throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.opnotysupp").toString());
|
throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.opnotysupp").toString());
|
||||||
|
@ -7770,7 +7770,7 @@ public class CachedRowSetImpl extends BaseRowSet implements RowSet, RowSetIntern
|
||||||
* @param columnName the name of the column
|
* @param columnName the name of the column
|
||||||
* @param x the column value
|
* @param x the column value
|
||||||
* @throws SQLException if a database access occurs
|
* @throws SQLException if a database access occurs
|
||||||
* @since 6.0
|
* @since 1.6
|
||||||
*/
|
*/
|
||||||
public void updateRowId(String columnName, RowId x) throws SQLException {
|
public void updateRowId(String columnName, RowId x) throws SQLException {
|
||||||
throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.opnotysupp").toString());
|
throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.opnotysupp").toString());
|
||||||
|
@ -7780,7 +7780,7 @@ public class CachedRowSetImpl extends BaseRowSet implements RowSet, RowSetIntern
|
||||||
* Retrieves the holdability of this ResultSet object
|
* Retrieves the holdability of this ResultSet object
|
||||||
* @return either ResultSet.HOLD_CURSORS_OVER_COMMIT or ResultSet.CLOSE_CURSORS_AT_COMMIT
|
* @return either ResultSet.HOLD_CURSORS_OVER_COMMIT or ResultSet.CLOSE_CURSORS_AT_COMMIT
|
||||||
* @throws SQLException if a database error occurs
|
* @throws SQLException if a database error occurs
|
||||||
* @since 6.0
|
* @since 1.6
|
||||||
*/
|
*/
|
||||||
public int getHoldability() throws SQLException {
|
public int getHoldability() throws SQLException {
|
||||||
throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.opnotysupp").toString());
|
throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.opnotysupp").toString());
|
||||||
|
@ -7791,7 +7791,7 @@ public class CachedRowSetImpl extends BaseRowSet implements RowSet, RowSetIntern
|
||||||
* method close has been called on it, or if it is automatically closed.
|
* method close has been called on it, or if it is automatically closed.
|
||||||
* @return true if this ResultSet object is closed; false if it is still open
|
* @return true if this ResultSet object is closed; false if it is still open
|
||||||
* @throws SQLException if a database access error occurs
|
* @throws SQLException if a database access error occurs
|
||||||
* @since 6.0
|
* @since 1.6
|
||||||
*/
|
*/
|
||||||
public boolean isClosed() throws SQLException {
|
public boolean isClosed() throws SQLException {
|
||||||
throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.opnotysupp").toString());
|
throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.opnotysupp").toString());
|
||||||
|
@ -7803,7 +7803,7 @@ public class CachedRowSetImpl extends BaseRowSet implements RowSet, RowSetIntern
|
||||||
* @param columnIndex the first column is 1, the second 2, ...
|
* @param columnIndex the first column is 1, the second 2, ...
|
||||||
* @param nString the value for the column to be updated
|
* @param nString the value for the column to be updated
|
||||||
* @throws SQLException if a database access error occurs
|
* @throws SQLException if a database access error occurs
|
||||||
* @since 6.0
|
* @since 1.6
|
||||||
*/
|
*/
|
||||||
public void updateNString(int columnIndex, String nString) throws SQLException {
|
public void updateNString(int columnIndex, String nString) throws SQLException {
|
||||||
throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.opnotysupp").toString());
|
throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.opnotysupp").toString());
|
||||||
|
@ -7815,7 +7815,7 @@ public class CachedRowSetImpl extends BaseRowSet implements RowSet, RowSetIntern
|
||||||
* @param columnName name of the Column
|
* @param columnName name of the Column
|
||||||
* @param nString the value for the column to be updated
|
* @param nString the value for the column to be updated
|
||||||
* @throws SQLException if a database access error occurs
|
* @throws SQLException if a database access error occurs
|
||||||
* @since 6.0
|
* @since 1.6
|
||||||
*/
|
*/
|
||||||
public void updateNString(String columnName, String nString) throws SQLException {
|
public void updateNString(String columnName, String nString) throws SQLException {
|
||||||
throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.opnotysupp").toString());
|
throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.opnotysupp").toString());
|
||||||
|
@ -7828,7 +7828,7 @@ public class CachedRowSetImpl extends BaseRowSet implements RowSet, RowSetIntern
|
||||||
* @param columnIndex the first column is 1, the second 2, ...
|
* @param columnIndex the first column is 1, the second 2, ...
|
||||||
* @param nClob the value for the column to be updated
|
* @param nClob the value for the column to be updated
|
||||||
* @throws SQLException if a database access error occurs
|
* @throws SQLException if a database access error occurs
|
||||||
* @since 6.0
|
* @since 1.6
|
||||||
*/
|
*/
|
||||||
public void updateNClob(int columnIndex, NClob nClob) throws SQLException {
|
public void updateNClob(int columnIndex, NClob nClob) throws SQLException {
|
||||||
throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.opnotysupp").toString());
|
throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.opnotysupp").toString());
|
||||||
|
@ -7840,7 +7840,7 @@ public class CachedRowSetImpl extends BaseRowSet implements RowSet, RowSetIntern
|
||||||
* @param columnName name of the column
|
* @param columnName name of the column
|
||||||
* @param nClob the value for the column to be updated
|
* @param nClob the value for the column to be updated
|
||||||
* @throws SQLException if a database access error occurs
|
* @throws SQLException if a database access error occurs
|
||||||
* @since 6.0
|
* @since 1.6
|
||||||
*/
|
*/
|
||||||
public void updateNClob(String columnName, NClob nClob) throws SQLException {
|
public void updateNClob(String columnName, NClob nClob) throws SQLException {
|
||||||
throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.opnotysupp").toString());
|
throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.opnotysupp").toString());
|
||||||
|
@ -7855,7 +7855,7 @@ public class CachedRowSetImpl extends BaseRowSet implements RowSet, RowSetIntern
|
||||||
* @return a <code>NClob</code> object representing the SQL
|
* @return a <code>NClob</code> object representing the SQL
|
||||||
* <code>NCLOB</code> value in the specified column
|
* <code>NCLOB</code> value in the specified column
|
||||||
* @exception SQLException if a database access error occurs
|
* @exception SQLException if a database access error occurs
|
||||||
* @since 6.0
|
* @since 1.6
|
||||||
*/
|
*/
|
||||||
public NClob getNClob(int i) throws SQLException {
|
public NClob getNClob(int i) throws SQLException {
|
||||||
throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.opnotysupp").toString());
|
throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.opnotysupp").toString());
|
||||||
|
@ -7871,7 +7871,7 @@ public class CachedRowSetImpl extends BaseRowSet implements RowSet, RowSetIntern
|
||||||
* @return a <code>NClob</code> object representing the SQL <code>NCLOB</code>
|
* @return a <code>NClob</code> object representing the SQL <code>NCLOB</code>
|
||||||
* value in the specified column
|
* value in the specified column
|
||||||
* @exception SQLException if a database access error occurs
|
* @exception SQLException if a database access error occurs
|
||||||
* @since 6.0
|
* @since 1.6
|
||||||
*/
|
*/
|
||||||
public NClob getNClob(String colName) throws SQLException {
|
public NClob getNClob(String colName) throws SQLException {
|
||||||
throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.opnotysupp").toString());
|
throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.opnotysupp").toString());
|
||||||
|
|
|
@ -4505,7 +4505,7 @@ public class JdbcRowSetImpl extends BaseRowSet implements JdbcRowSet, Joinable {
|
||||||
* @param columnIndex the first column is 1, the second is 2, ...
|
* @param columnIndex the first column is 1, the second is 2, ...
|
||||||
* @return a SQLXML object that maps an SQL XML value
|
* @return a SQLXML object that maps an SQL XML value
|
||||||
* @throws SQLException if a database access error occurs
|
* @throws SQLException if a database access error occurs
|
||||||
* @since 6.0
|
* @since 1.6
|
||||||
*/
|
*/
|
||||||
public SQLXML getSQLXML(int columnIndex) throws SQLException {
|
public SQLXML getSQLXML(int columnIndex) throws SQLException {
|
||||||
throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString());
|
throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString());
|
||||||
|
@ -4531,7 +4531,7 @@ public class JdbcRowSetImpl extends BaseRowSet implements JdbcRowSet, Joinable {
|
||||||
* @return the column value if the value is a SQL <code>NULL</code> the
|
* @return the column value if the value is a SQL <code>NULL</code> the
|
||||||
* value returned is <code>null</code>
|
* value returned is <code>null</code>
|
||||||
* @throws SQLException if a database access error occurs
|
* @throws SQLException if a database access error occurs
|
||||||
* @since 6.0
|
* @since 1.6
|
||||||
*/
|
*/
|
||||||
public RowId getRowId(int columnIndex) throws SQLException {
|
public RowId getRowId(int columnIndex) throws SQLException {
|
||||||
throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString());
|
throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString());
|
||||||
|
@ -4546,7 +4546,7 @@ public class JdbcRowSetImpl extends BaseRowSet implements JdbcRowSet, Joinable {
|
||||||
* @return the column value if the value is a SQL <code>NULL</code> the
|
* @return the column value if the value is a SQL <code>NULL</code> the
|
||||||
* value returned is <code>null</code>
|
* value returned is <code>null</code>
|
||||||
* @throws SQLException if a database access error occurs
|
* @throws SQLException if a database access error occurs
|
||||||
* @since 6.0
|
* @since 1.6
|
||||||
*/
|
*/
|
||||||
public RowId getRowId(String columnName) throws SQLException {
|
public RowId getRowId(String columnName) throws SQLException {
|
||||||
throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString());
|
throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString());
|
||||||
|
@ -4562,7 +4562,7 @@ public class JdbcRowSetImpl extends BaseRowSet implements JdbcRowSet, Joinable {
|
||||||
* @param columnIndex the first column is 1, the second 2, ...
|
* @param columnIndex the first column is 1, the second 2, ...
|
||||||
* @param x the column value
|
* @param x the column value
|
||||||
* @throws SQLException if a database access occurs
|
* @throws SQLException if a database access occurs
|
||||||
* @since 6.0
|
* @since 1.6
|
||||||
*/
|
*/
|
||||||
public void updateRowId(int columnIndex, RowId x) throws SQLException {
|
public void updateRowId(int columnIndex, RowId x) throws SQLException {
|
||||||
throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString());
|
throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString());
|
||||||
|
@ -4578,7 +4578,7 @@ public class JdbcRowSetImpl extends BaseRowSet implements JdbcRowSet, Joinable {
|
||||||
* @param columnName the name of the column
|
* @param columnName the name of the column
|
||||||
* @param x the column value
|
* @param x the column value
|
||||||
* @throws SQLException if a database access occurs
|
* @throws SQLException if a database access occurs
|
||||||
* @since 6.0
|
* @since 1.6
|
||||||
*/
|
*/
|
||||||
public void updateRowId(String columnName, RowId x) throws SQLException {
|
public void updateRowId(String columnName, RowId x) throws SQLException {
|
||||||
throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString());
|
throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString());
|
||||||
|
@ -4588,7 +4588,7 @@ public class JdbcRowSetImpl extends BaseRowSet implements JdbcRowSet, Joinable {
|
||||||
* Retrieves the holdability of this ResultSet object
|
* Retrieves the holdability of this ResultSet object
|
||||||
* @return either ResultSet.HOLD_CURSORS_OVER_COMMIT or ResultSet.CLOSE_CURSORS_AT_COMMIT
|
* @return either ResultSet.HOLD_CURSORS_OVER_COMMIT or ResultSet.CLOSE_CURSORS_AT_COMMIT
|
||||||
* @throws SQLException if a database error occurs
|
* @throws SQLException if a database error occurs
|
||||||
* @since 6.0
|
* @since 1.6
|
||||||
*/
|
*/
|
||||||
public int getHoldability() throws SQLException {
|
public int getHoldability() throws SQLException {
|
||||||
throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString());
|
throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString());
|
||||||
|
@ -4599,7 +4599,7 @@ public class JdbcRowSetImpl extends BaseRowSet implements JdbcRowSet, Joinable {
|
||||||
* method close has been called on it, or if it is automatically closed.
|
* method close has been called on it, or if it is automatically closed.
|
||||||
* @return true if this ResultSet object is closed; false if it is still open
|
* @return true if this ResultSet object is closed; false if it is still open
|
||||||
* @throws SQLException if a database access error occurs
|
* @throws SQLException if a database access error occurs
|
||||||
* @since 6.0
|
* @since 1.6
|
||||||
*/
|
*/
|
||||||
public boolean isClosed() throws SQLException {
|
public boolean isClosed() throws SQLException {
|
||||||
throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString());
|
throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString());
|
||||||
|
@ -4611,7 +4611,7 @@ public class JdbcRowSetImpl extends BaseRowSet implements JdbcRowSet, Joinable {
|
||||||
* @param columnIndex the first column is 1, the second 2, ...
|
* @param columnIndex the first column is 1, the second 2, ...
|
||||||
* @param nString the value for the column to be updated
|
* @param nString the value for the column to be updated
|
||||||
* @throws SQLException if a database access error occurs
|
* @throws SQLException if a database access error occurs
|
||||||
* @since 6.0
|
* @since 1.6
|
||||||
*/
|
*/
|
||||||
public void updateNString(int columnIndex, String nString) throws SQLException {
|
public void updateNString(int columnIndex, String nString) throws SQLException {
|
||||||
throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString());
|
throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString());
|
||||||
|
@ -4623,7 +4623,7 @@ public class JdbcRowSetImpl extends BaseRowSet implements JdbcRowSet, Joinable {
|
||||||
* @param columnName name of the Column
|
* @param columnName name of the Column
|
||||||
* @param nString the value for the column to be updated
|
* @param nString the value for the column to be updated
|
||||||
* @throws SQLException if a database access error occurs
|
* @throws SQLException if a database access error occurs
|
||||||
* @since 6.0
|
* @since 1.6
|
||||||
*/
|
*/
|
||||||
public void updateNString(String columnName, String nString) throws SQLException {
|
public void updateNString(String columnName, String nString) throws SQLException {
|
||||||
throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString());
|
throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString());
|
||||||
|
@ -4636,7 +4636,7 @@ public class JdbcRowSetImpl extends BaseRowSet implements JdbcRowSet, Joinable {
|
||||||
* @param columnIndex the first column is 1, the second 2, ...
|
* @param columnIndex the first column is 1, the second 2, ...
|
||||||
* @param nClob the value for the column to be updated
|
* @param nClob the value for the column to be updated
|
||||||
* @throws SQLException if a database access error occurs
|
* @throws SQLException if a database access error occurs
|
||||||
* @since 6.0
|
* @since 1.6
|
||||||
*/
|
*/
|
||||||
public void updateNClob(int columnIndex, NClob nClob) throws SQLException {
|
public void updateNClob(int columnIndex, NClob nClob) throws SQLException {
|
||||||
throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString());
|
throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString());
|
||||||
|
@ -4648,7 +4648,7 @@ public class JdbcRowSetImpl extends BaseRowSet implements JdbcRowSet, Joinable {
|
||||||
* @param columnName name of the column
|
* @param columnName name of the column
|
||||||
* @param nClob the value for the column to be updated
|
* @param nClob the value for the column to be updated
|
||||||
* @throws SQLException if a database access error occurs
|
* @throws SQLException if a database access error occurs
|
||||||
* @since 6.0
|
* @since 1.6
|
||||||
*/
|
*/
|
||||||
public void updateNClob(String columnName, NClob nClob) throws SQLException {
|
public void updateNClob(String columnName, NClob nClob) throws SQLException {
|
||||||
throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString());
|
throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString());
|
||||||
|
@ -4663,7 +4663,7 @@ public class JdbcRowSetImpl extends BaseRowSet implements JdbcRowSet, Joinable {
|
||||||
* @return a <code>NClob</code> object representing the SQL
|
* @return a <code>NClob</code> object representing the SQL
|
||||||
* <code>NCLOB</code> value in the specified column
|
* <code>NCLOB</code> value in the specified column
|
||||||
* @exception SQLException if a database access error occurs
|
* @exception SQLException if a database access error occurs
|
||||||
* @since 6.0
|
* @since 1.6
|
||||||
*/
|
*/
|
||||||
public NClob getNClob(int i) throws SQLException {
|
public NClob getNClob(int i) throws SQLException {
|
||||||
throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString());
|
throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString());
|
||||||
|
@ -4679,7 +4679,7 @@ public class JdbcRowSetImpl extends BaseRowSet implements JdbcRowSet, Joinable {
|
||||||
* @return a <code>NClob</code> object representing the SQL <code>NCLOB</code>
|
* @return a <code>NClob</code> object representing the SQL <code>NCLOB</code>
|
||||||
* value in the specified column
|
* value in the specified column
|
||||||
* @exception SQLException if a database access error occurs
|
* @exception SQLException if a database access error occurs
|
||||||
* @since 6.0
|
* @since 1.6
|
||||||
*/
|
*/
|
||||||
public NClob getNClob(String colName) throws SQLException {
|
public NClob getNClob(String colName) throws SQLException {
|
||||||
throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString());
|
throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString());
|
||||||
|
|
|
@ -76,16 +76,10 @@ import java.io.IOException;
|
||||||
* // attach to target VM
|
* // attach to target VM
|
||||||
* VirtualMachine vm = VirtualMachine.attach("2177");
|
* VirtualMachine vm = VirtualMachine.attach("2177");
|
||||||
*
|
*
|
||||||
* // get system properties in target VM
|
* // start management agent
|
||||||
* Properties props = vm.getSystemProperties();
|
* Properties props = new Properties();
|
||||||
*
|
* props.put("com.sun.management.jmxremote.port", "5000");
|
||||||
* // construct path to management agent
|
* vm.startManagementAgent(props);
|
||||||
* String home = props.getProperty("java.home");
|
|
||||||
* String agent = home + File.separator + "lib" + File.separator
|
|
||||||
* + "management-agent.jar";
|
|
||||||
*
|
|
||||||
* // load agent into target VM
|
|
||||||
* vm.loadAgent(agent, "com.sun.management.jmxremote.port=5000");
|
|
||||||
*
|
*
|
||||||
* // detach
|
* // detach
|
||||||
* vm.detach();
|
* vm.detach();
|
||||||
|
@ -93,9 +87,9 @@ import java.io.IOException;
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* <p> In this example we attach to a Java virtual machine that is identified by
|
* <p> In this example we attach to a Java virtual machine that is identified by
|
||||||
* the process identifier <code>2177</code>. The system properties from the target
|
* the process identifier <code>2177</code>. Then the JMX management agent is
|
||||||
* VM are then used to construct the path to a <i>management agent</i> which is then
|
* started in the target process using the supplied arguments. Finally, the
|
||||||
* loaded into the target VM. Once loaded the client detaches from the target VM. </p>
|
* client detaches from the target VM. </p>
|
||||||
*
|
*
|
||||||
* <p> A VirtualMachine is safe for use by multiple concurrent threads. </p>
|
* <p> A VirtualMachine is safe for use by multiple concurrent threads. </p>
|
||||||
*
|
*
|
||||||
|
@ -610,6 +604,68 @@ public abstract class VirtualMachine {
|
||||||
*/
|
*/
|
||||||
public abstract Properties getAgentProperties() throws IOException;
|
public abstract Properties getAgentProperties() throws IOException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Starts the JMX management agent in the target virtual machine.
|
||||||
|
*
|
||||||
|
* <p> The configuration properties are the same as those specified on
|
||||||
|
* the command line when starting the JMX management agent. In the same
|
||||||
|
* way as on the command line, you need to specify at least the
|
||||||
|
* {@code com.sun.management.jmxremote.port} property.
|
||||||
|
*
|
||||||
|
* <p> See the online documentation for <a
|
||||||
|
* href="../../../../../../../../technotes/guides/management/agent.html">
|
||||||
|
* Monitoring and Management Using JMX Technology</a> for further details.
|
||||||
|
*
|
||||||
|
* @param agentProperties
|
||||||
|
* A Properties object containing the configuration properties
|
||||||
|
* for the agent.
|
||||||
|
*
|
||||||
|
* @throws AttachOperationFailedException
|
||||||
|
* If the target virtual machine is unable to complete the
|
||||||
|
* attach operation. A more specific error message will be
|
||||||
|
* given by {@link AttachOperationFailedException#getMessage()}.
|
||||||
|
*
|
||||||
|
* @throws IOException
|
||||||
|
* If an I/O error occurs, a communication error for example,
|
||||||
|
* that cannot be identified as an error to indicate that the
|
||||||
|
* operation failed in the target VM.
|
||||||
|
*
|
||||||
|
* @throws IllegalArgumentException
|
||||||
|
* If keys or values in agentProperties are invalid.
|
||||||
|
*
|
||||||
|
* @throws NullPointerException
|
||||||
|
* If agentProperties is null.
|
||||||
|
*
|
||||||
|
* @since 1.9
|
||||||
|
*/
|
||||||
|
public abstract void startManagementAgent(Properties agentProperties) throws IOException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Starts the local JMX management agent in the target virtual machine.
|
||||||
|
*
|
||||||
|
* <p> See the online documentation for <a
|
||||||
|
* href="../../../../../../../../technotes/guides/management/agent.html">
|
||||||
|
* Monitoring and Management Using JMX Technology</a> for further details.
|
||||||
|
*
|
||||||
|
* @return The String representation of the local connector's service address.
|
||||||
|
* The value can be parsed by the
|
||||||
|
* {@link javax.management.remote.JMXServiceURL#JMXServiceURL(String)}
|
||||||
|
* constructor.
|
||||||
|
*
|
||||||
|
* @throws AttachOperationFailedException
|
||||||
|
* If the target virtual machine is unable to complete the
|
||||||
|
* attach operation. A more specific error message will be
|
||||||
|
* given by {@link AttachOperationFailedException#getMessage()}.
|
||||||
|
*
|
||||||
|
* @throws IOException
|
||||||
|
* If an I/O error occurs, a communication error for example,
|
||||||
|
* that cannot be identified as an error to indicate that the
|
||||||
|
* operation failed in the target VM.
|
||||||
|
*
|
||||||
|
* @since 1.9
|
||||||
|
*/
|
||||||
|
public abstract String startLocalManagementAgent() throws IOException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a hash-code value for this VirtualMachine. The hash
|
* Returns a hash-code value for this VirtualMachine. The hash
|
||||||
* code is based upon the VirtualMachine's components, and satifies
|
* code is based upon the VirtualMachine's components, and satifies
|
||||||
|
|
|
@ -45,7 +45,7 @@ import javax.accessibility.*;
|
||||||
*
|
*
|
||||||
* @author Arthur van Hoff
|
* @author Arthur van Hoff
|
||||||
* @author Chris Warth
|
* @author Chris Warth
|
||||||
* @since JDK1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
public class Applet extends Panel {
|
public class Applet extends Panel {
|
||||||
|
|
||||||
|
@ -375,7 +375,7 @@ public class Applet extends Panel {
|
||||||
*
|
*
|
||||||
* @return the locale of the applet; if no locale has
|
* @return the locale of the applet; if no locale has
|
||||||
* been set, the default locale is returned.
|
* been set, the default locale is returned.
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public Locale getLocale() {
|
public Locale getLocale() {
|
||||||
Locale locale = super.getLocale();
|
Locale locale = super.getLocale();
|
||||||
|
|
|
@ -43,7 +43,7 @@ import java.util.Iterator;
|
||||||
* information about its environment.
|
* information about its environment.
|
||||||
*
|
*
|
||||||
* @author Arthur van Hoff
|
* @author Arthur van Hoff
|
||||||
* @since JDK1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
public interface AppletContext {
|
public interface AppletContext {
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -35,7 +35,7 @@ import java.net.URL;
|
||||||
*
|
*
|
||||||
* @author Arthur van Hoff
|
* @author Arthur van Hoff
|
||||||
* @see java.applet.Applet#setStub(java.applet.AppletStub)
|
* @see java.applet.Applet#setStub(java.applet.AppletStub)
|
||||||
* @since JDK1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
public interface AppletStub {
|
public interface AppletStub {
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -32,7 +32,7 @@ package java.applet;
|
||||||
* together to produce a composite.
|
* together to produce a composite.
|
||||||
*
|
*
|
||||||
* @author Arthur van Hoff
|
* @author Arthur van Hoff
|
||||||
* @since JDK1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
public interface AudioClip {
|
public interface AudioClip {
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -55,6 +55,6 @@ For overviews, tutorials, examples, guides, and tool documentation, please see:
|
||||||
</ul>
|
</ul>
|
||||||
-->
|
-->
|
||||||
|
|
||||||
@since JDK1.0
|
@since 1.0
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -41,7 +41,7 @@ public class AWTError extends Error {
|
||||||
* Constructs an instance of <code>AWTError</code> with the specified
|
* Constructs an instance of <code>AWTError</code> with the specified
|
||||||
* detail message.
|
* detail message.
|
||||||
* @param msg the detail message.
|
* @param msg the detail message.
|
||||||
* @since JDK1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
public AWTError(String msg) {
|
public AWTError(String msg) {
|
||||||
super(msg);
|
super(msg);
|
||||||
|
|
|
@ -43,7 +43,7 @@ public class AWTException extends Exception {
|
||||||
* instance of <code>String</code> that describes this particular
|
* instance of <code>String</code> that describes this particular
|
||||||
* exception.
|
* exception.
|
||||||
* @param msg the detail message
|
* @param msg the detail message
|
||||||
* @since JDK1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
public AWTException(String msg) {
|
public AWTException(String msg) {
|
||||||
super(msg);
|
super(msg);
|
||||||
|
|
|
@ -119,7 +119,7 @@ import java.util.Hashtable;
|
||||||
* @author Arthur van Hoff
|
* @author Arthur van Hoff
|
||||||
* @see java.awt.Container#add(String, Component)
|
* @see java.awt.Container#add(String, Component)
|
||||||
* @see java.awt.ComponentOrientation
|
* @see java.awt.ComponentOrientation
|
||||||
* @since JDK1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
public class BorderLayout implements LayoutManager2,
|
public class BorderLayout implements LayoutManager2,
|
||||||
java.io.Serializable {
|
java.io.Serializable {
|
||||||
|
@ -367,7 +367,7 @@ public class BorderLayout implements LayoutManager2,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the horizontal gap between components.
|
* Returns the horizontal gap between components.
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public int getHgap() {
|
public int getHgap() {
|
||||||
return hgap;
|
return hgap;
|
||||||
|
@ -376,7 +376,7 @@ public class BorderLayout implements LayoutManager2,
|
||||||
/**
|
/**
|
||||||
* Sets the horizontal gap between components.
|
* Sets the horizontal gap between components.
|
||||||
* @param hgap the horizontal gap between components
|
* @param hgap the horizontal gap between components
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public void setHgap(int hgap) {
|
public void setHgap(int hgap) {
|
||||||
this.hgap = hgap;
|
this.hgap = hgap;
|
||||||
|
@ -384,7 +384,7 @@ public class BorderLayout implements LayoutManager2,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the vertical gap between components.
|
* Returns the vertical gap between components.
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public int getVgap() {
|
public int getVgap() {
|
||||||
return vgap;
|
return vgap;
|
||||||
|
@ -393,7 +393,7 @@ public class BorderLayout implements LayoutManager2,
|
||||||
/**
|
/**
|
||||||
* Sets the vertical gap between components.
|
* Sets the vertical gap between components.
|
||||||
* @param vgap the vertical gap between components
|
* @param vgap the vertical gap between components
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public void setVgap(int vgap) {
|
public void setVgap(int vgap) {
|
||||||
this.vgap = vgap;
|
this.vgap = vgap;
|
||||||
|
@ -415,7 +415,7 @@ public class BorderLayout implements LayoutManager2,
|
||||||
* @see java.awt.Container#add(java.awt.Component, java.lang.Object)
|
* @see java.awt.Container#add(java.awt.Component, java.lang.Object)
|
||||||
* @exception IllegalArgumentException if the constraint object is not
|
* @exception IllegalArgumentException if the constraint object is not
|
||||||
* a string, or if it not one of the five specified constants.
|
* a string, or if it not one of the five specified constants.
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public void addLayoutComponent(Component comp, Object constraints) {
|
public void addLayoutComponent(Component comp, Object constraints) {
|
||||||
synchronized (comp.getTreeLock()) {
|
synchronized (comp.getTreeLock()) {
|
||||||
|
|
|
@ -82,7 +82,7 @@ import javax.accessibility.*;
|
||||||
* @see java.awt.event.ActionListener
|
* @see java.awt.event.ActionListener
|
||||||
* @see java.awt.Component#processMouseEvent
|
* @see java.awt.Component#processMouseEvent
|
||||||
* @see java.awt.Component#addMouseListener
|
* @see java.awt.Component#addMouseListener
|
||||||
* @since JDK1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
public class Button extends Component implements Accessible {
|
public class Button extends Component implements Accessible {
|
||||||
|
|
||||||
|
@ -228,7 +228,7 @@ public class Button extends Component implements Accessible {
|
||||||
* If the string is <code>null</code> then the action command
|
* If the string is <code>null</code> then the action command
|
||||||
* is set to match the label of the button.
|
* is set to match the label of the button.
|
||||||
* @see java.awt.event.ActionEvent
|
* @see java.awt.event.ActionEvent
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public void setActionCommand(String command) {
|
public void setActionCommand(String command) {
|
||||||
actionCommand = command;
|
actionCommand = command;
|
||||||
|
@ -255,7 +255,7 @@ public class Button extends Component implements Accessible {
|
||||||
* @see #removeActionListener
|
* @see #removeActionListener
|
||||||
* @see #getActionListeners
|
* @see #getActionListeners
|
||||||
* @see java.awt.event.ActionListener
|
* @see java.awt.event.ActionListener
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public synchronized void addActionListener(ActionListener l) {
|
public synchronized void addActionListener(ActionListener l) {
|
||||||
if (l == null) {
|
if (l == null) {
|
||||||
|
@ -277,7 +277,7 @@ public class Button extends Component implements Accessible {
|
||||||
* @see #addActionListener
|
* @see #addActionListener
|
||||||
* @see #getActionListeners
|
* @see #getActionListeners
|
||||||
* @see java.awt.event.ActionListener
|
* @see java.awt.event.ActionListener
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public synchronized void removeActionListener(ActionListener l) {
|
public synchronized void removeActionListener(ActionListener l) {
|
||||||
if (l == null) {
|
if (l == null) {
|
||||||
|
@ -370,7 +370,7 @@ public class Button extends Component implements Accessible {
|
||||||
* @param e the event
|
* @param e the event
|
||||||
* @see java.awt.event.ActionEvent
|
* @see java.awt.event.ActionEvent
|
||||||
* @see java.awt.Button#processActionEvent
|
* @see java.awt.Button#processActionEvent
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
protected void processEvent(AWTEvent e) {
|
protected void processEvent(AWTEvent e) {
|
||||||
if (e instanceof ActionEvent) {
|
if (e instanceof ActionEvent) {
|
||||||
|
@ -401,7 +401,7 @@ public class Button extends Component implements Accessible {
|
||||||
* @see java.awt.event.ActionListener
|
* @see java.awt.event.ActionListener
|
||||||
* @see java.awt.Button#addActionListener
|
* @see java.awt.Button#addActionListener
|
||||||
* @see java.awt.Component#enableEvents
|
* @see java.awt.Component#enableEvents
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
protected void processActionEvent(ActionEvent e) {
|
protected void processActionEvent(ActionEvent e) {
|
||||||
ActionListener listener = actionListener;
|
ActionListener listener = actionListener;
|
||||||
|
|
|
@ -39,7 +39,7 @@ import javax.accessibility.*;
|
||||||
* in order to perform custom graphics on the canvas.
|
* in order to perform custom graphics on the canvas.
|
||||||
*
|
*
|
||||||
* @author Sami Shaio
|
* @author Sami Shaio
|
||||||
* @since JDK1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
public class Canvas extends Component implements Accessible {
|
public class Canvas extends Component implements Accessible {
|
||||||
|
|
||||||
|
|
|
@ -53,7 +53,7 @@ import java.io.IOException;
|
||||||
*
|
*
|
||||||
* @author Arthur van Hoff
|
* @author Arthur van Hoff
|
||||||
* @see java.awt.Container
|
* @see java.awt.Container
|
||||||
* @since JDK1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class CardLayout implements LayoutManager2,
|
public class CardLayout implements LayoutManager2,
|
||||||
|
@ -148,7 +148,7 @@ public class CardLayout implements LayoutManager2,
|
||||||
* @return the horizontal gap between components.
|
* @return the horizontal gap between components.
|
||||||
* @see java.awt.CardLayout#setHgap(int)
|
* @see java.awt.CardLayout#setHgap(int)
|
||||||
* @see java.awt.CardLayout#getVgap()
|
* @see java.awt.CardLayout#getVgap()
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public int getHgap() {
|
public int getHgap() {
|
||||||
return hgap;
|
return hgap;
|
||||||
|
@ -159,7 +159,7 @@ public class CardLayout implements LayoutManager2,
|
||||||
* @param hgap the horizontal gap between components.
|
* @param hgap the horizontal gap between components.
|
||||||
* @see java.awt.CardLayout#getHgap()
|
* @see java.awt.CardLayout#getHgap()
|
||||||
* @see java.awt.CardLayout#setVgap(int)
|
* @see java.awt.CardLayout#setVgap(int)
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public void setHgap(int hgap) {
|
public void setHgap(int hgap) {
|
||||||
this.hgap = hgap;
|
this.hgap = hgap;
|
||||||
|
@ -180,7 +180,7 @@ public class CardLayout implements LayoutManager2,
|
||||||
* @param vgap the vertical gap between components.
|
* @param vgap the vertical gap between components.
|
||||||
* @see java.awt.CardLayout#getVgap()
|
* @see java.awt.CardLayout#getVgap()
|
||||||
* @see java.awt.CardLayout#setHgap(int)
|
* @see java.awt.CardLayout#setHgap(int)
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public void setVgap(int vgap) {
|
public void setVgap(int vgap) {
|
||||||
this.vgap = vgap;
|
this.vgap = vgap;
|
||||||
|
|
|
@ -71,7 +71,7 @@ import javax.accessibility.*;
|
||||||
* @author Sami Shaio
|
* @author Sami Shaio
|
||||||
* @see java.awt.GridLayout
|
* @see java.awt.GridLayout
|
||||||
* @see java.awt.CheckboxGroup
|
* @see java.awt.CheckboxGroup
|
||||||
* @since JDK1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
public class Checkbox extends Component implements ItemSelectable, Accessible {
|
public class Checkbox extends Component implements ItemSelectable, Accessible {
|
||||||
|
|
||||||
|
@ -190,7 +190,7 @@ public class Checkbox extends Component implements ItemSelectable, Accessible {
|
||||||
* <code>GraphicsEnvironment.isHeadless</code>
|
* <code>GraphicsEnvironment.isHeadless</code>
|
||||||
* returns <code>true</code>
|
* returns <code>true</code>
|
||||||
* @see java.awt.GraphicsEnvironment#isHeadless
|
* @see java.awt.GraphicsEnvironment#isHeadless
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public Checkbox(String label, boolean state, CheckboxGroup group)
|
public Checkbox(String label, boolean state, CheckboxGroup group)
|
||||||
throws HeadlessException {
|
throws HeadlessException {
|
||||||
|
@ -216,7 +216,7 @@ public class Checkbox extends Component implements ItemSelectable, Accessible {
|
||||||
* <code>GraphicsEnvironment.isHeadless</code>
|
* <code>GraphicsEnvironment.isHeadless</code>
|
||||||
* returns <code>true</code>
|
* returns <code>true</code>
|
||||||
* @see java.awt.GraphicsEnvironment#isHeadless
|
* @see java.awt.GraphicsEnvironment#isHeadless
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public Checkbox(String label, CheckboxGroup group, boolean state)
|
public Checkbox(String label, CheckboxGroup group, boolean state)
|
||||||
throws HeadlessException {
|
throws HeadlessException {
|
||||||
|
@ -424,7 +424,7 @@ public class Checkbox extends Component implements ItemSelectable, Accessible {
|
||||||
* @see #setState
|
* @see #setState
|
||||||
* @see java.awt.event.ItemEvent
|
* @see java.awt.event.ItemEvent
|
||||||
* @see java.awt.event.ItemListener
|
* @see java.awt.event.ItemListener
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public synchronized void addItemListener(ItemListener l) {
|
public synchronized void addItemListener(ItemListener l) {
|
||||||
if (l == null) {
|
if (l == null) {
|
||||||
|
@ -446,7 +446,7 @@ public class Checkbox extends Component implements ItemSelectable, Accessible {
|
||||||
* @see #getItemListeners
|
* @see #getItemListeners
|
||||||
* @see java.awt.event.ItemEvent
|
* @see java.awt.event.ItemEvent
|
||||||
* @see java.awt.event.ItemListener
|
* @see java.awt.event.ItemListener
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public synchronized void removeItemListener(ItemListener l) {
|
public synchronized void removeItemListener(ItemListener l) {
|
||||||
if (l == null) {
|
if (l == null) {
|
||||||
|
@ -540,7 +540,7 @@ public class Checkbox extends Component implements ItemSelectable, Accessible {
|
||||||
* @param e the event
|
* @param e the event
|
||||||
* @see java.awt.event.ItemEvent
|
* @see java.awt.event.ItemEvent
|
||||||
* @see #processItemEvent
|
* @see #processItemEvent
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
protected void processEvent(AWTEvent e) {
|
protected void processEvent(AWTEvent e) {
|
||||||
if (e instanceof ItemEvent) {
|
if (e instanceof ItemEvent) {
|
||||||
|
@ -572,7 +572,7 @@ public class Checkbox extends Component implements ItemSelectable, Accessible {
|
||||||
* @see java.awt.event.ItemListener
|
* @see java.awt.event.ItemListener
|
||||||
* @see #addItemListener
|
* @see #addItemListener
|
||||||
* @see java.awt.Component#enableEvents
|
* @see java.awt.Component#enableEvents
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
protected void processItemEvent(ItemEvent e) {
|
protected void processItemEvent(ItemEvent e) {
|
||||||
ItemListener listener = itemListener;
|
ItemListener listener = itemListener;
|
||||||
|
|
|
@ -52,7 +52,7 @@ package java.awt;
|
||||||
*
|
*
|
||||||
* @author Sami Shaio
|
* @author Sami Shaio
|
||||||
* @see java.awt.Checkbox
|
* @see java.awt.Checkbox
|
||||||
* @since JDK1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
public class CheckboxGroup implements java.io.Serializable {
|
public class CheckboxGroup implements java.io.Serializable {
|
||||||
/**
|
/**
|
||||||
|
@ -84,7 +84,7 @@ public class CheckboxGroup implements java.io.Serializable {
|
||||||
* "on" state, or <code>null</code>.
|
* "on" state, or <code>null</code>.
|
||||||
* @see java.awt.Checkbox
|
* @see java.awt.Checkbox
|
||||||
* @see java.awt.CheckboxGroup#setSelectedCheckbox
|
* @see java.awt.CheckboxGroup#setSelectedCheckbox
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public Checkbox getSelectedCheckbox() {
|
public Checkbox getSelectedCheckbox() {
|
||||||
return getCurrent();
|
return getCurrent();
|
||||||
|
@ -113,7 +113,7 @@ public class CheckboxGroup implements java.io.Serializable {
|
||||||
* current selection.
|
* current selection.
|
||||||
* @see java.awt.Checkbox
|
* @see java.awt.Checkbox
|
||||||
* @see java.awt.CheckboxGroup#getSelectedCheckbox
|
* @see java.awt.CheckboxGroup#getSelectedCheckbox
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public void setSelectedCheckbox(Checkbox box) {
|
public void setSelectedCheckbox(Checkbox box) {
|
||||||
setCurrent(box);
|
setCurrent(box);
|
||||||
|
|
|
@ -59,7 +59,7 @@ import sun.awt.AWTAccessor;
|
||||||
* @author Sami Shaio
|
* @author Sami Shaio
|
||||||
* @see java.awt.event.ItemEvent
|
* @see java.awt.event.ItemEvent
|
||||||
* @see java.awt.event.ItemListener
|
* @see java.awt.event.ItemListener
|
||||||
* @since JDK1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
public class CheckboxMenuItem extends MenuItem implements ItemSelectable, Accessible {
|
public class CheckboxMenuItem extends MenuItem implements ItemSelectable, Accessible {
|
||||||
|
|
||||||
|
@ -102,7 +102,7 @@ public class CheckboxMenuItem extends MenuItem implements ItemSelectable, Access
|
||||||
* @exception HeadlessException if GraphicsEnvironment.isHeadless()
|
* @exception HeadlessException if GraphicsEnvironment.isHeadless()
|
||||||
* returns true
|
* returns true
|
||||||
* @see java.awt.GraphicsEnvironment#isHeadless
|
* @see java.awt.GraphicsEnvironment#isHeadless
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public CheckboxMenuItem() throws HeadlessException {
|
public CheckboxMenuItem() throws HeadlessException {
|
||||||
this("", false);
|
this("", false);
|
||||||
|
@ -132,7 +132,7 @@ public class CheckboxMenuItem extends MenuItem implements ItemSelectable, Access
|
||||||
* @exception HeadlessException if GraphicsEnvironment.isHeadless()
|
* @exception HeadlessException if GraphicsEnvironment.isHeadless()
|
||||||
* returns true
|
* returns true
|
||||||
* @see java.awt.GraphicsEnvironment#isHeadless
|
* @see java.awt.GraphicsEnvironment#isHeadless
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public CheckboxMenuItem(String label, boolean state)
|
public CheckboxMenuItem(String label, boolean state)
|
||||||
throws HeadlessException {
|
throws HeadlessException {
|
||||||
|
@ -231,7 +231,7 @@ public class CheckboxMenuItem extends MenuItem implements ItemSelectable, Access
|
||||||
* @see #setState
|
* @see #setState
|
||||||
* @see java.awt.event.ItemEvent
|
* @see java.awt.event.ItemEvent
|
||||||
* @see java.awt.event.ItemListener
|
* @see java.awt.event.ItemListener
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public synchronized void addItemListener(ItemListener l) {
|
public synchronized void addItemListener(ItemListener l) {
|
||||||
if (l == null) {
|
if (l == null) {
|
||||||
|
@ -253,7 +253,7 @@ public class CheckboxMenuItem extends MenuItem implements ItemSelectable, Access
|
||||||
* @see #getItemListeners
|
* @see #getItemListeners
|
||||||
* @see java.awt.event.ItemEvent
|
* @see java.awt.event.ItemEvent
|
||||||
* @see java.awt.event.ItemListener
|
* @see java.awt.event.ItemListener
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public synchronized void removeItemListener(ItemListener l) {
|
public synchronized void removeItemListener(ItemListener l) {
|
||||||
if (l == null) {
|
if (l == null) {
|
||||||
|
@ -350,7 +350,7 @@ public class CheckboxMenuItem extends MenuItem implements ItemSelectable, Access
|
||||||
* @param e the event
|
* @param e the event
|
||||||
* @see java.awt.event.ItemEvent
|
* @see java.awt.event.ItemEvent
|
||||||
* @see #processItemEvent
|
* @see #processItemEvent
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
protected void processEvent(AWTEvent e) {
|
protected void processEvent(AWTEvent e) {
|
||||||
if (e instanceof ItemEvent) {
|
if (e instanceof ItemEvent) {
|
||||||
|
@ -381,7 +381,7 @@ public class CheckboxMenuItem extends MenuItem implements ItemSelectable, Access
|
||||||
* @see java.awt.event.ItemListener
|
* @see java.awt.event.ItemListener
|
||||||
* @see #addItemListener
|
* @see #addItemListener
|
||||||
* @see java.awt.MenuItem#enableEvents
|
* @see java.awt.MenuItem#enableEvents
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
protected void processItemEvent(ItemEvent e) {
|
protected void processItemEvent(ItemEvent e) {
|
||||||
ItemListener listener = itemListener;
|
ItemListener listener = itemListener;
|
||||||
|
|
|
@ -68,7 +68,7 @@ import javax.accessibility.*;
|
||||||
*
|
*
|
||||||
* @author Sami Shaio
|
* @author Sami Shaio
|
||||||
* @author Arthur van Hoff
|
* @author Arthur van Hoff
|
||||||
* @since JDK1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
public class Choice extends Component implements ItemSelectable, Accessible {
|
public class Choice extends Component implements ItemSelectable, Accessible {
|
||||||
/**
|
/**
|
||||||
|
@ -158,7 +158,7 @@ public class Choice extends Component implements ItemSelectable, Accessible {
|
||||||
* Returns the number of items in this <code>Choice</code> menu.
|
* Returns the number of items in this <code>Choice</code> menu.
|
||||||
* @return the number of items in this <code>Choice</code> menu
|
* @return the number of items in this <code>Choice</code> menu
|
||||||
* @see #getItem
|
* @see #getItem
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public int getItemCount() {
|
public int getItemCount() {
|
||||||
return countItems();
|
return countItems();
|
||||||
|
@ -196,7 +196,7 @@ public class Choice extends Component implements ItemSelectable, Accessible {
|
||||||
* @param item the item to be added
|
* @param item the item to be added
|
||||||
* @exception NullPointerException if the item's value is
|
* @exception NullPointerException if the item's value is
|
||||||
* <code>null</code>
|
* <code>null</code>
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public void add(String item) {
|
public void add(String item) {
|
||||||
addItem(item);
|
addItem(item);
|
||||||
|
@ -291,7 +291,7 @@ public class Choice extends Component implements ItemSelectable, Accessible {
|
||||||
* @param item the item to remove from this <code>Choice</code> menu
|
* @param item the item to remove from this <code>Choice</code> menu
|
||||||
* @exception IllegalArgumentException if the item doesn't
|
* @exception IllegalArgumentException if the item doesn't
|
||||||
* exist in the choice menu
|
* exist in the choice menu
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public void remove(String item) {
|
public void remove(String item) {
|
||||||
synchronized (this) {
|
synchronized (this) {
|
||||||
|
@ -319,7 +319,7 @@ public class Choice extends Component implements ItemSelectable, Accessible {
|
||||||
* @param position the position of the item
|
* @param position the position of the item
|
||||||
* @throws IndexOutOfBoundsException if the specified
|
* @throws IndexOutOfBoundsException if the specified
|
||||||
* position is out of bounds
|
* position is out of bounds
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public void remove(int position) {
|
public void remove(int position) {
|
||||||
synchronized (this) {
|
synchronized (this) {
|
||||||
|
@ -357,7 +357,7 @@ public class Choice extends Component implements ItemSelectable, Accessible {
|
||||||
/**
|
/**
|
||||||
* Removes all items from the choice menu.
|
* Removes all items from the choice menu.
|
||||||
* @see #remove
|
* @see #remove
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public void removeAll() {
|
public void removeAll() {
|
||||||
synchronized (this) {
|
synchronized (this) {
|
||||||
|
@ -475,7 +475,7 @@ public class Choice extends Component implements ItemSelectable, Accessible {
|
||||||
* @see #select
|
* @see #select
|
||||||
* @see java.awt.event.ItemEvent
|
* @see java.awt.event.ItemEvent
|
||||||
* @see java.awt.event.ItemListener
|
* @see java.awt.event.ItemListener
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public synchronized void addItemListener(ItemListener l) {
|
public synchronized void addItemListener(ItemListener l) {
|
||||||
if (l == null) {
|
if (l == null) {
|
||||||
|
@ -497,7 +497,7 @@ public class Choice extends Component implements ItemSelectable, Accessible {
|
||||||
* @see #getItemListeners
|
* @see #getItemListeners
|
||||||
* @see java.awt.event.ItemEvent
|
* @see java.awt.event.ItemEvent
|
||||||
* @see java.awt.event.ItemListener
|
* @see java.awt.event.ItemListener
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public synchronized void removeItemListener(ItemListener l) {
|
public synchronized void removeItemListener(ItemListener l) {
|
||||||
if (l == null) {
|
if (l == null) {
|
||||||
|
@ -591,7 +591,7 @@ public class Choice extends Component implements ItemSelectable, Accessible {
|
||||||
* @param e the event
|
* @param e the event
|
||||||
* @see java.awt.event.ItemEvent
|
* @see java.awt.event.ItemEvent
|
||||||
* @see #processItemEvent
|
* @see #processItemEvent
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
protected void processEvent(AWTEvent e) {
|
protected void processEvent(AWTEvent e) {
|
||||||
if (e instanceof ItemEvent) {
|
if (e instanceof ItemEvent) {
|
||||||
|
@ -623,7 +623,7 @@ public class Choice extends Component implements ItemSelectable, Accessible {
|
||||||
* @see java.awt.event.ItemListener
|
* @see java.awt.event.ItemListener
|
||||||
* @see #addItemListener(ItemListener)
|
* @see #addItemListener(ItemListener)
|
||||||
* @see java.awt.Component#enableEvents
|
* @see java.awt.Component#enableEvents
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
protected void processItemEvent(ItemEvent e) {
|
protected void processItemEvent(ItemEvent e) {
|
||||||
ItemListener listener = itemListener;
|
ItemListener listener = itemListener;
|
||||||
|
|
|
@ -597,7 +597,7 @@ public class Color implements Paint, java.io.Serializable {
|
||||||
* @see #getRed
|
* @see #getRed
|
||||||
* @see #getGreen
|
* @see #getGreen
|
||||||
* @see #getBlue
|
* @see #getBlue
|
||||||
* @since JDK1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
public int getRGB() {
|
public int getRGB() {
|
||||||
return value;
|
return value;
|
||||||
|
@ -621,7 +621,7 @@ public class Color implements Paint, java.io.Serializable {
|
||||||
* a brighter version of this <code>Color</code>
|
* a brighter version of this <code>Color</code>
|
||||||
* with the same {@code alpha} value.
|
* with the same {@code alpha} value.
|
||||||
* @see java.awt.Color#darker
|
* @see java.awt.Color#darker
|
||||||
* @since JDK1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
public Color brighter() {
|
public Color brighter() {
|
||||||
int r = getRed();
|
int r = getRed();
|
||||||
|
@ -664,7 +664,7 @@ public class Color implements Paint, java.io.Serializable {
|
||||||
* a darker version of this <code>Color</code>
|
* a darker version of this <code>Color</code>
|
||||||
* with the same {@code alpha} value.
|
* with the same {@code alpha} value.
|
||||||
* @see java.awt.Color#brighter
|
* @see java.awt.Color#brighter
|
||||||
* @since JDK1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
public Color darker() {
|
public Color darker() {
|
||||||
return new Color(Math.max((int)(getRed() *FACTOR), 0),
|
return new Color(Math.max((int)(getRed() *FACTOR), 0),
|
||||||
|
@ -676,7 +676,7 @@ public class Color implements Paint, java.io.Serializable {
|
||||||
/**
|
/**
|
||||||
* Computes the hash code for this <code>Color</code>.
|
* Computes the hash code for this <code>Color</code>.
|
||||||
* @return a hash code value for this object.
|
* @return a hash code value for this object.
|
||||||
* @since JDK1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return value;
|
return value;
|
||||||
|
@ -693,7 +693,7 @@ public class Color implements Paint, java.io.Serializable {
|
||||||
* <code>Color</code>
|
* <code>Color</code>
|
||||||
* @return <code>true</code> if the objects are the same;
|
* @return <code>true</code> if the objects are the same;
|
||||||
* <code>false</code> otherwise.
|
* <code>false</code> otherwise.
|
||||||
* @since JDK1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
public boolean equals(Object obj) {
|
public boolean equals(Object obj) {
|
||||||
return obj instanceof Color && ((Color)obj).getRGB() == this.getRGB();
|
return obj instanceof Color && ((Color)obj).getRGB() == this.getRGB();
|
||||||
|
@ -723,7 +723,7 @@ public class Color implements Paint, java.io.Serializable {
|
||||||
* @exception NumberFormatException if the specified string cannot
|
* @exception NumberFormatException if the specified string cannot
|
||||||
* be interpreted as a decimal,
|
* be interpreted as a decimal,
|
||||||
* octal, or hexadecimal integer.
|
* octal, or hexadecimal integer.
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public static Color decode(String nm) throws NumberFormatException {
|
public static Color decode(String nm) throws NumberFormatException {
|
||||||
Integer intval = Integer.decode(nm);
|
Integer intval = Integer.decode(nm);
|
||||||
|
@ -747,7 +747,7 @@ public class Color implements Paint, java.io.Serializable {
|
||||||
* @see java.lang.System#getProperty(java.lang.String)
|
* @see java.lang.System#getProperty(java.lang.String)
|
||||||
* @see java.lang.Integer#getInteger(java.lang.String)
|
* @see java.lang.Integer#getInteger(java.lang.String)
|
||||||
* @see java.awt.Color#Color(int)
|
* @see java.awt.Color#Color(int)
|
||||||
* @since JDK1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
public static Color getColor(String nm) {
|
public static Color getColor(String nm) {
|
||||||
return getColor(nm, null);
|
return getColor(nm, null);
|
||||||
|
@ -771,7 +771,7 @@ public class Color implements Paint, java.io.Serializable {
|
||||||
* @see java.lang.System#getProperty(java.lang.String)
|
* @see java.lang.System#getProperty(java.lang.String)
|
||||||
* @see java.lang.Integer#getInteger(java.lang.String)
|
* @see java.lang.Integer#getInteger(java.lang.String)
|
||||||
* @see java.awt.Color#Color(int)
|
* @see java.awt.Color#Color(int)
|
||||||
* @since JDK1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
public static Color getColor(String nm, Color v) {
|
public static Color getColor(String nm, Color v) {
|
||||||
Integer intval = Integer.getInteger(nm);
|
Integer intval = Integer.getInteger(nm);
|
||||||
|
@ -801,7 +801,7 @@ public class Color implements Paint, java.io.Serializable {
|
||||||
* @see java.lang.System#getProperty(java.lang.String)
|
* @see java.lang.System#getProperty(java.lang.String)
|
||||||
* @see java.lang.Integer#getInteger(java.lang.String)
|
* @see java.lang.Integer#getInteger(java.lang.String)
|
||||||
* @see java.awt.Color#Color(int)
|
* @see java.awt.Color#Color(int)
|
||||||
* @since JDK1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
public static Color getColor(String nm, int v) {
|
public static Color getColor(String nm, int v) {
|
||||||
Integer intval = Integer.getInteger(nm);
|
Integer intval = Integer.getInteger(nm);
|
||||||
|
@ -834,7 +834,7 @@ public class Color implements Paint, java.io.Serializable {
|
||||||
* @see java.awt.Color#getRGB()
|
* @see java.awt.Color#getRGB()
|
||||||
* @see java.awt.Color#Color(int)
|
* @see java.awt.Color#Color(int)
|
||||||
* @see java.awt.image.ColorModel#getRGBdefault()
|
* @see java.awt.image.ColorModel#getRGBdefault()
|
||||||
* @since JDK1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
public static int HSBtoRGB(float hue, float saturation, float brightness) {
|
public static int HSBtoRGB(float hue, float saturation, float brightness) {
|
||||||
int r = 0, g = 0, b = 0;
|
int r = 0, g = 0, b = 0;
|
||||||
|
@ -902,7 +902,7 @@ public class Color implements Paint, java.io.Serializable {
|
||||||
* @see java.awt.Color#getRGB()
|
* @see java.awt.Color#getRGB()
|
||||||
* @see java.awt.Color#Color(int)
|
* @see java.awt.Color#Color(int)
|
||||||
* @see java.awt.image.ColorModel#getRGBdefault()
|
* @see java.awt.image.ColorModel#getRGBdefault()
|
||||||
* @since JDK1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
public static float[] RGBtoHSB(int r, int g, int b, float[] hsbvals) {
|
public static float[] RGBtoHSB(int r, int g, int b, float[] hsbvals) {
|
||||||
float hue, saturation, brightness;
|
float hue, saturation, brightness;
|
||||||
|
@ -957,7 +957,7 @@ public class Color implements Paint, java.io.Serializable {
|
||||||
* @param b the brightness of the color
|
* @param b the brightness of the color
|
||||||
* @return a <code>Color</code> object with the specified hue,
|
* @return a <code>Color</code> object with the specified hue,
|
||||||
* saturation, and brightness.
|
* saturation, and brightness.
|
||||||
* @since JDK1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
public static Color getHSBColor(float h, float s, float b) {
|
public static Color getHSBColor(float h, float s, float b) {
|
||||||
return new Color(HSBtoRGB(h, s, b));
|
return new Color(HSBtoRGB(h, s, b));
|
||||||
|
|
|
@ -1018,7 +1018,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||||
* Gets the name of the component.
|
* Gets the name of the component.
|
||||||
* @return this component's name
|
* @return this component's name
|
||||||
* @see #setName
|
* @see #setName
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public String getName() {
|
public String getName() {
|
||||||
if (name == null && !nameExplicitlySet) {
|
if (name == null && !nameExplicitlySet) {
|
||||||
|
@ -1035,7 +1035,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||||
* @param name the string that is to be this
|
* @param name the string that is to be this
|
||||||
* component's name
|
* component's name
|
||||||
* @see #getName
|
* @see #getName
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public void setName(String name) {
|
public void setName(String name) {
|
||||||
String oldName;
|
String oldName;
|
||||||
|
@ -1050,7 +1050,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||||
/**
|
/**
|
||||||
* Gets the parent of this component.
|
* Gets the parent of this component.
|
||||||
* @return the parent container of this component
|
* @return the parent container of this component
|
||||||
* @since JDK1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
public Container getParent() {
|
public Container getParent() {
|
||||||
return getParent_NoClientCode();
|
return getParent_NoClientCode();
|
||||||
|
@ -1221,7 +1221,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||||
* toolkit is used by that component. Therefore if the component
|
* toolkit is used by that component. Therefore if the component
|
||||||
* is moved from one frame to another, the toolkit it uses may change.
|
* is moved from one frame to another, the toolkit it uses may change.
|
||||||
* @return the toolkit of this component
|
* @return the toolkit of this component
|
||||||
* @since JDK1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
public Toolkit getToolkit() {
|
public Toolkit getToolkit() {
|
||||||
return getToolkitImpl();
|
return getToolkitImpl();
|
||||||
|
@ -1250,7 +1250,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||||
* otherwise
|
* otherwise
|
||||||
* @see #validate
|
* @see #validate
|
||||||
* @see #invalidate
|
* @see #invalidate
|
||||||
* @since JDK1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
public boolean isValid() {
|
public boolean isValid() {
|
||||||
return (peer != null) && valid;
|
return (peer != null) && valid;
|
||||||
|
@ -1292,7 +1292,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||||
* @return <code>true</code> if the component is visible,
|
* @return <code>true</code> if the component is visible,
|
||||||
* <code>false</code> otherwise
|
* <code>false</code> otherwise
|
||||||
* @see #setVisible
|
* @see #setVisible
|
||||||
* @since JDK1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
@Transient
|
@Transient
|
||||||
public boolean isVisible() {
|
public boolean isVisible() {
|
||||||
|
@ -1419,7 +1419,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||||
* @return <code>true</code> if the component is showing,
|
* @return <code>true</code> if the component is showing,
|
||||||
* <code>false</code> otherwise
|
* <code>false</code> otherwise
|
||||||
* @see #setVisible
|
* @see #setVisible
|
||||||
* @since JDK1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
public boolean isShowing() {
|
public boolean isShowing() {
|
||||||
if (visible && (peer != null)) {
|
if (visible && (peer != null)) {
|
||||||
|
@ -1437,7 +1437,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||||
* @return <code>true</code> if the component is enabled,
|
* @return <code>true</code> if the component is enabled,
|
||||||
* <code>false</code> otherwise
|
* <code>false</code> otherwise
|
||||||
* @see #setEnabled
|
* @see #setEnabled
|
||||||
* @since JDK1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
public boolean isEnabled() {
|
public boolean isEnabled() {
|
||||||
return isEnabledImpl();
|
return isEnabledImpl();
|
||||||
|
@ -1466,7 +1466,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||||
* enabled; otherwise this component is disabled
|
* enabled; otherwise this component is disabled
|
||||||
* @see #isEnabled
|
* @see #isEnabled
|
||||||
* @see #isLightweight
|
* @see #isLightweight
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public void setEnabled(boolean b) {
|
public void setEnabled(boolean b) {
|
||||||
enable(b);
|
enable(b);
|
||||||
|
@ -1611,7 +1611,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||||
* otherwise, hides this component
|
* otherwise, hides this component
|
||||||
* @see #isVisible
|
* @see #isVisible
|
||||||
* @see #invalidate
|
* @see #invalidate
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public void setVisible(boolean b) {
|
public void setVisible(boolean b) {
|
||||||
show(b);
|
show(b);
|
||||||
|
@ -1739,7 +1739,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||||
* not have a foreground color, the foreground color of its parent
|
* not have a foreground color, the foreground color of its parent
|
||||||
* is returned
|
* is returned
|
||||||
* @see #setForeground
|
* @see #setForeground
|
||||||
* @since JDK1.0
|
* @since 1.0
|
||||||
* @beaninfo
|
* @beaninfo
|
||||||
* bound: true
|
* bound: true
|
||||||
*/
|
*/
|
||||||
|
@ -1760,7 +1760,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||||
* then this component will inherit
|
* then this component will inherit
|
||||||
* the foreground color of its parent
|
* the foreground color of its parent
|
||||||
* @see #getForeground
|
* @see #getForeground
|
||||||
* @since JDK1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
public void setForeground(Color c) {
|
public void setForeground(Color c) {
|
||||||
Color oldColor = foreground;
|
Color oldColor = foreground;
|
||||||
|
@ -1796,7 +1796,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||||
* not have a background color,
|
* not have a background color,
|
||||||
* the background color of its parent is returned
|
* the background color of its parent is returned
|
||||||
* @see #setBackground
|
* @see #setBackground
|
||||||
* @since JDK1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
@Transient
|
@Transient
|
||||||
public Color getBackground() {
|
public Color getBackground() {
|
||||||
|
@ -1819,7 +1819,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||||
* if this parameter is <code>null</code>, then this
|
* if this parameter is <code>null</code>, then this
|
||||||
* component will inherit the background color of its parent
|
* component will inherit the background color of its parent
|
||||||
* @see #getBackground
|
* @see #getBackground
|
||||||
* @since JDK1.0
|
* @since 1.0
|
||||||
* @beaninfo
|
* @beaninfo
|
||||||
* bound: true
|
* bound: true
|
||||||
*/
|
*/
|
||||||
|
@ -1856,7 +1856,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||||
* @return this component's font; if a font has not been set
|
* @return this component's font; if a font has not been set
|
||||||
* for this component, the font of its parent is returned
|
* for this component, the font of its parent is returned
|
||||||
* @see #setFont
|
* @see #setFont
|
||||||
* @since JDK1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
@Transient
|
@Transient
|
||||||
public Font getFont() {
|
public Font getFont() {
|
||||||
|
@ -1887,7 +1887,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||||
* component will inherit the font of its parent
|
* component will inherit the font of its parent
|
||||||
* @see #getFont
|
* @see #getFont
|
||||||
* @see #invalidate
|
* @see #invalidate
|
||||||
* @since JDK1.0
|
* @since 1.0
|
||||||
* @beaninfo
|
* @beaninfo
|
||||||
* bound: true
|
* bound: true
|
||||||
*/
|
*/
|
||||||
|
@ -1940,7 +1940,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||||
* does not have its own locale and has not yet been added to
|
* does not have its own locale and has not yet been added to
|
||||||
* a containment hierarchy such that the locale can be determined
|
* a containment hierarchy such that the locale can be determined
|
||||||
* from the containing parent
|
* from the containing parent
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public Locale getLocale() {
|
public Locale getLocale() {
|
||||||
Locale locale = this.locale;
|
Locale locale = this.locale;
|
||||||
|
@ -1965,7 +1965,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||||
* @param l the locale to become this component's locale
|
* @param l the locale to become this component's locale
|
||||||
* @see #getLocale
|
* @see #getLocale
|
||||||
* @see #invalidate
|
* @see #invalidate
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public void setLocale(Locale l) {
|
public void setLocale(Locale l) {
|
||||||
Locale oldValue = locale;
|
Locale oldValue = locale;
|
||||||
|
@ -1986,7 +1986,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||||
* @see java.awt.image.ColorModel
|
* @see java.awt.image.ColorModel
|
||||||
* @see java.awt.peer.ComponentPeer#getColorModel()
|
* @see java.awt.peer.ComponentPeer#getColorModel()
|
||||||
* @see Toolkit#getColorModel()
|
* @see Toolkit#getColorModel()
|
||||||
* @since JDK1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
public ColorModel getColorModel() {
|
public ColorModel getColorModel() {
|
||||||
ComponentPeer peer = this.peer;
|
ComponentPeer peer = this.peer;
|
||||||
|
@ -2016,7 +2016,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||||
* the coordinate space of the component's parent
|
* the coordinate space of the component's parent
|
||||||
* @see #setLocation
|
* @see #setLocation
|
||||||
* @see #getLocationOnScreen
|
* @see #getLocationOnScreen
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public Point getLocation() {
|
public Point getLocation() {
|
||||||
return location();
|
return location();
|
||||||
|
@ -2095,7 +2095,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||||
* @see #getLocation
|
* @see #getLocation
|
||||||
* @see #setBounds
|
* @see #setBounds
|
||||||
* @see #invalidate
|
* @see #invalidate
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public void setLocation(int x, int y) {
|
public void setLocation(int x, int y) {
|
||||||
move(x, y);
|
move(x, y);
|
||||||
|
@ -2127,7 +2127,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||||
* @see #getLocation
|
* @see #getLocation
|
||||||
* @see #setBounds
|
* @see #setBounds
|
||||||
* @see #invalidate
|
* @see #invalidate
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public void setLocation(Point p) {
|
public void setLocation(Point p) {
|
||||||
setLocation(p.x, p.y);
|
setLocation(p.x, p.y);
|
||||||
|
@ -2143,7 +2143,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||||
* @return a <code>Dimension</code> object that indicates the
|
* @return a <code>Dimension</code> object that indicates the
|
||||||
* size of this component
|
* size of this component
|
||||||
* @see #setSize
|
* @see #setSize
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public Dimension getSize() {
|
public Dimension getSize() {
|
||||||
return size();
|
return size();
|
||||||
|
@ -2170,7 +2170,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||||
* @see #getSize
|
* @see #getSize
|
||||||
* @see #setBounds
|
* @see #setBounds
|
||||||
* @see #invalidate
|
* @see #invalidate
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public void setSize(int width, int height) {
|
public void setSize(int width, int height) {
|
||||||
resize(width, height);
|
resize(width, height);
|
||||||
|
@ -2201,7 +2201,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||||
* @see #setSize
|
* @see #setSize
|
||||||
* @see #setBounds
|
* @see #setBounds
|
||||||
* @see #invalidate
|
* @see #invalidate
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public void setSize(Dimension d) {
|
public void setSize(Dimension d) {
|
||||||
resize(d);
|
resize(d);
|
||||||
|
@ -2258,7 +2258,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||||
* @see #setSize(int, int)
|
* @see #setSize(int, int)
|
||||||
* @see #setSize(Dimension)
|
* @see #setSize(Dimension)
|
||||||
* @see #invalidate
|
* @see #invalidate
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public void setBounds(int x, int y, int width, int height) {
|
public void setBounds(int x, int y, int width, int height) {
|
||||||
reshape(x, y, width, height);
|
reshape(x, y, width, height);
|
||||||
|
@ -2402,7 +2402,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||||
* @see #setSize(int, int)
|
* @see #setSize(int, int)
|
||||||
* @see #setSize(Dimension)
|
* @see #setSize(Dimension)
|
||||||
* @see #invalidate
|
* @see #invalidate
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public void setBounds(Rectangle r) {
|
public void setBounds(Rectangle r) {
|
||||||
setBounds(r.x, r.y, r.width, r.height);
|
setBounds(r.x, r.y, r.width, r.height);
|
||||||
|
@ -2883,7 +2883,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||||
* @see #doLayout()
|
* @see #doLayout()
|
||||||
* @see LayoutManager
|
* @see LayoutManager
|
||||||
* @see Container#validate
|
* @see Container#validate
|
||||||
* @since JDK1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
public void validate() {
|
public void validate() {
|
||||||
synchronized (getTreeLock()) {
|
synchronized (getTreeLock()) {
|
||||||
|
@ -2926,7 +2926,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||||
* @see #doLayout
|
* @see #doLayout
|
||||||
* @see LayoutManager
|
* @see LayoutManager
|
||||||
* @see java.awt.Container#isValidateRoot
|
* @see java.awt.Container#isValidateRoot
|
||||||
* @since JDK1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
public void invalidate() {
|
public void invalidate() {
|
||||||
synchronized (getTreeLock()) {
|
synchronized (getTreeLock()) {
|
||||||
|
@ -3021,7 +3021,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||||
* @return a graphics context for this component, or <code>null</code>
|
* @return a graphics context for this component, or <code>null</code>
|
||||||
* if it has none
|
* if it has none
|
||||||
* @see #paint
|
* @see #paint
|
||||||
* @since JDK1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
public Graphics getGraphics() {
|
public Graphics getGraphics() {
|
||||||
if (peer instanceof LightweightPeer) {
|
if (peer instanceof LightweightPeer) {
|
||||||
|
@ -3085,7 +3085,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||||
* @see #getPeer
|
* @see #getPeer
|
||||||
* @see java.awt.peer.ComponentPeer#getFontMetrics(Font)
|
* @see java.awt.peer.ComponentPeer#getFontMetrics(Font)
|
||||||
* @see Toolkit#getFontMetrics(Font)
|
* @see Toolkit#getFontMetrics(Font)
|
||||||
* @since JDK1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
public FontMetrics getFontMetrics(Font font) {
|
public FontMetrics getFontMetrics(Font font) {
|
||||||
// This is an unsupported hack, but left in for a customer.
|
// This is an unsupported hack, but left in for a customer.
|
||||||
|
@ -3125,7 +3125,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||||
* @see #contains
|
* @see #contains
|
||||||
* @see Toolkit#createCustomCursor
|
* @see Toolkit#createCustomCursor
|
||||||
* @see Cursor
|
* @see Cursor
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public void setCursor(Cursor cursor) {
|
public void setCursor(Cursor cursor) {
|
||||||
this.cursor = cursor;
|
this.cursor = cursor;
|
||||||
|
@ -3158,7 +3158,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||||
* If no cursor is set in the entire hierarchy,
|
* If no cursor is set in the entire hierarchy,
|
||||||
* <code>Cursor.DEFAULT_CURSOR</code> is returned.
|
* <code>Cursor.DEFAULT_CURSOR</code> is returned.
|
||||||
* @see #setCursor
|
* @see #setCursor
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public Cursor getCursor() {
|
public Cursor getCursor() {
|
||||||
return getCursor_NoClientCode();
|
return getCursor_NoClientCode();
|
||||||
|
@ -3212,7 +3212,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||||
*
|
*
|
||||||
* @param g the graphics context to use for painting
|
* @param g the graphics context to use for painting
|
||||||
* @see #update
|
* @see #update
|
||||||
* @since JDK1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
public void paint(Graphics g) {
|
public void paint(Graphics g) {
|
||||||
}
|
}
|
||||||
|
@ -3248,7 +3248,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||||
* @param g the specified context to use for updating
|
* @param g the specified context to use for updating
|
||||||
* @see #paint
|
* @see #paint
|
||||||
* @see #repaint()
|
* @see #repaint()
|
||||||
* @since JDK1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
public void update(Graphics g) {
|
public void update(Graphics g) {
|
||||||
paint(g);
|
paint(g);
|
||||||
|
@ -3264,7 +3264,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||||
*
|
*
|
||||||
* @param g the graphics context to use for painting
|
* @param g the graphics context to use for painting
|
||||||
* @see #paint
|
* @see #paint
|
||||||
* @since JDK1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
public void paintAll(Graphics g) {
|
public void paintAll(Graphics g) {
|
||||||
if (isShowing()) {
|
if (isShowing()) {
|
||||||
|
@ -3308,7 +3308,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||||
|
|
||||||
*
|
*
|
||||||
* @see #update(Graphics)
|
* @see #update(Graphics)
|
||||||
* @since JDK1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
public void repaint() {
|
public void repaint() {
|
||||||
repaint(0, 0, 0, width, height);
|
repaint(0, 0, 0, width, height);
|
||||||
|
@ -3327,7 +3327,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||||
* @param tm maximum time in milliseconds before update
|
* @param tm maximum time in milliseconds before update
|
||||||
* @see #paint
|
* @see #paint
|
||||||
* @see #update(Graphics)
|
* @see #update(Graphics)
|
||||||
* @since JDK1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
public void repaint(long tm) {
|
public void repaint(long tm) {
|
||||||
repaint(tm, 0, 0, width, height);
|
repaint(tm, 0, 0, width, height);
|
||||||
|
@ -3351,7 +3351,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||||
* @param width the width
|
* @param width the width
|
||||||
* @param height the height
|
* @param height the height
|
||||||
* @see #update(Graphics)
|
* @see #update(Graphics)
|
||||||
* @since JDK1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
public void repaint(int x, int y, int width, int height) {
|
public void repaint(int x, int y, int width, int height) {
|
||||||
repaint(0, x, y, width, height);
|
repaint(0, x, y, width, height);
|
||||||
|
@ -3377,7 +3377,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||||
* @param width the width
|
* @param width the width
|
||||||
* @param height the height
|
* @param height the height
|
||||||
* @see #update(Graphics)
|
* @see #update(Graphics)
|
||||||
* @since JDK1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
public void repaint(long tm, int x, int y, int width, int height) {
|
public void repaint(long tm, int x, int y, int width, int height) {
|
||||||
if (this.peer instanceof LightweightPeer) {
|
if (this.peer instanceof LightweightPeer) {
|
||||||
|
@ -3430,7 +3430,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||||
* graphics context is the bounding rectangle of this component.
|
* graphics context is the bounding rectangle of this component.
|
||||||
* @param g the graphics context to use for printing
|
* @param g the graphics context to use for printing
|
||||||
* @see #paint(Graphics)
|
* @see #paint(Graphics)
|
||||||
* @since JDK1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
public void print(Graphics g) {
|
public void print(Graphics g) {
|
||||||
paint(g);
|
paint(g);
|
||||||
|
@ -3445,7 +3445,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||||
* graphics context is the bounding rectangle of this component.
|
* graphics context is the bounding rectangle of this component.
|
||||||
* @param g the graphics context to use for printing
|
* @param g the graphics context to use for printing
|
||||||
* @see #print(Graphics)
|
* @see #print(Graphics)
|
||||||
* @since JDK1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
public void printAll(Graphics g) {
|
public void printAll(Graphics g) {
|
||||||
if (isShowing()) {
|
if (isShowing()) {
|
||||||
|
@ -3525,7 +3525,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||||
* @see Graphics#drawImage(Image, int, int, int, int, Color, java.awt.image.ImageObserver)
|
* @see Graphics#drawImage(Image, int, int, int, int, Color, java.awt.image.ImageObserver)
|
||||||
* @see Graphics#drawImage(Image, int, int, int, int, java.awt.image.ImageObserver)
|
* @see Graphics#drawImage(Image, int, int, int, int, java.awt.image.ImageObserver)
|
||||||
* @see java.awt.image.ImageObserver#imageUpdate(java.awt.Image, int, int, int, int, int)
|
* @see java.awt.image.ImageObserver#imageUpdate(java.awt.Image, int, int, int, int, int)
|
||||||
* @since JDK1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
public boolean imageUpdate(Image img, int infoflags,
|
public boolean imageUpdate(Image img, int infoflags,
|
||||||
int x, int y, int w, int h) {
|
int x, int y, int w, int h) {
|
||||||
|
@ -3550,7 +3550,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||||
* Creates an image from the specified image producer.
|
* Creates an image from the specified image producer.
|
||||||
* @param producer the image producer
|
* @param producer the image producer
|
||||||
* @return the image produced
|
* @return the image produced
|
||||||
* @since JDK1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
public Image createImage(ImageProducer producer) {
|
public Image createImage(ImageProducer producer) {
|
||||||
ComponentPeer peer = this.peer;
|
ComponentPeer peer = this.peer;
|
||||||
|
@ -3572,7 +3572,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||||
* <code>true</code>.
|
* <code>true</code>.
|
||||||
* @see #isDisplayable
|
* @see #isDisplayable
|
||||||
* @see GraphicsEnvironment#isHeadless
|
* @see GraphicsEnvironment#isHeadless
|
||||||
* @since JDK1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
public Image createImage(int width, int height) {
|
public Image createImage(int width, int height) {
|
||||||
ComponentPeer peer = this.peer;
|
ComponentPeer peer = this.peer;
|
||||||
|
@ -3643,7 +3643,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||||
* to be notified as the image is being prepared
|
* to be notified as the image is being prepared
|
||||||
* @return <code>true</code> if the image has already been fully
|
* @return <code>true</code> if the image has already been fully
|
||||||
* prepared; <code>false</code> otherwise
|
* prepared; <code>false</code> otherwise
|
||||||
* @since JDK1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
public boolean prepareImage(Image image, ImageObserver observer) {
|
public boolean prepareImage(Image image, ImageObserver observer) {
|
||||||
return prepareImage(image, -1, -1, observer);
|
return prepareImage(image, -1, -1, observer);
|
||||||
|
@ -3665,7 +3665,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||||
* @return <code>true</code> if the image has already been fully
|
* @return <code>true</code> if the image has already been fully
|
||||||
* prepared; <code>false</code> otherwise
|
* prepared; <code>false</code> otherwise
|
||||||
* @see java.awt.image.ImageObserver
|
* @see java.awt.image.ImageObserver
|
||||||
* @since JDK1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
public boolean prepareImage(Image image, int width, int height,
|
public boolean prepareImage(Image image, int width, int height,
|
||||||
ImageObserver observer) {
|
ImageObserver observer) {
|
||||||
|
@ -3701,7 +3701,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||||
* @see #prepareImage(Image, int, int, java.awt.image.ImageObserver)
|
* @see #prepareImage(Image, int, int, java.awt.image.ImageObserver)
|
||||||
* @see Toolkit#checkImage(Image, int, int, java.awt.image.ImageObserver)
|
* @see Toolkit#checkImage(Image, int, int, java.awt.image.ImageObserver)
|
||||||
* @see java.awt.image.ImageObserver
|
* @see java.awt.image.ImageObserver
|
||||||
* @since JDK1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
public int checkImage(Image image, ImageObserver observer) {
|
public int checkImage(Image image, ImageObserver observer) {
|
||||||
return checkImage(image, -1, -1, observer);
|
return checkImage(image, -1, -1, observer);
|
||||||
|
@ -3737,7 +3737,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||||
* @see #prepareImage(Image, int, int, java.awt.image.ImageObserver)
|
* @see #prepareImage(Image, int, int, java.awt.image.ImageObserver)
|
||||||
* @see Toolkit#checkImage(Image, int, int, java.awt.image.ImageObserver)
|
* @see Toolkit#checkImage(Image, int, int, java.awt.image.ImageObserver)
|
||||||
* @see java.awt.image.ImageObserver
|
* @see java.awt.image.ImageObserver
|
||||||
* @since JDK1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
public int checkImage(Image image, int width, int height,
|
public int checkImage(Image image, int width, int height,
|
||||||
ImageObserver observer) {
|
ImageObserver observer) {
|
||||||
|
@ -4622,7 +4622,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||||
* @param x the <i>x</i> coordinate of the point
|
* @param x the <i>x</i> coordinate of the point
|
||||||
* @param y the <i>y</i> coordinate of the point
|
* @param y the <i>y</i> coordinate of the point
|
||||||
* @see #getComponentAt(int, int)
|
* @see #getComponentAt(int, int)
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public boolean contains(int x, int y) {
|
public boolean contains(int x, int y) {
|
||||||
return inside(x, y);
|
return inside(x, y);
|
||||||
|
@ -4644,7 +4644,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||||
* @param p the point
|
* @param p the point
|
||||||
* @throws NullPointerException if {@code p} is {@code null}
|
* @throws NullPointerException if {@code p} is {@code null}
|
||||||
* @see #getComponentAt(Point)
|
* @see #getComponentAt(Point)
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public boolean contains(Point p) {
|
public boolean contains(Point p) {
|
||||||
return contains(p.x, p.y);
|
return contains(p.x, p.y);
|
||||||
|
@ -4669,7 +4669,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||||
* <code>null</code> if the location
|
* <code>null</code> if the location
|
||||||
* is outside this component
|
* is outside this component
|
||||||
* @see #contains(int, int)
|
* @see #contains(int, int)
|
||||||
* @since JDK1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
public Component getComponentAt(int x, int y) {
|
public Component getComponentAt(int x, int y) {
|
||||||
return locate(x, y);
|
return locate(x, y);
|
||||||
|
@ -4689,7 +4689,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||||
* specified point.
|
* specified point.
|
||||||
* @param p the point
|
* @param p the point
|
||||||
* @see java.awt.Component#contains
|
* @see java.awt.Component#contains
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public Component getComponentAt(Point p) {
|
public Component getComponentAt(Point p) {
|
||||||
return getComponentAt(p.x, p.y);
|
return getComponentAt(p.x, p.y);
|
||||||
|
@ -5224,7 +5224,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||||
* @see java.awt.event.ComponentListener
|
* @see java.awt.event.ComponentListener
|
||||||
* @see #removeComponentListener
|
* @see #removeComponentListener
|
||||||
* @see #getComponentListeners
|
* @see #getComponentListeners
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public synchronized void addComponentListener(ComponentListener l) {
|
public synchronized void addComponentListener(ComponentListener l) {
|
||||||
if (l == null) {
|
if (l == null) {
|
||||||
|
@ -5248,7 +5248,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||||
* @see java.awt.event.ComponentListener
|
* @see java.awt.event.ComponentListener
|
||||||
* @see #addComponentListener
|
* @see #addComponentListener
|
||||||
* @see #getComponentListeners
|
* @see #getComponentListeners
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public synchronized void removeComponentListener(ComponentListener l) {
|
public synchronized void removeComponentListener(ComponentListener l) {
|
||||||
if (l == null) {
|
if (l == null) {
|
||||||
|
@ -5286,7 +5286,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||||
* @see java.awt.event.FocusListener
|
* @see java.awt.event.FocusListener
|
||||||
* @see #removeFocusListener
|
* @see #removeFocusListener
|
||||||
* @see #getFocusListeners
|
* @see #getFocusListeners
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public synchronized void addFocusListener(FocusListener l) {
|
public synchronized void addFocusListener(FocusListener l) {
|
||||||
if (l == null) {
|
if (l == null) {
|
||||||
|
@ -5317,7 +5317,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||||
* @see java.awt.event.FocusListener
|
* @see java.awt.event.FocusListener
|
||||||
* @see #addFocusListener
|
* @see #addFocusListener
|
||||||
* @see #getFocusListeners
|
* @see #getFocusListeners
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public synchronized void removeFocusListener(FocusListener l) {
|
public synchronized void removeFocusListener(FocusListener l) {
|
||||||
if (l == null) {
|
if (l == null) {
|
||||||
|
@ -5618,7 +5618,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||||
* @see java.awt.event.KeyListener
|
* @see java.awt.event.KeyListener
|
||||||
* @see #removeKeyListener
|
* @see #removeKeyListener
|
||||||
* @see #getKeyListeners
|
* @see #getKeyListeners
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public synchronized void addKeyListener(KeyListener l) {
|
public synchronized void addKeyListener(KeyListener l) {
|
||||||
if (l == null) {
|
if (l == null) {
|
||||||
|
@ -5649,7 +5649,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||||
* @see java.awt.event.KeyListener
|
* @see java.awt.event.KeyListener
|
||||||
* @see #addKeyListener
|
* @see #addKeyListener
|
||||||
* @see #getKeyListeners
|
* @see #getKeyListeners
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public synchronized void removeKeyListener(KeyListener l) {
|
public synchronized void removeKeyListener(KeyListener l) {
|
||||||
if (l == null) {
|
if (l == null) {
|
||||||
|
@ -5687,7 +5687,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||||
* @see java.awt.event.MouseListener
|
* @see java.awt.event.MouseListener
|
||||||
* @see #removeMouseListener
|
* @see #removeMouseListener
|
||||||
* @see #getMouseListeners
|
* @see #getMouseListeners
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public synchronized void addMouseListener(MouseListener l) {
|
public synchronized void addMouseListener(MouseListener l) {
|
||||||
if (l == null) {
|
if (l == null) {
|
||||||
|
@ -5718,7 +5718,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||||
* @see java.awt.event.MouseListener
|
* @see java.awt.event.MouseListener
|
||||||
* @see #addMouseListener
|
* @see #addMouseListener
|
||||||
* @see #getMouseListeners
|
* @see #getMouseListeners
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public synchronized void removeMouseListener(MouseListener l) {
|
public synchronized void removeMouseListener(MouseListener l) {
|
||||||
if (l == null) {
|
if (l == null) {
|
||||||
|
@ -5756,7 +5756,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||||
* @see java.awt.event.MouseMotionListener
|
* @see java.awt.event.MouseMotionListener
|
||||||
* @see #removeMouseMotionListener
|
* @see #removeMouseMotionListener
|
||||||
* @see #getMouseMotionListeners
|
* @see #getMouseMotionListeners
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public synchronized void addMouseMotionListener(MouseMotionListener l) {
|
public synchronized void addMouseMotionListener(MouseMotionListener l) {
|
||||||
if (l == null) {
|
if (l == null) {
|
||||||
|
@ -5787,7 +5787,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||||
* @see java.awt.event.MouseMotionListener
|
* @see java.awt.event.MouseMotionListener
|
||||||
* @see #addMouseMotionListener
|
* @see #addMouseMotionListener
|
||||||
* @see #getMouseMotionListeners
|
* @see #getMouseMotionListeners
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public synchronized void removeMouseMotionListener(MouseMotionListener l) {
|
public synchronized void removeMouseMotionListener(MouseMotionListener l) {
|
||||||
if (l == null) {
|
if (l == null) {
|
||||||
|
@ -6072,7 +6072,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||||
* @see #processEvent
|
* @see #processEvent
|
||||||
* @see #disableEvents
|
* @see #disableEvents
|
||||||
* @see AWTEvent
|
* @see AWTEvent
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
protected final void enableEvents(long eventsToEnable) {
|
protected final void enableEvents(long eventsToEnable) {
|
||||||
long notifyAncestors = 0;
|
long notifyAncestors = 0;
|
||||||
|
@ -6108,7 +6108,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||||
* from being delivered to this component.
|
* from being delivered to this component.
|
||||||
* @param eventsToDisable the event mask defining the event types
|
* @param eventsToDisable the event mask defining the event types
|
||||||
* @see #enableEvents
|
* @see #enableEvents
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
protected final void disableEvents(long eventsToDisable) {
|
protected final void disableEvents(long eventsToDisable) {
|
||||||
long notifyAncestors = 0;
|
long notifyAncestors = 0;
|
||||||
|
@ -6285,7 +6285,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||||
* @see #processInputMethodEvent
|
* @see #processInputMethodEvent
|
||||||
* @see #processHierarchyEvent
|
* @see #processHierarchyEvent
|
||||||
* @see #processMouseWheelEvent
|
* @see #processMouseWheelEvent
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
protected void processEvent(AWTEvent e) {
|
protected void processEvent(AWTEvent e) {
|
||||||
if (e instanceof FocusEvent) {
|
if (e instanceof FocusEvent) {
|
||||||
|
@ -6351,7 +6351,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||||
* @see java.awt.event.ComponentListener
|
* @see java.awt.event.ComponentListener
|
||||||
* @see #addComponentListener
|
* @see #addComponentListener
|
||||||
* @see #enableEvents
|
* @see #enableEvents
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
protected void processComponentEvent(ComponentEvent e) {
|
protected void processComponentEvent(ComponentEvent e) {
|
||||||
ComponentListener listener = componentListener;
|
ComponentListener listener = componentListener;
|
||||||
|
@ -6414,7 +6414,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||||
* @see #addFocusListener
|
* @see #addFocusListener
|
||||||
* @see #enableEvents
|
* @see #enableEvents
|
||||||
* @see #dispatchEvent
|
* @see #dispatchEvent
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
protected void processFocusEvent(FocusEvent e) {
|
protected void processFocusEvent(FocusEvent e) {
|
||||||
FocusListener listener = focusListener;
|
FocusListener listener = focusListener;
|
||||||
|
@ -6480,7 +6480,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||||
* @see #addKeyListener
|
* @see #addKeyListener
|
||||||
* @see #enableEvents
|
* @see #enableEvents
|
||||||
* @see #isShowing
|
* @see #isShowing
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
protected void processKeyEvent(KeyEvent e) {
|
protected void processKeyEvent(KeyEvent e) {
|
||||||
KeyListener listener = keyListener;
|
KeyListener listener = keyListener;
|
||||||
|
@ -6522,7 +6522,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||||
* @see java.awt.event.MouseListener
|
* @see java.awt.event.MouseListener
|
||||||
* @see #addMouseListener
|
* @see #addMouseListener
|
||||||
* @see #enableEvents
|
* @see #enableEvents
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
protected void processMouseEvent(MouseEvent e) {
|
protected void processMouseEvent(MouseEvent e) {
|
||||||
MouseListener listener = mouseListener;
|
MouseListener listener = mouseListener;
|
||||||
|
@ -6570,7 +6570,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||||
* @see java.awt.event.MouseMotionListener
|
* @see java.awt.event.MouseMotionListener
|
||||||
* @see #addMouseMotionListener
|
* @see #addMouseMotionListener
|
||||||
* @see #enableEvents
|
* @see #enableEvents
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
protected void processMouseMotionEvent(MouseEvent e) {
|
protected void processMouseMotionEvent(MouseEvent e) {
|
||||||
MouseMotionListener listener = mouseMotionListener;
|
MouseMotionListener listener = mouseMotionListener;
|
||||||
|
@ -6882,7 +6882,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||||
* @see #isDisplayable
|
* @see #isDisplayable
|
||||||
* @see #removeNotify
|
* @see #removeNotify
|
||||||
* @see #invalidate
|
* @see #invalidate
|
||||||
* @since JDK1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
public void addNotify() {
|
public void addNotify() {
|
||||||
synchronized (getTreeLock()) {
|
synchronized (getTreeLock()) {
|
||||||
|
@ -6985,7 +6985,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||||
*
|
*
|
||||||
* @see #isDisplayable
|
* @see #isDisplayable
|
||||||
* @see #addNotify
|
* @see #addNotify
|
||||||
* @since JDK1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
public void removeNotify() {
|
public void removeNotify() {
|
||||||
KeyboardFocusManager.clearMostRecentFocusOwner(this);
|
KeyboardFocusManager.clearMostRecentFocusOwner(this);
|
||||||
|
@ -7094,7 +7094,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||||
* @return <code>true</code> if this <code>Component</code> is
|
* @return <code>true</code> if this <code>Component</code> is
|
||||||
* focusable; <code>false</code> otherwise
|
* focusable; <code>false</code> otherwise
|
||||||
* @see #setFocusable
|
* @see #setFocusable
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
* @deprecated As of 1.4, replaced by <code>isFocusable()</code>.
|
* @deprecated As of 1.4, replaced by <code>isFocusable()</code>.
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
|
@ -7433,7 +7433,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||||
* @see #isFocusable
|
* @see #isFocusable
|
||||||
* @see #isDisplayable
|
* @see #isDisplayable
|
||||||
* @see KeyboardFocusManager#clearGlobalFocusOwner
|
* @see KeyboardFocusManager#clearGlobalFocusOwner
|
||||||
* @since JDK1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
public void requestFocus() {
|
public void requestFocus() {
|
||||||
requestFocusHelper(false, true);
|
requestFocusHelper(false, true);
|
||||||
|
@ -7862,7 +7862,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||||
* Transfers the focus to the next component, as though this Component were
|
* Transfers the focus to the next component, as though this Component were
|
||||||
* the focus owner.
|
* the focus owner.
|
||||||
* @see #requestFocus()
|
* @see #requestFocus()
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public void transferFocus() {
|
public void transferFocus() {
|
||||||
nextFocus();
|
nextFocus();
|
||||||
|
@ -8070,7 +8070,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||||
* @param popup the popup menu to be added to the component.
|
* @param popup the popup menu to be added to the component.
|
||||||
* @see #remove(MenuComponent)
|
* @see #remove(MenuComponent)
|
||||||
* @exception NullPointerException if {@code popup} is {@code null}
|
* @exception NullPointerException if {@code popup} is {@code null}
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public void add(PopupMenu popup) {
|
public void add(PopupMenu popup) {
|
||||||
synchronized (getTreeLock()) {
|
synchronized (getTreeLock()) {
|
||||||
|
@ -8095,7 +8095,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||||
* Removes the specified popup menu from the component.
|
* Removes the specified popup menu from the component.
|
||||||
* @param popup the popup menu to be removed
|
* @param popup the popup menu to be removed
|
||||||
* @see #add(PopupMenu)
|
* @see #add(PopupMenu)
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public void remove(MenuComponent popup) {
|
public void remove(MenuComponent popup) {
|
||||||
|
@ -8126,7 +8126,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||||
* <code>null</code>.
|
* <code>null</code>.
|
||||||
*
|
*
|
||||||
* @return a string representation of this component's state
|
* @return a string representation of this component's state
|
||||||
* @since JDK1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
protected String paramString() {
|
protected String paramString() {
|
||||||
final String thisName = Objects.toString(getName(), "");
|
final String thisName = Objects.toString(getName(), "");
|
||||||
|
@ -8140,7 +8140,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||||
/**
|
/**
|
||||||
* Returns a string representation of this component and its values.
|
* Returns a string representation of this component and its values.
|
||||||
* @return a string representation of this component
|
* @return a string representation of this component
|
||||||
* @since JDK1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return getClass().getName() + '[' + paramString() + ']';
|
return getClass().getName() + '[' + paramString() + ']';
|
||||||
|
@ -8150,7 +8150,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||||
* Prints a listing of this component to the standard system output
|
* Prints a listing of this component to the standard system output
|
||||||
* stream <code>System.out</code>.
|
* stream <code>System.out</code>.
|
||||||
* @see java.lang.System#out
|
* @see java.lang.System#out
|
||||||
* @since JDK1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
public void list() {
|
public void list() {
|
||||||
list(System.out, 0);
|
list(System.out, 0);
|
||||||
|
@ -8161,7 +8161,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||||
* stream.
|
* stream.
|
||||||
* @param out a print stream
|
* @param out a print stream
|
||||||
* @throws NullPointerException if {@code out} is {@code null}
|
* @throws NullPointerException if {@code out} is {@code null}
|
||||||
* @since JDK1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
public void list(PrintStream out) {
|
public void list(PrintStream out) {
|
||||||
list(out, 0);
|
list(out, 0);
|
||||||
|
@ -8174,7 +8174,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||||
* @param indent number of spaces to indent
|
* @param indent number of spaces to indent
|
||||||
* @see java.io.PrintStream#println(java.lang.Object)
|
* @see java.io.PrintStream#println(java.lang.Object)
|
||||||
* @throws NullPointerException if {@code out} is {@code null}
|
* @throws NullPointerException if {@code out} is {@code null}
|
||||||
* @since JDK1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
public void list(PrintStream out, int indent) {
|
public void list(PrintStream out, int indent) {
|
||||||
for (int i = 0 ; i < indent ; i++) {
|
for (int i = 0 ; i < indent ; i++) {
|
||||||
|
@ -8187,7 +8187,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||||
* Prints a listing to the specified print writer.
|
* Prints a listing to the specified print writer.
|
||||||
* @param out the print writer to print to
|
* @param out the print writer to print to
|
||||||
* @throws NullPointerException if {@code out} is {@code null}
|
* @throws NullPointerException if {@code out} is {@code null}
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public void list(PrintWriter out) {
|
public void list(PrintWriter out) {
|
||||||
list(out, 0);
|
list(out, 0);
|
||||||
|
@ -8200,7 +8200,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||||
* @param indent the number of spaces to indent
|
* @param indent the number of spaces to indent
|
||||||
* @throws NullPointerException if {@code out} is {@code null}
|
* @throws NullPointerException if {@code out} is {@code null}
|
||||||
* @see java.io.PrintStream#println(java.lang.Object)
|
* @see java.io.PrintStream#println(java.lang.Object)
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public void list(PrintWriter out, int indent) {
|
public void list(PrintWriter out, int indent) {
|
||||||
for (int i = 0 ; i < indent ; i++) {
|
for (int i = 0 ; i < indent ; i++) {
|
||||||
|
|
|
@ -85,7 +85,7 @@ import sun.security.action.GetBooleanAction;
|
||||||
* @see #add(java.awt.Component, int)
|
* @see #add(java.awt.Component, int)
|
||||||
* @see #getComponent(int)
|
* @see #getComponent(int)
|
||||||
* @see LayoutManager
|
* @see LayoutManager
|
||||||
* @since JDK1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
public class Container extends Component {
|
public class Container extends Component {
|
||||||
|
|
||||||
|
@ -302,7 +302,7 @@ public class Container extends Component {
|
||||||
*
|
*
|
||||||
* @return the number of components in this panel.
|
* @return the number of components in this panel.
|
||||||
* @see #getComponent
|
* @see #getComponent
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
* @see Component#getTreeLock()
|
* @see Component#getTreeLock()
|
||||||
*/
|
*/
|
||||||
public int getComponentCount() {
|
public int getComponentCount() {
|
||||||
|
@ -384,7 +384,7 @@ public class Container extends Component {
|
||||||
* @return the insets of this container.
|
* @return the insets of this container.
|
||||||
* @see Insets
|
* @see Insets
|
||||||
* @see LayoutManager
|
* @see LayoutManager
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public Insets getInsets() {
|
public Insets getInsets() {
|
||||||
return insets();
|
return insets();
|
||||||
|
@ -975,7 +975,7 @@ public class Container extends Component {
|
||||||
* @see #validate
|
* @see #validate
|
||||||
* @see javax.swing.JComponent#revalidate()
|
* @see javax.swing.JComponent#revalidate()
|
||||||
* @see LayoutManager
|
* @see LayoutManager
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public void add(Component comp, Object constraints) {
|
public void add(Component comp, Object constraints) {
|
||||||
addImpl(comp, constraints, -1);
|
addImpl(comp, constraints, -1);
|
||||||
|
@ -1078,7 +1078,7 @@ public class Container extends Component {
|
||||||
* @see #invalidate
|
* @see #invalidate
|
||||||
* @see LayoutManager
|
* @see LayoutManager
|
||||||
* @see LayoutManager2
|
* @see LayoutManager2
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
protected void addImpl(Component comp, Object constraints, int index) {
|
protected void addImpl(Component comp, Object constraints, int index) {
|
||||||
synchronized (getTreeLock()) {
|
synchronized (getTreeLock()) {
|
||||||
|
@ -1202,7 +1202,7 @@ public class Container extends Component {
|
||||||
* @see #invalidate
|
* @see #invalidate
|
||||||
* @see #validate
|
* @see #validate
|
||||||
* @see #getComponentCount
|
* @see #getComponentCount
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public void remove(int index) {
|
public void remove(int index) {
|
||||||
synchronized (getTreeLock()) {
|
synchronized (getTreeLock()) {
|
||||||
|
@ -1501,7 +1501,7 @@ public class Container extends Component {
|
||||||
* @see LayoutManager#layoutContainer
|
* @see LayoutManager#layoutContainer
|
||||||
* @see #setLayout
|
* @see #setLayout
|
||||||
* @see #validate
|
* @see #validate
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public void doLayout() {
|
public void doLayout() {
|
||||||
layout();
|
layout();
|
||||||
|
@ -1749,7 +1749,7 @@ public class Container extends Component {
|
||||||
* @param f The font to become this container's font.
|
* @param f The font to become this container's font.
|
||||||
* @see Component#getFont
|
* @see Component#getFont
|
||||||
* @see #invalidate
|
* @see #invalidate
|
||||||
* @since JDK1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
public void setFont(Font f) {
|
public void setFont(Font f) {
|
||||||
boolean shouldinvalidate = false;
|
boolean shouldinvalidate = false;
|
||||||
|
@ -1834,7 +1834,7 @@ public class Container extends Component {
|
||||||
* @see #getLayout
|
* @see #getLayout
|
||||||
* @see LayoutManager#minimumLayoutSize(Container)
|
* @see LayoutManager#minimumLayoutSize(Container)
|
||||||
* @see Component#getMinimumSize
|
* @see Component#getMinimumSize
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public Dimension getMinimumSize() {
|
public Dimension getMinimumSize() {
|
||||||
return minimumSize();
|
return minimumSize();
|
||||||
|
@ -2539,7 +2539,7 @@ public class Container extends Component {
|
||||||
* point is within the bounds of the container the container itself
|
* point is within the bounds of the container the container itself
|
||||||
* is returned; otherwise the top-most child is returned.
|
* is returned; otherwise the top-most child is returned.
|
||||||
* @see Component#contains
|
* @see Component#contains
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public Component getComponentAt(int x, int y) {
|
public Component getComponentAt(int x, int y) {
|
||||||
return locate(x, y);
|
return locate(x, y);
|
||||||
|
@ -2585,7 +2585,7 @@ public class Container extends Component {
|
||||||
* or <code>null</code> if the component does
|
* or <code>null</code> if the component does
|
||||||
* not contain the point.
|
* not contain the point.
|
||||||
* @see Component#contains
|
* @see Component#contains
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public Component getComponentAt(Point p) {
|
public Component getComponentAt(Point p) {
|
||||||
return getComponentAt(p.x, p.y);
|
return getComponentAt(p.x, p.y);
|
||||||
|
@ -2837,7 +2837,7 @@ public class Container extends Component {
|
||||||
* @param c the component
|
* @param c the component
|
||||||
* @return <code>true</code> if it is an ancestor;
|
* @return <code>true</code> if it is an ancestor;
|
||||||
* <code>false</code> otherwise.
|
* <code>false</code> otherwise.
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public boolean isAncestorOf(Component c) {
|
public boolean isAncestorOf(Component c) {
|
||||||
Container p;
|
Container p;
|
||||||
|
@ -3012,7 +3012,7 @@ public class Container extends Component {
|
||||||
* @param indent the number of spaces to indent
|
* @param indent the number of spaces to indent
|
||||||
* @throws NullPointerException if {@code out} is {@code null}
|
* @throws NullPointerException if {@code out} is {@code null}
|
||||||
* @see Component#list(java.io.PrintStream, int)
|
* @see Component#list(java.io.PrintStream, int)
|
||||||
* @since JDK1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
public void list(PrintStream out, int indent) {
|
public void list(PrintStream out, int indent) {
|
||||||
super.list(out, indent);
|
super.list(out, indent);
|
||||||
|
@ -3039,7 +3039,7 @@ public class Container extends Component {
|
||||||
* @param indent the number of spaces to indent
|
* @param indent the number of spaces to indent
|
||||||
* @throws NullPointerException if {@code out} is {@code null}
|
* @throws NullPointerException if {@code out} is {@code null}
|
||||||
* @see Component#list(java.io.PrintWriter, int)
|
* @see Component#list(java.io.PrintWriter, int)
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public void list(PrintWriter out, int indent) {
|
public void list(PrintWriter out, int indent) {
|
||||||
super.list(out, indent);
|
super.list(out, indent);
|
||||||
|
|
|
@ -92,7 +92,7 @@ import java.security.AccessControlException;
|
||||||
*
|
*
|
||||||
* @author Sami Shaio
|
* @author Sami Shaio
|
||||||
* @author Arthur van Hoff
|
* @author Arthur van Hoff
|
||||||
* @since JDK1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
public class Dialog extends Window {
|
public class Dialog extends Window {
|
||||||
|
|
||||||
|
|
|
@ -57,7 +57,7 @@ import java.io.*;
|
||||||
* <code>PGDN</code>, <code>F1</code>, <code>F2</code>, etc).
|
* <code>PGDN</code>, <code>F1</code>, <code>F2</code>, etc).
|
||||||
*
|
*
|
||||||
* @author Sami Shaio
|
* @author Sami Shaio
|
||||||
* @since JDK1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
public class Event implements java.io.Serializable {
|
public class Event implements java.io.Serializable {
|
||||||
private transient long data;
|
private transient long data;
|
||||||
|
@ -871,7 +871,7 @@ public class Event implements java.io.Serializable {
|
||||||
* @return a string that represents the event and the values
|
* @return a string that represents the event and the values
|
||||||
* of its member fields.
|
* of its member fields.
|
||||||
* @see java.awt.Event#paramString
|
* @see java.awt.Event#paramString
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return getClass().getName() + "[" + paramString() + "]";
|
return getClass().getName() + "[" + paramString() + "]";
|
||||||
|
|
|
@ -44,7 +44,7 @@ import sun.awt.AWTAccessor;
|
||||||
*
|
*
|
||||||
* @author Sami Shaio
|
* @author Sami Shaio
|
||||||
* @author Arthur van Hoff
|
* @author Arthur van Hoff
|
||||||
* @since JDK1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
public class FileDialog extends Dialog {
|
public class FileDialog extends Dialog {
|
||||||
|
|
||||||
|
@ -176,7 +176,7 @@ public class FileDialog extends Dialog {
|
||||||
* <code>FileDialog(parent, "", LOAD)</code>.
|
* <code>FileDialog(parent, "", LOAD)</code>.
|
||||||
*
|
*
|
||||||
* @param parent the owner of the dialog
|
* @param parent the owner of the dialog
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public FileDialog(Frame parent) {
|
public FileDialog(Frame parent) {
|
||||||
this(parent, "", LOAD);
|
this(parent, "", LOAD);
|
||||||
|
@ -353,7 +353,7 @@ public class FileDialog extends Dialog {
|
||||||
* @see java.awt.FileDialog#getMode
|
* @see java.awt.FileDialog#getMode
|
||||||
* @exception IllegalArgumentException if an illegal file
|
* @exception IllegalArgumentException if an illegal file
|
||||||
* dialog mode is supplied
|
* dialog mode is supplied
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public void setMode(int mode) {
|
public void setMode(int mode) {
|
||||||
switch (mode) {
|
switch (mode) {
|
||||||
|
|
|
@ -79,7 +79,7 @@ import java.io.IOException;
|
||||||
*
|
*
|
||||||
* @author Arthur van Hoff
|
* @author Arthur van Hoff
|
||||||
* @author Sami Shaio
|
* @author Sami Shaio
|
||||||
* @since JDK1.0
|
* @since 1.0
|
||||||
* @see ComponentOrientation
|
* @see ComponentOrientation
|
||||||
*/
|
*/
|
||||||
public class FlowLayout implements LayoutManager, java.io.Serializable {
|
public class FlowLayout implements LayoutManager, java.io.Serializable {
|
||||||
|
@ -246,7 +246,7 @@ public class FlowLayout implements LayoutManager, java.io.Serializable {
|
||||||
* or <code>FlowLayout.TRAILING</code>.
|
* or <code>FlowLayout.TRAILING</code>.
|
||||||
* @return the alignment value for this layout
|
* @return the alignment value for this layout
|
||||||
* @see java.awt.FlowLayout#setAlignment
|
* @see java.awt.FlowLayout#setAlignment
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public int getAlignment() {
|
public int getAlignment() {
|
||||||
return newAlign;
|
return newAlign;
|
||||||
|
@ -264,7 +264,7 @@ public class FlowLayout implements LayoutManager, java.io.Serializable {
|
||||||
* </ul>
|
* </ul>
|
||||||
* @param align one of the alignment values shown above
|
* @param align one of the alignment values shown above
|
||||||
* @see #getAlignment()
|
* @see #getAlignment()
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public void setAlignment(int align) {
|
public void setAlignment(int align) {
|
||||||
this.newAlign = align;
|
this.newAlign = align;
|
||||||
|
@ -295,7 +295,7 @@ public class FlowLayout implements LayoutManager, java.io.Serializable {
|
||||||
* and between the components and the borders
|
* and between the components and the borders
|
||||||
* of the <code>Container</code>
|
* of the <code>Container</code>
|
||||||
* @see java.awt.FlowLayout#setHgap
|
* @see java.awt.FlowLayout#setHgap
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public int getHgap() {
|
public int getHgap() {
|
||||||
return hgap;
|
return hgap;
|
||||||
|
@ -310,7 +310,7 @@ public class FlowLayout implements LayoutManager, java.io.Serializable {
|
||||||
* and between the components and the borders
|
* and between the components and the borders
|
||||||
* of the <code>Container</code>
|
* of the <code>Container</code>
|
||||||
* @see java.awt.FlowLayout#getHgap
|
* @see java.awt.FlowLayout#getHgap
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public void setHgap(int hgap) {
|
public void setHgap(int hgap) {
|
||||||
this.hgap = hgap;
|
this.hgap = hgap;
|
||||||
|
@ -325,7 +325,7 @@ public class FlowLayout implements LayoutManager, java.io.Serializable {
|
||||||
* and between the components and the borders
|
* and between the components and the borders
|
||||||
* of the <code>Container</code>
|
* of the <code>Container</code>
|
||||||
* @see java.awt.FlowLayout#setVgap
|
* @see java.awt.FlowLayout#setVgap
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public int getVgap() {
|
public int getVgap() {
|
||||||
return vgap;
|
return vgap;
|
||||||
|
@ -339,7 +339,7 @@ public class FlowLayout implements LayoutManager, java.io.Serializable {
|
||||||
* and between the components and the borders
|
* and between the components and the borders
|
||||||
* of the <code>Container</code>
|
* of the <code>Container</code>
|
||||||
* @see java.awt.FlowLayout#getVgap
|
* @see java.awt.FlowLayout#getVgap
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public void setVgap(int vgap) {
|
public void setVgap(int vgap) {
|
||||||
this.vgap = vgap;
|
this.vgap = vgap;
|
||||||
|
|
|
@ -364,7 +364,7 @@ public class Font implements java.io.Serializable
|
||||||
/**
|
/**
|
||||||
* The logical name of this <code>Font</code>, as passed to the
|
* The logical name of this <code>Font</code>, as passed to the
|
||||||
* constructor.
|
* constructor.
|
||||||
* @since JDK1.0
|
* @since 1.0
|
||||||
*
|
*
|
||||||
* @serial
|
* @serial
|
||||||
* @see #getName
|
* @see #getName
|
||||||
|
@ -374,7 +374,7 @@ public class Font implements java.io.Serializable
|
||||||
/**
|
/**
|
||||||
* The style of this <code>Font</code>, as passed to the constructor.
|
* The style of this <code>Font</code>, as passed to the constructor.
|
||||||
* This style can be PLAIN, BOLD, ITALIC, or BOLD+ITALIC.
|
* This style can be PLAIN, BOLD, ITALIC, or BOLD+ITALIC.
|
||||||
* @since JDK1.0
|
* @since 1.0
|
||||||
*
|
*
|
||||||
* @serial
|
* @serial
|
||||||
* @see #getStyle()
|
* @see #getStyle()
|
||||||
|
@ -383,7 +383,7 @@ public class Font implements java.io.Serializable
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The point size of this <code>Font</code>, rounded to integer.
|
* The point size of this <code>Font</code>, rounded to integer.
|
||||||
* @since JDK1.0
|
* @since 1.0
|
||||||
*
|
*
|
||||||
* @serial
|
* @serial
|
||||||
* @see #getSize()
|
* @see #getSize()
|
||||||
|
@ -436,7 +436,7 @@ public class Font implements java.io.Serializable
|
||||||
/**
|
/**
|
||||||
* Gets the peer of this <code>Font</code>.
|
* Gets the peer of this <code>Font</code>.
|
||||||
* @return the peer of the <code>Font</code>.
|
* @return the peer of the <code>Font</code>.
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
* @deprecated Font rendering is now platform independent.
|
* @deprecated Font rendering is now platform independent.
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
|
@ -562,7 +562,7 @@ public class Font implements java.io.Serializable
|
||||||
* @param size the point size of the {@code Font}
|
* @param size the point size of the {@code Font}
|
||||||
* @see GraphicsEnvironment#getAllFonts
|
* @see GraphicsEnvironment#getAllFonts
|
||||||
* @see GraphicsEnvironment#getAvailableFontFamilyNames
|
* @see GraphicsEnvironment#getAvailableFontFamilyNames
|
||||||
* @since JDK1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
public Font(String name, int style, int size) {
|
public Font(String name, int style, int size) {
|
||||||
this.name = (name != null) ? name : "Default";
|
this.name = (name != null) ? name : "Default";
|
||||||
|
@ -1180,7 +1180,7 @@ public class Font implements java.io.Serializable
|
||||||
*
|
*
|
||||||
* @see #getName
|
* @see #getName
|
||||||
* @see #getFontName
|
* @see #getFontName
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public String getFamily() {
|
public String getFamily() {
|
||||||
return getFamily_NoClientCode();
|
return getFamily_NoClientCode();
|
||||||
|
@ -1240,7 +1240,7 @@ public class Font implements java.io.Serializable
|
||||||
* this <code>Font</code>.
|
* this <code>Font</code>.
|
||||||
* @see #getFamily
|
* @see #getFamily
|
||||||
* @see #getFontName
|
* @see #getFontName
|
||||||
* @since JDK1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return name;
|
return name;
|
||||||
|
@ -1286,7 +1286,7 @@ public class Font implements java.io.Serializable
|
||||||
* @see #isPlain
|
* @see #isPlain
|
||||||
* @see #isBold
|
* @see #isBold
|
||||||
* @see #isItalic
|
* @see #isItalic
|
||||||
* @since JDK1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
public int getStyle() {
|
public int getStyle() {
|
||||||
return style;
|
return style;
|
||||||
|
@ -1312,7 +1312,7 @@ public class Font implements java.io.Serializable
|
||||||
* @see #getSize2D
|
* @see #getSize2D
|
||||||
* @see GraphicsConfiguration#getDefaultTransform
|
* @see GraphicsConfiguration#getDefaultTransform
|
||||||
* @see GraphicsConfiguration#getNormalizingTransform
|
* @see GraphicsConfiguration#getNormalizingTransform
|
||||||
* @since JDK1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
public int getSize() {
|
public int getSize() {
|
||||||
return size;
|
return size;
|
||||||
|
@ -1337,7 +1337,7 @@ public class Font implements java.io.Serializable
|
||||||
* PLAIN style;
|
* PLAIN style;
|
||||||
* <code>false</code> otherwise.
|
* <code>false</code> otherwise.
|
||||||
* @see java.awt.Font#getStyle
|
* @see java.awt.Font#getStyle
|
||||||
* @since JDK1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
public boolean isPlain() {
|
public boolean isPlain() {
|
||||||
return style == 0;
|
return style == 0;
|
||||||
|
@ -1350,7 +1350,7 @@ public class Font implements java.io.Serializable
|
||||||
* style is BOLD;
|
* style is BOLD;
|
||||||
* <code>false</code> otherwise.
|
* <code>false</code> otherwise.
|
||||||
* @see java.awt.Font#getStyle
|
* @see java.awt.Font#getStyle
|
||||||
* @since JDK1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
public boolean isBold() {
|
public boolean isBold() {
|
||||||
return (style & BOLD) != 0;
|
return (style & BOLD) != 0;
|
||||||
|
@ -1363,7 +1363,7 @@ public class Font implements java.io.Serializable
|
||||||
* style is ITALIC;
|
* style is ITALIC;
|
||||||
* <code>false</code> otherwise.
|
* <code>false</code> otherwise.
|
||||||
* @see java.awt.Font#getStyle
|
* @see java.awt.Font#getStyle
|
||||||
* @since JDK1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
public boolean isItalic() {
|
public boolean isItalic() {
|
||||||
return (style & ITALIC) != 0;
|
return (style & ITALIC) != 0;
|
||||||
|
@ -1484,7 +1484,7 @@ public class Font implements java.io.Serializable
|
||||||
* describes, or a new default <code>Font</code> if
|
* describes, or a new default <code>Font</code> if
|
||||||
* <code>str</code> is <code>null</code>.
|
* <code>str</code> is <code>null</code>.
|
||||||
* @see #getFamily
|
* @see #getFamily
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public static Font decode(String str) {
|
public static Font decode(String str) {
|
||||||
String fontName = str;
|
String fontName = str;
|
||||||
|
@ -1595,7 +1595,7 @@ public class Font implements java.io.Serializable
|
||||||
/**
|
/**
|
||||||
* Returns a hashcode for this <code>Font</code>.
|
* Returns a hashcode for this <code>Font</code>.
|
||||||
* @return a hashcode value for this <code>Font</code>.
|
* @return a hashcode value for this <code>Font</code>.
|
||||||
* @since JDK1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
if (hash == 0) {
|
if (hash == 0) {
|
||||||
|
@ -1622,7 +1622,7 @@ public class Font implements java.io.Serializable
|
||||||
* or if the argument is a <code>Font</code> object
|
* or if the argument is a <code>Font</code> object
|
||||||
* describing the same font as this object;
|
* describing the same font as this object;
|
||||||
* <code>false</code> otherwise.
|
* <code>false</code> otherwise.
|
||||||
* @since JDK1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
public boolean equals(Object obj) {
|
public boolean equals(Object obj) {
|
||||||
if (obj == this) {
|
if (obj == this) {
|
||||||
|
@ -1667,7 +1667,7 @@ public class Font implements java.io.Serializable
|
||||||
* representation.
|
* representation.
|
||||||
* @return a <code>String</code> representation of this
|
* @return a <code>String</code> representation of this
|
||||||
* <code>Font</code> object.
|
* <code>Font</code> object.
|
||||||
* @since JDK1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
// NOTE: This method may be called by privileged threads.
|
// NOTE: This method may be called by privileged threads.
|
||||||
// DO NOT INVOKE CLIENT CODE ON THIS THREAD!
|
// DO NOT INVOKE CLIENT CODE ON THIS THREAD!
|
||||||
|
|
|
@ -94,7 +94,7 @@ import java.text.CharacterIterator;
|
||||||
*
|
*
|
||||||
* @author Jim Graham
|
* @author Jim Graham
|
||||||
* @see java.awt.Font
|
* @see java.awt.Font
|
||||||
* @since JDK1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
public abstract class FontMetrics implements java.io.Serializable {
|
public abstract class FontMetrics implements java.io.Serializable {
|
||||||
|
|
||||||
|
@ -625,7 +625,6 @@ public abstract class FontMetrics implements java.io.Serializable {
|
||||||
* object's values as a <code>String</code>.
|
* object's values as a <code>String</code>.
|
||||||
* @return a <code>String</code> representation of this
|
* @return a <code>String</code> representation of this
|
||||||
* <code>FontMetrics</code> object.
|
* <code>FontMetrics</code> object.
|
||||||
* @since JDK1.0.
|
|
||||||
*/
|
*/
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return getClass().getName() +
|
return getClass().getName() +
|
||||||
|
|
|
@ -130,7 +130,7 @@ import javax.accessibility.*;
|
||||||
* @author Sami Shaio
|
* @author Sami Shaio
|
||||||
* @see WindowEvent
|
* @see WindowEvent
|
||||||
* @see Window#addWindowListener
|
* @see Window#addWindowListener
|
||||||
* @since JDK1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
public class Frame extends Window implements MenuContainer {
|
public class Frame extends Window implements MenuContainer {
|
||||||
|
|
||||||
|
|
|
@ -99,7 +99,7 @@ import java.text.AttributedCharacterIterator;
|
||||||
* @see java.awt.Graphics#setPaintMode()
|
* @see java.awt.Graphics#setPaintMode()
|
||||||
* @see java.awt.Graphics#setXORMode(java.awt.Color)
|
* @see java.awt.Graphics#setXORMode(java.awt.Color)
|
||||||
* @see java.awt.Graphics#setFont(java.awt.Font)
|
* @see java.awt.Graphics#setFont(java.awt.Font)
|
||||||
* @since JDK1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
public abstract class Graphics {
|
public abstract class Graphics {
|
||||||
|
|
||||||
|
@ -283,7 +283,7 @@ public abstract class Graphics {
|
||||||
* @see java.awt.Graphics#clipRect
|
* @see java.awt.Graphics#clipRect
|
||||||
* @see java.awt.Graphics#setClip(int, int, int, int)
|
* @see java.awt.Graphics#setClip(int, int, int, int)
|
||||||
* @see java.awt.Graphics#setClip(Shape)
|
* @see java.awt.Graphics#setClip(Shape)
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public abstract Rectangle getClipBounds();
|
public abstract Rectangle getClipBounds();
|
||||||
|
|
||||||
|
@ -321,7 +321,7 @@ public abstract class Graphics {
|
||||||
* @see java.awt.Graphics#clipRect
|
* @see java.awt.Graphics#clipRect
|
||||||
* @see java.awt.Graphics#setClip(Shape)
|
* @see java.awt.Graphics#setClip(Shape)
|
||||||
* @see java.awt.Graphics#getClip
|
* @see java.awt.Graphics#getClip
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public abstract void setClip(int x, int y, int width, int height);
|
public abstract void setClip(int x, int y, int width, int height);
|
||||||
|
|
||||||
|
@ -339,7 +339,7 @@ public abstract class Graphics {
|
||||||
* @see java.awt.Graphics#clipRect
|
* @see java.awt.Graphics#clipRect
|
||||||
* @see java.awt.Graphics#setClip(int, int, int, int)
|
* @see java.awt.Graphics#setClip(int, int, int, int)
|
||||||
* @see java.awt.Graphics#setClip(Shape)
|
* @see java.awt.Graphics#setClip(Shape)
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public abstract Shape getClip();
|
public abstract Shape getClip();
|
||||||
|
|
||||||
|
@ -357,7 +357,7 @@ public abstract class Graphics {
|
||||||
* @see java.awt.Graphics#getClip()
|
* @see java.awt.Graphics#getClip()
|
||||||
* @see java.awt.Graphics#clipRect
|
* @see java.awt.Graphics#clipRect
|
||||||
* @see java.awt.Graphics#setClip(int, int, int, int)
|
* @see java.awt.Graphics#setClip(int, int, int, int)
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public abstract void setClip(Shape clip);
|
public abstract void setClip(Shape clip);
|
||||||
|
|
||||||
|
@ -694,7 +694,7 @@ public abstract class Graphics {
|
||||||
* @param yPoints an array of <i>y</i> points
|
* @param yPoints an array of <i>y</i> points
|
||||||
* @param nPoints the total number of points
|
* @param nPoints the total number of points
|
||||||
* @see java.awt.Graphics#drawPolygon(int[], int[], int)
|
* @see java.awt.Graphics#drawPolygon(int[], int[], int)
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public abstract void drawPolyline(int xPoints[], int yPoints[],
|
public abstract void drawPolyline(int xPoints[], int yPoints[],
|
||||||
int nPoints);
|
int nPoints);
|
||||||
|
@ -1058,7 +1058,7 @@ public abstract class Graphics {
|
||||||
* @see java.awt.Image
|
* @see java.awt.Image
|
||||||
* @see java.awt.image.ImageObserver
|
* @see java.awt.image.ImageObserver
|
||||||
* @see java.awt.image.ImageObserver#imageUpdate(java.awt.Image, int, int, int, int, int)
|
* @see java.awt.image.ImageObserver#imageUpdate(java.awt.Image, int, int, int, int, int)
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public abstract boolean drawImage(Image img,
|
public abstract boolean drawImage(Image img,
|
||||||
int dx1, int dy1, int dx2, int dy2,
|
int dx1, int dy1, int dx2, int dy2,
|
||||||
|
@ -1119,7 +1119,7 @@ public abstract class Graphics {
|
||||||
* @see java.awt.Image
|
* @see java.awt.Image
|
||||||
* @see java.awt.image.ImageObserver
|
* @see java.awt.image.ImageObserver
|
||||||
* @see java.awt.image.ImageObserver#imageUpdate(java.awt.Image, int, int, int, int, int)
|
* @see java.awt.image.ImageObserver#imageUpdate(java.awt.Image, int, int, int, int, int)
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public abstract boolean drawImage(Image img,
|
public abstract boolean drawImage(Image img,
|
||||||
int dx1, int dy1, int dx2, int dy2,
|
int dx1, int dy1, int dx2, int dy2,
|
||||||
|
|
|
@ -662,7 +662,7 @@ public abstract class Graphics2D extends Graphics {
|
||||||
* <code>null</code>
|
* <code>null</code>
|
||||||
* @see java.awt.Graphics#drawBytes
|
* @see java.awt.Graphics#drawBytes
|
||||||
* @see java.awt.Graphics#drawChars
|
* @see java.awt.Graphics#drawChars
|
||||||
* @since JDK1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
public abstract void drawString(String str, int x, int y);
|
public abstract void drawString(String str, int x, int y);
|
||||||
|
|
||||||
|
@ -968,7 +968,7 @@ public abstract class Graphics2D extends Graphics {
|
||||||
* context are relative to this new origin.
|
* context are relative to this new origin.
|
||||||
* @param x the specified x coordinate
|
* @param x the specified x coordinate
|
||||||
* @param y the specified y coordinate
|
* @param y the specified y coordinate
|
||||||
* @since JDK1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
public abstract void translate(int x, int y);
|
public abstract void translate(int x, int y);
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,7 @@ package java.awt;
|
||||||
* @author Doug Stein
|
* @author Doug Stein
|
||||||
* @author Bill Spitzak (orignial NeWS & OLIT implementation)
|
* @author Bill Spitzak (orignial NeWS & OLIT implementation)
|
||||||
* @see java.awt.GridBagLayout
|
* @see java.awt.GridBagLayout
|
||||||
* @since JDK1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
public class GridBagConstraints implements Cloneable, java.io.Serializable {
|
public class GridBagConstraints implements Cloneable, java.io.Serializable {
|
||||||
|
|
||||||
|
|
|
@ -359,7 +359,7 @@ import java.util.Arrays;
|
||||||
* @see java.awt.GridBagConstraints
|
* @see java.awt.GridBagConstraints
|
||||||
* @see java.awt.GridBagLayoutInfo
|
* @see java.awt.GridBagLayoutInfo
|
||||||
* @see java.awt.ComponentOrientation
|
* @see java.awt.ComponentOrientation
|
||||||
* @since JDK1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
public class GridBagLayout implements LayoutManager2,
|
public class GridBagLayout implements LayoutManager2,
|
||||||
java.io.Serializable {
|
java.io.Serializable {
|
||||||
|
@ -562,7 +562,7 @@ java.io.Serializable {
|
||||||
* @return the graphics origin of the cell in the top-left
|
* @return the graphics origin of the cell in the top-left
|
||||||
* corner of the layout grid
|
* corner of the layout grid
|
||||||
* @see java.awt.ComponentOrientation
|
* @see java.awt.ComponentOrientation
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public Point getLayoutOrigin () {
|
public Point getLayoutOrigin () {
|
||||||
Point origin = new Point(0,0);
|
Point origin = new Point(0,0);
|
||||||
|
@ -580,7 +580,7 @@ java.io.Serializable {
|
||||||
* @return an array of two arrays, containing the widths
|
* @return an array of two arrays, containing the widths
|
||||||
* of the layout columns and
|
* of the layout columns and
|
||||||
* the heights of the layout rows
|
* the heights of the layout rows
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public int [][] getLayoutDimensions () {
|
public int [][] getLayoutDimensions () {
|
||||||
if (layoutInfo == null)
|
if (layoutInfo == null)
|
||||||
|
@ -606,7 +606,7 @@ java.io.Serializable {
|
||||||
* @return an array of two arrays, representing the
|
* @return an array of two arrays, representing the
|
||||||
* horizontal weights of the layout columns
|
* horizontal weights of the layout columns
|
||||||
* and the vertical weights of the layout rows
|
* and the vertical weights of the layout rows
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public double [][] getLayoutWeights () {
|
public double [][] getLayoutWeights () {
|
||||||
if (layoutInfo == null)
|
if (layoutInfo == null)
|
||||||
|
@ -647,7 +647,7 @@ java.io.Serializable {
|
||||||
* in the layout grid contains the point
|
* in the layout grid contains the point
|
||||||
* (<i>x</i>, <i>y</i>).
|
* (<i>x</i>, <i>y</i>).
|
||||||
* @see java.awt.ComponentOrientation
|
* @see java.awt.ComponentOrientation
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public Point location(int x, int y) {
|
public Point location(int x, int y) {
|
||||||
Point loc = new Point(0,0);
|
Point loc = new Point(0,0);
|
||||||
|
|
|
@ -62,7 +62,7 @@ public class GridBagLayoutInfo implements java.io.Serializable {
|
||||||
* grid cells with it's own parameters.
|
* grid cells with it's own parameters.
|
||||||
* @param width the columns
|
* @param width the columns
|
||||||
* @param height the rows
|
* @param height the rows
|
||||||
* @since 6.0
|
* @since 1.6
|
||||||
*/
|
*/
|
||||||
GridBagLayoutInfo(int width, int height) {
|
GridBagLayoutInfo(int width, int height) {
|
||||||
this.width = width;
|
this.width = width;
|
||||||
|
|
|
@ -88,7 +88,7 @@ package java.awt;
|
||||||
* number of rows is set to zero.
|
* number of rows is set to zero.
|
||||||
*
|
*
|
||||||
* @author Arthur van Hoff
|
* @author Arthur van Hoff
|
||||||
* @since JDK1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
public class GridLayout implements LayoutManager, java.io.Serializable {
|
public class GridLayout implements LayoutManager, java.io.Serializable {
|
||||||
/*
|
/*
|
||||||
|
@ -144,7 +144,7 @@ public class GridLayout implements LayoutManager, java.io.Serializable {
|
||||||
/**
|
/**
|
||||||
* Creates a grid layout with a default of one column per component,
|
* Creates a grid layout with a default of one column per component,
|
||||||
* in a single row.
|
* in a single row.
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public GridLayout() {
|
public GridLayout() {
|
||||||
this(1, 0, 0, 0);
|
this(1, 0, 0, 0);
|
||||||
|
@ -203,7 +203,7 @@ public class GridLayout implements LayoutManager, java.io.Serializable {
|
||||||
/**
|
/**
|
||||||
* Gets the number of rows in this layout.
|
* Gets the number of rows in this layout.
|
||||||
* @return the number of rows in this layout
|
* @return the number of rows in this layout
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public int getRows() {
|
public int getRows() {
|
||||||
return rows;
|
return rows;
|
||||||
|
@ -214,7 +214,7 @@ public class GridLayout implements LayoutManager, java.io.Serializable {
|
||||||
* @param rows the number of rows in this layout
|
* @param rows the number of rows in this layout
|
||||||
* @exception IllegalArgumentException if the value of both
|
* @exception IllegalArgumentException if the value of both
|
||||||
* <code>rows</code> and <code>cols</code> is set to zero
|
* <code>rows</code> and <code>cols</code> is set to zero
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public void setRows(int rows) {
|
public void setRows(int rows) {
|
||||||
if ((rows == 0) && (this.cols == 0)) {
|
if ((rows == 0) && (this.cols == 0)) {
|
||||||
|
@ -226,7 +226,7 @@ public class GridLayout implements LayoutManager, java.io.Serializable {
|
||||||
/**
|
/**
|
||||||
* Gets the number of columns in this layout.
|
* Gets the number of columns in this layout.
|
||||||
* @return the number of columns in this layout
|
* @return the number of columns in this layout
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public int getColumns() {
|
public int getColumns() {
|
||||||
return cols;
|
return cols;
|
||||||
|
@ -242,7 +242,7 @@ public class GridLayout implements LayoutManager, java.io.Serializable {
|
||||||
* @param cols the number of columns in this layout
|
* @param cols the number of columns in this layout
|
||||||
* @exception IllegalArgumentException if the value of both
|
* @exception IllegalArgumentException if the value of both
|
||||||
* <code>rows</code> and <code>cols</code> is set to zero
|
* <code>rows</code> and <code>cols</code> is set to zero
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public void setColumns(int cols) {
|
public void setColumns(int cols) {
|
||||||
if ((cols == 0) && (this.rows == 0)) {
|
if ((cols == 0) && (this.rows == 0)) {
|
||||||
|
@ -254,7 +254,7 @@ public class GridLayout implements LayoutManager, java.io.Serializable {
|
||||||
/**
|
/**
|
||||||
* Gets the horizontal gap between components.
|
* Gets the horizontal gap between components.
|
||||||
* @return the horizontal gap between components
|
* @return the horizontal gap between components
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public int getHgap() {
|
public int getHgap() {
|
||||||
return hgap;
|
return hgap;
|
||||||
|
@ -263,7 +263,7 @@ public class GridLayout implements LayoutManager, java.io.Serializable {
|
||||||
/**
|
/**
|
||||||
* Sets the horizontal gap between components to the specified value.
|
* Sets the horizontal gap between components to the specified value.
|
||||||
* @param hgap the horizontal gap between components
|
* @param hgap the horizontal gap between components
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public void setHgap(int hgap) {
|
public void setHgap(int hgap) {
|
||||||
this.hgap = hgap;
|
this.hgap = hgap;
|
||||||
|
@ -272,7 +272,7 @@ public class GridLayout implements LayoutManager, java.io.Serializable {
|
||||||
/**
|
/**
|
||||||
* Gets the vertical gap between components.
|
* Gets the vertical gap between components.
|
||||||
* @return the vertical gap between components
|
* @return the vertical gap between components
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public int getVgap() {
|
public int getVgap() {
|
||||||
return vgap;
|
return vgap;
|
||||||
|
@ -281,7 +281,7 @@ public class GridLayout implements LayoutManager, java.io.Serializable {
|
||||||
/**
|
/**
|
||||||
* Sets the vertical gap between components to the specified value.
|
* Sets the vertical gap between components to the specified value.
|
||||||
* @param vgap the vertical gap between components
|
* @param vgap the vertical gap between components
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public void setVgap(int vgap) {
|
public void setVgap(int vgap) {
|
||||||
this.vgap = vgap;
|
this.vgap = vgap;
|
||||||
|
|
|
@ -41,7 +41,7 @@ import sun.awt.image.SurfaceManager;
|
||||||
*
|
*
|
||||||
* @author Sami Shaio
|
* @author Sami Shaio
|
||||||
* @author Arthur van Hoff
|
* @author Arthur van Hoff
|
||||||
* @since JDK1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
public abstract class Image {
|
public abstract class Image {
|
||||||
|
|
||||||
|
@ -164,7 +164,7 @@ public abstract class Image {
|
||||||
* @see java.awt.Image#SCALE_SMOOTH
|
* @see java.awt.Image#SCALE_SMOOTH
|
||||||
* @see java.awt.Image#SCALE_REPLICATE
|
* @see java.awt.Image#SCALE_REPLICATE
|
||||||
* @see java.awt.Image#SCALE_AREA_AVERAGING
|
* @see java.awt.Image#SCALE_AREA_AVERAGING
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public Image getScaledInstance(int width, int height, int hints) {
|
public Image getScaledInstance(int width, int height, int hints) {
|
||||||
ImageFilter filter;
|
ImageFilter filter;
|
||||||
|
@ -180,21 +180,21 @@ public abstract class Image {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Use the default image-scaling algorithm.
|
* Use the default image-scaling algorithm.
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public static final int SCALE_DEFAULT = 1;
|
public static final int SCALE_DEFAULT = 1;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Choose an image-scaling algorithm that gives higher priority
|
* Choose an image-scaling algorithm that gives higher priority
|
||||||
* to scaling speed than smoothness of the scaled image.
|
* to scaling speed than smoothness of the scaled image.
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public static final int SCALE_FAST = 2;
|
public static final int SCALE_FAST = 2;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Choose an image-scaling algorithm that gives higher priority
|
* Choose an image-scaling algorithm that gives higher priority
|
||||||
* to image smoothness than scaling speed.
|
* to image smoothness than scaling speed.
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public static final int SCALE_SMOOTH = 4;
|
public static final int SCALE_SMOOTH = 4;
|
||||||
|
|
||||||
|
@ -205,7 +205,7 @@ public abstract class Image {
|
||||||
* that performs the same algorithm yet integrates more efficiently
|
* that performs the same algorithm yet integrates more efficiently
|
||||||
* into the imaging infrastructure supplied by the toolkit.
|
* into the imaging infrastructure supplied by the toolkit.
|
||||||
* @see java.awt.image.ReplicateScaleFilter
|
* @see java.awt.image.ReplicateScaleFilter
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public static final int SCALE_REPLICATE = 8;
|
public static final int SCALE_REPLICATE = 8;
|
||||||
|
|
||||||
|
@ -215,7 +215,7 @@ public abstract class Image {
|
||||||
* performs the same algorithm yet integrates more efficiently
|
* performs the same algorithm yet integrates more efficiently
|
||||||
* into the image infrastructure supplied by the toolkit.
|
* into the image infrastructure supplied by the toolkit.
|
||||||
* @see java.awt.image.AreaAveragingScaleFilter
|
* @see java.awt.image.AreaAveragingScaleFilter
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public static final int SCALE_AREA_AVERAGING = 16;
|
public static final int SCALE_AREA_AVERAGING = 16;
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,7 @@ package java.awt;
|
||||||
* @author Sami Shaio
|
* @author Sami Shaio
|
||||||
* @see java.awt.LayoutManager
|
* @see java.awt.LayoutManager
|
||||||
* @see java.awt.Container
|
* @see java.awt.Container
|
||||||
* @since JDK1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
public class Insets implements Cloneable, java.io.Serializable {
|
public class Insets implements Cloneable, java.io.Serializable {
|
||||||
|
|
||||||
|
@ -130,7 +130,7 @@ public class Insets implements Cloneable, java.io.Serializable {
|
||||||
* <code>bottom</code>, and <code>right</code> are all equal.
|
* <code>bottom</code>, and <code>right</code> are all equal.
|
||||||
* @return <code>true</code> if the two insets are equal;
|
* @return <code>true</code> if the two insets are equal;
|
||||||
* otherwise <code>false</code>.
|
* otherwise <code>false</code>.
|
||||||
* @since JDK1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public boolean equals(Object obj) {
|
public boolean equals(Object obj) {
|
||||||
if (obj instanceof Insets) {
|
if (obj instanceof Insets) {
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue