From 47d1b9ee33267d764c4d9a94b0a6cc35ac59ffdf Mon Sep 17 00:00:00 2001 From: Igor Veresov Date: Fri, 10 Feb 2012 17:40:20 -0800 Subject: [PATCH 01/82] 7144296: PS: Optimize nmethods processing Prunes scavenge roots in code list every young GC, promote objects directly pointed by the code immediately Reviewed-by: johnc, jcoomes --- .../parallelScavenge/psPromotionManager.cpp | 163 +---------------- .../parallelScavenge/psPromotionManager.hpp | 4 +- .../psPromotionManager.inline.hpp | 170 +++++++++++++++++- .../parallelScavenge/psScavenge.cpp | 5 +- .../parallelScavenge/psScavenge.hpp | 5 +- .../parallelScavenge/psScavenge.inline.hpp | 21 ++- .../parallelScavenge/psTasks.cpp | 5 +- 7 files changed, 193 insertions(+), 180 deletions(-) diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.cpp index 255bb8ee8c7..f7249690539 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.cpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2012, 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 @@ -247,167 +247,6 @@ void PSPromotionManager::flush_labs() { } } -// -// This method is pretty bulky. It would be nice to split it up -// into smaller submethods, but we need to be careful not to hurt -// performance. -// - -oop PSPromotionManager::copy_to_survivor_space(oop o) { - assert(PSScavenge::should_scavenge(&o), "Sanity"); - - oop new_obj = NULL; - - // NOTE! We must be very careful with any methods that access the mark - // in o. There may be multiple threads racing on it, and it may be forwarded - // at any time. Do not use oop methods for accessing the mark! - markOop test_mark = o->mark(); - - // The same test as "o->is_forwarded()" - if (!test_mark->is_marked()) { - bool new_obj_is_tenured = false; - size_t new_obj_size = o->size(); - - // Find the objects age, MT safe. - int age = (test_mark->has_displaced_mark_helper() /* o->has_displaced_mark() */) ? - test_mark->displaced_mark_helper()->age() : test_mark->age(); - - // Try allocating obj in to-space (unless too old) - if (age < PSScavenge::tenuring_threshold()) { - new_obj = (oop) _young_lab.allocate(new_obj_size); - if (new_obj == NULL && !_young_gen_is_full) { - // Do we allocate directly, or flush and refill? - if (new_obj_size > (YoungPLABSize / 2)) { - // Allocate this object directly - new_obj = (oop)young_space()->cas_allocate(new_obj_size); - } else { - // Flush and fill - _young_lab.flush(); - - HeapWord* lab_base = young_space()->cas_allocate(YoungPLABSize); - if (lab_base != NULL) { - _young_lab.initialize(MemRegion(lab_base, YoungPLABSize)); - // Try the young lab allocation again. - new_obj = (oop) _young_lab.allocate(new_obj_size); - } else { - _young_gen_is_full = true; - } - } - } - } - - // Otherwise try allocating obj tenured - if (new_obj == NULL) { -#ifndef PRODUCT - if (Universe::heap()->promotion_should_fail()) { - return oop_promotion_failed(o, test_mark); - } -#endif // #ifndef PRODUCT - - new_obj = (oop) _old_lab.allocate(new_obj_size); - new_obj_is_tenured = true; - - if (new_obj == NULL) { - if (!_old_gen_is_full) { - // Do we allocate directly, or flush and refill? - if (new_obj_size > (OldPLABSize / 2)) { - // Allocate this object directly - new_obj = (oop)old_gen()->cas_allocate(new_obj_size); - } else { - // Flush and fill - _old_lab.flush(); - - HeapWord* lab_base = old_gen()->cas_allocate(OldPLABSize); - if(lab_base != NULL) { - _old_lab.initialize(MemRegion(lab_base, OldPLABSize)); - // Try the old lab allocation again. - new_obj = (oop) _old_lab.allocate(new_obj_size); - } - } - } - - // This is the promotion failed test, and code handling. - // The code belongs here for two reasons. It is slightly - // different thatn the code below, and cannot share the - // CAS testing code. Keeping the code here also minimizes - // the impact on the common case fast path code. - - if (new_obj == NULL) { - _old_gen_is_full = true; - return oop_promotion_failed(o, test_mark); - } - } - } - - assert(new_obj != NULL, "allocation should have succeeded"); - - // Copy obj - Copy::aligned_disjoint_words((HeapWord*)o, (HeapWord*)new_obj, new_obj_size); - - // Now we have to CAS in the header. - if (o->cas_forward_to(new_obj, test_mark)) { - // We won any races, we "own" this object. - assert(new_obj == o->forwardee(), "Sanity"); - - // Increment age if obj still in new generation. Now that - // we're dealing with a markOop that cannot change, it is - // okay to use the non mt safe oop methods. - if (!new_obj_is_tenured) { - new_obj->incr_age(); - assert(young_space()->contains(new_obj), "Attempt to push non-promoted obj"); - } - - // Do the size comparison first with new_obj_size, which we - // already have. Hopefully, only a few objects are larger than - // _min_array_size_for_chunking, and most of them will be arrays. - // So, the is->objArray() test would be very infrequent. - if (new_obj_size > _min_array_size_for_chunking && - new_obj->is_objArray() && - PSChunkLargeArrays) { - // we'll chunk it - oop* const masked_o = mask_chunked_array_oop(o); - push_depth(masked_o); - TASKQUEUE_STATS_ONLY(++_arrays_chunked; ++_masked_pushes); - } else { - // we'll just push its contents - new_obj->push_contents(this); - } - } else { - // We lost, someone else "owns" this object - guarantee(o->is_forwarded(), "Object must be forwarded if the cas failed."); - - // Try to deallocate the space. If it was directly allocated we cannot - // deallocate it, so we have to test. If the deallocation fails, - // overwrite with a filler object. - if (new_obj_is_tenured) { - if (!_old_lab.unallocate_object((HeapWord*) new_obj, new_obj_size)) { - CollectedHeap::fill_with_object((HeapWord*) new_obj, new_obj_size); - } - } else if (!_young_lab.unallocate_object((HeapWord*) new_obj, new_obj_size)) { - CollectedHeap::fill_with_object((HeapWord*) new_obj, new_obj_size); - } - - // don't update this before the unallocation! - new_obj = o->forwardee(); - } - } else { - assert(o->is_forwarded(), "Sanity"); - new_obj = o->forwardee(); - } - -#ifdef DEBUG - // This code must come after the CAS test, or it will print incorrect - // information. - if (TraceScavenge) { - gclog_or_tty->print_cr("{%s %s " PTR_FORMAT " -> " PTR_FORMAT " (" SIZE_FORMAT ")}", - PSScavenge::should_scavenge(&new_obj) ? "copying" : "tenuring", - new_obj->blueprint()->internal_name(), o, new_obj, new_obj->size()); - } -#endif - - return new_obj; -} - template void PSPromotionManager::process_array_chunk_work( oop obj, int start, int end) { diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.hpp index 80c09d9131c..360640eba07 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.hpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2012, 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 @@ -171,7 +171,7 @@ class PSPromotionManager : public CHeapObj { void set_old_gen_is_full(bool state) { _old_gen_is_full = state; } // Promotion methods - oop copy_to_survivor_space(oop o); + template oop copy_to_survivor_space(oop o); oop oop_promotion_failed(oop obj, markOop obj_mark); void reset(); diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.inline.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.inline.hpp index eae7eaded83..6c5da301436 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.inline.hpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2012, 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 @@ -61,6 +61,170 @@ inline void PSPromotionManager::claim_or_forward_depth(T* p) { claim_or_forward_internal_depth(p); } +// +// This method is pretty bulky. It would be nice to split it up +// into smaller submethods, but we need to be careful not to hurt +// performance. +// +template +oop PSPromotionManager::copy_to_survivor_space(oop o) { + assert(PSScavenge::should_scavenge(&o), "Sanity"); + + oop new_obj = NULL; + + // NOTE! We must be very careful with any methods that access the mark + // in o. There may be multiple threads racing on it, and it may be forwarded + // at any time. Do not use oop methods for accessing the mark! + markOop test_mark = o->mark(); + + // The same test as "o->is_forwarded()" + if (!test_mark->is_marked()) { + bool new_obj_is_tenured = false; + size_t new_obj_size = o->size(); + + if (!promote_immediately) { + // Find the objects age, MT safe. + int age = (test_mark->has_displaced_mark_helper() /* o->has_displaced_mark() */) ? + test_mark->displaced_mark_helper()->age() : test_mark->age(); + + // Try allocating obj in to-space (unless too old) + if (age < PSScavenge::tenuring_threshold()) { + new_obj = (oop) _young_lab.allocate(new_obj_size); + if (new_obj == NULL && !_young_gen_is_full) { + // Do we allocate directly, or flush and refill? + if (new_obj_size > (YoungPLABSize / 2)) { + // Allocate this object directly + new_obj = (oop)young_space()->cas_allocate(new_obj_size); + } else { + // Flush and fill + _young_lab.flush(); + + HeapWord* lab_base = young_space()->cas_allocate(YoungPLABSize); + if (lab_base != NULL) { + _young_lab.initialize(MemRegion(lab_base, YoungPLABSize)); + // Try the young lab allocation again. + new_obj = (oop) _young_lab.allocate(new_obj_size); + } else { + _young_gen_is_full = true; + } + } + } + } + } + + // Otherwise try allocating obj tenured + if (new_obj == NULL) { +#ifndef PRODUCT + if (Universe::heap()->promotion_should_fail()) { + return oop_promotion_failed(o, test_mark); + } +#endif // #ifndef PRODUCT + + new_obj = (oop) _old_lab.allocate(new_obj_size); + new_obj_is_tenured = true; + + if (new_obj == NULL) { + if (!_old_gen_is_full) { + // Do we allocate directly, or flush and refill? + if (new_obj_size > (OldPLABSize / 2)) { + // Allocate this object directly + new_obj = (oop)old_gen()->cas_allocate(new_obj_size); + } else { + // Flush and fill + _old_lab.flush(); + + HeapWord* lab_base = old_gen()->cas_allocate(OldPLABSize); + if(lab_base != NULL) { + _old_lab.initialize(MemRegion(lab_base, OldPLABSize)); + // Try the old lab allocation again. + new_obj = (oop) _old_lab.allocate(new_obj_size); + } + } + } + + // This is the promotion failed test, and code handling. + // The code belongs here for two reasons. It is slightly + // different thatn the code below, and cannot share the + // CAS testing code. Keeping the code here also minimizes + // the impact on the common case fast path code. + + if (new_obj == NULL) { + _old_gen_is_full = true; + return oop_promotion_failed(o, test_mark); + } + } + } + + assert(new_obj != NULL, "allocation should have succeeded"); + + // Copy obj + Copy::aligned_disjoint_words((HeapWord*)o, (HeapWord*)new_obj, new_obj_size); + + // Now we have to CAS in the header. + if (o->cas_forward_to(new_obj, test_mark)) { + // We won any races, we "own" this object. + assert(new_obj == o->forwardee(), "Sanity"); + + // Increment age if obj still in new generation. Now that + // we're dealing with a markOop that cannot change, it is + // okay to use the non mt safe oop methods. + if (!new_obj_is_tenured) { + new_obj->incr_age(); + assert(young_space()->contains(new_obj), "Attempt to push non-promoted obj"); + } + + // Do the size comparison first with new_obj_size, which we + // already have. Hopefully, only a few objects are larger than + // _min_array_size_for_chunking, and most of them will be arrays. + // So, the is->objArray() test would be very infrequent. + if (new_obj_size > _min_array_size_for_chunking && + new_obj->is_objArray() && + PSChunkLargeArrays) { + // we'll chunk it + oop* const masked_o = mask_chunked_array_oop(o); + push_depth(masked_o); + TASKQUEUE_STATS_ONLY(++_arrays_chunked; ++_masked_pushes); + } else { + // we'll just push its contents + new_obj->push_contents(this); + } + } else { + // We lost, someone else "owns" this object + guarantee(o->is_forwarded(), "Object must be forwarded if the cas failed."); + + // Try to deallocate the space. If it was directly allocated we cannot + // deallocate it, so we have to test. If the deallocation fails, + // overwrite with a filler object. + if (new_obj_is_tenured) { + if (!_old_lab.unallocate_object((HeapWord*) new_obj, new_obj_size)) { + CollectedHeap::fill_with_object((HeapWord*) new_obj, new_obj_size); + } + } else if (!_young_lab.unallocate_object((HeapWord*) new_obj, new_obj_size)) { + CollectedHeap::fill_with_object((HeapWord*) new_obj, new_obj_size); + } + + // don't update this before the unallocation! + new_obj = o->forwardee(); + } + } else { + assert(o->is_forwarded(), "Sanity"); + new_obj = o->forwardee(); + } + +#ifdef DEBUG + // This code must come after the CAS test, or it will print incorrect + // information. + if (TraceScavenge) { + gclog_or_tty->print_cr("{%s %s " PTR_FORMAT " -> " PTR_FORMAT " (" SIZE_FORMAT ")}", + PSScavenge::should_scavenge(&new_obj) ? "copying" : "tenuring", + new_obj->blueprint()->internal_name(), o, new_obj, new_obj->size()); + } +#endif + + return new_obj; +} + + inline void PSPromotionManager::process_popped_location_depth(StarTask p) { if (is_oop_masked(p)) { assert(PSChunkLargeArrays, "invariant"); @@ -69,9 +233,9 @@ inline void PSPromotionManager::process_popped_location_depth(StarTask p) { } else { if (p.is_narrow()) { assert(UseCompressedOops, "Error"); - PSScavenge::copy_and_push_safe_barrier(this, (narrowOop*)p); + PSScavenge::copy_and_push_safe_barrier(this, p); } else { - PSScavenge::copy_and_push_safe_barrier(this, (oop*)p); + PSScavenge::copy_and_push_safe_barrier(this, p); } } } diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.cpp index f3cf14203cf..0912ab670bf 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.cpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.cpp @@ -24,6 +24,7 @@ #include "precompiled.hpp" #include "classfile/symbolTable.hpp" +#include "code/codeCache.hpp" #include "gc_implementation/parallelScavenge/cardTableExtension.hpp" #include "gc_implementation/parallelScavenge/gcTaskManager.hpp" #include "gc_implementation/parallelScavenge/generationSizer.hpp" @@ -100,7 +101,7 @@ public: // Weak refs may be visited more than once. if (PSScavenge::should_scavenge(p, _to_space)) { - PSScavenge::copy_and_push_safe_barrier(_promotion_manager, p); + PSScavenge::copy_and_push_safe_barrier(_promotion_manager, p); } } virtual void do_oop(oop* p) { PSKeepAliveClosure::do_oop_work(p); } @@ -602,6 +603,8 @@ bool PSScavenge::invoke_no_policy() { NOT_PRODUCT(reference_processor()->verify_no_references_recorded()); + CodeCache::prune_scavenge_root_nmethods(); + // Re-verify object start arrays if (VerifyObjectStartArray && VerifyAfterGC) { diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.hpp index f3e65a16689..030fdb20cb5 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.hpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -135,7 +135,8 @@ class PSScavenge: AllStatic { template static inline bool should_scavenge(T* p, MutableSpace* to_space); template static inline bool should_scavenge(T* p, bool check_to_space); - template inline static void copy_and_push_safe_barrier(PSPromotionManager* pm, T* p); + template + inline static void copy_and_push_safe_barrier(PSPromotionManager* pm, T* p); // Is an object in the young generation // This assumes that the HeapWord argument is in the heap, diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.inline.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.inline.hpp index 880f0678904..8497dd1ce54 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.inline.hpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,6 +28,7 @@ #include "gc_implementation/parallelScavenge/cardTableExtension.hpp" #include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp" #include "gc_implementation/parallelScavenge/psPromotionManager.hpp" +#include "gc_implementation/parallelScavenge/psPromotionManager.inline.hpp" #include "gc_implementation/parallelScavenge/psScavenge.hpp" inline void PSScavenge::save_to_space_top_before_gc() { @@ -65,7 +66,7 @@ inline bool PSScavenge::should_scavenge(T* p, bool check_to_space) { // Attempt to "claim" oop at p via CAS, push the new obj if successful // This version tests the oop* to make sure it is within the heap before // attempting marking. -template +template inline void PSScavenge::copy_and_push_safe_barrier(PSPromotionManager* pm, T* p) { assert(should_scavenge(p, true), "revisiting object?"); @@ -73,7 +74,7 @@ inline void PSScavenge::copy_and_push_safe_barrier(PSPromotionManager* pm, oop o = oopDesc::load_decode_heap_oop_not_null(p); oop new_obj = o->is_forwarded() ? o->forwardee() - : pm->copy_to_survivor_space(o); + : pm->copy_to_survivor_space(o); oopDesc::encode_store_heap_oop_not_null(p, new_obj); // We cannot mark without test, as some code passes us pointers @@ -86,7 +87,8 @@ inline void PSScavenge::copy_and_push_safe_barrier(PSPromotionManager* pm, } } -class PSScavengeRootsClosure: public OopClosure { +template +class PSRootsClosure: public OopClosure { private: PSPromotionManager* _promotion_manager; @@ -94,13 +96,16 @@ class PSScavengeRootsClosure: public OopClosure { template void do_oop_work(T *p) { if (PSScavenge::should_scavenge(p)) { // We never card mark roots, maybe call a func without test? - PSScavenge::copy_and_push_safe_barrier(_promotion_manager, p); + PSScavenge::copy_and_push_safe_barrier(_promotion_manager, p); } } public: - PSScavengeRootsClosure(PSPromotionManager* pm) : _promotion_manager(pm) { } - void do_oop(oop* p) { PSScavengeRootsClosure::do_oop_work(p); } - void do_oop(narrowOop* p) { PSScavengeRootsClosure::do_oop_work(p); } + PSRootsClosure(PSPromotionManager* pm) : _promotion_manager(pm) { } + void do_oop(oop* p) { PSRootsClosure::do_oop_work(p); } + void do_oop(narrowOop* p) { PSRootsClosure::do_oop_work(p); } }; +typedef PSRootsClosure PSScavengeRootsClosure; +typedef PSRootsClosure PSPromoteRootsClosure; + #endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSSCAVENGE_INLINE_HPP diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psTasks.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psTasks.cpp index 0800681f94a..db28f249f09 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psTasks.cpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psTasks.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2012, 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 @@ -51,6 +51,7 @@ void ScavengeRootsTask::do_it(GCTaskManager* manager, uint which) { PSPromotionManager* pm = PSPromotionManager::gc_thread_promotion_manager(which); PSScavengeRootsClosure roots_closure(pm); + PSPromoteRootsClosure roots_to_old_closure(pm); switch (_root_type) { case universe: @@ -91,7 +92,7 @@ void ScavengeRootsTask::do_it(GCTaskManager* manager, uint which) { case code_cache: { - CodeBlobToOopClosure each_scavengable_code_blob(&roots_closure, /*do_marking=*/ true); + CodeBlobToOopClosure each_scavengable_code_blob(&roots_to_old_closure, /*do_marking=*/ true); CodeCache::scavenge_root_nmethods_do(&each_scavengable_code_blob); } break; From 6a31970946bc09a4a6ae5f9b2056ed4c635f0571 Mon Sep 17 00:00:00 2001 From: Antonios Printezis Date: Tue, 14 Feb 2012 08:21:08 -0500 Subject: [PATCH 02/82] 7129892: G1: explicit marking cycle initiation might fail to initiate a marking cycle If we try to schedule an initial-mark GC in order to explicit start a conc mark cycle and it gets pre-empted by antoher GC, we should retry the attempt as long as it's appropriate for the GC cause. Reviewed-by: brutisso, johnc --- .../gc_implementation/g1/g1CollectedHeap.cpp | 102 +++++++++++------- .../gc_implementation/g1/g1CollectedHeap.hpp | 2 +- 2 files changed, 63 insertions(+), 41 deletions(-) diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp index c3dd180befb..378a8034d61 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp @@ -958,7 +958,7 @@ HeapWord* G1CollectedHeap::attempt_allocation_slow(size_t word_size, should_try_gc = false; } else { // Read the GC count while still holding the Heap_lock. - gc_count_before = SharedHeap::heap()->total_collections(); + gc_count_before = total_collections(); should_try_gc = true; } } @@ -976,7 +976,7 @@ HeapWord* G1CollectedHeap::attempt_allocation_slow(size_t word_size, // failed to allocate. No point in trying to allocate // further. We'll just return NULL. MutexLockerEx x(Heap_lock); - *gc_count_before_ret = SharedHeap::heap()->total_collections(); + *gc_count_before_ret = total_collections(); return NULL; } } else { @@ -1031,7 +1031,8 @@ HeapWord* G1CollectedHeap::attempt_allocation_humongous(size_t word_size, // the check before we do the actual allocation. The reason for doing it // before the allocation is that we avoid having to keep track of the newly // allocated memory while we do a GC. - if (g1_policy()->need_to_start_conc_mark("concurrent humongous allocation", word_size)) { + if (g1_policy()->need_to_start_conc_mark("concurrent humongous allocation", + word_size)) { collect(GCCause::_g1_humongous_allocation); } @@ -1059,7 +1060,7 @@ HeapWord* G1CollectedHeap::attempt_allocation_humongous(size_t word_size, should_try_gc = false; } else { // Read the GC count while still holding the Heap_lock. - gc_count_before = SharedHeap::heap()->total_collections(); + gc_count_before = total_collections(); should_try_gc = true; } } @@ -1081,7 +1082,7 @@ HeapWord* G1CollectedHeap::attempt_allocation_humongous(size_t word_size, // failed to allocate. No point in trying to allocate // further. We'll just return NULL. MutexLockerEx x(Heap_lock); - *gc_count_before_ret = SharedHeap::heap()->total_collections(); + *gc_count_before_ret = total_collections(); return NULL; } } else { @@ -2311,10 +2312,12 @@ size_t G1CollectedHeap::unsafe_max_alloc() { } bool G1CollectedHeap::should_do_concurrent_full_gc(GCCause::Cause cause) { - return - ((cause == GCCause::_gc_locker && GCLockerInvokesConcurrent) || - (cause == GCCause::_java_lang_system_gc && ExplicitGCInvokesConcurrent) || - cause == GCCause::_g1_humongous_allocation); + switch (cause) { + case GCCause::_gc_locker: return GCLockerInvokesConcurrent; + case GCCause::_java_lang_system_gc: return ExplicitGCInvokesConcurrent; + case GCCause::_g1_humongous_allocation: return true; + default: return false; + } } #ifndef PRODUCT @@ -2408,47 +2411,66 @@ void G1CollectedHeap::collect_as_vm_thread(GCCause::Cause cause) { } void G1CollectedHeap::collect(GCCause::Cause cause) { - // The caller doesn't have the Heap_lock - assert(!Heap_lock->owned_by_self(), "this thread should not own the Heap_lock"); + assert_heap_not_locked(); unsigned int gc_count_before; unsigned int full_gc_count_before; - { - MutexLocker ml(Heap_lock); + bool retry_gc; - // Read the GC count while holding the Heap_lock - gc_count_before = SharedHeap::heap()->total_collections(); - full_gc_count_before = SharedHeap::heap()->total_full_collections(); - } + do { + retry_gc = false; - if (should_do_concurrent_full_gc(cause)) { - // Schedule an initial-mark evacuation pause that will start a - // concurrent cycle. We're setting word_size to 0 which means that - // we are not requesting a post-GC allocation. - VM_G1IncCollectionPause op(gc_count_before, - 0, /* word_size */ - true, /* should_initiate_conc_mark */ - g1_policy()->max_pause_time_ms(), - cause); - VMThread::execute(&op); - } else { - if (cause == GCCause::_gc_locker - DEBUG_ONLY(|| cause == GCCause::_scavenge_alot)) { + { + MutexLocker ml(Heap_lock); - // Schedule a standard evacuation pause. We're setting word_size - // to 0 which means that we are not requesting a post-GC allocation. + // Read the GC count while holding the Heap_lock + gc_count_before = total_collections(); + full_gc_count_before = total_full_collections(); + } + + if (should_do_concurrent_full_gc(cause)) { + // Schedule an initial-mark evacuation pause that will start a + // concurrent cycle. We're setting word_size to 0 which means that + // we are not requesting a post-GC allocation. VM_G1IncCollectionPause op(gc_count_before, 0, /* word_size */ - false, /* should_initiate_conc_mark */ + true, /* should_initiate_conc_mark */ g1_policy()->max_pause_time_ms(), cause); VMThread::execute(&op); + if (!op.pause_succeeded()) { + // Another GC got scheduled and prevented us from scheduling + // the initial-mark GC. It's unlikely that the GC that + // pre-empted us was also an initial-mark GC. So, we'll retry + // the initial-mark GC. + + if (full_gc_count_before == total_full_collections()) { + retry_gc = true; + } else { + // A Full GC happened while we were trying to schedule the + // initial-mark GC. No point in starting a new cycle given + // that the whole heap was collected anyway. + } + } } else { - // Schedule a Full GC. - VM_G1CollectFull op(gc_count_before, full_gc_count_before, cause); - VMThread::execute(&op); + if (cause == GCCause::_gc_locker + DEBUG_ONLY(|| cause == GCCause::_scavenge_alot)) { + + // Schedule a standard evacuation pause. We're setting word_size + // to 0 which means that we are not requesting a post-GC allocation. + VM_G1IncCollectionPause op(gc_count_before, + 0, /* word_size */ + false, /* should_initiate_conc_mark */ + g1_policy()->max_pause_time_ms(), + cause); + VMThread::execute(&op); + } else { + // Schedule a Full GC. + VM_G1CollectFull op(gc_count_before, full_gc_count_before, cause); + VMThread::execute(&op); + } } - } + } while (retry_gc); } bool G1CollectedHeap::is_in(const void* p) const { @@ -3149,12 +3171,12 @@ void G1CollectedHeap::verify(bool allow_dirty, // We apply the relevant closures to all the oops in the // system dictionary, the string table and the code cache. - const int so = SharedHeap::SO_AllClasses | SharedHeap::SO_Strings | SharedHeap::SO_CodeCache; + const int so = SO_AllClasses | SO_Strings | SO_CodeCache; process_strong_roots(true, // activate StrongRootsScope true, // we set "collecting perm gen" to true, // so we don't reset the dirty cards in the perm gen. - SharedHeap::ScanningOption(so), // roots scanning options + ScanningOption(so), // roots scanning options &rootsCl, &blobsCl, &rootsCl); @@ -4734,7 +4756,7 @@ public: void G1CollectedHeap:: g1_process_strong_roots(bool collecting_perm_gen, - SharedHeap::ScanningOption so, + ScanningOption so, OopClosure* scan_non_heap_roots, OopsInHeapRegionClosure* scan_rs, OopsInGenClosure* scan_perm, diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp index 10e03431549..fe83718d575 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp @@ -770,7 +770,7 @@ protected: // the "i" of the calling parallel worker thread's work(i) function. // In the sequential case this param will be ignored. void g1_process_strong_roots(bool collecting_perm_gen, - SharedHeap::ScanningOption so, + ScanningOption so, OopClosure* scan_non_heap_roots, OopsInHeapRegionClosure* scan_rs, OopsInGenClosure* scan_perm, From fa9d6d7682ab4f9839038879077beebffa01ee25 Mon Sep 17 00:00:00 2001 From: John Cuthbertson Date: Wed, 18 Jan 2012 09:50:16 -0800 Subject: [PATCH 03/82] 7129514: time warp warnings after 7117303 Replace calls to os::javaTimeMillis() that are used to update the milliseconds since the last GC to an equivalent that uses a monotonically non-decreasing time source. Reviewed-by: ysr, jmasa --- .../concurrentMarkSweepGeneration.cpp | 6 +++++- .../vm/gc_implementation/parNew/parNewGeneration.cpp | 8 ++++++-- hotspot/src/share/vm/memory/defNewGeneration.cpp | 9 +++++++-- hotspot/src/share/vm/memory/genMarkSweep.cpp | 6 +++++- 4 files changed, 23 insertions(+), 6 deletions(-) diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp index 986495cbeaf..ac8ac93ff9e 100644 --- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp +++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp @@ -6092,7 +6092,11 @@ void CMSCollector::sweep(bool asynch) { _inter_sweep_timer.reset(); _inter_sweep_timer.start(); - update_time_of_last_gc(os::javaTimeMillis()); + // We need to use a monotonically non-deccreasing time in ms + // or we will see time-warp warnings and os::javaTimeMillis() + // does not guarantee monotonicity. + jlong now = os::javaTimeNanos() / NANOSECS_PER_MILLISEC; + update_time_of_last_gc(now); // NOTE on abstract state transitions: // Mutators allocate-live and/or mark the mod-union table dirty diff --git a/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp b/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp index 91445947c33..4f64dff0824 100644 --- a/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp +++ b/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2012, 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 @@ -1042,7 +1042,11 @@ void ParNewGeneration::collect(bool full, size_policy->avg_survived()->sample(from()->used()); } - update_time_of_last_gc(os::javaTimeMillis()); + // We need to use a monotonically non-deccreasing time in ms + // or we will see time-warp warnings and os::javaTimeMillis() + // does not guarantee monotonicity. + jlong now = os::javaTimeNanos() / NANOSECS_PER_MILLISEC; + update_time_of_last_gc(now); SpecializationStats::print(); diff --git a/hotspot/src/share/vm/memory/defNewGeneration.cpp b/hotspot/src/share/vm/memory/defNewGeneration.cpp index 5913b2c78f9..69ae3624a25 100644 --- a/hotspot/src/share/vm/memory/defNewGeneration.cpp +++ b/hotspot/src/share/vm/memory/defNewGeneration.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2012, 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 @@ -655,7 +655,12 @@ void DefNewGeneration::collect(bool full, from()->set_concurrent_iteration_safe_limit(from()->top()); to()->set_concurrent_iteration_safe_limit(to()->top()); SpecializationStats::print(); - update_time_of_last_gc(os::javaTimeMillis()); + + // We need to use a monotonically non-deccreasing time in ms + // or we will see time-warp warnings and os::javaTimeMillis() + // does not guarantee monotonicity. + jlong now = os::javaTimeNanos() / NANOSECS_PER_MILLISEC; + update_time_of_last_gc(now); } class RemoveForwardPointerClosure: public ObjectClosure { diff --git a/hotspot/src/share/vm/memory/genMarkSweep.cpp b/hotspot/src/share/vm/memory/genMarkSweep.cpp index 925d968b6bc..d5cf4dc7562 100644 --- a/hotspot/src/share/vm/memory/genMarkSweep.cpp +++ b/hotspot/src/share/vm/memory/genMarkSweep.cpp @@ -176,7 +176,11 @@ void GenMarkSweep::invoke_at_safepoint(int level, ReferenceProcessor* rp, // Update time of last gc for all generations we collected // (which curently is all the generations in the heap). - gch->update_time_of_last_gc(os::javaTimeMillis()); + // We need to use a monotonically non-deccreasing time in ms + // or we will see time-warp warnings and os::javaTimeMillis() + // does not guarantee monotonicity. + jlong now = os::javaTimeNanos() / NANOSECS_PER_MILLISEC; + gch->update_time_of_last_gc(now); } void GenMarkSweep::allocate_stacks() { From ec9b7d57ac7490520769912f6c3f75f1b6e383cb Mon Sep 17 00:00:00 2001 From: Frederic Parain Date: Wed, 1 Feb 2012 03:52:37 -0800 Subject: [PATCH 04/82] 7120974: ManagementPermission "control" needs clarification Reviewed-by: mchung, dholmes --- .../lang/management/ManagementPermission.java | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/jdk/src/share/classes/java/lang/management/ManagementPermission.java b/jdk/src/share/classes/java/lang/management/ManagementPermission.java index bf27f1dd1ae..6df6f1e3d42 100644 --- a/jdk/src/share/classes/java/lang/management/ManagementPermission.java +++ b/jdk/src/share/classes/java/lang/management/ManagementPermission.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -46,12 +46,17 @@ at the permission allows, and associated risks"> * * control * Ability to control the runtime characteristics of the Java virtual - * machine, for example, setting the -verbose:gc and -verbose:class flag, - * setting the threshold of a memory pool, and enabling and disabling - * the thread contention monitoring support. + * machine, for example, enabling and disabling the verbose output for + * the class loading or memory system, setting the threshold of a memory + * pool, and enabling and disabling the thread contention monitoring + * support. Some actions controlled by this permission can disclose + * information about the running application, like the -verbose:class + * flag. * * This allows an attacker to control the runtime characteristics - * of the Java virtual machine and cause the system to misbehave. + * of the Java virtual machine and cause the system to misbehave. An + * attacker can also access some information related to the running + * application. * * * From 8ac9bc5858db9723efeef833ec26a2669d83c806 Mon Sep 17 00:00:00 2001 From: Bradford Wetmore Date: Wed, 1 Feb 2012 16:00:39 -0800 Subject: [PATCH 05/82] 7141910: Incorrect copyright dates on new test cases Reviewed-by: mullan --- .../ssl/internal/ssl/EngineArgs/DebugReportsOneExtraByte.java | 2 +- .../net/ssl/internal/ssl/EngineArgs/DebugReportsOneExtraByte.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/EngineArgs/DebugReportsOneExtraByte.java b/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/EngineArgs/DebugReportsOneExtraByte.java index cd9564e46ae..0f69a0590d9 100644 --- a/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/EngineArgs/DebugReportsOneExtraByte.java +++ b/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/EngineArgs/DebugReportsOneExtraByte.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2012, 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 diff --git a/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/EngineArgs/DebugReportsOneExtraByte.sh b/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/EngineArgs/DebugReportsOneExtraByte.sh index 7fbbbed9c2c..cfc30267a25 100644 --- a/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/EngineArgs/DebugReportsOneExtraByte.sh +++ b/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/EngineArgs/DebugReportsOneExtraByte.sh @@ -1,7 +1,7 @@ #! /bin/sh # -# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it From 7313a31b9272e13541335b5e7ee2f8cde0332620 Mon Sep 17 00:00:00 2001 From: Matthew Smith Date: Thu, 2 Feb 2012 17:49:10 +0400 Subject: [PATCH 06/82] 7132194: GtkFileDialog does not point to the correct file(s) is Recent Files are used Handle the file list differently if gtk_file_chooser_get_current_folder() returns NULL Reviewed-by: anthony --- .../sun/awt/sun_awt_X11_GtkFileDialogPeer.c | 64 +++++++++++++++++-- 1 file changed, 60 insertions(+), 4 deletions(-) diff --git a/jdk/src/solaris/native/sun/awt/sun_awt_X11_GtkFileDialogPeer.c b/jdk/src/solaris/native/sun/awt/sun_awt_X11_GtkFileDialogPeer.c index 403a16e0311..66dca0d60db 100644 --- a/jdk/src/solaris/native/sun/awt/sun_awt_X11_GtkFileDialogPeer.c +++ b/jdk/src/solaris/native/sun/awt/sun_awt_X11_GtkFileDialogPeer.c @@ -171,6 +171,53 @@ static jobjectArray toFilenamesArray(JNIEnv *env, GSList* list) return array; } +/** + * Convert a GSList to an array of filenames (with the parent folder) + */ +static jobjectArray toPathAndFilenamesArray(JNIEnv *env, GSList* list) +{ + jstring str; + jclass stringCls; + GSList *iterator; + jobjectArray array; + int i; + char* entry; + + + if (list == NULL) { + return NULL; + } + + stringCls = (*env)->FindClass(env, "java/lang/String"); + if (stringCls == NULL) { + JNU_ThrowInternalError(env, "Could not get java.lang.String class"); + return NULL; + } + + array = (*env)->NewObjectArray(env, fp_gtk_g_slist_length(list), stringCls, + NULL); + if (array == NULL) { + JNU_ThrowInternalError(env, "Could not instantiate array files array"); + return NULL; + } + + i = 0; + for (iterator = list; iterator; iterator = iterator->next) { + entry = (char*) iterator->data; + + //check for leading slash. + if (entry[0] == '/') { + entry++; + } + + str = (*env)->NewStringUTF(env, entry); + (*env)->SetObjectArrayElement(env, array, i, str); + i++; + } + + return array; +} + static void handle_response(GtkWidget* aDialog, gint responseId, gpointer obj) { JNIEnv *env; @@ -183,16 +230,25 @@ static void handle_response(GtkWidget* aDialog, gint responseId, gpointer obj) env = (JNIEnv *) JNU_GetEnv(jvm, JNI_VERSION_1_2); current_folder = NULL; filenames = NULL; + gboolean full_path_names = FALSE; if (responseId == GTK_RESPONSE_ACCEPT) { current_folder = fp_gtk_file_chooser_get_current_folder( GTK_FILE_CHOOSER(aDialog)); + if (current_folder == NULL) { + full_path_names = TRUE; + } filenames = fp_gtk_file_chooser_get_filenames(GTK_FILE_CHOOSER(aDialog)); } - - jcurrent_folder = (*env)->NewStringUTF(env, current_folder); - jfilenames = toFilenamesArray(env, filenames); - + if (full_path_names) { + //This is a hack for use with "Recent Folders" in gtk where each + //file could have its own directory. + jcurrent_folder = (*env)->NewStringUTF(env, "/"); + jfilenames = toPathAndFilenamesArray(env, filenames); + } else { + jcurrent_folder = (*env)->NewStringUTF(env, current_folder); + jfilenames = toFilenamesArray(env, filenames); + } (*env)->CallVoidMethod(env, obj, setFileInternalMethodID, jcurrent_folder, jfilenames); fp_g_free(current_folder); From c750a3e42c9774bf351e403bb68ff1ceb0b6a772 Mon Sep 17 00:00:00 2001 From: Sonali Goel Date: Thu, 2 Feb 2012 15:37:22 -0800 Subject: [PATCH 07/82] 7141141: Add 3 new test scenarios for testing Main-Class attribute in jar manifest file Reviewed-by: ksrini, darcy --- jdk/test/tools/launcher/Arrrghs.java | 18 +-- .../launcher/MainClassAttributeTest.java | 103 ++++++++++++++++++ 2 files changed, 104 insertions(+), 17 deletions(-) create mode 100644 jdk/test/tools/launcher/MainClassAttributeTest.java diff --git a/jdk/test/tools/launcher/Arrrghs.java b/jdk/test/tools/launcher/Arrrghs.java index 6c75737a911..6306e2c2f87 100644 --- a/jdk/test/tools/launcher/Arrrghs.java +++ b/jdk/test/tools/launcher/Arrrghs.java @@ -24,7 +24,7 @@ /** * @test * @bug 5030233 6214916 6356475 6571029 6684582 6742159 4459600 6758881 6753938 - * 6894719 6968053 7067922 + * 6894719 6968053 * @summary Argument parsing validation. * @compile -XDignore.symbol.file Arrrghs.java * @run main Arrrghs @@ -373,21 +373,6 @@ public class Arrrghs extends TestHelper { System.out.println(tr); } - /* - * a missing manifest entry 7067922, we ignore this test for locales - * which are localized, thus the testing is limited to English locales. - */ - static void test7067922() { - if (!isEnglishLocale()) { - return; - } - TestResult tr = null; - createJar("cvf", "missingmainentry.jar", "."); - tr = doExec(javaCmd, "-jar", "missingmainentry.jar"); - tr.contains("no main manifest attribute"); - System.out.println(tr); - } - /** * @param args the command line arguments * @throws java.io.FileNotFoundException @@ -400,7 +385,6 @@ public class Arrrghs extends TestHelper { runBasicErrorMessageTests(); runMainMethodTests(); test6894719(); - test7067922(); runDiagOptionTests(); if (testExitValue > 0) { System.out.println("Total of " + testExitValue + " failed"); diff --git a/jdk/test/tools/launcher/MainClassAttributeTest.java b/jdk/test/tools/launcher/MainClassAttributeTest.java new file mode 100644 index 00000000000..425b0257643 --- /dev/null +++ b/jdk/test/tools/launcher/MainClassAttributeTest.java @@ -0,0 +1,103 @@ +/* + * Copyright (c) 2012, 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 7067922 + * @author sogoel + * @summary Test negative scenarios for main class attribute + * @build MainClassAttributeTest + * @run main MainClassAttributeTest + */ + +import java.io.File; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +/* + * This tests negative scenarios for Main class entry in a jar file. + * An error should be thrown for each of the test cases when such a + * jar is executed. + */ + +public class MainClassAttributeTest extends TestHelper { + + /* + * These tests compare messages which could be localized, therefore + * these tests compare messages only with English locales, and + * for all other locales, the exit values are checked. + */ + static void runTest(File jarFile, String expectedErrorMessage) { + TestResult tr = doExec(TestHelper.javaCmd, + "-jar", jarFile.getAbsolutePath()); + if (isEnglishLocale() && !tr.contains(expectedErrorMessage)) { + System.out.println(tr); + throw new RuntimeException("expected string not found"); + } + if (tr.isOK()) { + System.out.println(tr); + throw new RuntimeException("test exit with status 0"); + } + } + + // Missing manifest entry + static void test1() throws IOException { + File jarFile = new File("missingmainentry.jar"); + createJar("cvf", jarFile.getName(), "."); + runTest(jarFile, "no main manifest attribute"); + } + + // Entry point in manifest file has .class extension + static void test2() throws IOException { + File jarFile = new File("extensionmainentry.jar"); + createJar("Foo.class", jarFile, new File("Foo"), (String[])null); + runTest(jarFile, "Error: Could not find or load main class"); + } + + // Entry point in manifest file is misspelled + static void test3() throws IOException { + File jarFile = new File("misspelledmainentry.jar"); + createJar("FooMIS", jarFile, new File("Foo"), (String[])null); + runTest(jarFile, "Error: Could not find or load main class"); + } + + // Main-Class attribute is misspelled in manifest file + static void test4() throws IOException { + File jarFile = new File("misspelledMainAttribute.jar"); + File manifestFile = new File("manifest.txt"); + List contents = new ArrayList<>(); + contents.add("MainClassName: Foo"); + createFile(manifestFile, contents); + createJar("-cmf", manifestFile.getName(), jarFile.getName()); + runTest(jarFile, "no main manifest attribute"); + } + + public static void main(String[] args) throws IOException { + test1(); + test2(); + test3(); + test4(); + } +} From 314ecdc15add8f58b374b952ca9869b5bc940923 Mon Sep 17 00:00:00 2001 From: Pavel Porvatov Date: Fri, 3 Feb 2012 17:57:39 +0400 Subject: [PATCH 08/82] 7141573: JProgressBar resize exception, if setStringPainted in Windows LAF Reviewed-by: malenkov --- .../plaf/windows/WindowsProgressBarUI.java | 5 ++ .../JProgressBar/7141573/bug7141573.java | 62 +++++++++++++++++++ 2 files changed, 67 insertions(+) create mode 100644 jdk/test/javax/swing/JProgressBar/7141573/bug7141573.java diff --git a/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsProgressBarUI.java b/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsProgressBarUI.java index 8fb15f9492d..302b6bc565d 100644 --- a/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsProgressBarUI.java +++ b/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsProgressBarUI.java @@ -137,6 +137,11 @@ public class WindowsProgressBarUI extends BasicProgressBarUI g.setColor(progressBar.getForeground()); barRectHeight -= 2; barRectWidth -= 2; + + if (barRectWidth <= 0 || barRectHeight <= 0) { + return; + } + Graphics2D g2 = (Graphics2D)g; g2.setStroke(new BasicStroke((float)(vertical ? barRectWidth : barRectHeight), BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL)); diff --git a/jdk/test/javax/swing/JProgressBar/7141573/bug7141573.java b/jdk/test/javax/swing/JProgressBar/7141573/bug7141573.java new file mode 100644 index 00000000000..d26161ee188 --- /dev/null +++ b/jdk/test/javax/swing/JProgressBar/7141573/bug7141573.java @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2012, 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 7141573 + @summary JProgressBar resize exception, if setStringPainted in Windows LAF + @author Pavel Porvatov +*/ + +import javax.swing.*; +import java.awt.image.BufferedImage; + +public class bug7141573 { + public static void main(String[] args) throws Exception { + try { + UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel"); + } catch (Exception e) { + System.out.println("WindowsLookAndFeel is not supported. The test bug7141573 is skipped."); + + return; + } + + SwingUtilities.invokeAndWait(new Runnable() { + @Override + public void run() { + BufferedImage image = new BufferedImage(200, 200, BufferedImage.TYPE_INT_ARGB); + + JProgressBar bar = new JProgressBar(); + + bar.setStringPainted(true); + + bar.setSize(100, 1); + bar.paint(image.getGraphics()); + + bar.setSize(1, 100); + bar.paint(image.getGraphics()); + + System.out.println("The test bug7141573 is passed."); + } + }); + } +} From a1486e0c08252ab48e8dbc20cad8b1b1865609bb Mon Sep 17 00:00:00 2001 From: Pavel Porvatov Date: Fri, 3 Feb 2012 18:01:24 +0400 Subject: [PATCH 09/82] 7071775: javax/swing/JFileChooser/6396844/TwentyThousandTest.java failed on winxp Reviewed-by: alexp --- .../6396844/TwentyThousandTest.java | 110 +++++++++--------- 1 file changed, 58 insertions(+), 52 deletions(-) diff --git a/jdk/test/javax/swing/JFileChooser/6396844/TwentyThousandTest.java b/jdk/test/javax/swing/JFileChooser/6396844/TwentyThousandTest.java index 2e244a380d6..a4df9535d97 100644 --- a/jdk/test/javax/swing/JFileChooser/6396844/TwentyThousandTest.java +++ b/jdk/test/javax/swing/JFileChooser/6396844/TwentyThousandTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,29 +26,30 @@ * @bug 6396844 * @summary Tests memory leak for 20000 files * @author Sergey Malenkov - * @run main/othervm/timeout=1000 -mx256m TwentyThousandTest + * @library ../../regtesthelpers + * @build Util + * @run main/othervm/timeout=1000 -mx128m TwentyThousandTest */ +import sun.java2d.Disposer; +import sun.java2d.DisposerRecord; + import javax.swing.*; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; +import java.awt.event.HierarchyEvent; +import java.awt.event.HierarchyListener; import java.io.File; import java.io.FileWriter; -public class TwentyThousandTest implements ActionListener, Runnable { +public class TwentyThousandTest { private static final int FILES = 20000; - private static final int ATTEMPTS = 100; + private static final int ATTEMPTS = 20; private static final int INTERVAL = 100; - private static final boolean ALWAYS_NEW_INSTANCE = false; - private static final boolean UPDATE_UI_EACH_INTERVAL = true; - private static final boolean AUTO_CLOSE_DIALOG = true; - - private static JFileChooser CHOOSER; - private static String tmpDir; + private static volatile boolean disposerComplete; + public static void main(String[] args) throws Exception { tmpDir = System.getProperty("java.io.tmpdir"); @@ -77,15 +78,13 @@ public class TwentyThousandTest implements ActionListener, Runnable { System.out.println("Do " + ATTEMPTS + " attempts for " + laf.getClassName()); - for ( int i = 0; i < ATTEMPTS; i++ ) { + for (int i = 0; i < ATTEMPTS; i++) { System.out.print(i + " "); doAttempt(); } System.out.println(); - - CHOOSER = null; } System.out.println("Removing " + FILES + " files"); @@ -94,7 +93,7 @@ public class TwentyThousandTest implements ActionListener, Runnable { getTempFile(i).delete(); } - System.out.println( "Test passed successfully" ); + System.out.println("Test passed successfully"); } private static File getTempFile(int i) { @@ -104,48 +103,55 @@ public class TwentyThousandTest implements ActionListener, Runnable { private static void doAttempt() throws Exception { SwingUtilities.invokeAndWait(new Runnable() { public void run() { - if ( ALWAYS_NEW_INSTANCE || ( CHOOSER == null ) ) - CHOOSER = new JFileChooser(tmpDir); + final JFileChooser chooser = new JFileChooser(tmpDir); - if ( UPDATE_UI_EACH_INTERVAL ) - CHOOSER.updateUI(); + chooser.updateUI(); - if ( AUTO_CLOSE_DIALOG ) { - Thread t = new Thread( new TwentyThousandTest( CHOOSER ) ); - t.start(); - CHOOSER.showOpenDialog( null ); - } else { - CHOOSER.showOpenDialog( null ); - } + // Postpone JFileChooser closing until it becomes visible + chooser.addHierarchyListener(new HierarchyListener() { + @Override + public void hierarchyChanged(HierarchyEvent e) { + if ((e.getChangeFlags() & HierarchyEvent.SHOWING_CHANGED) != 0) { + if (chooser.isShowing()) { + Thread thread = new Thread(new Runnable() { + public void run() { + try { + Thread.sleep(INTERVAL); + + // Close JFileChooser + SwingUtilities.invokeLater(new Runnable() { + public void run() { + chooser.cancelSelection(); + } + }); + } catch (InterruptedException e) { + throw new RuntimeException(e); + } + } + }); + + thread.start(); + } + } + } + }); + + chooser.showOpenDialog(null); } }); - // Allow to collect garbage by GC - Thread.sleep(1000); - - System.gc(); - } - - private final JFileChooser chooser; - - TwentyThousandTest( JFileChooser chooser ) { - this.chooser = chooser; - } - - public void run() { - while ( !this.chooser.isShowing() ) { - try { - Thread.sleep( 30 ); - } catch ( InterruptedException exception ) { - exception.printStackTrace(); + DisposerRecord disposerRecord = new DisposerRecord() { + public void dispose() { + disposerComplete = true; } - } - Timer timer = new Timer( INTERVAL, this ); - timer.setRepeats( false ); - timer.start(); - } + }; - public void actionPerformed( ActionEvent event ) { - this.chooser.cancelSelection(); + disposerComplete = false; + + Disposer.addRecord(new Object(), disposerRecord); + + while (!disposerComplete) { + Util.generateOOME(); + } } } From 80e0df803f3d9ab25d9871d31a7a331bbbf07ee9 Mon Sep 17 00:00:00 2001 From: Phil Race Date: Fri, 3 Feb 2012 09:57:45 -0800 Subject: [PATCH 10/82] 7141914: Draw glyph cause JVM crash Reviewed-by: bae, igor --- jdk/src/share/classes/sun/font/FileFont.java | 4 +++- jdk/src/share/classes/sun/font/StandardGlyphVector.java | 5 +++-- jdk/src/share/classes/sun/font/SunFontManager.java | 3 +++ jdk/src/share/classes/sun/font/TrueTypeFont.java | 3 +++ 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/jdk/src/share/classes/sun/font/FileFont.java b/jdk/src/share/classes/sun/font/FileFont.java index adce6d94e5d..9c72251dffc 100644 --- a/jdk/src/share/classes/sun/font/FileFont.java +++ b/jdk/src/share/classes/sun/font/FileFont.java @@ -163,7 +163,9 @@ public abstract class FileFont extends PhysicalFont { } } } - scaler.dispose(); + if (scaler != null) { + scaler.dispose(); + } scaler = FontScaler.getNullScaler(); } diff --git a/jdk/src/share/classes/sun/font/StandardGlyphVector.java b/jdk/src/share/classes/sun/font/StandardGlyphVector.java index c452dd97c1d..66001682dff 100644 --- a/jdk/src/share/classes/sun/font/StandardGlyphVector.java +++ b/jdk/src/share/classes/sun/font/StandardGlyphVector.java @@ -1740,8 +1740,9 @@ public class StandardGlyphVector extends GlyphVector { tx, sgv.font.getStyle(), aa, fm); - - FontStrike strike = sgv.font2D.getStrike(desc); // !!! getStrike(desc, false) + // Get the strike via the handle. Shouldn't matter + // if we've invalidated the font but its an extra precaution. + FontStrike strike = sgv.font2D.handle.font2D.getStrike(desc); // !!! getStrike(desc, false) return new GlyphStrike(sgv, strike, dx, dy); } diff --git a/jdk/src/share/classes/sun/font/SunFontManager.java b/jdk/src/share/classes/sun/font/SunFontManager.java index bd55f8bbd9c..bb069a3a06c 100644 --- a/jdk/src/share/classes/sun/font/SunFontManager.java +++ b/jdk/src/share/classes/sun/font/SunFontManager.java @@ -2619,6 +2619,9 @@ public abstract class SunFontManager implements FontSupport, FontManagerForSGE { physicalFonts.remove(oldFont.fullName); fullNameToFont.remove(oldFont.fullName.toLowerCase(Locale.ENGLISH)); FontFamily.remove(oldFont); + if (oldFont instanceof FileFont) { + ((FileFont)oldFont).deregisterFontAndClearStrikeCache(); + } if (localeFullNamesToFont != null) { Map.Entry[] mapEntries = diff --git a/jdk/src/share/classes/sun/font/TrueTypeFont.java b/jdk/src/share/classes/sun/font/TrueTypeFont.java index e60a74b7b05..5a3180e1546 100644 --- a/jdk/src/share/classes/sun/font/TrueTypeFont.java +++ b/jdk/src/share/classes/sun/font/TrueTypeFont.java @@ -1037,6 +1037,9 @@ public class TrueTypeFont extends FileFont { if (head_Table != null && head_Table.capacity() >= 18) { ShortBuffer sb = head_Table.asShortBuffer(); upem = sb.get(9) & 0xffff; + if (upem < 16 || upem > 16384) { + upem = 2048; + } } ByteBuffer os2_Table = getTableBuffer(os_2Tag); From 511e7438d7b40fcd2a3ea01ee7e9698d9d13a075 Mon Sep 17 00:00:00 2001 From: Chris Hegarty Date: Sat, 4 Feb 2012 07:29:11 +0000 Subject: [PATCH 11/82] 7041778: Move SCTP implementation out of sun.nio.ch and into its own package Reviewed-by: alanb --- jdk/make/com/sun/nio/sctp/Exportedfiles.gmk | 14 +- jdk/make/com/sun/nio/sctp/FILES_java.gmk | 32 ++--- jdk/make/com/sun/nio/sctp/Makefile | 6 +- jdk/make/com/sun/nio/sctp/mapfile-vers | 48 +++---- .../classes/com/sun/nio/sctp/MessageInfo.java | 6 +- .../classes/com/sun/nio/sctp/SctpChannel.java | 2 +- .../com/sun/nio/sctp/SctpMultiChannel.java | 2 +- .../com/sun/nio/sctp/SctpServerChannel.java | 2 +- .../nio/sctp/SctpStandardSocketOptions.java | 16 +-- .../sun/nio/ch/AbstractPollArrayWrapper.java | 14 +- .../sun/nio/ch/AbstractPollSelectorImpl.java | 2 +- .../share/classes/sun/nio/ch/IOStatus.java | 24 ++-- jdk/src/share/classes/sun/nio/ch/IOUtil.java | 9 +- jdk/src/share/classes/sun/nio/ch/Net.java | 8 +- .../share/classes/sun/nio/ch/SelChImpl.java | 2 +- .../classes/sun/nio/ch/SelectionKeyImpl.java | 12 +- .../classes/sun/nio/ch/SelectorImpl.java | 4 +- jdk/src/share/classes/sun/nio/ch/Util.java | 8 +- .../MessageInfoImpl.java} | 26 ++-- .../ch/{ => sctp}/SctpStdSocketOption.java | 2 +- .../sun/nio/ch/DevPollSelectorImpl.java | 2 +- .../classes/sun/nio/ch/EPollSelectorImpl.java | 2 +- .../classes/sun/nio/ch/NativeThread.java | 8 +- .../classes/sun/nio/ch/PollArrayWrapper.java | 4 +- .../AssociationChange.java} | 12 +- .../AssociationImpl.java} | 10 +- .../PeerAddrChange.java} | 6 +- .../ResultContainer.java} | 34 ++--- .../nio/ch/{ => sctp}/SctpChannelImpl.java | 37 ++++-- .../ch/{ => sctp}/SctpMultiChannelImpl.java | 31 +++-- .../sun/nio/ch/{ => sctp}/SctpNet.java | 4 +- .../nio/ch/{ => sctp}/SctpNotification.java | 2 +- .../ch/{ => sctp}/SctpServerChannelImpl.java | 11 +- .../SendFailed.java} | 14 +- .../{SctpShutdown.java => sctp/Shutdown.java} | 6 +- .../native/sun/nio/ch/{ => sctp}/Sctp.h | 0 .../sun/nio/ch/{ => sctp}/SctpChannelImpl.c | 124 +++++++++--------- .../native/sun/nio/ch/{ => sctp}/SctpNet.c | 98 +++++++------- .../nio/ch/{ => sctp}/SctpServerChannelImpl.c | 10 +- .../sun/nio/ch/WindowsSelectorImpl.java | 2 +- .../nio/ch/{ => sctp}/SctpChannelImpl.java | 2 +- .../ch/{ => sctp}/SctpMultiChannelImpl.java | 2 +- .../ch/{ => sctp}/SctpServerChannelImpl.java | 2 +- 43 files changed, 348 insertions(+), 314 deletions(-) rename jdk/src/share/classes/sun/nio/ch/{SctpMessageInfoImpl.java => sctp/MessageInfoImpl.java} (86%) rename jdk/src/share/classes/sun/nio/ch/{ => sctp}/SctpStdSocketOption.java (98%) rename jdk/src/solaris/classes/sun/nio/ch/{SctpAssocChange.java => sctp/AssociationChange.java} (92%) rename jdk/src/solaris/classes/sun/nio/ch/{SctpAssociationImpl.java => sctp/AssociationImpl.java} (88%) rename jdk/src/solaris/classes/sun/nio/ch/{SctpPeerAddrChange.java => sctp/PeerAddrChange.java} (95%) rename jdk/src/solaris/classes/sun/nio/ch/{SctpResultContainer.java => sctp/ResultContainer.java} (82%) rename jdk/src/solaris/classes/sun/nio/ch/{ => sctp}/SctpChannelImpl.java (97%) rename jdk/src/solaris/classes/sun/nio/ch/{ => sctp}/SctpMultiChannelImpl.java (97%) rename jdk/src/solaris/classes/sun/nio/ch/{ => sctp}/SctpNet.java (99%) rename jdk/src/solaris/classes/sun/nio/ch/{ => sctp}/SctpNotification.java (98%) rename jdk/src/solaris/classes/sun/nio/ch/{ => sctp}/SctpServerChannelImpl.java (98%) rename jdk/src/solaris/classes/sun/nio/ch/{SctpSendFailed.java => sctp/SendFailed.java} (91%) rename jdk/src/solaris/classes/sun/nio/ch/{SctpShutdown.java => sctp/Shutdown.java} (94%) rename jdk/src/solaris/native/sun/nio/ch/{ => sctp}/Sctp.h (100%) rename jdk/src/solaris/native/sun/nio/ch/{ => sctp}/SctpChannelImpl.c (83%) rename jdk/src/solaris/native/sun/nio/ch/{ => sctp}/SctpNet.c (87%) rename jdk/src/solaris/native/sun/nio/ch/{ => sctp}/SctpServerChannelImpl.c (86%) rename jdk/src/windows/classes/sun/nio/ch/{ => sctp}/SctpChannelImpl.java (99%) rename jdk/src/windows/classes/sun/nio/ch/{ => sctp}/SctpMultiChannelImpl.java (99%) rename jdk/src/windows/classes/sun/nio/ch/{ => sctp}/SctpServerChannelImpl.java (99%) diff --git a/jdk/make/com/sun/nio/sctp/Exportedfiles.gmk b/jdk/make/com/sun/nio/sctp/Exportedfiles.gmk index b56c69faff4..f2f6970a827 100644 --- a/jdk/make/com/sun/nio/sctp/Exportedfiles.gmk +++ b/jdk/make/com/sun/nio/sctp/Exportedfiles.gmk @@ -29,11 +29,11 @@ ifneq ($(PLATFORM), windows) FILES_export = \ - sun/nio/ch/SctpAssocChange.java \ - sun/nio/ch/SctpChannelImpl.java \ - sun/nio/ch/SctpNet.java \ - sun/nio/ch/SctpPeerAddrChange.java \ - sun/nio/ch/SctpResultContainer.java \ - sun/nio/ch/SctpServerChannelImpl.java \ - sun/nio/ch/SctpStdSocketOption.java + sun/nio/ch/sctp/AssociationChange.java \ + sun/nio/ch/sctp/SctpChannelImpl.java \ + sun/nio/ch/sctp/SctpNet.java \ + sun/nio/ch/sctp/PeerAddrChange.java \ + sun/nio/ch/sctp/ResultContainer.java \ + sun/nio/ch/sctp/SctpServerChannelImpl.java \ + sun/nio/ch/sctp/SctpStdSocketOption.java endif diff --git a/jdk/make/com/sun/nio/sctp/FILES_java.gmk b/jdk/make/com/sun/nio/sctp/FILES_java.gmk index 725131e7280..667af33277b 100644 --- a/jdk/make/com/sun/nio/sctp/FILES_java.gmk +++ b/jdk/make/com/sun/nio/sctp/FILES_java.gmk @@ -42,25 +42,25 @@ FILES_java = \ com/sun/nio/sctp/SendFailedNotification.java \ com/sun/nio/sctp/ShutdownNotification.java \ \ - sun/nio/ch/SctpMessageInfoImpl.java \ - sun/nio/ch/SctpStdSocketOption.java + sun/nio/ch/sctp/MessageInfoImpl.java \ + sun/nio/ch/sctp/SctpStdSocketOption.java ifneq ($(PLATFORM), windows) FILES_java += \ - sun/nio/ch/SctpAssocChange.java \ - sun/nio/ch/SctpAssociationImpl.java \ - sun/nio/ch/SctpChannelImpl.java \ - sun/nio/ch/SctpMultiChannelImpl.java \ - sun/nio/ch/SctpNet.java \ - sun/nio/ch/SctpNotification.java \ - sun/nio/ch/SctpPeerAddrChange.java \ - sun/nio/ch/SctpResultContainer.java \ - sun/nio/ch/SctpSendFailed.java \ - sun/nio/ch/SctpServerChannelImpl.java \ - sun/nio/ch/SctpShutdown.java + sun/nio/ch/sctp/AssociationChange.java \ + sun/nio/ch/sctp/AssociationImpl.java \ + sun/nio/ch/sctp/PeerAddrChange.java \ + sun/nio/ch/sctp/ResultContainer.java \ + sun/nio/ch/sctp/SctpChannelImpl.java \ + sun/nio/ch/sctp/SctpMultiChannelImpl.java \ + sun/nio/ch/sctp/SctpNet.java \ + sun/nio/ch/sctp/SctpNotification.java \ + sun/nio/ch/sctp/SctpServerChannelImpl.java \ + sun/nio/ch/sctp/SendFailed.java \ + sun/nio/ch/sctp/Shutdown.java else FILES_java += \ - sun/nio/ch/SctpChannelImpl.java \ - sun/nio/ch/SctpMultiChannelImpl.java \ - sun/nio/ch/SctpServerChannelImpl.java + sun/nio/ch/sctp/SctpChannelImpl.java \ + sun/nio/ch/sctp/SctpMultiChannelImpl.java \ + sun/nio/ch/sctp/SctpServerChannelImpl.java endif diff --git a/jdk/make/com/sun/nio/sctp/Makefile b/jdk/make/com/sun/nio/sctp/Makefile index 4a9a5c36ff1..158077b78d1 100644 --- a/jdk/make/com/sun/nio/sctp/Makefile +++ b/jdk/make/com/sun/nio/sctp/Makefile @@ -47,14 +47,16 @@ include $(BUILDDIR)/common/Library.gmk # # Find platform-specific C source files # -vpath %.c $(PLATFORM_SRC)/native/sun/nio/ch +vpath %.c $(PLATFORM_SRC)/native/sun/nio/ch/sctp # # Include nio.h, net_util.h, sun_nio_ch_IOStatus.h, etc # OTHER_INCLUDES += \ -I$(SHARE_SRC)/native/sun/nio/ch \ + -I$(SHARE_SRC)/native/sun/nio/ch/sctp \ -I$(SHARE_SRC)/native/java/net \ + -I$(PLATFORM_SRC)/native/sun/nio/ch \ -I$(PLATFORM_SRC)/native/java/net \ -I$(CLASSHDRDIR)/../../../../java/java.nio/nio/CClassHeaders @@ -75,5 +77,5 @@ endif # ifneq windows clean clobber:: $(RM) -r $(CLASSDESTDIR)/com/sun/nio/sctp - $(RM) -r $(CLASSDESTDIR)/sun/nio/ch + $(RM) -r $(CLASSDESTDIR)/sun/nio/ch/sctp diff --git a/jdk/make/com/sun/nio/sctp/mapfile-vers b/jdk/make/com/sun/nio/sctp/mapfile-vers index 058995ecaa8..ceb27dab972 100644 --- a/jdk/make/com/sun/nio/sctp/mapfile-vers +++ b/jdk/make/com/sun/nio/sctp/mapfile-vers @@ -25,30 +25,30 @@ SUNWprivate_1.1 { global: - Java_sun_nio_ch_SctpNet_init; - Java_sun_nio_ch_SctpNet_socket0; - Java_sun_nio_ch_SctpNet_bindx; - Java_sun_nio_ch_SctpNet_branch0; - Java_sun_nio_ch_SctpNet_listen0; - Java_sun_nio_ch_SctpNet_connect0; - Java_sun_nio_ch_SctpNet_close0; - Java_sun_nio_ch_SctpNet_preClose0; - Java_sun_nio_ch_SctpNet_getLocalAddresses0; - Java_sun_nio_ch_SctpNet_getRemoteAddresses0; - Java_sun_nio_ch_SctpNet_getPrimAddrOption0; - Java_sun_nio_ch_SctpNet_setPrimAddrOption0; - Java_sun_nio_ch_SctpNet_setPeerPrimAddrOption0; - Java_sun_nio_ch_SctpNet_getInitMsgOption0; - Java_sun_nio_ch_SctpNet_setInitMsgOption0; - Java_sun_nio_ch_SctpNet_getIntOption0; - Java_sun_nio_ch_SctpNet_setIntOption0; - Java_sun_nio_ch_SctpNet_shutdown0; - Java_sun_nio_ch_SctpChannelImpl_initIDs; - Java_sun_nio_ch_SctpChannelImpl_checkConnect; - Java_sun_nio_ch_SctpChannelImpl_receive0; - Java_sun_nio_ch_SctpChannelImpl_send0; - Java_sun_nio_ch_SctpServerChannelImpl_initIDs; - Java_sun_nio_ch_SctpServerChannelImpl_accept0; + Java_sun_nio_ch_sctp_SctpNet_init; + Java_sun_nio_ch_sctp_SctpNet_socket0; + Java_sun_nio_ch_sctp_SctpNet_bindx; + Java_sun_nio_ch_sctp_SctpNet_branch0; + Java_sun_nio_ch_sctp_SctpNet_listen0; + Java_sun_nio_ch_sctp_SctpNet_connect0; + Java_sun_nio_ch_sctp_SctpNet_close0; + Java_sun_nio_ch_sctp_SctpNet_preClose0; + Java_sun_nio_ch_sctp_SctpNet_getLocalAddresses0; + Java_sun_nio_ch_sctp_SctpNet_getRemoteAddresses0; + Java_sun_nio_ch_sctp_SctpNet_getPrimAddrOption0; + Java_sun_nio_ch_sctp_SctpNet_setPrimAddrOption0; + Java_sun_nio_ch_sctp_SctpNet_setPeerPrimAddrOption0; + Java_sun_nio_ch_sctp_SctpNet_getInitMsgOption0; + Java_sun_nio_ch_sctp_SctpNet_setInitMsgOption0; + Java_sun_nio_ch_sctp_SctpNet_getIntOption0; + Java_sun_nio_ch_sctp_SctpNet_setIntOption0; + Java_sun_nio_ch_sctp_SctpNet_shutdown0; + Java_sun_nio_ch_sctp_SctpChannelImpl_initIDs; + Java_sun_nio_ch_sctp_SctpChannelImpl_checkConnect; + Java_sun_nio_ch_sctp_SctpChannelImpl_receive0; + Java_sun_nio_ch_sctp_SctpChannelImpl_send0; + Java_sun_nio_ch_sctp_SctpServerChannelImpl_initIDs; + Java_sun_nio_ch_sctp_SctpServerChannelImpl_accept0; JNI_OnLoad; local: *; diff --git a/jdk/src/share/classes/com/sun/nio/sctp/MessageInfo.java b/jdk/src/share/classes/com/sun/nio/sctp/MessageInfo.java index b851b77ac43..85cac09f50d 100644 --- a/jdk/src/share/classes/com/sun/nio/sctp/MessageInfo.java +++ b/jdk/src/share/classes/com/sun/nio/sctp/MessageInfo.java @@ -94,7 +94,7 @@ public abstract class MessageInfo { if (streamNumber < 0 || streamNumber > 65536) throw new IllegalArgumentException("Invalid stream number"); - return new sun.nio.ch.SctpMessageInfoImpl(null, address, streamNumber); + return new sun.nio.ch.sctp.MessageInfoImpl(null, address, streamNumber); } /** * Creates a {@code MessageInfo} instance suitable for use when @@ -133,8 +133,8 @@ public abstract class MessageInfo { if (streamNumber < 0 || streamNumber > 65536) throw new IllegalArgumentException("Invalid stream number"); - return new sun.nio.ch.SctpMessageInfoImpl(association, address, - streamNumber); + return new sun.nio.ch.sctp.MessageInfoImpl(association, + address, streamNumber); } /** diff --git a/jdk/src/share/classes/com/sun/nio/sctp/SctpChannel.java b/jdk/src/share/classes/com/sun/nio/sctp/SctpChannel.java index d040a7a07ea..27666981319 100644 --- a/jdk/src/share/classes/com/sun/nio/sctp/SctpChannel.java +++ b/jdk/src/share/classes/com/sun/nio/sctp/SctpChannel.java @@ -162,7 +162,7 @@ public abstract class SctpChannel */ public static SctpChannel open() throws IOException { - return new sun.nio.ch.SctpChannelImpl((SelectorProvider)null); + return new sun.nio.ch.sctp.SctpChannelImpl((SelectorProvider)null); } /** diff --git a/jdk/src/share/classes/com/sun/nio/sctp/SctpMultiChannel.java b/jdk/src/share/classes/com/sun/nio/sctp/SctpMultiChannel.java index 229d18ec039..e1df42e2d11 100644 --- a/jdk/src/share/classes/com/sun/nio/sctp/SctpMultiChannel.java +++ b/jdk/src/share/classes/com/sun/nio/sctp/SctpMultiChannel.java @@ -162,7 +162,7 @@ public abstract class SctpMultiChannel */ public static SctpMultiChannel open() throws IOException { - return new sun.nio.ch.SctpMultiChannelImpl((SelectorProvider)null); + return new sun.nio.ch.sctp.SctpMultiChannelImpl((SelectorProvider)null); } /** diff --git a/jdk/src/share/classes/com/sun/nio/sctp/SctpServerChannel.java b/jdk/src/share/classes/com/sun/nio/sctp/SctpServerChannel.java index 3867fc9ca34..49bb0bc83a2 100644 --- a/jdk/src/share/classes/com/sun/nio/sctp/SctpServerChannel.java +++ b/jdk/src/share/classes/com/sun/nio/sctp/SctpServerChannel.java @@ -98,7 +98,7 @@ public abstract class SctpServerChannel */ public static SctpServerChannel open() throws IOException { - return new sun.nio.ch.SctpServerChannelImpl((SelectorProvider)null); + return new sun.nio.ch.sctp.SctpServerChannelImpl((SelectorProvider)null); } /** diff --git a/jdk/src/share/classes/com/sun/nio/sctp/SctpStandardSocketOptions.java b/jdk/src/share/classes/com/sun/nio/sctp/SctpStandardSocketOptions.java index 22c5f4a005b..82d70be8e84 100644 --- a/jdk/src/share/classes/com/sun/nio/sctp/SctpStandardSocketOptions.java +++ b/jdk/src/share/classes/com/sun/nio/sctp/SctpStandardSocketOptions.java @@ -25,7 +25,7 @@ package com.sun.nio.sctp; import java.net.SocketAddress; -import sun.nio.ch.SctpStdSocketOption; +import sun.nio.ch.sctp.SctpStdSocketOption; /** * SCTP channels supports the socket options defined by this class @@ -50,7 +50,7 @@ public class SctpStandardSocketOptions { */ public static final SctpSocketOption SCTP_DISABLE_FRAGMENTS = new SctpStdSocketOption("SCTP_DISABLE_FRAGMENTS", Boolean.class, - sun.nio.ch.SctpStdSocketOption.SCTP_DISABLE_FRAGMENTS); + sun.nio.ch.sctp.SctpStdSocketOption.SCTP_DISABLE_FRAGMENTS); /** * Enables or disables explicit message completion. @@ -69,7 +69,7 @@ public class SctpStandardSocketOptions { */ public static final SctpSocketOption SCTP_EXPLICIT_COMPLETE = new SctpStdSocketOption("SCTP_EXPLICIT_COMPLETE", Boolean.class, - sun.nio.ch.SctpStdSocketOption.SCTP_EXPLICIT_COMPLETE); + sun.nio.ch.sctp.SctpStdSocketOption.SCTP_EXPLICIT_COMPLETE); /** * Fragmented interleave controls how the presentation of messages occur @@ -120,7 +120,7 @@ public class SctpStandardSocketOptions { public static final SctpSocketOption SCTP_FRAGMENT_INTERLEAVE = new SctpStdSocketOption("SCTP_FRAGMENT_INTERLEAVE", Integer.class, - sun.nio.ch.SctpStdSocketOption.SCTP_FRAGMENT_INTERLEAVE); + sun.nio.ch.sctp.SctpStdSocketOption.SCTP_FRAGMENT_INTERLEAVE); /** * The maximum number of streams requested by the local endpoint during @@ -171,7 +171,7 @@ public class SctpStandardSocketOptions { */ public static final SctpSocketOption SCTP_NODELAY = new SctpStdSocketOption("SCTP_NODELAY", Boolean.class, - sun.nio.ch.SctpStdSocketOption.SCTP_NODELAY); + sun.nio.ch.sctp.SctpStdSocketOption.SCTP_NODELAY); /** * Requests that the local SCTP stack use the given peer address as @@ -246,7 +246,7 @@ public class SctpStandardSocketOptions { */ public static final SctpSocketOption SO_SNDBUF = new SctpStdSocketOption("SO_SNDBUF", Integer.class, - sun.nio.ch.SctpStdSocketOption.SO_SNDBUF); + sun.nio.ch.sctp.SctpStdSocketOption.SO_SNDBUF); /** * The size of the socket receive buffer. @@ -273,7 +273,7 @@ public class SctpStandardSocketOptions { */ public static final SctpSocketOption SO_RCVBUF = new SctpStdSocketOption("SO_RCVBUF", Integer.class, - sun.nio.ch.SctpStdSocketOption.SO_RCVBUF); + sun.nio.ch.sctp.SctpStdSocketOption.SO_RCVBUF); /** * Linger on close if data is present. @@ -304,7 +304,7 @@ public class SctpStandardSocketOptions { */ public static final SctpSocketOption SO_LINGER = new SctpStdSocketOption("SO_LINGER", Integer.class, - sun.nio.ch.SctpStdSocketOption.SO_LINGER); + sun.nio.ch.sctp.SctpStdSocketOption.SO_LINGER); /** * This class is used to set the maximum number of inbound/outbound streams diff --git a/jdk/src/share/classes/sun/nio/ch/AbstractPollArrayWrapper.java b/jdk/src/share/classes/sun/nio/ch/AbstractPollArrayWrapper.java index b4d0d72e8a4..b0f943def2d 100644 --- a/jdk/src/share/classes/sun/nio/ch/AbstractPollArrayWrapper.java +++ b/jdk/src/share/classes/sun/nio/ch/AbstractPollArrayWrapper.java @@ -35,15 +35,15 @@ import sun.misc.*; * @since 1.4 */ -abstract class AbstractPollArrayWrapper { +public abstract class AbstractPollArrayWrapper { // Event masks - static final short POLLIN = 0x0001; - static final short POLLOUT = 0x0004; - static final short POLLERR = 0x0008; - static final short POLLHUP = 0x0010; - static final short POLLNVAL = 0x0020; - static final short POLLREMOVE = 0x0800; + public static final short POLLIN = 0x0001; + public static final short POLLOUT = 0x0004; + public static final short POLLERR = 0x0008; + public static final short POLLHUP = 0x0010; + public static final short POLLNVAL = 0x0020; + public static final short POLLREMOVE = 0x0800; // Miscellaneous constants static final short SIZE_POLLFD = 8; diff --git a/jdk/src/share/classes/sun/nio/ch/AbstractPollSelectorImpl.java b/jdk/src/share/classes/sun/nio/ch/AbstractPollSelectorImpl.java index 8f3a7dce185..225ac63bbf2 100644 --- a/jdk/src/share/classes/sun/nio/ch/AbstractPollSelectorImpl.java +++ b/jdk/src/share/classes/sun/nio/ch/AbstractPollSelectorImpl.java @@ -67,7 +67,7 @@ abstract class AbstractPollSelectorImpl this.channelOffset = offset; } - void putEventOps(SelectionKeyImpl sk, int ops) { + public void putEventOps(SelectionKeyImpl sk, int ops) { synchronized (closeLock) { if (closed) throw new ClosedSelectorException(); diff --git a/jdk/src/share/classes/sun/nio/ch/IOStatus.java b/jdk/src/share/classes/sun/nio/ch/IOStatus.java index 92b99fe126a..68802c099e4 100644 --- a/jdk/src/share/classes/sun/nio/ch/IOStatus.java +++ b/jdk/src/share/classes/sun/nio/ch/IOStatus.java @@ -28,16 +28,16 @@ package sun.nio.ch; // Constants for reporting I/O status -final class IOStatus { +public final class IOStatus { private IOStatus() { } - static final int EOF = -1; // End of file - static final int UNAVAILABLE = -2; // Nothing available (non-blocking) - static final int INTERRUPTED = -3; // System call interrupted - static final int UNSUPPORTED = -4; // Operation not supported - static final int THROWN = -5; // Exception thrown in JNI code - static final int UNSUPPORTED_CASE = -6; // This case not supported + public static final int EOF = -1; // End of file + public static final int UNAVAILABLE = -2; // Nothing available (non-blocking) + public static final int INTERRUPTED = -3; // System call interrupted + public static final int UNSUPPORTED = -4; // Operation not supported + public static final int THROWN = -5; // Exception thrown in JNI code + public static final int UNSUPPORTED_CASE = -6; // This case not supported // The following two methods are for use in try/finally blocks where a // status value needs to be normalized before being returned to the invoker @@ -55,28 +55,28 @@ final class IOStatus { // } // - static int normalize(int n) { + public static int normalize(int n) { if (n == UNAVAILABLE) return 0; return n; } - static boolean check(int n) { + public static boolean check(int n) { return (n >= UNAVAILABLE); } - static long normalize(long n) { + public static long normalize(long n) { if (n == UNAVAILABLE) return 0; return n; } - static boolean check(long n) { + public static boolean check(long n) { return (n >= UNAVAILABLE); } // Return true iff n is not one of the IOStatus values - static boolean checkAll(long n) { + public static boolean checkAll(long n) { return ((n > EOF) || (n < UNSUPPORTED_CASE)); } diff --git a/jdk/src/share/classes/sun/nio/ch/IOUtil.java b/jdk/src/share/classes/sun/nio/ch/IOUtil.java index 559d647c8ff..e5320bc86b0 100644 --- a/jdk/src/share/classes/sun/nio/ch/IOUtil.java +++ b/jdk/src/share/classes/sun/nio/ch/IOUtil.java @@ -34,7 +34,7 @@ import java.nio.ByteBuffer; * File-descriptor based I/O utilities that are shared by NIO classes. */ -class IOUtil { +public class IOUtil { private IOUtil() { } // No instantiation @@ -309,7 +309,7 @@ class IOUtil { } } - static FileDescriptor newFD(int i) { + public static FileDescriptor newFD(int i) { FileDescriptor fd = new FileDescriptor(); setfdVal(fd, i); return fd; @@ -326,10 +326,11 @@ class IOUtil { static native boolean drain(int fd) throws IOException; - static native void configureBlocking(FileDescriptor fd, boolean blocking) + public static native void configureBlocking(FileDescriptor fd, + boolean blocking) throws IOException; - static native int fdVal(FileDescriptor fd); + public static native int fdVal(FileDescriptor fd); static native void setfdVal(FileDescriptor fd, int value); diff --git a/jdk/src/share/classes/sun/nio/ch/Net.java b/jdk/src/share/classes/sun/nio/ch/Net.java index aecbc7ba5bc..9f2d1f01776 100644 --- a/jdk/src/share/classes/sun/nio/ch/Net.java +++ b/jdk/src/share/classes/sun/nio/ch/Net.java @@ -33,7 +33,7 @@ import java.security.AccessController; import java.security.PrivilegedAction; -class Net { // package-private +public class Net { private Net() { } @@ -75,7 +75,7 @@ class Net { // package-private return canJoin6WithIPv4Group0(); } - static InetSocketAddress checkAddress(SocketAddress sa) { + public static InetSocketAddress checkAddress(SocketAddress sa) { if (sa == null) throw new NullPointerException(); if (!(sa instanceof InetSocketAddress)) @@ -330,7 +330,7 @@ class Net { // package-private // Due to oddities SO_REUSEADDR on windows reuse is ignored private static native int socket0(boolean preferIPv6, boolean stream, boolean reuse); - static void bind(FileDescriptor fd, InetAddress addr, int port) + public static void bind(FileDescriptor fd, InetAddress addr, int port) throws IOException { bind(UNSPEC, fd, addr, port); @@ -383,7 +383,7 @@ class Net { // package-private private static native InetAddress localInetAddress(FileDescriptor fd) throws IOException; - static InetSocketAddress localAddress(FileDescriptor fd) + public static InetSocketAddress localAddress(FileDescriptor fd) throws IOException { return new InetSocketAddress(localInetAddress(fd), localPort(fd)); diff --git a/jdk/src/share/classes/sun/nio/ch/SelChImpl.java b/jdk/src/share/classes/sun/nio/ch/SelChImpl.java index 580bc33dd54..2f97faff80e 100644 --- a/jdk/src/share/classes/sun/nio/ch/SelChImpl.java +++ b/jdk/src/share/classes/sun/nio/ch/SelChImpl.java @@ -36,7 +36,7 @@ import java.io.IOException; * @since 1.4 */ -interface SelChImpl extends Channel { +public interface SelChImpl extends Channel { FileDescriptor getFD(); diff --git a/jdk/src/share/classes/sun/nio/ch/SelectionKeyImpl.java b/jdk/src/share/classes/sun/nio/ch/SelectionKeyImpl.java index fd2c28f9d5d..ce1783ee735 100644 --- a/jdk/src/share/classes/sun/nio/ch/SelectionKeyImpl.java +++ b/jdk/src/share/classes/sun/nio/ch/SelectionKeyImpl.java @@ -34,12 +34,12 @@ import java.nio.channels.spi.*; * An implementation of SelectionKey for Solaris. */ -class SelectionKeyImpl +public class SelectionKeyImpl extends AbstractSelectionKey { final SelChImpl channel; // package-private - final SelectorImpl selector; // package-private + public final SelectorImpl selector; // Index for a pollfd array in Selector that this key is registered with private int index; @@ -91,15 +91,15 @@ class SelectionKeyImpl // The nio versions of these operations do not care if a key // has been invalidated. They are for internal use by nio code. - void nioReadyOps(int ops) { // package-private + public void nioReadyOps(int ops) { readyOps = ops; } - int nioReadyOps() { // package-private + public int nioReadyOps() { return readyOps; } - SelectionKey nioInterestOps(int ops) { // package-private + public SelectionKey nioInterestOps(int ops) { if ((ops & ~channel().validOps()) != 0) throw new IllegalArgumentException(); channel.translateAndSetInterestOps(ops, this); @@ -107,7 +107,7 @@ class SelectionKeyImpl return this; } - int nioInterestOps() { // package-private + public int nioInterestOps() { return interestOps; } diff --git a/jdk/src/share/classes/sun/nio/ch/SelectorImpl.java b/jdk/src/share/classes/sun/nio/ch/SelectorImpl.java index bf93513fada..c881e3fe525 100644 --- a/jdk/src/share/classes/sun/nio/ch/SelectorImpl.java +++ b/jdk/src/share/classes/sun/nio/ch/SelectorImpl.java @@ -36,7 +36,7 @@ import java.util.*; * Base Selector implementation class. */ -abstract class SelectorImpl +public abstract class SelectorImpl extends AbstractSelector { @@ -118,7 +118,7 @@ abstract class SelectorImpl protected abstract void implClose() throws IOException; - void putEventOps(SelectionKeyImpl sk, int ops) { } + public void putEventOps(SelectionKeyImpl sk, int ops) { } protected final SelectionKey register(AbstractSelectableChannel ch, int ops, diff --git a/jdk/src/share/classes/sun/nio/ch/Util.java b/jdk/src/share/classes/sun/nio/ch/Util.java index fafc48f3552..56aa1f65e39 100644 --- a/jdk/src/share/classes/sun/nio/ch/Util.java +++ b/jdk/src/share/classes/sun/nio/ch/Util.java @@ -40,7 +40,7 @@ import sun.misc.Cleaner; import sun.security.action.GetPropertyAction; -class Util { +public class Util { // -- Caches -- @@ -158,7 +158,7 @@ class Util { /** * Returns a temporary buffer of at least the given size */ - static ByteBuffer getTemporaryDirectBuffer(int size) { + public static ByteBuffer getTemporaryDirectBuffer(int size) { BufferCache cache = bufferCache.get(); ByteBuffer buf = cache.get(size); if (buf != null) { @@ -178,7 +178,7 @@ class Util { /** * Releases a temporary buffer by returning to the cache or freeing it. */ - static void releaseTemporaryDirectBuffer(ByteBuffer buf) { + public static void releaseTemporaryDirectBuffer(ByteBuffer buf) { offerFirstTemporaryDirectBuffer(buf); } @@ -467,7 +467,7 @@ class Util { private static boolean loaded = false; - static void load() { + public static void load() { synchronized (Util.class) { if (loaded) return; diff --git a/jdk/src/share/classes/sun/nio/ch/SctpMessageInfoImpl.java b/jdk/src/share/classes/sun/nio/ch/sctp/MessageInfoImpl.java similarity index 86% rename from jdk/src/share/classes/sun/nio/ch/SctpMessageInfoImpl.java rename to jdk/src/share/classes/sun/nio/ch/sctp/MessageInfoImpl.java index 676ac9c3ca5..3bc023562e7 100644 --- a/jdk/src/share/classes/sun/nio/ch/SctpMessageInfoImpl.java +++ b/jdk/src/share/classes/sun/nio/ch/sctp/MessageInfoImpl.java @@ -22,7 +22,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package sun.nio.ch; +package sun.nio.ch.sctp; import java.net.SocketAddress; import com.sun.nio.sctp.MessageInfo; @@ -31,7 +31,7 @@ import com.sun.nio.sctp.Association; /** * An implementation of a MessageInfo. */ -public class SctpMessageInfoImpl extends MessageInfo { +public class MessageInfoImpl extends MessageInfo { private final SocketAddress address; private final int bytes; /* 0 */ @@ -43,9 +43,9 @@ public class SctpMessageInfoImpl extends MessageInfo { private long timeToLive; /* 0L */ private int ppid; /* 0 */ - public SctpMessageInfoImpl(Association association, - SocketAddress address, - int streamNumber) { + public MessageInfoImpl(Association association, + SocketAddress address, + int streamNumber) { this.association = association; this.address = address; this.streamNumber = streamNumber; @@ -53,13 +53,13 @@ public class SctpMessageInfoImpl extends MessageInfo { } /* Invoked from native */ - private SctpMessageInfoImpl(int assocId, - SocketAddress address, - int bytes, - int streamNumber, - boolean complete, - boolean unordered, - int ppid) { + private MessageInfoImpl(int assocId, + SocketAddress address, + int bytes, + int streamNumber, + boolean complete, + boolean unordered, + int ppid) { this.assocId = assocId; this.address = address; this.bytes = bytes; @@ -75,7 +75,7 @@ public class SctpMessageInfoImpl extends MessageInfo { } /** - * SctpMessageInfoImpl instances created from native will need to have their + * MessageInfoImpl instances created from native will need to have their * association set from the channel. */ void setAssociation(Association association) { diff --git a/jdk/src/share/classes/sun/nio/ch/SctpStdSocketOption.java b/jdk/src/share/classes/sun/nio/ch/sctp/SctpStdSocketOption.java similarity index 98% rename from jdk/src/share/classes/sun/nio/ch/SctpStdSocketOption.java rename to jdk/src/share/classes/sun/nio/ch/sctp/SctpStdSocketOption.java index f94c7598bbe..b5d5ee5e6f3 100644 --- a/jdk/src/share/classes/sun/nio/ch/SctpStdSocketOption.java +++ b/jdk/src/share/classes/sun/nio/ch/sctp/SctpStdSocketOption.java @@ -22,7 +22,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package sun.nio.ch; +package sun.nio.ch.sctp; import com.sun.nio.sctp.SctpSocketOption; diff --git a/jdk/src/solaris/classes/sun/nio/ch/DevPollSelectorImpl.java b/jdk/src/solaris/classes/sun/nio/ch/DevPollSelectorImpl.java index 1badd793fb5..05862e2356a 100644 --- a/jdk/src/solaris/classes/sun/nio/ch/DevPollSelectorImpl.java +++ b/jdk/src/solaris/classes/sun/nio/ch/DevPollSelectorImpl.java @@ -180,7 +180,7 @@ class DevPollSelectorImpl ((SelChImpl)selch).kill(); } - void putEventOps(SelectionKeyImpl sk, int ops) { + public void putEventOps(SelectionKeyImpl sk, int ops) { if (closed) throw new ClosedSelectorException(); int fd = IOUtil.fdVal(sk.channel.getFD()); diff --git a/jdk/src/solaris/classes/sun/nio/ch/EPollSelectorImpl.java b/jdk/src/solaris/classes/sun/nio/ch/EPollSelectorImpl.java index c6a09ba4ed5..c18650372ca 100644 --- a/jdk/src/solaris/classes/sun/nio/ch/EPollSelectorImpl.java +++ b/jdk/src/solaris/classes/sun/nio/ch/EPollSelectorImpl.java @@ -181,7 +181,7 @@ class EPollSelectorImpl ((SelChImpl)selch).kill(); } - void putEventOps(SelectionKeyImpl sk, int ops) { + public void putEventOps(SelectionKeyImpl sk, int ops) { if (closed) throw new ClosedSelectorException(); pollWrapper.setInterest(sk.channel, ops); diff --git a/jdk/src/solaris/classes/sun/nio/ch/NativeThread.java b/jdk/src/solaris/classes/sun/nio/ch/NativeThread.java index 968484233cf..574c33d3c50 100644 --- a/jdk/src/solaris/classes/sun/nio/ch/NativeThread.java +++ b/jdk/src/solaris/classes/sun/nio/ch/NativeThread.java @@ -37,21 +37,21 @@ package sun.nio.ch; // always returns -1 and the signal(long) method has no effect. -class NativeThread { +public class NativeThread { // Returns an opaque token representing the native thread underlying the // invoking Java thread. On systems that do not require signalling, this // method always returns -1. // - static native long current(); + public static native long current(); // Signals the given native thread so as to release it from a blocking I/O // operation. On systems that do not require signalling, this method has // no effect. // - static native void signal(long nt); + public static native void signal(long nt); - static native void init(); + private static native void init(); static { Util.load(); diff --git a/jdk/src/solaris/classes/sun/nio/ch/PollArrayWrapper.java b/jdk/src/solaris/classes/sun/nio/ch/PollArrayWrapper.java index 3fe4421f7cf..70c189e2318 100644 --- a/jdk/src/solaris/classes/sun/nio/ch/PollArrayWrapper.java +++ b/jdk/src/solaris/classes/sun/nio/ch/PollArrayWrapper.java @@ -41,9 +41,9 @@ import sun.misc.*; * @since 1.4 */ -class PollArrayWrapper extends AbstractPollArrayWrapper { +public class PollArrayWrapper extends AbstractPollArrayWrapper { - static final short POLLCONN = POLLOUT; + public static final short POLLCONN = POLLOUT; // File descriptor to write for interrupt int interruptFD; diff --git a/jdk/src/solaris/classes/sun/nio/ch/SctpAssocChange.java b/jdk/src/solaris/classes/sun/nio/ch/sctp/AssociationChange.java similarity index 92% rename from jdk/src/solaris/classes/sun/nio/ch/SctpAssocChange.java rename to jdk/src/solaris/classes/sun/nio/ch/sctp/AssociationChange.java index fe4c5334968..950c0b02923 100644 --- a/jdk/src/solaris/classes/sun/nio/ch/SctpAssocChange.java +++ b/jdk/src/solaris/classes/sun/nio/ch/sctp/AssociationChange.java @@ -22,7 +22,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package sun.nio.ch; +package sun.nio.ch.sctp; import com.sun.nio.sctp.Association; import com.sun.nio.sctp.AssociationChangeNotification; @@ -30,7 +30,7 @@ import com.sun.nio.sctp.AssociationChangeNotification; /** * An implementation of AssociationChangeNotification */ -public class SctpAssocChange extends AssociationChangeNotification +public class AssociationChange extends AssociationChangeNotification implements SctpNotification { /* static final ints so that they can be referenced from native */ @@ -50,10 +50,10 @@ public class SctpAssocChange extends AssociationChangeNotification private int maxInStreams; /* Invoked from native */ - private SctpAssocChange(int assocId, - int intEvent, - int maxOutStreams, - int maxInStreams) { + private AssociationChange(int assocId, + int intEvent, + int maxOutStreams, + int maxInStreams) { switch (intEvent) { case SCTP_COMM_UP : this.event = AssocChangeEvent.COMM_UP; diff --git a/jdk/src/solaris/classes/sun/nio/ch/SctpAssociationImpl.java b/jdk/src/solaris/classes/sun/nio/ch/sctp/AssociationImpl.java similarity index 88% rename from jdk/src/solaris/classes/sun/nio/ch/SctpAssociationImpl.java rename to jdk/src/solaris/classes/sun/nio/ch/sctp/AssociationImpl.java index c6688c33419..225f541298a 100644 --- a/jdk/src/solaris/classes/sun/nio/ch/SctpAssociationImpl.java +++ b/jdk/src/solaris/classes/sun/nio/ch/sctp/AssociationImpl.java @@ -22,17 +22,17 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package sun.nio.ch; +package sun.nio.ch.sctp; import com.sun.nio.sctp.Association; /** * An implementation of Association */ -public class SctpAssociationImpl extends Association { - public SctpAssociationImpl(int associationID, - int maxInStreams, - int maxOutStreams) { +public class AssociationImpl extends Association { + public AssociationImpl(int associationID, + int maxInStreams, + int maxOutStreams) { super(associationID, maxInStreams, maxOutStreams); } diff --git a/jdk/src/solaris/classes/sun/nio/ch/SctpPeerAddrChange.java b/jdk/src/solaris/classes/sun/nio/ch/sctp/PeerAddrChange.java similarity index 95% rename from jdk/src/solaris/classes/sun/nio/ch/SctpPeerAddrChange.java rename to jdk/src/solaris/classes/sun/nio/ch/sctp/PeerAddrChange.java index 1b89f63db3e..52bdbefc2bc 100644 --- a/jdk/src/solaris/classes/sun/nio/ch/SctpPeerAddrChange.java +++ b/jdk/src/solaris/classes/sun/nio/ch/sctp/PeerAddrChange.java @@ -22,7 +22,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package sun.nio.ch; +package sun.nio.ch.sctp; import java.net.SocketAddress; import com.sun.nio.sctp.Association; @@ -31,7 +31,7 @@ import com.sun.nio.sctp.PeerAddressChangeNotification; /** * An implementation of PeerAddressChangeNotification */ -public class SctpPeerAddrChange extends PeerAddressChangeNotification +public class PeerAddrChange extends PeerAddressChangeNotification implements SctpNotification { /* static final ints so that they can be referenced from native */ @@ -51,7 +51,7 @@ public class SctpPeerAddrChange extends PeerAddressChangeNotification private AddressChangeEvent event; /* Invoked from native */ - private SctpPeerAddrChange(int assocId, SocketAddress address, int intEvent) { + private PeerAddrChange(int assocId, SocketAddress address, int intEvent) { switch (intEvent) { case SCTP_ADDR_AVAILABLE : this.event = AddressChangeEvent.ADDR_AVAILABLE; diff --git a/jdk/src/solaris/classes/sun/nio/ch/SctpResultContainer.java b/jdk/src/solaris/classes/sun/nio/ch/sctp/ResultContainer.java similarity index 82% rename from jdk/src/solaris/classes/sun/nio/ch/SctpResultContainer.java rename to jdk/src/solaris/classes/sun/nio/ch/sctp/ResultContainer.java index f6c09d3f79a..69935d2dacb 100644 --- a/jdk/src/solaris/classes/sun/nio/ch/SctpResultContainer.java +++ b/jdk/src/solaris/classes/sun/nio/ch/sctp/ResultContainer.java @@ -22,13 +22,13 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package sun.nio.ch; +package sun.nio.ch.sctp; /** * Wraps the actual message or notification so that it can be * set and returned from the native receive implementation. */ -public class SctpResultContainer { +public class ResultContainer { /* static final ints so that they can be referenced from native */ static final int NOTHING = 0; static final int MESSAGE = 1; @@ -63,47 +63,47 @@ public class SctpResultContainer { return (SctpNotification) value; } - SctpMessageInfoImpl getMessageInfo() { + MessageInfoImpl getMessageInfo() { assert type() == MESSAGE; - if (value instanceof SctpMessageInfoImpl) - return (SctpMessageInfoImpl) value; + if (value instanceof MessageInfoImpl) + return (MessageInfoImpl) value; return null; } - SctpSendFailed getSendFailed() { + SendFailed getSendFailed() { assert type() == SEND_FAILED; - if (value instanceof SctpSendFailed) - return (SctpSendFailed) value; + if (value instanceof SendFailed) + return (SendFailed) value; return null; } - SctpAssocChange getAssociationChanged() { + AssociationChange getAssociationChanged() { assert type() == ASSOCIATION_CHANGED; - if (value instanceof SctpAssocChange) - return (SctpAssocChange) value; + if (value instanceof AssociationChange) + return (AssociationChange) value; return null; } - SctpPeerAddrChange getPeerAddressChanged() { + PeerAddrChange getPeerAddressChanged() { assert type() == PEER_ADDRESS_CHANGED; - if (value instanceof SctpPeerAddrChange) - return (SctpPeerAddrChange) value; + if (value instanceof PeerAddrChange) + return (PeerAddrChange) value; return null; } - SctpShutdown getShutdown() { + Shutdown getShutdown() { assert type() == SHUTDOWN; - if (value instanceof SctpShutdown) - return (SctpShutdown) value; + if (value instanceof Shutdown) + return (Shutdown) value; return null; } diff --git a/jdk/src/solaris/classes/sun/nio/ch/SctpChannelImpl.java b/jdk/src/solaris/classes/sun/nio/ch/sctp/SctpChannelImpl.java similarity index 97% rename from jdk/src/solaris/classes/sun/nio/ch/SctpChannelImpl.java rename to jdk/src/solaris/classes/sun/nio/ch/sctp/SctpChannelImpl.java index 699f80a9277..25afcff2695 100644 --- a/jdk/src/solaris/classes/sun/nio/ch/SctpChannelImpl.java +++ b/jdk/src/solaris/classes/sun/nio/ch/sctp/SctpChannelImpl.java @@ -22,7 +22,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package sun.nio.ch; +package sun.nio.ch.sctp; import java.net.InetAddress; import java.net.SocketAddress; @@ -53,11 +53,20 @@ import com.sun.nio.sctp.MessageInfo; import com.sun.nio.sctp.NotificationHandler; import com.sun.nio.sctp.SctpChannel; import com.sun.nio.sctp.SctpSocketOption; +import sun.nio.ch.DirectBuffer; +import sun.nio.ch.IOStatus; +import sun.nio.ch.IOUtil; +import sun.nio.ch.NativeThread; +import sun.nio.ch.Net; +import sun.nio.ch.PollArrayWrapper; +import sun.nio.ch.SelChImpl; +import sun.nio.ch.SelectionKeyImpl; +import sun.nio.ch.Util; import static com.sun.nio.sctp.SctpStandardSocketOptions.*; -import static sun.nio.ch.SctpResultContainer.SEND_FAILED; -import static sun.nio.ch.SctpResultContainer.ASSOCIATION_CHANGED; -import static sun.nio.ch.SctpResultContainer.PEER_ADDRESS_CHANGED; -import static sun.nio.ch.SctpResultContainer.SHUTDOWN; +import static sun.nio.ch.sctp.ResultContainer.SEND_FAILED; +import static sun.nio.ch.sctp.ResultContainer.ASSOCIATION_CHANGED; +import static sun.nio.ch.sctp.ResultContainer.PEER_ADDRESS_CHANGED; +import static sun.nio.ch.sctp.ResultContainer.SHUTDOWN; /** * An implementation of an SctpChannel @@ -745,7 +754,7 @@ public class SctpChannelImpl extends SctpChannel receiveInvoked.set(Boolean.TRUE); try { - SctpResultContainer resultContainer = new SctpResultContainer(); + ResultContainer resultContainer = new ResultContainer(); do { resultContainer.clear(); synchronized (receiveLock) { @@ -775,7 +784,7 @@ public class SctpChannelImpl extends SctpChannel /* message or nothing */ if (resultContainer.hasSomething()) { /* Set the association before returning */ - SctpMessageInfoImpl info = + MessageInfoImpl info = resultContainer.getMessageInfo(); synchronized (stateLock) { assert association != null; @@ -812,7 +821,7 @@ public class SctpChannelImpl extends SctpChannel private int receive(int fd, ByteBuffer dst, - SctpResultContainer resultContainer, + ResultContainer resultContainer, boolean peek) throws IOException { int pos = dst.position(); @@ -837,7 +846,7 @@ public class SctpChannelImpl extends SctpChannel } private int receiveIntoNativeBuffer(int fd, - SctpResultContainer resultContainer, + ResultContainer resultContainer, ByteBuffer bb, int rem, int pos, @@ -854,7 +863,7 @@ public class SctpChannelImpl extends SctpChannel private InternalNotificationHandler internalNotificationHandler = new InternalNotificationHandler(); - private void handleNotificationInternal(SctpResultContainer resultContainer) + private void handleNotificationInternal(ResultContainer resultContainer) { invokeNotificationHandler(resultContainer, internalNotificationHandler, null); @@ -869,8 +878,8 @@ public class SctpChannelImpl extends SctpChannel if (not.event().equals( AssociationChangeNotification.AssocChangeEvent.COMM_UP) && association == null) { - SctpAssocChange sac = (SctpAssocChange) not; - association = new SctpAssociationImpl + AssociationChange sac = (AssociationChange) not; + association = new AssociationImpl (sac.assocId(), sac.maxInStreams(), sac.maxOutStreams()); } return HandlerResult.CONTINUE; @@ -878,7 +887,7 @@ public class SctpChannelImpl extends SctpChannel } private HandlerResult invokeNotificationHandler - (SctpResultContainer resultContainer, + (ResultContainer resultContainer, NotificationHandler handler, T attachment) { SctpNotification notification = resultContainer.notification(); @@ -1078,7 +1087,7 @@ public class SctpChannelImpl extends SctpChannel /* Native */ private static native void initIDs(); - static native int receive0(int fd, SctpResultContainer resultContainer, + static native int receive0(int fd, ResultContainer resultContainer, long address, int length, boolean peek) throws IOException; static native int send0(int fd, long address, int length, diff --git a/jdk/src/solaris/classes/sun/nio/ch/SctpMultiChannelImpl.java b/jdk/src/solaris/classes/sun/nio/ch/sctp/SctpMultiChannelImpl.java similarity index 97% rename from jdk/src/solaris/classes/sun/nio/ch/SctpMultiChannelImpl.java rename to jdk/src/solaris/classes/sun/nio/ch/sctp/SctpMultiChannelImpl.java index 8ef16fac404..e00247f3970 100644 --- a/jdk/src/solaris/classes/sun/nio/ch/SctpMultiChannelImpl.java +++ b/jdk/src/solaris/classes/sun/nio/ch/sctp/SctpMultiChannelImpl.java @@ -22,7 +22,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package sun.nio.ch; +package sun.nio.ch.sctp; import java.net.InetAddress; import java.net.SocketAddress; @@ -53,8 +53,17 @@ import com.sun.nio.sctp.MessageInfo; import com.sun.nio.sctp.SctpChannel; import com.sun.nio.sctp.SctpMultiChannel; import com.sun.nio.sctp.SctpSocketOption; +import sun.nio.ch.DirectBuffer; +import sun.nio.ch.NativeThread; +import sun.nio.ch.IOStatus; +import sun.nio.ch.IOUtil; +import sun.nio.ch.Net; +import sun.nio.ch.PollArrayWrapper; +import sun.nio.ch.SelChImpl; +import sun.nio.ch.SelectionKeyImpl; +import sun.nio.ch.Util; import static com.sun.nio.sctp.SctpStandardSocketOptions.*; -import static sun.nio.ch.SctpResultContainer.*; +import static sun.nio.ch.sctp.ResultContainer.*; /** * An implementation of SctpMultiChannel @@ -466,7 +475,7 @@ public class SctpMultiChannelImpl extends SctpMultiChannel receiveInvoked.set(Boolean.TRUE); try { - SctpResultContainer resultContainer = new SctpResultContainer(); + ResultContainer resultContainer = new ResultContainer(); do { resultContainer.clear(); synchronized (receiveLock) { @@ -498,7 +507,7 @@ public class SctpMultiChannelImpl extends SctpMultiChannel /* message or nothing */ if (resultContainer.hasSomething()) { /* Set the association before returning */ - SctpMessageInfoImpl info = + MessageInfoImpl info = resultContainer.getMessageInfo(); info.setAssociation(lookupAssociation(info. associationID())); @@ -542,7 +551,7 @@ public class SctpMultiChannelImpl extends SctpMultiChannel private int receive(int fd, ByteBuffer dst, - SctpResultContainer resultContainer) + ResultContainer resultContainer) throws IOException { int pos = dst.position(); int lim = dst.limit(); @@ -566,7 +575,7 @@ public class SctpMultiChannelImpl extends SctpMultiChannel } private int receiveIntoNativeBuffer(int fd, - SctpResultContainer resultContainer, + ResultContainer resultContainer, ByteBuffer bb, int rem, int pos) @@ -580,7 +589,7 @@ public class SctpMultiChannelImpl extends SctpMultiChannel private InternalNotificationHandler internalNotificationHandler = new InternalNotificationHandler(); - private void handleNotificationInternal(SctpResultContainer resultContainer) + private void handleNotificationInternal(ResultContainer resultContainer) { invokeNotificationHandler(resultContainer, internalNotificationHandler, null); @@ -592,12 +601,12 @@ public class SctpMultiChannelImpl extends SctpMultiChannel @Override public HandlerResult handleNotification( AssociationChangeNotification not, Object unused) { - SctpAssocChange sac = (SctpAssocChange) not; + AssociationChange sac = (AssociationChange) not; /* Update map to reflect change in association */ switch (not.event()) { case COMM_UP : - Association newAssociation = new SctpAssociationImpl + Association newAssociation = new AssociationImpl (sac.assocId(), sac.maxInStreams(), sac.maxOutStreams()); addAssociation(newAssociation); break; @@ -612,7 +621,7 @@ public class SctpMultiChannelImpl extends SctpMultiChannel } private HandlerResult invokeNotificationHandler( - SctpResultContainer resultContainer, + ResultContainer resultContainer, NotificationHandler handler, T attachment) { HandlerResult result; @@ -956,7 +965,7 @@ public class SctpMultiChannelImpl extends SctpMultiChannel /* Use common native implementation shared between * one-to-one and one-to-many */ private static int receive0(int fd, - SctpResultContainer resultContainer, + ResultContainer resultContainer, long address, int length) throws IOException{ diff --git a/jdk/src/solaris/classes/sun/nio/ch/SctpNet.java b/jdk/src/solaris/classes/sun/nio/ch/sctp/SctpNet.java similarity index 99% rename from jdk/src/solaris/classes/sun/nio/ch/SctpNet.java rename to jdk/src/solaris/classes/sun/nio/ch/sctp/SctpNet.java index a275c99cf9c..efe25b335a4 100644 --- a/jdk/src/solaris/classes/sun/nio/ch/SctpNet.java +++ b/jdk/src/solaris/classes/sun/nio/ch/sctp/SctpNet.java @@ -22,7 +22,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package sun.nio.ch; +package sun.nio.ch.sctp; import java.io.FileDescriptor; import java.io.IOException; @@ -34,6 +34,8 @@ import java.util.Set; import java.util.HashSet; import java.security.AccessController; import sun.security.action.GetPropertyAction; +import sun.nio.ch.IOUtil; +import sun.nio.ch.Net; import com.sun.nio.sctp.SctpSocketOption; import static com.sun.nio.sctp.SctpStandardSocketOptions.*; diff --git a/jdk/src/solaris/classes/sun/nio/ch/SctpNotification.java b/jdk/src/solaris/classes/sun/nio/ch/sctp/SctpNotification.java similarity index 98% rename from jdk/src/solaris/classes/sun/nio/ch/SctpNotification.java rename to jdk/src/solaris/classes/sun/nio/ch/sctp/SctpNotification.java index d35ea804473..c901964b832 100644 --- a/jdk/src/solaris/classes/sun/nio/ch/SctpNotification.java +++ b/jdk/src/solaris/classes/sun/nio/ch/sctp/SctpNotification.java @@ -22,7 +22,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package sun.nio.ch; +package sun.nio.ch.sctp; import com.sun.nio.sctp.Association; import com.sun.nio.sctp.Notification; diff --git a/jdk/src/solaris/classes/sun/nio/ch/SctpServerChannelImpl.java b/jdk/src/solaris/classes/sun/nio/ch/sctp/SctpServerChannelImpl.java similarity index 98% rename from jdk/src/solaris/classes/sun/nio/ch/SctpServerChannelImpl.java rename to jdk/src/solaris/classes/sun/nio/ch/sctp/SctpServerChannelImpl.java index 85a2d73d4be..15d281bd309 100644 --- a/jdk/src/solaris/classes/sun/nio/ch/SctpServerChannelImpl.java +++ b/jdk/src/solaris/classes/sun/nio/ch/sctp/SctpServerChannelImpl.java @@ -22,7 +22,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package sun.nio.ch; +package sun.nio.ch.sctp; import java.net.SocketAddress; import java.net.InetSocketAddress; @@ -41,6 +41,15 @@ import com.sun.nio.sctp.SctpChannel; import com.sun.nio.sctp.SctpServerChannel; import com.sun.nio.sctp.SctpSocketOption; import com.sun.nio.sctp.SctpStandardSocketOptions; +import sun.nio.ch.DirectBuffer; +import sun.nio.ch.NativeThread; +import sun.nio.ch.IOStatus; +import sun.nio.ch.IOUtil; +import sun.nio.ch.Net; +import sun.nio.ch.PollArrayWrapper; +import sun.nio.ch.SelChImpl; +import sun.nio.ch.SelectionKeyImpl; +import sun.nio.ch.Util; /** * An implementation of SctpServerChannel diff --git a/jdk/src/solaris/classes/sun/nio/ch/SctpSendFailed.java b/jdk/src/solaris/classes/sun/nio/ch/sctp/SendFailed.java similarity index 91% rename from jdk/src/solaris/classes/sun/nio/ch/SctpSendFailed.java rename to jdk/src/solaris/classes/sun/nio/ch/sctp/SendFailed.java index ff71bdf1091..25717d5ce11 100644 --- a/jdk/src/solaris/classes/sun/nio/ch/SctpSendFailed.java +++ b/jdk/src/solaris/classes/sun/nio/ch/sctp/SendFailed.java @@ -22,7 +22,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package sun.nio.ch; +package sun.nio.ch.sctp; import java.nio.ByteBuffer; import java.net.SocketAddress; @@ -32,7 +32,7 @@ import com.sun.nio.sctp.SendFailedNotification; /** * An implementation of SendFailedNotification */ -public class SctpSendFailed extends SendFailedNotification +public class SendFailed extends SendFailedNotification implements SctpNotification { private Association association; @@ -45,11 +45,11 @@ public class SctpSendFailed extends SendFailedNotification private int streamNumber; /* Invoked from native */ - private SctpSendFailed(int assocId, - SocketAddress address, - ByteBuffer buffer, - int errorCode, - int streamNumber) { + private SendFailed(int assocId, + SocketAddress address, + ByteBuffer buffer, + int errorCode, + int streamNumber) { this.assocId = assocId; this.errorCode = errorCode; this.streamNumber = streamNumber; diff --git a/jdk/src/solaris/classes/sun/nio/ch/SctpShutdown.java b/jdk/src/solaris/classes/sun/nio/ch/sctp/Shutdown.java similarity index 94% rename from jdk/src/solaris/classes/sun/nio/ch/SctpShutdown.java rename to jdk/src/solaris/classes/sun/nio/ch/sctp/Shutdown.java index 9da2375c1cf..b3cf6691d77 100644 --- a/jdk/src/solaris/classes/sun/nio/ch/SctpShutdown.java +++ b/jdk/src/solaris/classes/sun/nio/ch/sctp/Shutdown.java @@ -22,7 +22,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package sun.nio.ch; +package sun.nio.ch.sctp; import com.sun.nio.sctp.Association; import com.sun.nio.sctp.ShutdownNotification; @@ -30,7 +30,7 @@ import com.sun.nio.sctp.ShutdownNotification; /** * An implementation of ShutdownNotification */ -public class SctpShutdown extends ShutdownNotification +public class Shutdown extends ShutdownNotification implements SctpNotification { private Association association; @@ -39,7 +39,7 @@ public class SctpShutdown extends ShutdownNotification private int assocId; /* Invoked from native */ - private SctpShutdown(int assocId) { + private Shutdown(int assocId) { this.assocId = assocId; } diff --git a/jdk/src/solaris/native/sun/nio/ch/Sctp.h b/jdk/src/solaris/native/sun/nio/ch/sctp/Sctp.h similarity index 100% rename from jdk/src/solaris/native/sun/nio/ch/Sctp.h rename to jdk/src/solaris/native/sun/nio/ch/sctp/Sctp.h diff --git a/jdk/src/solaris/native/sun/nio/ch/SctpChannelImpl.c b/jdk/src/solaris/native/sun/nio/ch/sctp/SctpChannelImpl.c similarity index 83% rename from jdk/src/solaris/native/sun/nio/ch/SctpChannelImpl.c rename to jdk/src/solaris/native/sun/nio/ch/sctp/SctpChannelImpl.c index 8e40204e442..4333720c3d8 100644 --- a/jdk/src/solaris/native/sun/nio/ch/SctpChannelImpl.c +++ b/jdk/src/solaris/native/sun/nio/ch/sctp/SctpChannelImpl.c @@ -32,21 +32,21 @@ #include "nio.h" #include "net_util.h" #include "net_util_md.h" -#include "sun_nio_ch_SctpNet.h" -#include "sun_nio_ch_SctpChannelImpl.h" -#include "sun_nio_ch_SctpAssocChange.h" -#include "sun_nio_ch_SctpResultContainer.h" -#include "sun_nio_ch_SctpPeerAddrChange.h" +#include "sun_nio_ch_sctp_SctpNet.h" +#include "sun_nio_ch_sctp_SctpChannelImpl.h" +#include "sun_nio_ch_sctp_AssociationChange.h" +#include "sun_nio_ch_sctp_ResultContainer.h" +#include "sun_nio_ch_sctp_PeerAddrChange.h" /* sizeof(union sctp_notification */ #define NOTIFICATION_BUFFER_SIZE 280 -#define MESSAGE_IMPL_CLASS "sun/nio/ch/SctpMessageInfoImpl" -#define RESULT_CONTAINER_CLASS "sun/nio/ch/SctpResultContainer" -#define SEND_FAILED_CLASS "sun/nio/ch/SctpSendFailed" -#define ASSOC_CHANGE_CLASS "sun/nio/ch/SctpAssocChange" -#define PEER_CHANGE_CLASS "sun/nio/ch/SctpPeerAddrChange" -#define SHUTDOWN_CLASS "sun/nio/ch/SctpShutdown" +#define MESSAGE_IMPL_CLASS "sun/nio/ch/sctp/MessageInfoImpl" +#define RESULT_CONTAINER_CLASS "sun/nio/ch/sctp/ResultContainer" +#define SEND_FAILED_CLASS "sun/nio/ch/sctp/SendFailed" +#define ASSOC_CHANGE_CLASS "sun/nio/ch/sctp/AssociationChange" +#define PEER_CHANGE_CLASS "sun/nio/ch/sctp/PeerAddrChange" +#define SHUTDOWN_CLASS "sun/nio/ch/sctp/Shutdown" struct controlData { int assocId; @@ -55,38 +55,40 @@ struct controlData { unsigned int ppid; }; -static jclass smi_class; /* sun.nio.ch.SctpMessageInfoImpl */ -static jmethodID smi_ctrID; /* sun.nio.ch.SctpMessageInfoImpl. */ -static jfieldID src_valueID; /* sun.nio.ch.SctpResultContainer.value */ -static jfieldID src_typeID; /* sun.nio.ch.SctpResultContainer.type */ -static jclass ssf_class; /* sun.nio.ch.SctpSendFailed */ -static jmethodID ssf_ctrID; /* sun.nio.ch.SctpSendFailed. */ -static jclass sac_class; /* sun.nio.ch.SctpAssociationChanged */ -static jmethodID sac_ctrID; /* sun.nio.ch.SctpAssociationChanged. */ -static jclass spc_class; /* sun.nio.ch.SctpPeerAddressChanged */ -static jmethodID spc_ctrID; /* sun.nio.ch.SctpPeerAddressChanged. */ -static jclass ss_class; /* sun.nio.ch.SctpShutdown */ -static jmethodID ss_ctrID; /* sun.nio.ch.SctpShutdown. */ -static jfieldID isa_addrID; /* java.net.InetSocketAddress.addr */ -static jfieldID isa_portID; /* java.net.InetSocketAddress.port */ +static jclass smi_class; /* sun.nio.ch.sctp.MessageInfoImpl */ +static jmethodID smi_ctrID; /* sun.nio.ch.sctp.MessageInfoImpl. */ +static jfieldID src_valueID; /* sun.nio.ch.sctp.ResultContainer.value */ +static jfieldID src_typeID; /* sun.nio.ch.sctp.ResultContainer.type */ +static jclass ssf_class; /* sun.nio.ch.sctp.SendFailed */ +static jmethodID ssf_ctrID; /* sun.nio.ch.sctp.SendFailed. */ +static jclass sac_class; /* sun.nio.ch.sctp.AssociationChange */ +static jmethodID sac_ctrID; /* sun.nio.ch.sctp.AssociationChange. */ +static jclass spc_class; /* sun.nio.ch.sctp.PeerAddressChanged */ +static jmethodID spc_ctrID; /* sun.nio.ch.sctp.PeerAddressChanged. */ +static jclass ss_class; /* sun.nio.ch.sctp.Shutdown */ +static jmethodID ss_ctrID; /* sun.nio.ch.sctp.Shutdown. */ +static jfieldID isa_addrID; /* java.net.InetSocketAddress.addr */ +static jfieldID isa_portID; /* java.net.InetSocketAddress.port */ /* defined in SctpNet.c */ jobject SockAddrToInetSocketAddress(JNIEnv* env, struct sockaddr* addr); +jint handleSocketError(JNIEnv *env, jint errorValue); + /* use SocketChannelImpl's checkConnect implementation */ extern jint Java_sun_nio_ch_SocketChannelImpl_checkConnect(JNIEnv* env, jobject this, jobject fdo, jboolean block, jboolean ready); /* - * Class: sun_nio_ch_SctpChannelImpl + * Class: sun_nio_ch_sctp_SctpChannelImpl * Method: initIDs * Signature: ()V */ -JNIEXPORT void JNICALL Java_sun_nio_ch_SctpChannelImpl_initIDs +JNIEXPORT void JNICALL Java_sun_nio_ch_sctp_SctpChannelImpl_initIDs (JNIEnv *env, jclass klass) { jclass cls; - /* SctpMessageInfoImpl */ + /* MessageInfoImpl */ cls = (*env)->FindClass(env, MESSAGE_IMPL_CLASS); CHECK_NULL(cls); smi_class = (*env)->NewGlobalRef(env, cls); @@ -95,7 +97,7 @@ JNIEXPORT void JNICALL Java_sun_nio_ch_SctpChannelImpl_initIDs "(ILjava/net/SocketAddress;IIZZI)V"); CHECK_NULL(smi_ctrID); - /* SctpResultContainer */ + /* ResultContainer */ cls = (*env)->FindClass(env, RESULT_CONTAINER_CLASS); CHECK_NULL(cls); src_valueID = (*env)->GetFieldID(env, cls, "value", "Ljava/lang/Object;"); @@ -103,7 +105,7 @@ JNIEXPORT void JNICALL Java_sun_nio_ch_SctpChannelImpl_initIDs src_typeID = (*env)->GetFieldID(env, cls, "type", "I"); CHECK_NULL(src_typeID); - /* SctpSendFailed */ + /* SendFailed */ cls = (*env)->FindClass(env, SEND_FAILED_CLASS); CHECK_NULL(cls); ssf_class = (*env)->NewGlobalRef(env, cls); @@ -112,7 +114,7 @@ JNIEXPORT void JNICALL Java_sun_nio_ch_SctpChannelImpl_initIDs "(ILjava/net/SocketAddress;Ljava/nio/ByteBuffer;II)V"); CHECK_NULL(ssf_ctrID); - /* SctpAssocChange */ + /* AssociationChange */ cls = (*env)->FindClass(env, ASSOC_CHANGE_CLASS); CHECK_NULL(cls); sac_class = (*env)->NewGlobalRef(env, cls); @@ -120,7 +122,7 @@ JNIEXPORT void JNICALL Java_sun_nio_ch_SctpChannelImpl_initIDs sac_ctrID = (*env)->GetMethodID(env, cls, "", "(IIII)V"); CHECK_NULL(sac_ctrID); - /* SctpPeerAddrChange */ + /* PeerAddrChange */ cls = (*env)->FindClass(env, PEER_CHANGE_CLASS); CHECK_NULL(cls); spc_class = (*env)->NewGlobalRef(env, cls); @@ -129,7 +131,7 @@ JNIEXPORT void JNICALL Java_sun_nio_ch_SctpChannelImpl_initIDs "(ILjava/net/SocketAddress;I)V"); CHECK_NULL(spc_ctrID); - /* sun.nio.ch.SctpShutdown */ + /* Shutdown */ cls = (*env)->FindClass(env, SHUTDOWN_CLASS); CHECK_NULL(cls); ss_class = (*env)->NewGlobalRef(env, cls); @@ -266,13 +268,13 @@ void handleSendFailed } } - /* create SctpSendFailed */ + /* create SendFailed */ resultObj = (*env)->NewObject(env, ssf_class, ssf_ctrID, ssf->ssf_assoc_id, isaObj, bufferObj, ssf->ssf_error, sri->sinfo_stream); CHECK_NULL(resultObj); (*env)->SetObjectField(env, resultContainerObj, src_valueID, resultObj); (*env)->SetIntField(env, resultContainerObj, src_typeID, - sun_nio_ch_SctpResultContainer_SEND_FAILED); + sun_nio_ch_sctp_ResultContainer_SEND_FAILED); } void handleAssocChange @@ -282,38 +284,38 @@ void handleAssocChange switch (sac->sac_state) { case SCTP_COMM_UP : - state = sun_nio_ch_SctpAssocChange_SCTP_COMM_UP; + state = sun_nio_ch_sctp_AssociationChange_SCTP_COMM_UP; break; case SCTP_COMM_LOST : - state = sun_nio_ch_SctpAssocChange_SCTP_COMM_LOST; + state = sun_nio_ch_sctp_AssociationChange_SCTP_COMM_LOST; break; case SCTP_RESTART : - state = sun_nio_ch_SctpAssocChange_SCTP_RESTART; + state = sun_nio_ch_sctp_AssociationChange_SCTP_RESTART; break; case SCTP_SHUTDOWN_COMP : - state = sun_nio_ch_SctpAssocChange_SCTP_SHUTDOWN; + state = sun_nio_ch_sctp_AssociationChange_SCTP_SHUTDOWN; break; case SCTP_CANT_STR_ASSOC : - state = sun_nio_ch_SctpAssocChange_SCTP_CANT_START; + state = sun_nio_ch_sctp_AssociationChange_SCTP_CANT_START; } - /* create SctpAssociationChanged */ + /* create AssociationChange */ resultObj = (*env)->NewObject(env, sac_class, sac_ctrID, sac->sac_assoc_id, state, sac->sac_outbound_streams, sac->sac_inbound_streams); CHECK_NULL(resultObj); (*env)->SetObjectField(env, resultContainerObj, src_valueID, resultObj); (*env)->SetIntField(env, resultContainerObj, src_typeID, - sun_nio_ch_SctpResultContainer_ASSOCIATION_CHANGED); + sun_nio_ch_sctp_ResultContainer_ASSOCIATION_CHANGED); } void handleShutdown (JNIEnv* env, jobject resultContainerObj, struct sctp_shutdown_event* sse) { - /* create SctpShutdown */ + /* create Shutdown */ jobject resultObj = (*env)->NewObject(env, ss_class, ss_ctrID, sse->sse_assoc_id); CHECK_NULL(resultObj); (*env)->SetObjectField(env, resultContainerObj, src_valueID, resultObj); (*env)->SetIntField(env, resultContainerObj, src_typeID, - sun_nio_ch_SctpResultContainer_SHUTDOWN); + sun_nio_ch_sctp_ResultContainer_SHUTDOWN); } void handlePeerAddrChange @@ -324,35 +326,35 @@ void handlePeerAddrChange switch (state) { case SCTP_ADDR_AVAILABLE : - event = sun_nio_ch_SctpPeerAddrChange_SCTP_ADDR_AVAILABLE; + event = sun_nio_ch_sctp_PeerAddrChange_SCTP_ADDR_AVAILABLE; break; case SCTP_ADDR_UNREACHABLE : - event = sun_nio_ch_SctpPeerAddrChange_SCTP_ADDR_UNREACHABLE; + event = sun_nio_ch_sctp_PeerAddrChange_SCTP_ADDR_UNREACHABLE; break; case SCTP_ADDR_REMOVED : - event = sun_nio_ch_SctpPeerAddrChange_SCTP_ADDR_REMOVED; + event = sun_nio_ch_sctp_PeerAddrChange_SCTP_ADDR_REMOVED; break; case SCTP_ADDR_ADDED : - event = sun_nio_ch_SctpPeerAddrChange_SCTP_ADDR_ADDED; + event = sun_nio_ch_sctp_PeerAddrChange_SCTP_ADDR_ADDED; break; case SCTP_ADDR_MADE_PRIM : - event = sun_nio_ch_SctpPeerAddrChange_SCTP_ADDR_MADE_PRIM; + event = sun_nio_ch_sctp_PeerAddrChange_SCTP_ADDR_MADE_PRIM; #ifdef __linux__ /* Solaris currently doesn't support SCTP_ADDR_CONFIRMED */ break; case SCTP_ADDR_CONFIRMED : - event = sun_nio_ch_SctpPeerAddrChange_SCTP_ADDR_CONFIRMED; + event = sun_nio_ch_sctp_PeerAddrChange_SCTP_ADDR_CONFIRMED; #endif /* __linux__ */ } addressObj = SockAddrToInetSocketAddress(env, (struct sockaddr*)&spc->spc_aaddr); - /* create SctpPeerAddressChanged */ + /* create PeerAddressChanged */ resultObj = (*env)->NewObject(env, spc_class, spc_ctrID, spc->spc_assoc_id, addressObj, event); CHECK_NULL(resultObj); (*env)->SetObjectField(env, resultContainerObj, src_valueID, resultObj); (*env)->SetIntField(env, resultContainerObj, src_typeID, - sun_nio_ch_SctpResultContainer_PEER_ADDRESS_CHANGED); + sun_nio_ch_sctp_ResultContainer_PEER_ADDRESS_CHANGED); } void handleUninteresting @@ -403,7 +405,7 @@ void handleMessage isa = SockAddrToInetSocketAddress(env, sap); getControlData(msg, cdata); - /* create SctpMessageInfoImpl */ + /* create MessageInfoImpl */ resultObj = (*env)->NewObject(env, smi_class, smi_ctrID, cdata->assocId, isa, read, cdata->streamNumber, isEOR ? JNI_TRUE : JNI_FALSE, @@ -411,15 +413,15 @@ void handleMessage CHECK_NULL(resultObj); (*env)->SetObjectField(env, resultContainerObj, src_valueID, resultObj); (*env)->SetIntField(env, resultContainerObj, src_typeID, - sun_nio_ch_SctpResultContainer_MESSAGE); + sun_nio_ch_sctp_ResultContainer_MESSAGE); } /* - * Class: sun_nio_ch_SctpChannelImpl + * Class: sun_nio_ch_sctp_SctpChannelImpl * Method: receive0 - * Signature: (ILsun/nio/ch/SctpResultContainer;JIZ)I + * Signature: (ILsun/nio/ch/sctp/ResultContainer;JIZ)I */ -JNIEXPORT jint JNICALL Java_sun_nio_ch_SctpChannelImpl_receive0 +JNIEXPORT jint JNICALL Java_sun_nio_ch_sctp_SctpChannelImpl_receive0 (JNIEnv *env, jclass klass, jint fd, jobject resultContainerObj, jlong address, jint length, jboolean peek) { SOCKADDR sa; @@ -505,11 +507,11 @@ JNIEXPORT jint JNICALL Java_sun_nio_ch_SctpChannelImpl_receive0 } /* - * Class: sun_nio_ch_SctpChannelImpl + * Class: sun_nio_ch_sctp_SctpChannelImpl * Method: send0 * Signature: (IJILjava/net/SocketAddress;IIZI)I */ -JNIEXPORT jint JNICALL Java_sun_nio_ch_SctpChannelImpl_send0 +JNIEXPORT jint JNICALL Java_sun_nio_ch_sctp_SctpChannelImpl_send0 (JNIEnv *env, jclass klass, jint fd, jlong address, jint length, jobject saTarget, jint assocId, jint streamNumber, jboolean unordered, jint ppid) { @@ -582,11 +584,11 @@ JNIEXPORT jint JNICALL Java_sun_nio_ch_SctpChannelImpl_send0 } /* - * Class: sun_nio_ch_SctpChannelImpl + * Class: sun_nio_ch_sctp_SctpChannelImpl * Method: checkConnect * Signature: (Ljava/io/FileDescriptor;ZZ)I */ -JNIEXPORT jint JNICALL Java_sun_nio_ch_SctpChannelImpl_checkConnect +JNIEXPORT jint JNICALL Java_sun_nio_ch_sctp_SctpChannelImpl_checkConnect (JNIEnv* env, jobject this, jobject fdo, jboolean block, jboolean ready) { return Java_sun_nio_ch_SocketChannelImpl_checkConnect(env, this, fdo, block, ready); diff --git a/jdk/src/solaris/native/sun/nio/ch/SctpNet.c b/jdk/src/solaris/native/sun/nio/ch/sctp/SctpNet.c similarity index 87% rename from jdk/src/solaris/native/sun/nio/ch/SctpNet.c rename to jdk/src/solaris/native/sun/nio/ch/sctp/SctpNet.c index 3eaf402ee80..35f7315de98 100644 --- a/jdk/src/solaris/native/sun/nio/ch/SctpNet.c +++ b/jdk/src/solaris/native/sun/nio/ch/sctp/SctpNet.c @@ -34,8 +34,8 @@ #include "nio.h" #include "net_util.h" #include "net_util_md.h" -#include "sun_nio_ch_SctpNet.h" -#include "sun_nio_ch_SctpStdSocketOption.h" +#include "sun_nio_ch_sctp_SctpNet.h" +#include "sun_nio_ch_sctp_SctpStdSocketOption.h" static jclass isaCls = 0; static jmethodID isaCtrID = 0; @@ -143,12 +143,12 @@ handleSocketError(JNIEnv *env, jint errorValue) } /* - * Class: sun_nio_ch_SctpNet + * Class: sun_nio_ch_sctp_SctpNet * Method: init * Signature: ()V */ JNIEXPORT void JNICALL -Java_sun_nio_ch_SctpNet_init +Java_sun_nio_ch_sctp_SctpNet_init (JNIEnv *env, jclass cl) { int sp[2]; if (socketpair(PF_UNIX, SOCK_STREAM, 0, sp) < 0) { @@ -160,11 +160,11 @@ Java_sun_nio_ch_SctpNet_init } /* - * Class: sun_nio_ch_SctpNet + * Class: sun_nio_ch_sctp_SctpNet * Method: socket0 * Signature: (Z)I */ -JNIEXPORT jint JNICALL Java_sun_nio_ch_SctpNet_socket0 +JNIEXPORT jint JNICALL Java_sun_nio_ch_sctp_SctpNet_socket0 (JNIEnv *env, jclass klass, jboolean oneToOne) { int fd; struct sctp_event_subscribe event; @@ -202,11 +202,11 @@ JNIEXPORT jint JNICALL Java_sun_nio_ch_SctpNet_socket0 } /* - * Class: sun_nio_ch_SctpNet + * Class: sun_nio_ch_sctp_SctpNet * Method: bindx * Signature: (I[Ljava/net/InetAddress;IIZ)V */ -JNIEXPORT void JNICALL Java_sun_nio_ch_SctpNet_bindx +JNIEXPORT void JNICALL Java_sun_nio_ch_sctp_SctpNet_bindx (JNIEnv *env, jclass klass, jint fd, jobjectArray addrs, jint port, jint addrsLength, jboolean add, jboolean preferIPv6) { SOCKADDR *sap, *tmpSap; @@ -241,24 +241,24 @@ JNIEXPORT void JNICALL Java_sun_nio_ch_SctpNet_bindx } /* - * Class: sun_nio_ch_SctpNet + * Class: sun_nio_ch_sctp_SctpNet * Method: listen0 * Signature: (II)V */ JNIEXPORT void JNICALL -Java_sun_nio_ch_SctpNet_listen0 +Java_sun_nio_ch_sctp_SctpNet_listen0 (JNIEnv *env, jclass cl, jint fd, jint backlog) { if (listen(fd, backlog) < 0) handleSocketError(env, errno); } /* - * Class: sun_nio_ch_SctpNet + * Class: sun_nio_ch_sctp_SctpNet * Method: connect0 * Signature: (ILjava/net/InetAddress;I)I */ JNIEXPORT jint JNICALL -Java_sun_nio_ch_SctpNet_connect0 +Java_sun_nio_ch_sctp_SctpNet_connect0 (JNIEnv *env, jclass clazz, int fd, jobject iao, jint port) { SOCKADDR sa; int sa_len = SOCKADDR_LEN; @@ -282,12 +282,12 @@ Java_sun_nio_ch_SctpNet_connect0 } /* - * Class: sun_nio_ch_SctpNet + * Class: sun_nio_ch_sctp_SctpNet * Method: close0 * Signature: (I)V */ JNIEXPORT void JNICALL -Java_sun_nio_ch_SctpNet_close0 +Java_sun_nio_ch_sctp_SctpNet_close0 (JNIEnv *env, jclass clazz, jint fd) { if (fd != -1) { int rv = close(fd); @@ -297,12 +297,12 @@ Java_sun_nio_ch_SctpNet_close0 } /* - * Class: sun_nio_ch_SctpNet + * Class: sun_nio_ch_sctp_SctpNet * Method: preClose0 * Signature: (I)V */ JNIEXPORT void JNICALL -Java_sun_nio_ch_SctpNet_preClose0 +Java_sun_nio_ch_sctp_SctpNet_preClose0 (JNIEnv *env, jclass clazz, jint fd) { if (preCloseFD >= 0) { if (dup2(preCloseFD, fd) < 0) @@ -340,11 +340,11 @@ jobject SockAddrToInetSocketAddress } /* - * Class: sun_nio_ch_SctpNet + * Class: sun_nio_ch_sctp_SctpNet * Method: getLocalAddresses0 * Signature: (I)[Ljava/net/SocketAddress; */ -JNIEXPORT jobjectArray JNICALL Java_sun_nio_ch_SctpNet_getLocalAddresses0 +JNIEXPORT jobjectArray JNICALL Java_sun_nio_ch_sctp_SctpNet_getLocalAddresses0 (JNIEnv *env, jclass klass, jint fd) { void *addr_buf, *laddr; struct sockaddr* sap; @@ -448,11 +448,11 @@ jobjectArray getRemoteAddresses } /* - * Class: sun_nio_ch_SctpNet + * Class: sun_nio_ch_sctp_SctpNet * Method: getRemoteAddresses0 * Signature: (II)[Ljava/net/SocketAddress; */ -JNIEXPORT jobjectArray JNICALL Java_sun_nio_ch_SctpNet_getRemoteAddresses0 +JNIEXPORT jobjectArray JNICALL Java_sun_nio_ch_sctp_SctpNet_getRemoteAddresses0 (JNIEnv *env, jclass klass, jint fd, jint assocId) { return getRemoteAddresses(env, fd, assocId); } @@ -465,13 +465,13 @@ int mapSocketOption int level; int optname; } const opts[] = { - { sun_nio_ch_SctpStdSocketOption_SCTP_DISABLE_FRAGMENTS, IPPROTO_SCTP, SCTP_DISABLE_FRAGMENTS }, - { sun_nio_ch_SctpStdSocketOption_SCTP_EXPLICIT_COMPLETE, IPPROTO_SCTP, SCTP_EXPLICIT_EOR }, - { sun_nio_ch_SctpStdSocketOption_SCTP_FRAGMENT_INTERLEAVE, IPPROTO_SCTP, SCTP_FRAGMENT_INTERLEAVE }, - { sun_nio_ch_SctpStdSocketOption_SCTP_NODELAY, IPPROTO_SCTP, SCTP_NODELAY }, - { sun_nio_ch_SctpStdSocketOption_SO_SNDBUF, SOL_SOCKET, SO_SNDBUF }, - { sun_nio_ch_SctpStdSocketOption_SO_RCVBUF, SOL_SOCKET, SO_RCVBUF }, - { sun_nio_ch_SctpStdSocketOption_SO_LINGER, SOL_SOCKET, SO_LINGER } }; + { sun_nio_ch_sctp_SctpStdSocketOption_SCTP_DISABLE_FRAGMENTS, IPPROTO_SCTP, SCTP_DISABLE_FRAGMENTS }, + { sun_nio_ch_sctp_SctpStdSocketOption_SCTP_EXPLICIT_COMPLETE, IPPROTO_SCTP, SCTP_EXPLICIT_EOR }, + { sun_nio_ch_sctp_SctpStdSocketOption_SCTP_FRAGMENT_INTERLEAVE, IPPROTO_SCTP, SCTP_FRAGMENT_INTERLEAVE }, + { sun_nio_ch_sctp_SctpStdSocketOption_SCTP_NODELAY, IPPROTO_SCTP, SCTP_NODELAY }, + { sun_nio_ch_sctp_SctpStdSocketOption_SO_SNDBUF, SOL_SOCKET, SO_SNDBUF }, + { sun_nio_ch_sctp_SctpStdSocketOption_SO_RCVBUF, SOL_SOCKET, SO_RCVBUF }, + { sun_nio_ch_sctp_SctpStdSocketOption_SO_LINGER, SOL_SOCKET, SO_LINGER } }; int i; for (i=0; i<(int)(sizeof(opts) / sizeof(opts[0])); i++) { @@ -487,11 +487,11 @@ int mapSocketOption } /* - * Class: sun_nio_ch_SctpNet + * Class: sun_nio_ch_sctp_SctpNet * Method: setIntOption0 * Signature: (III)V */ -JNIEXPORT void JNICALL Java_sun_nio_ch_SctpNet_setIntOption0 +JNIEXPORT void JNICALL Java_sun_nio_ch_sctp_SctpNet_setIntOption0 (JNIEnv *env, jclass klass, jint fd, jint opt, int arg) { int klevel, kopt; int result; @@ -505,7 +505,7 @@ JNIEXPORT void JNICALL Java_sun_nio_ch_SctpNet_setIntOption0 return; } - if (opt == sun_nio_ch_SctpStdSocketOption_SO_LINGER) { + if (opt == sun_nio_ch_sctp_SctpStdSocketOption_SO_LINGER) { parg = (void *)&linger; arglen = sizeof(linger); if (arg >= 0) { @@ -522,16 +522,16 @@ JNIEXPORT void JNICALL Java_sun_nio_ch_SctpNet_setIntOption0 if (NET_SetSockOpt(fd, klevel, kopt, parg, arglen) < 0) { JNU_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException", - "sun_nio_ch_SctpNet.setIntOption0"); + "sun_nio_ch_sctp_SctpNet.setIntOption0"); } } /* - * Class: sun_nio_ch_SctpNet + * Class: sun_nio_ch_sctp_SctpNet * Method: getIntOption0 * Signature: (II)I */ -JNIEXPORT int JNICALL Java_sun_nio_ch_SctpNet_getIntOption0 +JNIEXPORT int JNICALL Java_sun_nio_ch_sctp_SctpNet_getIntOption0 (JNIEnv *env, jclass klass, jint fd, jint opt) { int klevel, kopt; int result; @@ -545,7 +545,7 @@ JNIEXPORT int JNICALL Java_sun_nio_ch_SctpNet_getIntOption0 return -1; } - if (opt == sun_nio_ch_SctpStdSocketOption_SO_LINGER) { + if (opt == sun_nio_ch_sctp_SctpStdSocketOption_SO_LINGER) { arg = (void *)&linger; arglen = sizeof(linger); } else { @@ -559,18 +559,18 @@ JNIEXPORT int JNICALL Java_sun_nio_ch_SctpNet_getIntOption0 return -1; } - if (opt == sun_nio_ch_SctpStdSocketOption_SO_LINGER) + if (opt == sun_nio_ch_sctp_SctpStdSocketOption_SO_LINGER) return linger.l_onoff ? linger.l_linger : -1; else return result; } /* - * Class: sun_nio_ch_SctpNet + * Class: sun_nio_ch_sctp_SctpNet * Method: getPrimAddrOption0 * Signature: (II)Ljava/net/SocketAddress; */ -JNIEXPORT jobject JNICALL Java_sun_nio_ch_SctpNet_getPrimAddrOption0 +JNIEXPORT jobject JNICALL Java_sun_nio_ch_sctp_SctpNet_getPrimAddrOption0 (JNIEnv *env, jclass klass, jint fd, jint assocId) { struct sctp_setprim prim; unsigned int prim_len = sizeof(prim); @@ -588,11 +588,11 @@ JNIEXPORT jobject JNICALL Java_sun_nio_ch_SctpNet_getPrimAddrOption0 } /* - * Class: sun_nio_ch_SctpNet + * Class: sun_nio_ch_sctp_SctpNet * Method: setPrimAddrOption0 * Signature: (IILjava/net/InetAddress;I)V */ -JNIEXPORT void JNICALL Java_sun_nio_ch_SctpNet_setPrimAddrOption0 +JNIEXPORT void JNICALL Java_sun_nio_ch_sctp_SctpNet_setPrimAddrOption0 (JNIEnv *env, jclass klass, jint fd, jint assocId, jobject iaObj, jint port) { struct sctp_setprim prim; struct sockaddr* sap = (struct sockaddr*)&prim.ssp_addr; @@ -612,11 +612,11 @@ JNIEXPORT void JNICALL Java_sun_nio_ch_SctpNet_setPrimAddrOption0 } /* - * Class: sun_nio_ch_SctpNet + * Class: sun_nio_ch_sctp_SctpNet * Method: setPeerPrimAddrOption0 * Signature: (IILjava/net/InetAddress;I)V */ -JNIEXPORT void JNICALL Java_sun_nio_ch_SctpNet_setPeerPrimAddrOption0 +JNIEXPORT void JNICALL Java_sun_nio_ch_sctp_SctpNet_setPeerPrimAddrOption0 (JNIEnv *env, jclass klass, jint fd, jint assocId, jobject iaObj, jint port, jboolean preferIPv6) { struct sctp_setpeerprim prim; @@ -638,11 +638,11 @@ JNIEXPORT void JNICALL Java_sun_nio_ch_SctpNet_setPeerPrimAddrOption0 } /* - * Class: sun_nio_ch_SctpNet + * Class: sun_nio_ch_sctp_SctpNet * Method: getInitMsgOption0 * Signature: (I[I)V */ -JNIEXPORT void JNICALL Java_sun_nio_ch_SctpNet_getInitMsgOption0 +JNIEXPORT void JNICALL Java_sun_nio_ch_sctp_SctpNet_getInitMsgOption0 (JNIEnv *env, jclass klass, jint fd, jintArray retVal) { struct sctp_initmsg sctp_initmsg; unsigned int sim_len = sizeof(sctp_initmsg); @@ -661,11 +661,11 @@ JNIEXPORT void JNICALL Java_sun_nio_ch_SctpNet_getInitMsgOption0 } /* - * Class: sun_nio_ch_SctpNet + * Class: sun_nio_ch_sctp_SctpNet * Method: setInitMsgOption0 * Signature: (III)V */ -JNIEXPORT void JNICALL Java_sun_nio_ch_SctpNet_setInitMsgOption0 +JNIEXPORT void JNICALL Java_sun_nio_ch_sctp_SctpNet_setInitMsgOption0 (JNIEnv *env, jclass klass, jint fd, jint inArg, jint outArg) { struct sctp_initmsg sctp_initmsg; @@ -682,11 +682,11 @@ JNIEXPORT void JNICALL Java_sun_nio_ch_SctpNet_setInitMsgOption0 } /* - * Class: sun_nio_ch_SctpNet + * Class: sun_nio_ch_sctp_SctpNet * Method: shutdown0 * Signature: (II)V */ -JNIEXPORT void JNICALL Java_sun_nio_ch_SctpNet_shutdown0 +JNIEXPORT void JNICALL Java_sun_nio_ch_sctp_SctpNet_shutdown0 (JNIEnv *env, jclass klass, jint fd, jint assocId) { int rv; struct msghdr msg[1]; @@ -738,11 +738,11 @@ JNIEXPORT void JNICALL Java_sun_nio_ch_SctpNet_shutdown0 } /* - * Class: sun_nio_ch_SctpNet + * Class: sun_nio_ch_sctp_SctpNet * Method: branch * Signature: (II)I */ -JNIEXPORT int JNICALL Java_sun_nio_ch_SctpNet_branch0 +JNIEXPORT int JNICALL Java_sun_nio_ch_sctp_SctpNet_branch0 (JNIEnv *env, jclass klass, jint fd, jint assocId) { int newfd = 0; if ((newfd = nio_sctp_peeloff(fd, assocId)) < 0) { diff --git a/jdk/src/solaris/native/sun/nio/ch/SctpServerChannelImpl.c b/jdk/src/solaris/native/sun/nio/ch/sctp/SctpServerChannelImpl.c similarity index 86% rename from jdk/src/solaris/native/sun/nio/ch/SctpServerChannelImpl.c rename to jdk/src/solaris/native/sun/nio/ch/sctp/SctpServerChannelImpl.c index 5d23ae18806..4469cf2ea4d 100644 --- a/jdk/src/solaris/native/sun/nio/ch/SctpServerChannelImpl.c +++ b/jdk/src/solaris/native/sun/nio/ch/sctp/SctpServerChannelImpl.c @@ -23,7 +23,7 @@ * questions. */ -#include "sun_nio_ch_SctpServerChannelImpl.h" +#include "sun_nio_ch_sctp_SctpServerChannelImpl.h" extern void Java_sun_nio_ch_ServerSocketChannelImpl_initIDs(JNIEnv* env, jclass c); @@ -32,21 +32,21 @@ extern jint Java_sun_nio_ch_ServerSocketChannelImpl_accept0(JNIEnv* env, jobject this, jobject ssfdo, jobject newfdo, jobjectArray isaa); /* - * Class: sun_nio_ch_SctpServerChannelImpl + * Class: sun_nio_ch_sctp_SctpServerChannelImpl * Method: initIDs * Signature: ()V */ -JNIEXPORT void JNICALL Java_sun_nio_ch_SctpServerChannelImpl_initIDs +JNIEXPORT void JNICALL Java_sun_nio_ch_sctp_SctpServerChannelImpl_initIDs (JNIEnv* env, jclass c) { Java_sun_nio_ch_ServerSocketChannelImpl_initIDs(env, c); } /* - * Class: sun_nio_ch_SctpServerChannelImpl + * Class: sun_nio_ch_sctp_SctpServerChannelImpl * Method: accept0 * Signature: (Ljava/io/FileDescriptor;Ljava/io/FileDescriptor;[Ljava/net/InetSocketAddress;)I */ -JNIEXPORT jint JNICALL Java_sun_nio_ch_SctpServerChannelImpl_accept0 +JNIEXPORT jint JNICALL Java_sun_nio_ch_sctp_SctpServerChannelImpl_accept0 (JNIEnv* env, jobject this, jobject ssfdo, jobject newfdo, jobjectArray isaa) { return Java_sun_nio_ch_ServerSocketChannelImpl_accept0(env, this, ssfdo, newfdo, isaa); diff --git a/jdk/src/windows/classes/sun/nio/ch/WindowsSelectorImpl.java b/jdk/src/windows/classes/sun/nio/ch/WindowsSelectorImpl.java index 2011b85a0fd..b755e6ef0c4 100644 --- a/jdk/src/windows/classes/sun/nio/ch/WindowsSelectorImpl.java +++ b/jdk/src/windows/classes/sun/nio/ch/WindowsSelectorImpl.java @@ -585,7 +585,7 @@ final class WindowsSelectorImpl extends SelectorImpl { ((SelChImpl)selch).kill(); } - void putEventOps(SelectionKeyImpl sk, int ops) { + public void putEventOps(SelectionKeyImpl sk, int ops) { synchronized (closeLock) { if (pollWrapper == null) throw new ClosedSelectorException(); diff --git a/jdk/src/windows/classes/sun/nio/ch/SctpChannelImpl.java b/jdk/src/windows/classes/sun/nio/ch/sctp/SctpChannelImpl.java similarity index 99% rename from jdk/src/windows/classes/sun/nio/ch/SctpChannelImpl.java rename to jdk/src/windows/classes/sun/nio/ch/sctp/SctpChannelImpl.java index 562a97f21d6..52fcb8ea1f8 100644 --- a/jdk/src/windows/classes/sun/nio/ch/SctpChannelImpl.java +++ b/jdk/src/windows/classes/sun/nio/ch/sctp/SctpChannelImpl.java @@ -22,7 +22,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package sun.nio.ch; +package sun.nio.ch.sctp; import java.net.SocketAddress; import java.net.InetAddress; diff --git a/jdk/src/windows/classes/sun/nio/ch/SctpMultiChannelImpl.java b/jdk/src/windows/classes/sun/nio/ch/sctp/SctpMultiChannelImpl.java similarity index 99% rename from jdk/src/windows/classes/sun/nio/ch/SctpMultiChannelImpl.java rename to jdk/src/windows/classes/sun/nio/ch/sctp/SctpMultiChannelImpl.java index b2300f9dfc8..afb52a92f65 100644 --- a/jdk/src/windows/classes/sun/nio/ch/SctpMultiChannelImpl.java +++ b/jdk/src/windows/classes/sun/nio/ch/sctp/SctpMultiChannelImpl.java @@ -22,7 +22,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package sun.nio.ch; +package sun.nio.ch.sctp; import java.net.SocketAddress; import java.net.InetAddress; diff --git a/jdk/src/windows/classes/sun/nio/ch/SctpServerChannelImpl.java b/jdk/src/windows/classes/sun/nio/ch/sctp/SctpServerChannelImpl.java similarity index 99% rename from jdk/src/windows/classes/sun/nio/ch/SctpServerChannelImpl.java rename to jdk/src/windows/classes/sun/nio/ch/sctp/SctpServerChannelImpl.java index 842e4b0f1a4..a8c50d3257a 100644 --- a/jdk/src/windows/classes/sun/nio/ch/SctpServerChannelImpl.java +++ b/jdk/src/windows/classes/sun/nio/ch/sctp/SctpServerChannelImpl.java @@ -22,7 +22,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package sun.nio.ch; +package sun.nio.ch.sctp; import java.net.SocketAddress; import java.net.InetAddress; From 33859eda7af8a168de45f0625bafcac4158aa763 Mon Sep 17 00:00:00 2001 From: Miroslav Kos Date: Sun, 5 Feb 2012 12:29:31 +0000 Subject: [PATCH 12/82] 7140918: Remove dependency on apt and com.sun.mirror API Co-authored-by: Martin Grebac Reviewed-by: darcy --- jdk/make/common/Release.gmk | 11 +++++------ jdk/make/common/internal/Defs-jaxws.gmk | 10 ++++++---- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/jdk/make/common/Release.gmk b/jdk/make/common/Release.gmk index 5e3b0330110..e5593b83b2f 100644 --- a/jdk/make/common/Release.gmk +++ b/jdk/make/common/Release.gmk @@ -362,10 +362,11 @@ TOOLS = \ com/sun/tools/corba \ com/sun/tools/internal/xjc \ com/sun/tools/internal/ws \ - META-INF/services/com.sun.mirror.apt.AnnotationProcessorFactory \ - META-INF/services/com.sun.tools.xjc.Plugin \ + META-INF/services/com.sun.tools.internal.ws.wscompile.Plugin \ + META-INF/services/com.sun.tools.internal.xjc.Plugin \ com/sun/istack/internal/tools \ - com/sun/istack/internal/ws \ + com/sun/tools/internal/jxc/ap \ + com/sun/tools/internal/ws/wscompile/plugin/at_generated \ com/sun/codemodel \ com/sun/tools/internal/jxc \ com/sun/xml/internal/rngom \ @@ -528,10 +529,8 @@ $(NOT_RT_JAR_LIST): FRC $(ECHO) "com/sun/mirror/" >> $@ $(ECHO) "com/sun/source/" >> $@ $(ECHO) "com/sun/istack/internal/tools/" >> $@ - $(ECHO) "com/sun/istack/internal/ws/" >> $@ $(ECHO) "META-INF/services/com.sun.jdi.connect.Connector" >> $@ $(ECHO) "META-INF/services/com.sun.jdi.connect.spi.TransportService" >> $@ - $(ECHO) "META-INF/services/com.sun.mirror.apt.AnnotationProcessorFactory" >> $@ $(ECHO) "META-INF/services/com.sun.tools.xjc.Plugin" >> $@ $(ECHO) "com/sun/tools/" >> $@ $(ECHO) "sun/jvmstat/" >> $@ @@ -1000,7 +999,7 @@ initial-image-jdk:: initial-image-jdk-setup \ @# @# files that might not exist need to be touched. @# - $(TOUCH) $(CLASSBINDIR)/META-INF/services/com.sun.tools.xjc.Plugin + $(TOUCH) $(CLASSBINDIR)/META-INF/services/com.sun.tools.internal.xjc.Plugin @# @# lib/tools.jar @# diff --git a/jdk/make/common/internal/Defs-jaxws.gmk b/jdk/make/common/internal/Defs-jaxws.gmk index 105651c79fc..f0ba12b292a 100644 --- a/jdk/make/common/internal/Defs-jaxws.gmk +++ b/jdk/make/common/internal/Defs-jaxws.gmk @@ -34,7 +34,6 @@ IMPORT_RT_PACKAGES += \ javax/xml/ws \ javax/jws \ javax/annotation \ - com/sun/istack/internal \ com/sun/xml/internal/bind \ com/sun/xml/internal/fastinfoset \ com/sun/xml/internal/messaging \ @@ -42,13 +41,13 @@ IMPORT_RT_PACKAGES += \ com/sun/xml/internal/txw2 \ com/sun/xml/internal/ws \ com/sun/xml/internal/stream/buffer + NOT_USED_PACKAGES += \ com/sun/tools/internal/txw2 IMPORT_TOOLS_PACKAGES += \ com/sun/codemodel \ com/sun/istack/internal/tools \ - com/sun/istack/internal/ws \ com/sun/xml/internal/rngom \ com/sun/xml/internal/xsom \ com/sun/xml/internal/dtdparser \ @@ -56,6 +55,9 @@ IMPORT_TOOLS_PACKAGES += \ com/sun/tools/internal/ws \ com/sun/tools/internal/jxc \ org/relaxng \ - META-INF/services/com.sun.mirror.apt.AnnotationProcessorFactory \ - META-INF/services/com.sun.tools.internal.xjc.Plugin + META-INF/services/com.sun.tools.internal.ws.wscompile.Plugin \ + META-INF/services/com.sun.tools.internal.xjc.Plugin \ + com/sun/tools/internal/jxc/ap \ + com/sun/tools/internal/ws/wscompile/plugin/at_generated + From 6667bfa0a92c1959fb4f87f5ac08cb1d06959af5 Mon Sep 17 00:00:00 2001 From: Joe Darcy Date: Sun, 5 Feb 2012 21:49:45 -0800 Subject: [PATCH 13/82] 7041249: Remove apt tool and API from the JDK Reviewed-by: jjg, ohair --- jdk/make/com/sun/Makefile | 1 - jdk/make/common/Release.gmk | 6 - jdk/make/common/internal/Defs-langtools.gmk | 4 +- jdk/make/docs/Makefile | 60 +------- jdk/make/docs/NON_CORE_PKGS.gmk | 7 +- jdk/make/launchers/Makefile | 3 +- jdk/make/launchers/Makefile.launcher | 6 +- jdk/src/linux/doc/man/apt.1 | 153 -------------------- jdk/src/linux/doc/man/ja/apt.1 | 153 -------------------- jdk/src/solaris/doc/sun/man/man1/apt.1 | 153 -------------------- jdk/src/solaris/doc/sun/man/man1/ja/apt.1 | 153 -------------------- 11 files changed, 5 insertions(+), 694 deletions(-) delete mode 100644 jdk/src/linux/doc/man/apt.1 delete mode 100644 jdk/src/linux/doc/man/ja/apt.1 delete mode 100644 jdk/src/solaris/doc/sun/man/man1/apt.1 delete mode 100644 jdk/src/solaris/doc/sun/man/man1/ja/apt.1 diff --git a/jdk/make/com/sun/Makefile b/jdk/make/com/sun/Makefile index 33d5824773c..7c436af52d1 100644 --- a/jdk/make/com/sun/Makefile +++ b/jdk/make/com/sun/Makefile @@ -47,7 +47,6 @@ SUBDIRS_enterprise = crypto/provider jndi \ org rowset net/httpserver SUBDIRS_misc = $(SCRIPT_SUBDIR) tracing servicetag nio demo -# Omit mirror since it's built with the apt tool. SUBDIRS_tools = tools include $(BUILDDIR)/common/Subdirs.gmk diff --git a/jdk/make/common/Release.gmk b/jdk/make/common/Release.gmk index e5593b83b2f..cd042ff0191 100644 --- a/jdk/make/common/Release.gmk +++ b/jdk/make/common/Release.gmk @@ -132,7 +132,6 @@ endif JDK_MAN_PAGES = \ $(JRE_MAN_PAGES) \ appletviewer.1 \ - apt.1 \ extcheck.1 \ idlj.1 \ jar.1 \ @@ -264,7 +263,6 @@ SOURCES = \ com/sun/java/swing \ com/sun/javadoc \ com/sun/jmx \ - com/sun/mirror \ com/sun/source \ com/sun/naming \ com/sun/security/auth \ @@ -346,7 +344,6 @@ TOOLS = \ com/sun/javadoc \ com/sun/jdi \ com/sun/jarsigner \ - com/sun/mirror \ com/sun/source \ com/sun/tools/classfile \ com/sun/tools/doclets \ @@ -356,7 +353,6 @@ TOOLS = \ com/sun/tools/hat \ com/sun/tools/javac \ com/sun/tools/javadoc \ - com/sun/tools/apt \ com/sun/tools/javah \ com/sun/tools/javap \ com/sun/tools/corba \ @@ -439,7 +435,6 @@ NOTJRETOOLS = \ java-rmi.cgi \ javac$(EXE_SUFFIX) \ javadoc$(EXE_SUFFIX) \ - apt$(EXE_SUFFIX) \ javah$(EXE_SUFFIX) \ javap$(EXE_SUFFIX) \ jcmd$(EXE_SUFFIX) \ @@ -526,7 +521,6 @@ $(NOT_RT_JAR_LIST): FRC $(ECHO) "com/sun/javadoc/" >> $@ $(ECHO) "com/sun/jdi/" >> $@ $(ECHO) "com/sun/jarsigner/" >> $@ - $(ECHO) "com/sun/mirror/" >> $@ $(ECHO) "com/sun/source/" >> $@ $(ECHO) "com/sun/istack/internal/tools/" >> $@ $(ECHO) "META-INF/services/com.sun.jdi.connect.Connector" >> $@ diff --git a/jdk/make/common/internal/Defs-langtools.gmk b/jdk/make/common/internal/Defs-langtools.gmk index d20180b1265..e5649583fa5 100644 --- a/jdk/make/common/internal/Defs-langtools.gmk +++ b/jdk/make/common/internal/Defs-langtools.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1997, 2012, 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 @@ -32,9 +32,7 @@ IMPORT_RT_PACKAGES += \ IMPORT_TOOLS_PACKAGES += \ com/sun/javadoc \ - com/sun/mirror \ com/sun/source \ - com/sun/tools/apt \ com/sun/tools/classfile \ com/sun/tools/doclets \ com/sun/tools/javac \ diff --git a/jdk/make/docs/Makefile b/jdk/make/docs/Makefile index 61756eab7e9..a4247e5bf72 100644 --- a/jdk/make/docs/Makefile +++ b/jdk/make/docs/Makefile @@ -1,4 +1,4 @@ -# Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1997, 2012, 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 @@ -356,64 +356,6 @@ $(COREAPI_PACKAGES_FILE): $(DIRECTORY_CACHE) $(call PackageDependencies,$(CORE_P $(prep-target) $(call PackageFilter,$(CORE_PKGS)) -############################################################# -# -# mirrordocs -# - -# Part of langtools -ifdef LANGTOOLS_DIST - ALL_OTHER_TARGETS += mirrordocs -endif - -MIRROR_DOCDIR := $(JDK_API_DOCSDIR)/apt/mirror -MIRROR2COREAPI := ../../$(JDKJRE2COREAPI) -MIRROR_DOCTITLE := Mirror API -MIRROR_WINDOWTITLE := Mirror API -MIRROR_HEADER := Mirror API -MIRROR_BOTTOM := $(call CommonBottom,$(MIRROR_FIRST_COPYRIGHT_YEAR)) -MIRROR_GROUPNAME := Packages -MIRROR_OVERVIEW := $(IMPORTSRCDIR)/com/sun/mirror/overview.html -MIRROR_REGEXP := com.sun.mirror.* -# MIRROR_PKGS is located in NON_CORE_PKGS.gmk - -# The index.html, options, and packages files -MIRROR_INDEX_FILE = $(MIRROR_DOCDIR)/index.html -MIRROR_OPTIONS_FILE = $(DOCSTMPDIR)/mirror.options -MIRROR_PACKAGES_FILE = $(DOCSTMPDIR)/mirror.packages - -mirrordocs: $(MIRROR_INDEX_FILE) - -# Set relative location to core api document root -$(MIRROR_INDEX_FILE): GET2DOCSDIR=$(MIRROR2COREAPI)/.. - -# Run javadoc if the index file is out of date or missing -$(MIRROR_INDEX_FILE): $(MIRROR_OPTIONS_FILE) $(MIRROR_PACKAGES_FILE) - $(prep-javadoc) - $(call JavadocSummary,$(MIRROR_OPTIONS_FILE),$(MIRROR_PACKAGES_FILE)) - $(JAVADOC_CMD) $(JAVADOC_VM_MEMORY_FLAGS) -d $(@D) \ - @$(MIRROR_OPTIONS_FILE) @$(MIRROR_PACKAGES_FILE) - -# Create file with javadoc options in it -$(MIRROR_OPTIONS_FILE): $(MIRROR_OVERVIEW) - $(prep-target) - @($(call OptionOnly,$(COMMON_JAVADOCFLAGS)) ; \ - $(call OptionPair,-sourcepath,$(RELEASEDOCS_SOURCEPATH)) ; \ - $(call OptionPair,-encoding,ascii) ; \ - $(call OptionPair,-overview,$(MIRROR_OVERVIEW)) ; \ - $(call OptionPair,-doctitle,$(MIRROR_DOCTITLE)) ; \ - $(call OptionPair,-windowtitle,$(MIRROR_WINDOWTITLE) $(DRAFT_WINTITLE));\ - $(call OptionPair,-header,$(MIRROR_HEADER)$(DRAFT_HEADER)) ; \ - $(call OptionPair,-bottom,$(MIRROR_BOTTOM)$(DRAFT_BOTTOM)) ; \ - $(call OptionTrip,-group,$(MIRROR_GROUPNAME),$(MIRROR_REGEXP)); \ - $(call OptionTrip,-linkoffline,$(MIRROR2COREAPI),$(COREAPI_DOCSDIR)); \ - ) >> $@ - -# Create a file with the package names in it -$(MIRROR_PACKAGES_FILE): $(DIRECTORY_CACHE) $(call PackageDependencies,$(MIRROR_PKGS)) - $(prep-target) - $(call PackageFilter,$(MIRROR_PKGS)) - ############################################################# # # docletapidocs diff --git a/jdk/make/docs/NON_CORE_PKGS.gmk b/jdk/make/docs/NON_CORE_PKGS.gmk index e8eda9dfd92..8f4e36dcbdb 100644 --- a/jdk/make/docs/NON_CORE_PKGS.gmk +++ b/jdk/make/docs/NON_CORE_PKGS.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2002, 2012, 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 @@ -71,11 +71,6 @@ DOCLETAPI_PKGS = com.sun.javadoc TAGLETAPI_FILE = com/sun/tools/doclets/Taglet.java -MIRROR_PKGS = com.sun.mirror.apt \ - com.sun.mirror.declaration \ - com.sun.mirror.type \ - com.sun.mirror.util - ATTACH_PKGS = com.sun.tools.attach \ com.sun.tools.attach.spi diff --git a/jdk/make/launchers/Makefile b/jdk/make/launchers/Makefile index 5fe13cdf13e..9979d973b39 100644 --- a/jdk/make/launchers/Makefile +++ b/jdk/make/launchers/Makefile @@ -1,5 +1,5 @@ # -# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2004, 2012, 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 @@ -55,7 +55,6 @@ endif define make-all-launchers $(make-appletviewer) -$(call make-launcher, apt, com.sun.tools.apt.Main, , ) $(call make-launcher, extcheck, com.sun.tools.extcheck.Main, , ) $(call make-launcher, idlj, com.sun.tools.corba.se.idl.toJavaPortable.Compile, , ) $(call make-launcher, jar, sun.tools.jar.Main, , ) diff --git a/jdk/make/launchers/Makefile.launcher b/jdk/make/launchers/Makefile.launcher index 0908d613b82..6d98efc4994 100644 --- a/jdk/make/launchers/Makefile.launcher +++ b/jdk/make/launchers/Makefile.launcher @@ -1,5 +1,5 @@ # -# Copyright (c) 2004, 2005, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -47,10 +47,6 @@ ifndef MAIN_CLASS endif # Some tools need the wildcard expansion option -ifeq ($(PROGRAM),apt) - WILDCARDS=true - NEVER_ACT_AS_SERVER_CLASS_MACHINE=true -endif ifeq ($(PROGRAM),javac) WILDCARDS=true MAIN_JAVA_ARGS += -J-Xss4m -J-ea:com.sun.tools... diff --git a/jdk/src/linux/doc/man/apt.1 b/jdk/src/linux/doc/man/apt.1 deleted file mode 100644 index 2d77108a5d4..00000000000 --- a/jdk/src/linux/doc/man/apt.1 +++ /dev/null @@ -1,153 +0,0 @@ -." Copyright (c) 2004, 2011, 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. -." -.TH apt 1 "10 May 2011" - -.LP -.SH "NAME" -.LP -.LP -\f2apt\fP \- annotation processing tool -.LP -.SH "SYNOPSIS" -.LP -.LP -\f2apt [\-classpath \fP\f2classpath\fP] [\-sourcepath \f2sourcepath\fP] [\-d \f2directory\fP] [\-s \f2directory\fP] [\-factorypath \f2path\fP] [\-factory \f2class\fP] [\-print] [\-nocompile] [\-A\f2key\fP[\f2=val\fP] ...] [\f2javac option\fP] sourcefiles [@files] -.LP -.SH "PARAMETERS" -.LP -.LP -Options may be in any order. For a discussion of parameters which apply to a specific option, see OPTIONS below. -.LP -.RS 3 -.TP 3 -sourcefiles -Zero or more source files to be processed. -.TP 3 -@files -One or more files that list source files or other options -.RE - -.LP -.SH "DESCRIPTION" -.LP -.LP -\f3Note\fP: The \f2apt\fP tool and its associated API contained in the package \f2com.sun.mirror\fP have been deprecated since JDK 7 and are planned to be removed in the next major JDK release. Use the options available in the \f2javac(1)\fP tool and the APIs contained in the packages \f2javax.annotation.processing\fP and \f2javax.lang.model\fP to process annotations. -.LP -.LP -The tool \f2apt\fP, annotation processing tool, includes reflective APIs and supporting infrastructure to process program annotations. The \f2apt\fP reflective APIs provide a build\-time, source\-based, read\-only view of program structure. These reflective APIs are designed to cleanly model the Java(TM) programming language's type system after the addition of generics. First, \f2apt\fP runs annotation processors that can produce new source code and other files. Next, \f2apt\fP can cause compilation of both original and generated source files, easing development. The reflective APIs and other APIs used to interact with the tool are subpackages of \f2com.sun.mirror\fP. -.LP -.LP -A fuller discussion of how the tool operates as well as instructions for developing with \f2apt\fP are in -.na -\f4Getting Started with \fP\f4apt\fP. @ -.fi -http://download.oracle.com/javase/7/docs/technotes/guides/apt/GettingStarted.html -.LP -.SH "OPTIONS" -.LP -.SS -apt specific options -.LP -.RS 3 -.TP 3 -\-s dir -Specify the directory root under which processor\-generated source files will be placed; files are placed in subdirectories based on package namespace. -.TP 3 -\-nocompile -Do not compile source files to class files. -.TP 3 -\-print -Print out textual representation of specified types; perform no annotation processing or compilation. -.TP 3 -\-A[key[=val]] -Options to pass to annotation processors \-\- these are not interpreted by \f2apt\fP directly, but are made available for use by individual processors -.TP 3 -\-factorypath path -Specify where to find annotation processor factories; if this option is used, the classpath is \f2not\fP searched for factories. -.TP 3 -\-factory classname -Name of annotation processor factory to use; bypasses default discovery process -.TP 3 -\-version -Print version information. -.TP 3 -\-X -Display information about non\-standard options. -.RE - -.LP -.SS -Options shared with javac -.LP -.RS 3 -.TP 3 -\-d dir -Specify where to place processor and javac generated class files -.TP 3 -\-cp path or \-classpath path -Specify where to find user class files and annotation processor factories. If \f2\-factorypath\fP is given, the classpath is not searched for factories. -.RE - -.LP -.LP -Consult the javac(1) man page for information on \f2javac\fP options. -.LP -.SS -Non\-Standard Options -.LP -.RS 3 -.TP 3 -\-XListAnnotationTypes -List found annotation types. -.TP 3 -\-XListDeclarations -List specified and included declarations. -.TP 3 -\-XPrintAptRounds -Print information about initial and recursive \f2apt\fP rounds. -.TP 3 -\-XPrintFactoryInfo -Print information about which annotations a factory is asked to process. -.TP 3 -\-XclassesAsDecls -Treat both class and source files as declarations to process. -.RE - -.LP -.LP -\f3Note\fP: Because these options are non\-standard, they are subject to change without notice. -.LP -.SH "NOTES" -.LP -.LP -The \f2apt\fP tool and its associated API contained in the package \f2com.sun.mirror\fP have been deprecated since JDK 7 and are planned to be removed in the next major JDK release. Use the options available in the \f2javac(1)\fP tool and the APIs contained in the packages \f2javax.annotation.processing\fP and \f2javax.lang.model\fP to process annotations. -.LP -.SH "SEE ALSO" -.LP -.RS 3 -.TP 2 -o -javac(1), java(1) -.RE - -.LP - diff --git a/jdk/src/linux/doc/man/ja/apt.1 b/jdk/src/linux/doc/man/ja/apt.1 deleted file mode 100644 index bd788983f81..00000000000 --- a/jdk/src/linux/doc/man/ja/apt.1 +++ /dev/null @@ -1,153 +0,0 @@ -." Copyright (c) 2004, 2011, 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. -." -.TH apt 1 "07 May 2011" - -.LP -.SH "NAME" -.LP -.LP -\f2apt\fP \- Ãí¼á½èÍý¥Ä¡¼¥ë -.LP -.SH "·Á¼°" -.LP -.LP -\f2apt [\-classpath \fP\f2classpath\fP] [\-sourcepath \f2sourcepath\fP] [\-d \f2directory\fP] [\-s \f2directory\fP] [\-factorypath \f2path\fP] [\-factory \f2class\fP] [\-print] [\-nocompile] [\-A\f2key\fP[\f2=val\fP] ...] [\f2javac option\fP] sourcefiles [@files] -.LP -.SH "¥Ñ¥é¥á¡¼¥¿" -.LP -.LP -¥ª¥×¥·¥ç¥ó¤Î»ØÄê½ç½ø¤Ë·è¤Þ¤ê¤Ï¤¢¤ê¤Þ¤»¤ó¡£ÆÃÄê¤Î¥ª¥×¥·¥ç¥ó¤ËŬÍѤµ¤ì¤ë¥Ñ¥é¥á¡¼¥¿¤Ë¤Ä¤¤¤Æ¤Ï¡¢²¼µ­¤Î¡Ö¥ª¥×¥·¥ç¥ó¡×¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£ -.LP -.RS 3 -.TP 3 -sourcefiles -¥¼¥í¡¢1 ¤Ä¡¢¤Þ¤¿¤ÏÊ£¿ô¤Î½èÍýÂоݤΥ½¡¼¥¹¥Õ¥¡¥¤¥ë -.TP 3 -@files -¥½¡¼¥¹¥Õ¥¡¥¤¥ë¤Þ¤¿¤Ï¾¤Î¥ª¥×¥·¥ç¥ó¤ò°ìÍ÷ɽ¼¨¤¹¤ë 1 ¤Ä¤Þ¤¿¤ÏÊ£¿ô¤Î¥Õ¥¡¥¤¥ë -.RE - -.LP -.SH "ÀâÌÀ" -.LP -.LP -\f3Ãí\fP: \f2apt\fP ¥Ä¡¼¥ë¤È¡¢¥Ñ¥Ã¥±¡¼¥¸ \f2com.sun.mirror\fP ¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ë¤½¤ì¤Ë´ØÏ¢¤·¤¿ API ¤Ï¡¢JDK 7 °Ê¹ßÈó¿ä¾©¤Ë¤Ê¤Ã¤Æ¤ª¤ê¡¢JDK ¤Î¼¡¤Î¥á¥¸¥ã¡¼¥ê¥ê¡¼¥¹¤Çºï½ü¤µ¤ì¤ëͽÄê¤Ç¤¹¡£\f2javac(1)\fP ¥Ä¡¼¥ë¤ÇÍøÍѲÄǽ¤Ê¥ª¥×¥·¥ç¥ó¤È¡¢¥Ñ¥Ã¥±¡¼¥¸ \f2javax.annotation.processing\fP ¤ª¤è¤Ó \f2javax.lang.model\fP ¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ë API ¤ò»ÈÍѤ·¤Æ¡¢Ãí¼á¤ò½èÍý¤·¤Æ¤¯¤À¤µ¤¤¡£ -.LP -.LP -Ãí¼á½èÍý¥Ä¡¼¥ë \f2apt\fP ¤Ï¡¢¥ê¥Õ¥ì¥¯¥È API ¤È¥µ¥Ý¡¼¥È¥¤¥ó¥Õ¥é¥¹¥È¥é¥¯¥Á¥ã¡¼¤«¤é¹½À®¤µ¤ì¡¢¥×¥í¥°¥é¥àÃí¼á¤ò½èÍý¤·¤Þ¤¹¡£\f2apt\fP ¥ê¥Õ¥ì¥¯¥È API ¤Ï¡¢ ¹½ÃÛ»þ¤Î¥½¡¼¥¹¥Ù¡¼¥¹¤Ç¡¢¥×¥í¥°¥é¥à¹½Â¤¤Ë´Ø¤¹¤ëÆɤ߼è¤êÀìÍѥӥ塼¤òÄ󶡤·¤Þ¤¹¡£¤³¤ì¤é¤Î¥ê¥Õ¥ì¥¯¥È API ¤Ï¡¢Áí¾Î¤òÄɲä·¤¿¸å¤Ë¡¢Java(TM) ¥×¥í¥°¥é¥ß¥ó¥°¸À¸ì¤Î·¿¥·¥¹¥Æ¥à¤òÀµ¤·¤¯¥â¥Ç¥ë²½¤¹¤ë¤è¤¦¤ËÀ߷פµ¤ì¤Æ¤¤¤Þ¤¹¡£ºÇ½é¤Ë¡¢\f2apt\fP ¤Ï¡¢¿·¤·¤¤¥½¡¼¥¹¥³¡¼¥É¤È¾¤Î¥Õ¥¡¥¤¥ë¤òºîÀ®¤¹¤ëÃí¼á¥×¥í¥»¥Ã¥µ¤ò¼Â¹Ô¤·¤Þ¤¹¡£¼¡¤Ë¡¢\f2apt\fP ¤Ï¡¢¸µ¤Î¥½¡¼¥¹¥Õ¥¡¥¤¥ë¤ÈÀ¸À®¤·¤¿¥½¡¼¥¹¥Õ¥¡¥¤¥ë¤ÎξÊý¤ò¥³¥ó¥Ñ¥¤¥ë¤¹¤ë¤¿¤á¡¢³«È¯¤¬³Ú¤Ë¤Ê¤ê¤Þ¤¹¡£¥Ä¡¼¥ë¤È¤Î¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Ë»ÈÍѤµ¤ì¤ë¥ê¥Õ¥ì¥¯¥È API ¤Ê¤É¤Î API ¤Ï¡¢\f2com.sun.mirror\fP ¤Î¥µ¥Ö¥Ñ¥Ã¥±¡¼¥¸¤Ç¤¹¡£ -.LP -.LP -¥Ä¡¼¥ë¤Îµ¡Ç½¤Ë´Ø¤¹¤ë¾ÜºÙ¤È¡¢\f2apt\fP ¤ò»ÈÍѤ·¤¿³«È¯ÊýË¡¤Ë¤Ä¤¤¤Æ¤Ï¡¢ -.na -\f4¡Öapt ÆþÌç¡×\fP @ -.fi -http://java.sun.com/javase/6/docs/technotes/guides/apt/GettingStarted.html¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£ -.LP -.SH "¥ª¥×¥·¥ç¥ó" -.LP -.SS -apt ¸ÇÍ­¤Î¥ª¥×¥·¥ç¥ó -.LP -.RS 3 -.TP 3 -\-s dir -¥×¥í¥»¥Ã¥µ¤ÎÀ¸À®¤¹¤ë¥½¡¼¥¹¥Õ¥¡¥¤¥ë¤òÃÖ¤¯¥Ç¥£¥ì¥¯¥È¥ê¥ë¡¼¥È¤ò»ØÄꤷ¤Þ¤¹¡£ ¥Õ¥¡¥¤¥ë¤Ï¡¢¥Ñ¥Ã¥±¡¼¥¸¤Î̾Á°¶õ´Ö¤Ë´ð¤Å¤¤¤Æ¥µ¥Ö¥Ç¥£¥ì¥¯¥È¥ê¤ËÃÖ¤«¤ì¤Þ¤¹¡£ -.TP 3 -\-nocompile -¥½¡¼¥¹¥Õ¥¡¥¤¥ë¤ò¥¯¥é¥¹¥Õ¥¡¥¤¥ë¤Ë¥³¥ó¥Ñ¥¤¥ë¤·¤Þ¤»¤ó¡£ -.TP 3 -\-print -»ØÄꤷ¤¿¥¿¥¤¥×¤Î¥Æ¥­¥¹¥Èɽ¸½¤ò½ÐÎϤ·¤Þ¤¹¡£ Ãí¼á½èÍý¤Þ¤¿¤Ï¥³¥ó¥Ñ¥¤¥ë¤Ï¹Ô¤¤¤Þ¤»¤ó¡£ -.TP 3 -\-A[key[=val]] -Ãí¼á¥×¥í¥»¥Ã¥µ¤ØÅϤ¹¥ª¥×¥·¥ç¥ó¤Ç¤¹¡£ ¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¡¢\f2apt\fP ¤¬Ä¾Àܲò¼á¤¹¤ë¤Î¤Ç¤Ï¤Ê¤¯¡¢¤½¤ì¤¾¤ì¤Î¥×¥í¥»¥Ã¥µ¤Ë¤è¤Ã¤Æ»ÈÍѤǤ­¤ë¤è¤¦¤ËÊѤ¨¤é¤ì¤Þ¤¹¡£ -.TP 3 -\-factorypath path -Ãí¼á¥×¥í¥»¥Ã¥µ¥Õ¥¡¥¯¥È¥ê¤ò¸¡º÷¤¹¤ë¾ì½ê¤ò»ØÄꤷ¤Þ¤¹¡£ ¤³¤Î¥ª¥×¥·¥ç¥ó¤ò»ÈÍѤ¹¤ë¾ì¹ç¡¢¥¯¥é¥¹¥Ñ¥¹¤Î¥Õ¥¡¥¯¥È¥ê¤Ï¸¡º÷¤µ¤ì¤Þ¤»¤ó¡£ -.TP 3 -\-factory classname -»ÈÍѤ¹¤ëÃí¼á¥×¥í¥»¥Ã¥µ¥Õ¥¡¥¯¥È¥ê¤Î̾Á°¤Ç¤¹¡£ ¥Ç¥Õ¥©¥ë¥È¤Î¸¡½Ð¥×¥í¥»¥¹¤ò¾Êά¤·¤Þ¤¹¡£ -.TP 3 -\-version -¥Ð¡¼¥¸¥ç¥ó¾ðÊó¤ò½ÐÎϤ·¤Þ¤¹¡£ -.TP 3 -\-X -Èóɸ½à¥ª¥×¥·¥ç¥ó¤Ë´Ø¤¹¤ë¾ðÊó¤òɽ¼¨¤·¤Þ¤¹¡£ -.RE - -.LP -.SS -javac ¤È¶¦ÍѤ¹¤ë¥ª¥×¥·¥ç¥ó -.LP -.RS 3 -.TP 3 -\-d dir -¥×¥í¥»¥Ã¥µ¤È javac À¸À®¤Î¥¯¥é¥¹¥Õ¥¡¥¤¥ë¤òÃÖ¤¯¾ì½ê¤ò»ØÄꤷ¤Þ¤¹¡£ -.TP 3 -\-cp path ¤Þ¤¿¤Ï \-classpath path -¥æ¡¼¥¶¡¼¥¯¥é¥¹¥Õ¥¡¥¤¥ë¤ÈÃí¼á¥×¥í¥»¥Ã¥µ¥Õ¥¡¥¯¥È¥ê¤ò¸¡º÷¤¹¤ë¾ì½ê¤ò»ØÄꤷ¤Þ¤¹¡£\f2\-factorypath\fP ¤¬»ØÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢¥¯¥é¥¹¥Ñ¥¹¤Î¥Õ¥¡¥¯¥È¥ê¤Ï¸¡º÷¤µ¤ì¤Þ¤»¤ó¡£ -.RE - -.LP -.LP -\f2javac\fP ¥ª¥×¥·¥ç¥ó¤Î¾ÜºÙ¤Ë¤Ä¤¤¤Æ¤Ï¡¢javac(1) ¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£ -.LP -.SS -Èóɸ½à¥ª¥×¥·¥ç¥ó -.LP -.RS 3 -.TP 3 -\-XListAnnotationTypes -Ãí¼á¤Î·¿¤Ë¸¡½Ð¤µ¤ì¤ë¥ê¥¹¥È. -.TP 3 -\-XListDeclarations -»ØÄꤪ¤è¤ÓÀë¸À¤¬¥¤¥ó¥¯¥ë¡¼¥É¤µ¤ì¤ë¥ê¥¹¥È. -.TP 3 -\-XPrintAptRounds -½é´ü¤ª¤è¤ÓºÆµ¢Åª¤Ê \f2apt\fP ¥é¥¦¥ó¥É¤Ë´Ø¤¹¤ë¾ðÊó¤ò½ÐÎϤ¹¤ë. -.TP 3 -\-XPrintFactoryInfo -½èÍý¤òÍ׵᤹¤ë¥Õ¥¡¥¯¥È¥ê¤ÎÃí¼á¤Ë´Ø¤¹¤ë¾ðÊó¤ò½ÐÎϤ¹¤ë. -.TP 3 -\-XclassesAsDecls -¥¯¥é¥¹¥Õ¥¡¥¤¥ë¤È¥½¡¼¥¹¥Õ¥¡¥¤¥ë¤ÎξÊý¤ò¡¢½èÍýÂоݤÎÀë¸À¤È¤·¤Æ½èÍý¤·¤Þ¤¹¡£ -.RE - -.LP -.LP -\f3Ãí\fP: ¤³¤ì¤é¤ÏÈóɸ½à¥ª¥×¥·¥ç¥ó¤Ê¤Î¤Ç¡¢Í½¹ð¤Ê¤¯Êѹ¹¤µ¤ì¤ë²ÄǽÀ­¤¬¤¢¤ê¤Þ¤¹¡£ -.LP -.SH "Ãí" -.LP -.LP -\f2apt\fP ¥Ä¡¼¥ë¤È¡¢¥Ñ¥Ã¥±¡¼¥¸ \f2com.sun.mirror\fP ¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ë¤½¤ì¤Ë´ØÏ¢¤·¤¿ API ¤Ï¡¢JDK 7 °Ê¹ßÈó¿ä¾©¤Ë¤Ê¤Ã¤Æ¤ª¤ê¡¢JDK ¤Î¼¡¤Î¥á¥¸¥ã¡¼¥ê¥ê¡¼¥¹¤Çºï½ü¤µ¤ì¤ëͽÄê¤Ç¤¹¡£\f2javac(1)\fP ¥Ä¡¼¥ë¤ÇÍøÍѲÄǽ¤Ê¥ª¥×¥·¥ç¥ó¤È¡¢¥Ñ¥Ã¥±¡¼¥¸ \f2javax.annotation.processing\fP ¤ª¤è¤Ó \f2javax.lang.model\fP ¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ë API ¤ò»ÈÍѤ·¤Æ¡¢Ãí¼á¤ò½èÍý¤·¤Æ¤¯¤À¤µ¤¤¡£ -.LP -.SH "´ØÏ¢¹àÌÜ" -.LP -.RS 3 -.TP 2 -o -javac(1), java(1) -.RE - -.LP - diff --git a/jdk/src/solaris/doc/sun/man/man1/apt.1 b/jdk/src/solaris/doc/sun/man/man1/apt.1 deleted file mode 100644 index 2d77108a5d4..00000000000 --- a/jdk/src/solaris/doc/sun/man/man1/apt.1 +++ /dev/null @@ -1,153 +0,0 @@ -." Copyright (c) 2004, 2011, 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. -." -.TH apt 1 "10 May 2011" - -.LP -.SH "NAME" -.LP -.LP -\f2apt\fP \- annotation processing tool -.LP -.SH "SYNOPSIS" -.LP -.LP -\f2apt [\-classpath \fP\f2classpath\fP] [\-sourcepath \f2sourcepath\fP] [\-d \f2directory\fP] [\-s \f2directory\fP] [\-factorypath \f2path\fP] [\-factory \f2class\fP] [\-print] [\-nocompile] [\-A\f2key\fP[\f2=val\fP] ...] [\f2javac option\fP] sourcefiles [@files] -.LP -.SH "PARAMETERS" -.LP -.LP -Options may be in any order. For a discussion of parameters which apply to a specific option, see OPTIONS below. -.LP -.RS 3 -.TP 3 -sourcefiles -Zero or more source files to be processed. -.TP 3 -@files -One or more files that list source files or other options -.RE - -.LP -.SH "DESCRIPTION" -.LP -.LP -\f3Note\fP: The \f2apt\fP tool and its associated API contained in the package \f2com.sun.mirror\fP have been deprecated since JDK 7 and are planned to be removed in the next major JDK release. Use the options available in the \f2javac(1)\fP tool and the APIs contained in the packages \f2javax.annotation.processing\fP and \f2javax.lang.model\fP to process annotations. -.LP -.LP -The tool \f2apt\fP, annotation processing tool, includes reflective APIs and supporting infrastructure to process program annotations. The \f2apt\fP reflective APIs provide a build\-time, source\-based, read\-only view of program structure. These reflective APIs are designed to cleanly model the Java(TM) programming language's type system after the addition of generics. First, \f2apt\fP runs annotation processors that can produce new source code and other files. Next, \f2apt\fP can cause compilation of both original and generated source files, easing development. The reflective APIs and other APIs used to interact with the tool are subpackages of \f2com.sun.mirror\fP. -.LP -.LP -A fuller discussion of how the tool operates as well as instructions for developing with \f2apt\fP are in -.na -\f4Getting Started with \fP\f4apt\fP. @ -.fi -http://download.oracle.com/javase/7/docs/technotes/guides/apt/GettingStarted.html -.LP -.SH "OPTIONS" -.LP -.SS -apt specific options -.LP -.RS 3 -.TP 3 -\-s dir -Specify the directory root under which processor\-generated source files will be placed; files are placed in subdirectories based on package namespace. -.TP 3 -\-nocompile -Do not compile source files to class files. -.TP 3 -\-print -Print out textual representation of specified types; perform no annotation processing or compilation. -.TP 3 -\-A[key[=val]] -Options to pass to annotation processors \-\- these are not interpreted by \f2apt\fP directly, but are made available for use by individual processors -.TP 3 -\-factorypath path -Specify where to find annotation processor factories; if this option is used, the classpath is \f2not\fP searched for factories. -.TP 3 -\-factory classname -Name of annotation processor factory to use; bypasses default discovery process -.TP 3 -\-version -Print version information. -.TP 3 -\-X -Display information about non\-standard options. -.RE - -.LP -.SS -Options shared with javac -.LP -.RS 3 -.TP 3 -\-d dir -Specify where to place processor and javac generated class files -.TP 3 -\-cp path or \-classpath path -Specify where to find user class files and annotation processor factories. If \f2\-factorypath\fP is given, the classpath is not searched for factories. -.RE - -.LP -.LP -Consult the javac(1) man page for information on \f2javac\fP options. -.LP -.SS -Non\-Standard Options -.LP -.RS 3 -.TP 3 -\-XListAnnotationTypes -List found annotation types. -.TP 3 -\-XListDeclarations -List specified and included declarations. -.TP 3 -\-XPrintAptRounds -Print information about initial and recursive \f2apt\fP rounds. -.TP 3 -\-XPrintFactoryInfo -Print information about which annotations a factory is asked to process. -.TP 3 -\-XclassesAsDecls -Treat both class and source files as declarations to process. -.RE - -.LP -.LP -\f3Note\fP: Because these options are non\-standard, they are subject to change without notice. -.LP -.SH "NOTES" -.LP -.LP -The \f2apt\fP tool and its associated API contained in the package \f2com.sun.mirror\fP have been deprecated since JDK 7 and are planned to be removed in the next major JDK release. Use the options available in the \f2javac(1)\fP tool and the APIs contained in the packages \f2javax.annotation.processing\fP and \f2javax.lang.model\fP to process annotations. -.LP -.SH "SEE ALSO" -.LP -.RS 3 -.TP 2 -o -javac(1), java(1) -.RE - -.LP - diff --git a/jdk/src/solaris/doc/sun/man/man1/ja/apt.1 b/jdk/src/solaris/doc/sun/man/man1/ja/apt.1 deleted file mode 100644 index bd788983f81..00000000000 --- a/jdk/src/solaris/doc/sun/man/man1/ja/apt.1 +++ /dev/null @@ -1,153 +0,0 @@ -." Copyright (c) 2004, 2011, 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. -." -.TH apt 1 "07 May 2011" - -.LP -.SH "NAME" -.LP -.LP -\f2apt\fP \- Ãí¼á½èÍý¥Ä¡¼¥ë -.LP -.SH "·Á¼°" -.LP -.LP -\f2apt [\-classpath \fP\f2classpath\fP] [\-sourcepath \f2sourcepath\fP] [\-d \f2directory\fP] [\-s \f2directory\fP] [\-factorypath \f2path\fP] [\-factory \f2class\fP] [\-print] [\-nocompile] [\-A\f2key\fP[\f2=val\fP] ...] [\f2javac option\fP] sourcefiles [@files] -.LP -.SH "¥Ñ¥é¥á¡¼¥¿" -.LP -.LP -¥ª¥×¥·¥ç¥ó¤Î»ØÄê½ç½ø¤Ë·è¤Þ¤ê¤Ï¤¢¤ê¤Þ¤»¤ó¡£ÆÃÄê¤Î¥ª¥×¥·¥ç¥ó¤ËŬÍѤµ¤ì¤ë¥Ñ¥é¥á¡¼¥¿¤Ë¤Ä¤¤¤Æ¤Ï¡¢²¼µ­¤Î¡Ö¥ª¥×¥·¥ç¥ó¡×¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£ -.LP -.RS 3 -.TP 3 -sourcefiles -¥¼¥í¡¢1 ¤Ä¡¢¤Þ¤¿¤ÏÊ£¿ô¤Î½èÍýÂоݤΥ½¡¼¥¹¥Õ¥¡¥¤¥ë -.TP 3 -@files -¥½¡¼¥¹¥Õ¥¡¥¤¥ë¤Þ¤¿¤Ï¾¤Î¥ª¥×¥·¥ç¥ó¤ò°ìÍ÷ɽ¼¨¤¹¤ë 1 ¤Ä¤Þ¤¿¤ÏÊ£¿ô¤Î¥Õ¥¡¥¤¥ë -.RE - -.LP -.SH "ÀâÌÀ" -.LP -.LP -\f3Ãí\fP: \f2apt\fP ¥Ä¡¼¥ë¤È¡¢¥Ñ¥Ã¥±¡¼¥¸ \f2com.sun.mirror\fP ¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ë¤½¤ì¤Ë´ØÏ¢¤·¤¿ API ¤Ï¡¢JDK 7 °Ê¹ßÈó¿ä¾©¤Ë¤Ê¤Ã¤Æ¤ª¤ê¡¢JDK ¤Î¼¡¤Î¥á¥¸¥ã¡¼¥ê¥ê¡¼¥¹¤Çºï½ü¤µ¤ì¤ëͽÄê¤Ç¤¹¡£\f2javac(1)\fP ¥Ä¡¼¥ë¤ÇÍøÍѲÄǽ¤Ê¥ª¥×¥·¥ç¥ó¤È¡¢¥Ñ¥Ã¥±¡¼¥¸ \f2javax.annotation.processing\fP ¤ª¤è¤Ó \f2javax.lang.model\fP ¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ë API ¤ò»ÈÍѤ·¤Æ¡¢Ãí¼á¤ò½èÍý¤·¤Æ¤¯¤À¤µ¤¤¡£ -.LP -.LP -Ãí¼á½èÍý¥Ä¡¼¥ë \f2apt\fP ¤Ï¡¢¥ê¥Õ¥ì¥¯¥È API ¤È¥µ¥Ý¡¼¥È¥¤¥ó¥Õ¥é¥¹¥È¥é¥¯¥Á¥ã¡¼¤«¤é¹½À®¤µ¤ì¡¢¥×¥í¥°¥é¥àÃí¼á¤ò½èÍý¤·¤Þ¤¹¡£\f2apt\fP ¥ê¥Õ¥ì¥¯¥È API ¤Ï¡¢ ¹½ÃÛ»þ¤Î¥½¡¼¥¹¥Ù¡¼¥¹¤Ç¡¢¥×¥í¥°¥é¥à¹½Â¤¤Ë´Ø¤¹¤ëÆɤ߼è¤êÀìÍѥӥ塼¤òÄ󶡤·¤Þ¤¹¡£¤³¤ì¤é¤Î¥ê¥Õ¥ì¥¯¥È API ¤Ï¡¢Áí¾Î¤òÄɲä·¤¿¸å¤Ë¡¢Java(TM) ¥×¥í¥°¥é¥ß¥ó¥°¸À¸ì¤Î·¿¥·¥¹¥Æ¥à¤òÀµ¤·¤¯¥â¥Ç¥ë²½¤¹¤ë¤è¤¦¤ËÀ߷פµ¤ì¤Æ¤¤¤Þ¤¹¡£ºÇ½é¤Ë¡¢\f2apt\fP ¤Ï¡¢¿·¤·¤¤¥½¡¼¥¹¥³¡¼¥É¤È¾¤Î¥Õ¥¡¥¤¥ë¤òºîÀ®¤¹¤ëÃí¼á¥×¥í¥»¥Ã¥µ¤ò¼Â¹Ô¤·¤Þ¤¹¡£¼¡¤Ë¡¢\f2apt\fP ¤Ï¡¢¸µ¤Î¥½¡¼¥¹¥Õ¥¡¥¤¥ë¤ÈÀ¸À®¤·¤¿¥½¡¼¥¹¥Õ¥¡¥¤¥ë¤ÎξÊý¤ò¥³¥ó¥Ñ¥¤¥ë¤¹¤ë¤¿¤á¡¢³«È¯¤¬³Ú¤Ë¤Ê¤ê¤Þ¤¹¡£¥Ä¡¼¥ë¤È¤Î¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Ë»ÈÍѤµ¤ì¤ë¥ê¥Õ¥ì¥¯¥È API ¤Ê¤É¤Î API ¤Ï¡¢\f2com.sun.mirror\fP ¤Î¥µ¥Ö¥Ñ¥Ã¥±¡¼¥¸¤Ç¤¹¡£ -.LP -.LP -¥Ä¡¼¥ë¤Îµ¡Ç½¤Ë´Ø¤¹¤ë¾ÜºÙ¤È¡¢\f2apt\fP ¤ò»ÈÍѤ·¤¿³«È¯ÊýË¡¤Ë¤Ä¤¤¤Æ¤Ï¡¢ -.na -\f4¡Öapt ÆþÌç¡×\fP @ -.fi -http://java.sun.com/javase/6/docs/technotes/guides/apt/GettingStarted.html¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£ -.LP -.SH "¥ª¥×¥·¥ç¥ó" -.LP -.SS -apt ¸ÇÍ­¤Î¥ª¥×¥·¥ç¥ó -.LP -.RS 3 -.TP 3 -\-s dir -¥×¥í¥»¥Ã¥µ¤ÎÀ¸À®¤¹¤ë¥½¡¼¥¹¥Õ¥¡¥¤¥ë¤òÃÖ¤¯¥Ç¥£¥ì¥¯¥È¥ê¥ë¡¼¥È¤ò»ØÄꤷ¤Þ¤¹¡£ ¥Õ¥¡¥¤¥ë¤Ï¡¢¥Ñ¥Ã¥±¡¼¥¸¤Î̾Á°¶õ´Ö¤Ë´ð¤Å¤¤¤Æ¥µ¥Ö¥Ç¥£¥ì¥¯¥È¥ê¤ËÃÖ¤«¤ì¤Þ¤¹¡£ -.TP 3 -\-nocompile -¥½¡¼¥¹¥Õ¥¡¥¤¥ë¤ò¥¯¥é¥¹¥Õ¥¡¥¤¥ë¤Ë¥³¥ó¥Ñ¥¤¥ë¤·¤Þ¤»¤ó¡£ -.TP 3 -\-print -»ØÄꤷ¤¿¥¿¥¤¥×¤Î¥Æ¥­¥¹¥Èɽ¸½¤ò½ÐÎϤ·¤Þ¤¹¡£ Ãí¼á½èÍý¤Þ¤¿¤Ï¥³¥ó¥Ñ¥¤¥ë¤Ï¹Ô¤¤¤Þ¤»¤ó¡£ -.TP 3 -\-A[key[=val]] -Ãí¼á¥×¥í¥»¥Ã¥µ¤ØÅϤ¹¥ª¥×¥·¥ç¥ó¤Ç¤¹¡£ ¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¡¢\f2apt\fP ¤¬Ä¾Àܲò¼á¤¹¤ë¤Î¤Ç¤Ï¤Ê¤¯¡¢¤½¤ì¤¾¤ì¤Î¥×¥í¥»¥Ã¥µ¤Ë¤è¤Ã¤Æ»ÈÍѤǤ­¤ë¤è¤¦¤ËÊѤ¨¤é¤ì¤Þ¤¹¡£ -.TP 3 -\-factorypath path -Ãí¼á¥×¥í¥»¥Ã¥µ¥Õ¥¡¥¯¥È¥ê¤ò¸¡º÷¤¹¤ë¾ì½ê¤ò»ØÄꤷ¤Þ¤¹¡£ ¤³¤Î¥ª¥×¥·¥ç¥ó¤ò»ÈÍѤ¹¤ë¾ì¹ç¡¢¥¯¥é¥¹¥Ñ¥¹¤Î¥Õ¥¡¥¯¥È¥ê¤Ï¸¡º÷¤µ¤ì¤Þ¤»¤ó¡£ -.TP 3 -\-factory classname -»ÈÍѤ¹¤ëÃí¼á¥×¥í¥»¥Ã¥µ¥Õ¥¡¥¯¥È¥ê¤Î̾Á°¤Ç¤¹¡£ ¥Ç¥Õ¥©¥ë¥È¤Î¸¡½Ð¥×¥í¥»¥¹¤ò¾Êά¤·¤Þ¤¹¡£ -.TP 3 -\-version -¥Ð¡¼¥¸¥ç¥ó¾ðÊó¤ò½ÐÎϤ·¤Þ¤¹¡£ -.TP 3 -\-X -Èóɸ½à¥ª¥×¥·¥ç¥ó¤Ë´Ø¤¹¤ë¾ðÊó¤òɽ¼¨¤·¤Þ¤¹¡£ -.RE - -.LP -.SS -javac ¤È¶¦ÍѤ¹¤ë¥ª¥×¥·¥ç¥ó -.LP -.RS 3 -.TP 3 -\-d dir -¥×¥í¥»¥Ã¥µ¤È javac À¸À®¤Î¥¯¥é¥¹¥Õ¥¡¥¤¥ë¤òÃÖ¤¯¾ì½ê¤ò»ØÄꤷ¤Þ¤¹¡£ -.TP 3 -\-cp path ¤Þ¤¿¤Ï \-classpath path -¥æ¡¼¥¶¡¼¥¯¥é¥¹¥Õ¥¡¥¤¥ë¤ÈÃí¼á¥×¥í¥»¥Ã¥µ¥Õ¥¡¥¯¥È¥ê¤ò¸¡º÷¤¹¤ë¾ì½ê¤ò»ØÄꤷ¤Þ¤¹¡£\f2\-factorypath\fP ¤¬»ØÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢¥¯¥é¥¹¥Ñ¥¹¤Î¥Õ¥¡¥¯¥È¥ê¤Ï¸¡º÷¤µ¤ì¤Þ¤»¤ó¡£ -.RE - -.LP -.LP -\f2javac\fP ¥ª¥×¥·¥ç¥ó¤Î¾ÜºÙ¤Ë¤Ä¤¤¤Æ¤Ï¡¢javac(1) ¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£ -.LP -.SS -Èóɸ½à¥ª¥×¥·¥ç¥ó -.LP -.RS 3 -.TP 3 -\-XListAnnotationTypes -Ãí¼á¤Î·¿¤Ë¸¡½Ð¤µ¤ì¤ë¥ê¥¹¥È. -.TP 3 -\-XListDeclarations -»ØÄꤪ¤è¤ÓÀë¸À¤¬¥¤¥ó¥¯¥ë¡¼¥É¤µ¤ì¤ë¥ê¥¹¥È. -.TP 3 -\-XPrintAptRounds -½é´ü¤ª¤è¤ÓºÆµ¢Åª¤Ê \f2apt\fP ¥é¥¦¥ó¥É¤Ë´Ø¤¹¤ë¾ðÊó¤ò½ÐÎϤ¹¤ë. -.TP 3 -\-XPrintFactoryInfo -½èÍý¤òÍ׵᤹¤ë¥Õ¥¡¥¯¥È¥ê¤ÎÃí¼á¤Ë´Ø¤¹¤ë¾ðÊó¤ò½ÐÎϤ¹¤ë. -.TP 3 -\-XclassesAsDecls -¥¯¥é¥¹¥Õ¥¡¥¤¥ë¤È¥½¡¼¥¹¥Õ¥¡¥¤¥ë¤ÎξÊý¤ò¡¢½èÍýÂоݤÎÀë¸À¤È¤·¤Æ½èÍý¤·¤Þ¤¹¡£ -.RE - -.LP -.LP -\f3Ãí\fP: ¤³¤ì¤é¤ÏÈóɸ½à¥ª¥×¥·¥ç¥ó¤Ê¤Î¤Ç¡¢Í½¹ð¤Ê¤¯Êѹ¹¤µ¤ì¤ë²ÄǽÀ­¤¬¤¢¤ê¤Þ¤¹¡£ -.LP -.SH "Ãí" -.LP -.LP -\f2apt\fP ¥Ä¡¼¥ë¤È¡¢¥Ñ¥Ã¥±¡¼¥¸ \f2com.sun.mirror\fP ¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ë¤½¤ì¤Ë´ØÏ¢¤·¤¿ API ¤Ï¡¢JDK 7 °Ê¹ßÈó¿ä¾©¤Ë¤Ê¤Ã¤Æ¤ª¤ê¡¢JDK ¤Î¼¡¤Î¥á¥¸¥ã¡¼¥ê¥ê¡¼¥¹¤Çºï½ü¤µ¤ì¤ëͽÄê¤Ç¤¹¡£\f2javac(1)\fP ¥Ä¡¼¥ë¤ÇÍøÍѲÄǽ¤Ê¥ª¥×¥·¥ç¥ó¤È¡¢¥Ñ¥Ã¥±¡¼¥¸ \f2javax.annotation.processing\fP ¤ª¤è¤Ó \f2javax.lang.model\fP ¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ë API ¤ò»ÈÍѤ·¤Æ¡¢Ãí¼á¤ò½èÍý¤·¤Æ¤¯¤À¤µ¤¤¡£ -.LP -.SH "´ØÏ¢¹àÌÜ" -.LP -.RS 3 -.TP 2 -o -javac(1), java(1) -.RE - -.LP - From b37db2a9db7eeff4005236da8dd735604da3a62b Mon Sep 17 00:00:00 2001 From: Alan Bateman Date: Tue, 7 Feb 2012 13:28:32 +0000 Subject: [PATCH 14/82] 7142847: TEST_BUG: java/nio/file/WatchService/SensitivityModifier.java has incorrect @run tag, runs Basic Reviewed-by: chegar --- jdk/test/java/nio/file/WatchService/Basic.java | 10 +++++----- .../nio/file/WatchService/SensitivityModifier.java | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/jdk/test/java/nio/file/WatchService/Basic.java b/jdk/test/java/nio/file/WatchService/Basic.java index fd1dee4b007..019ec96c30f 100644 --- a/jdk/test/java/nio/file/WatchService/Basic.java +++ b/jdk/test/java/nio/file/WatchService/Basic.java @@ -25,7 +25,7 @@ * @bug 4313887 6838333 7017446 * @summary Unit test for java.nio.file.WatchService * @library .. - * @run main/timeout=120 Basic + * @run main Basic */ import java.nio.file.*; @@ -281,11 +281,11 @@ public class Basic { System.out.println("poll with timeout..."); try { - long start = System.currentTimeMillis(); + long start = System.nanoTime(); key = watcher.poll(3000, TimeUnit.MILLISECONDS); if (key != null) throw new RuntimeException("no keys registered"); - long waited = System.currentTimeMillis() - start; + long waited = TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - start); if (waited < 2900) throw new RuntimeException("poll was too short"); } catch (InterruptedException x) { @@ -358,14 +358,14 @@ public class Basic { } // assume that poll throws exception immediately - long start = System.currentTimeMillis(); + long start = System.nanoTime(); try { watcher.poll(10000, TimeUnit.MILLISECONDS); throw new RuntimeException("ClosedWatchServiceException not thrown"); } catch (InterruptedException x) { throw new RuntimeException(x); } catch (ClosedWatchServiceException x) { - long waited = System.currentTimeMillis() - start; + long waited = TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - start); if (waited > 5000) throw new RuntimeException("poll was too long"); } diff --git a/jdk/test/java/nio/file/WatchService/SensitivityModifier.java b/jdk/test/java/nio/file/WatchService/SensitivityModifier.java index 3027d8d4e09..b0cafb330c2 100644 --- a/jdk/test/java/nio/file/WatchService/SensitivityModifier.java +++ b/jdk/test/java/nio/file/WatchService/SensitivityModifier.java @@ -23,9 +23,9 @@ /* @test * @bug 4313887 - * @summary Sanity test for Sun-specific sensitivyt level watch event modifier + * @summary Sanity test for Sun-specific sensitivity level watch event modifier * @library .. - * @run main/timeout=330 Basic + * @run main/timeout=240 SensitivityModifier */ import java.nio.file.*; From d8c00fda7b4ac591cb44e1c3ded89153e8e87685 Mon Sep 17 00:00:00 2001 From: Joe Darcy Date: Tue, 7 Feb 2012 17:39:13 -0800 Subject: [PATCH 15/82] 7143629: JDK jar/zip code should use unsigned library support Reviewed-by: sherman --- jdk/src/share/classes/java/util/jar/JarOutputStream.java | 4 ++-- jdk/src/share/classes/java/util/jar/Manifest.java | 4 ++-- jdk/src/share/classes/java/util/zip/InflaterInputStream.java | 4 ++-- jdk/src/share/classes/java/util/zip/ZipInputStream.java | 4 ++-- .../demo/nio/zipfs/src/com/sun/nio/zipfs/ZipConstants.java | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/jdk/src/share/classes/java/util/jar/JarOutputStream.java b/jdk/src/share/classes/java/util/jar/JarOutputStream.java index 843b16aa8d7..36942772619 100644 --- a/jdk/src/share/classes/java/util/jar/JarOutputStream.java +++ b/jdk/src/share/classes/java/util/jar/JarOutputStream.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -135,7 +135,7 @@ class JarOutputStream extends ZipOutputStream { * The bytes are assumed to be in Intel (little-endian) byte order. */ private static int get16(byte[] b, int off) { - return (b[off] & 0xff) | ((b[off+1] & 0xff) << 8); + return Byte.toUnsignedInt(b[off]) | ( Byte.toUnsignedInt(b[off+1]) << 8); } /* diff --git a/jdk/src/share/classes/java/util/jar/Manifest.java b/jdk/src/share/classes/java/util/jar/Manifest.java index 3bb56715282..49612938ab8 100644 --- a/jdk/src/share/classes/java/util/jar/Manifest.java +++ b/jdk/src/share/classes/java/util/jar/Manifest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -339,7 +339,7 @@ public class Manifest implements Cloneable { return -1; } } - return buf[pos++] & 0xff; + return Byte.toUnsignedInt(buf[pos++]); } public int read(byte[] b, int off, int len) throws IOException { diff --git a/jdk/src/share/classes/java/util/zip/InflaterInputStream.java b/jdk/src/share/classes/java/util/zip/InflaterInputStream.java index 53e16ee22e3..b948905d0e8 100644 --- a/jdk/src/share/classes/java/util/zip/InflaterInputStream.java +++ b/jdk/src/share/classes/java/util/zip/InflaterInputStream.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2012, 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 @@ -119,7 +119,7 @@ class InflaterInputStream extends FilterInputStream { */ public int read() throws IOException { ensureOpen(); - return read(singleByteBuf, 0, 1) == -1 ? -1 : singleByteBuf[0] & 0xff; + return read(singleByteBuf, 0, 1) == -1 ? -1 : Byte.toUnsignedInt(singleByteBuf[0]); } /** diff --git a/jdk/src/share/classes/java/util/zip/ZipInputStream.java b/jdk/src/share/classes/java/util/zip/ZipInputStream.java index a60adb8040e..7076f9be5d8 100644 --- a/jdk/src/share/classes/java/util/zip/ZipInputStream.java +++ b/jdk/src/share/classes/java/util/zip/ZipInputStream.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -435,7 +435,7 @@ class ZipInputStream extends InflaterInputStream implements ZipConstants { * The bytes are assumed to be in Intel (little-endian) byte order. */ private static final int get16(byte b[], int off) { - return (b[off] & 0xff) | ((b[off+1] & 0xff) << 8); + return Byte.toUnsignedInt(b[off]) | (Byte.toUnsignedInt(b[off+1]) << 8); } /* diff --git a/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipConstants.java b/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipConstants.java index dd15bf87e68..0fab957b37a 100644 --- a/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipConstants.java +++ b/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipConstants.java @@ -185,11 +185,11 @@ class ZipConstants { */ /////////////////////////////////////////////////////// static final int CH(byte[] b, int n) { - return b[n] & 0xff; + return Byte.toUnsignedInt(b[n]); } static final int SH(byte[] b, int n) { - return (b[n] & 0xff) | ((b[n + 1] & 0xff) << 8); + return Byte.toUnsignedInt(b[n]) | (Byte.toUnsignedInt(b[n + 1]) << 8); } static final long LG(byte[] b, int n) { From 18a83d872ba9b7982606e9518bcc193a9e261d39 Mon Sep 17 00:00:00 2001 From: Weijun Wang Date: Wed, 8 Feb 2012 11:44:36 +0800 Subject: [PATCH 16/82] 6880619: reg tests for 6879540 Reviewed-by: valeriep --- .../sun/security/krb5/auto/EmptyPassword.java | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 jdk/test/sun/security/krb5/auto/EmptyPassword.java diff --git a/jdk/test/sun/security/krb5/auto/EmptyPassword.java b/jdk/test/sun/security/krb5/auto/EmptyPassword.java new file mode 100644 index 00000000000..d66b202ec37 --- /dev/null +++ b/jdk/test/sun/security/krb5/auto/EmptyPassword.java @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2012, 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 6879540 + * @summary enable empty password for kerberos 5 + * @compile -XDignore.symbol.file EmptyPassword.java + * @run main/othervm EmptyPassword + */ + +public class EmptyPassword { + + public static void main(String[] args) + throws Exception { + + OneKDC kdc = new OneKDC("aes128-cts"); + kdc.addPrincipal("empty", "".toCharArray()); + + Context c = Context.fromUserPass("empty", "".toCharArray(), false); + c.status(); + } +} + From 5070eb57b624f0cf0f815c8c5037cfbef6350190 Mon Sep 17 00:00:00 2001 From: Chris Hegarty Date: Wed, 8 Feb 2012 11:16:52 +0000 Subject: [PATCH 17/82] 7105929: java/util/concurrent/FutureTask/BlockingTaskExecutor.java fails on solaris sparc Reviewed-by: dholmes --- .../java/util/concurrent/FutureTask/BlockingTaskExecutor.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jdk/test/java/util/concurrent/FutureTask/BlockingTaskExecutor.java b/jdk/test/java/util/concurrent/FutureTask/BlockingTaskExecutor.java index 00aed7c47f0..05b37082989 100644 --- a/jdk/test/java/util/concurrent/FutureTask/BlockingTaskExecutor.java +++ b/jdk/test/java/util/concurrent/FutureTask/BlockingTaskExecutor.java @@ -75,10 +75,10 @@ public class BlockingTaskExecutor { throw new Error("Executor stuck"); // Wait for the invocation thread to complete. - thread.join(1000); + thread.join(5000); if (thread.isAlive()) { thread.interrupt(); - thread.join(1000); + thread.join(5000); throw new Error("invokeAll stuck"); } } From ba9ddb94fa922678bce6ebc328b51c82793b2e26 Mon Sep 17 00:00:00 2001 From: Gary Adams Date: Wed, 8 Feb 2012 11:18:29 +0000 Subject: [PATCH 18/82] 6736316: Timeout value in java/util/concurrent/locks/Lock/FlakyMutex.java is insufficient Reviewed-by: chegar, dholmes, alanb --- jdk/test/java/util/concurrent/locks/Lock/FlakyMutex.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jdk/test/java/util/concurrent/locks/Lock/FlakyMutex.java b/jdk/test/java/util/concurrent/locks/Lock/FlakyMutex.java index 8422c33fa5c..7722e84e686 100644 --- a/jdk/test/java/util/concurrent/locks/Lock/FlakyMutex.java +++ b/jdk/test/java/util/concurrent/locks/Lock/FlakyMutex.java @@ -86,7 +86,7 @@ public class FlakyMutex implements Lock { } catch (Throwable t) { unexpected(t); }}});} barrier.await(); es.shutdown(); - check(es.awaitTermination(10, TimeUnit.SECONDS)); + check(es.awaitTermination(30, TimeUnit.SECONDS)); } private static class FlakySync extends AbstractQueuedLongSynchronizer { From d53f00fb69145125eb05ebfd2af2f65ff1943777 Mon Sep 17 00:00:00 2001 From: Gary Adams Date: Wed, 8 Feb 2012 11:19:25 +0000 Subject: [PATCH 19/82] 6957683: test/java/util/concurrent/ThreadPoolExecutor/Custom.java failing Reviewed-by: chegar, dholmes, alanb --- .../java/util/concurrent/ThreadPoolExecutor/Custom.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/jdk/test/java/util/concurrent/ThreadPoolExecutor/Custom.java b/jdk/test/java/util/concurrent/ThreadPoolExecutor/Custom.java index ac666b68951..b05b3e826b7 100644 --- a/jdk/test/java/util/concurrent/ThreadPoolExecutor/Custom.java +++ b/jdk/test/java/util/concurrent/ThreadPoolExecutor/Custom.java @@ -100,8 +100,8 @@ public class Custom { equal(countExecutorThreads(), threadCount); equal(CustomTask.births.get(), threadCount); tpe.shutdown(); - tpe.awaitTermination(Long.MAX_VALUE, TimeUnit.NANOSECONDS); - Thread.sleep(10); + tpe.awaitTermination(120, TimeUnit.SECONDS); + Thread.sleep(1000); equal(countExecutorThreads(), 0); CustomSTPE stpe = new CustomSTPE(); @@ -110,8 +110,8 @@ public class Custom { equal(CustomSTPE.decorations.get(), threadCount); equal(countExecutorThreads(), threadCount); stpe.shutdown(); - stpe.awaitTermination(Long.MAX_VALUE, TimeUnit.NANOSECONDS); - Thread.sleep(10); + stpe.awaitTermination(120, TimeUnit.SECONDS); + Thread.sleep(1000); equal(countExecutorThreads(), 0); System.out.printf("%nPassed = %d, failed = %d%n%n", passed, failed); From 0b4df63ee22afac3c8aacfcbf8f444b6c0fc91c8 Mon Sep 17 00:00:00 2001 From: Pavel Porvatov Date: Wed, 8 Feb 2012 16:15:12 +0400 Subject: [PATCH 20/82] 7138665: JOptionPane.getValue() unexpected change between JRE 1.6 and JRE 1.7 Reviewed-by: alexp --- .../classes/javax/swing/JOptionPane.java | 4 +- .../swing/plaf/basic/BasicOptionPaneUI.java | 1 + .../swing/JOptionPane/7138665/bug7138665.java | 70 +++++++++++++++++++ 3 files changed, 72 insertions(+), 3 deletions(-) create mode 100644 jdk/test/javax/swing/JOptionPane/7138665/bug7138665.java diff --git a/jdk/src/share/classes/javax/swing/JOptionPane.java b/jdk/src/share/classes/javax/swing/JOptionPane.java index 9849c37b1ee..c532cf619c0 100644 --- a/jdk/src/share/classes/javax/swing/JOptionPane.java +++ b/jdk/src/share/classes/javax/swing/JOptionPane.java @@ -34,7 +34,6 @@ import java.awt.KeyboardFocusManager; import java.awt.Frame; import java.awt.Point; import java.awt.HeadlessException; -import java.awt.Toolkit; import java.awt.Window; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; @@ -994,8 +993,7 @@ public class JOptionPane extends JComponent implements Accessible // if the user closed the window without selecting a button // (newValue = null in that case). Otherwise, close the dialog. if (dialog.isVisible() && event.getSource() == JOptionPane.this && - (event.getPropertyName().equals(VALUE_PROPERTY) || - event.getPropertyName().equals(INPUT_VALUE_PROPERTY)) && + (event.getPropertyName().equals(VALUE_PROPERTY)) && event.getNewValue() != null && event.getNewValue() != JOptionPane.UNINITIALIZED_VALUE) { dialog.setVisible(false); diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicOptionPaneUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicOptionPaneUI.java index 6a0b024ceeb..444b903dd33 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicOptionPaneUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicOptionPaneUI.java @@ -1236,6 +1236,7 @@ public class BasicOptionPaneUI extends OptionPaneUI { int index = list.locationToIndex(e.getPoint()); optionPane.setInputValue(list.getModel().getElementAt(index)); + optionPane.setValue(JOptionPane.OK_OPTION); } } diff --git a/jdk/test/javax/swing/JOptionPane/7138665/bug7138665.java b/jdk/test/javax/swing/JOptionPane/7138665/bug7138665.java new file mode 100644 index 00000000000..44d4084536b --- /dev/null +++ b/jdk/test/javax/swing/JOptionPane/7138665/bug7138665.java @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2012, 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 7138665 + @summary JOptionPane.getValue() unexpected change between JRE 1.6 and JRE 1.7 + @author Pavel Porvatov +*/ + +import sun.awt.SunToolkit; + +import javax.swing.*; +import java.awt.*; +import java.awt.event.KeyEvent; + +public class bug7138665 { + public static void main(String[] args) throws Exception { + SwingUtilities.invokeLater(new Runnable() { + @Override + public void run() { + JOptionPane pane = new JOptionPane("Enter value", JOptionPane.QUESTION_MESSAGE, + JOptionPane.OK_CANCEL_OPTION, null, null, null); + pane.setWantsInput(true); + + JDialog dialog = pane.createDialog(null, "My Dialog"); + dialog.setVisible(true); + + Object result = pane.getValue(); + + if (result == null || ((Integer) result).intValue() != JOptionPane.OK_OPTION) { + throw new RuntimeException("Invalid result: " + result); + } + + System.out.println("Test bug7138665 passed"); + } + }); + + SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit(); + + toolkit.realSync(); + + Robot robot = new Robot(); + + robot.setAutoDelay(100); + robot.keyPress(KeyEvent.VK_ENTER); + robot.keyRelease(KeyEvent.VK_ENTER); + + toolkit.realSync(); + } +} From ff7281a8661cd49bf8f1d6224f99216b276d6949 Mon Sep 17 00:00:00 2001 From: Oleg Pekhovskiy Date: Wed, 8 Feb 2012 18:28:10 +0400 Subject: [PATCH 21/82] 7132367: [macosx] ChoiceMouseWheelTest should be adapted for mac toolkit Reviewed-by: art --- .../Choice/ChoiceMouseWheelTest/ChoiceMouseWheelTest.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/jdk/test/java/awt/Choice/ChoiceMouseWheelTest/ChoiceMouseWheelTest.java b/jdk/test/java/awt/Choice/ChoiceMouseWheelTest/ChoiceMouseWheelTest.java index 2c147102bcc..e545b08fea0 100644 --- a/jdk/test/java/awt/Choice/ChoiceMouseWheelTest/ChoiceMouseWheelTest.java +++ b/jdk/test/java/awt/Choice/ChoiceMouseWheelTest/ChoiceMouseWheelTest.java @@ -96,7 +96,10 @@ public class ChoiceMouseWheelTest extends Frame { // Test mouse wheel over the choice String name = Toolkit.getDefaultToolkit().getClass().getName(); - if(!name.equals("sun.awt.X11.XToolkit")) { // mouse wheel doesn't work for the choice on X11, so skip it + + // mouse wheel doesn't work for the choice on X11 and Mac, so skip it + if(!name.equals("sun.awt.X11.XToolkit") + && !name.equals("sun.lwawt.macosx.LWCToolkit")) { robot.mouseWheel(1); Util.waitForIdle(robot); From 3a09f847bb3ab5608fe8416aa51532ed976b57b1 Mon Sep 17 00:00:00 2001 From: Yumin Qi Date: Thu, 9 Feb 2012 00:51:47 -0800 Subject: [PATCH 22/82] 7131006: java/lang/management/ThreadMXBean/ThreadLists.java Reviewed-by: dholmes, acorn --- hotspot/src/share/vm/classfile/vmSymbols.hpp | 1 + hotspot/src/share/vm/utilities/preserveException.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/hotspot/src/share/vm/classfile/vmSymbols.hpp b/hotspot/src/share/vm/classfile/vmSymbols.hpp index 40f36ad66cf..d6ed1def52c 100644 --- a/hotspot/src/share/vm/classfile/vmSymbols.hpp +++ b/hotspot/src/share/vm/classfile/vmSymbols.hpp @@ -284,6 +284,7 @@ template(run_method_name, "run") \ template(exit_method_name, "exit") \ template(add_method_name, "add") \ + template(remove_method_name, "remove") \ template(parent_name, "parent") \ template(threads_name, "threads") \ template(groups_name, "groups") \ diff --git a/hotspot/src/share/vm/utilities/preserveException.cpp b/hotspot/src/share/vm/utilities/preserveException.cpp index ea9ff309ec2..0248eed107a 100644 --- a/hotspot/src/share/vm/utilities/preserveException.cpp +++ b/hotspot/src/share/vm/utilities/preserveException.cpp @@ -32,9 +32,9 @@ PreserveExceptionMark::PreserveExceptionMark(Thread*& thread) { thread = Thread::current(); _thread = thread; _preserved_exception_oop = Handle(thread, _thread->pending_exception()); - _thread->clear_pending_exception(); // Needed to avoid infinite recursion _preserved_exception_line = _thread->exception_line(); _preserved_exception_file = _thread->exception_file(); + _thread->clear_pending_exception(); // Needed to avoid infinite recursion } From ffc91880e18e0f951da920fde3b7f50f1593d476 Mon Sep 17 00:00:00 2001 From: Pavel Porvatov Date: Thu, 9 Feb 2012 14:21:53 +0400 Subject: [PATCH 23/82] 7143857: Memory leak in javax.swing.plaf.synth.SynthTreeUI Reviewed-by: alexp --- jdk/src/share/classes/javax/swing/plaf/synth/SynthTreeUI.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/jdk/src/share/classes/javax/swing/plaf/synth/SynthTreeUI.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthTreeUI.java index e7a684e66a7..f1a9b15f862 100644 --- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthTreeUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthTreeUI.java @@ -434,6 +434,8 @@ public class SynthTreeUI extends BasicTreeUI // Empty out the renderer pane, allowing renderers to be gc'ed. rendererPane.removeAll(); + + paintContext = null; } private void configureRenderer(SynthContext context) { From d228d3127c19cafad375501672f82d0940ecac92 Mon Sep 17 00:00:00 2001 From: Carlos Lucasius Date: Thu, 9 Feb 2012 13:43:15 +0000 Subject: [PATCH 24/82] 7114611: (fs) DirectoryStream fails with SIGBUS on some embedded platforms, dirent alignment Reviewed-by: dholmes, alanb --- jdk/src/solaris/native/sun/nio/fs/UnixNativeDispatcher.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/jdk/src/solaris/native/sun/nio/fs/UnixNativeDispatcher.c b/jdk/src/solaris/native/sun/nio/fs/UnixNativeDispatcher.c index 57882b6a473..596dd990e1e 100644 --- a/jdk/src/solaris/native/sun/nio/fs/UnixNativeDispatcher.c +++ b/jdk/src/solaris/native/sun/nio/fs/UnixNativeDispatcher.c @@ -605,9 +605,12 @@ Java_sun_nio_fs_UnixNativeDispatcher_closedir(JNIEnv* env, jclass this, jlong di JNIEXPORT jbyteArray JNICALL Java_sun_nio_fs_UnixNativeDispatcher_readdir(JNIEnv* env, jclass this, jlong value) { - char entry[sizeof(struct dirent64) + PATH_MAX + 1]; - struct dirent64* ptr = (struct dirent64*)&entry; struct dirent64* result; + struct { + struct dirent64 buf; + char name_extra[PATH_MAX + 1 - sizeof result->d_name]; + } entry; + struct dirent64* ptr = &entry.buf; int res; DIR* dirp = jlong_to_ptr(value); From 36a08afe2a15cbd1d356e880367dcb71b209831f Mon Sep 17 00:00:00 2001 From: Pavel Porvatov Date: Thu, 9 Feb 2012 18:26:57 +0400 Subject: [PATCH 25/82] 7142955: DefaultTreeCellRenderer doesn't honor 'Tree.rendererFillBackground' LAF property Reviewed-by: malenkov --- .../swing/tree/DefaultTreeCellRenderer.java | 2 +- .../7142955/bug7142955.java | 72 +++++++++++++++++++ 2 files changed, 73 insertions(+), 1 deletion(-) create mode 100644 jdk/test/javax/swing/tree/DefaultTreeCellRenderer/7142955/bug7142955.java diff --git a/jdk/src/share/classes/javax/swing/tree/DefaultTreeCellRenderer.java b/jdk/src/share/classes/javax/swing/tree/DefaultTreeCellRenderer.java index ed4e00dfc7d..d8b261c3f28 100644 --- a/jdk/src/share/classes/javax/swing/tree/DefaultTreeCellRenderer.java +++ b/jdk/src/share/classes/javax/swing/tree/DefaultTreeCellRenderer.java @@ -156,7 +156,7 @@ public class DefaultTreeCellRenderer extends JLabel implements TreeCellRenderer protected Color borderSelectionColor; private boolean isDropCell; - private boolean fillBackground = true; + private boolean fillBackground; /** * Set to true after the constructor has run. diff --git a/jdk/test/javax/swing/tree/DefaultTreeCellRenderer/7142955/bug7142955.java b/jdk/test/javax/swing/tree/DefaultTreeCellRenderer/7142955/bug7142955.java new file mode 100644 index 00000000000..40eadaa99b8 --- /dev/null +++ b/jdk/test/javax/swing/tree/DefaultTreeCellRenderer/7142955/bug7142955.java @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2012, 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 7142955 + @summary DefaultTreeCellRenderer doesn't honor 'Tree.rendererFillBackground' LAF property + @author Pavel Porvatov +*/ + +import javax.swing.*; +import javax.swing.tree.DefaultTreeCellRenderer; +import java.awt.*; +import java.awt.image.BufferedImage; + +public class bug7142955 { + private static final Color TEST_COLOR = Color.RED; + + public static void main(String[] args) throws Exception { + UIManager.put("Tree.rendererFillBackground", Boolean.FALSE); + UIManager.put("Tree.textBackground", TEST_COLOR); + + SwingUtilities.invokeAndWait(new Runnable() { + @Override + public void run() { + int w = 200; + int h = 100; + + BufferedImage image = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB); + + Graphics g = image.getGraphics(); + + g.setColor(Color.WHITE); + g.fillRect(0, 0, image.getWidth(), image.getHeight()); + + DefaultTreeCellRenderer renderer = new DefaultTreeCellRenderer(); + + renderer.setSize(w, h); + renderer.paint(g); + + for (int y = 0; y < h; y++) { + for (int x = 0; x < w; x++) { + if (image.getRGB(x, y) == TEST_COLOR.getRGB()) { + throw new RuntimeException("Test bug7142955 failed"); + } + } + } + + System.out.println("Test bug7142955 passed."); + } + }); + } +} From e0ec1c804eaffd33a4918663703b399e0538788d Mon Sep 17 00:00:00 2001 From: Zhengyu Gu Date: Thu, 9 Feb 2012 10:16:26 -0500 Subject: [PATCH 26/82] 7141259: Native stack is missing in hs_err Code cleanup and creating a private decoder for error handler, since it can be triggered from in signal handler, where no lock can be taken Reviewed-by: dholmes, kamg, acorn, coleenp --- hotspot/src/os/bsd/vm/decoder_machO.hpp | 7 +- hotspot/src/os/windows/vm/decoder_windows.hpp | 2 +- hotspot/src/share/vm/utilities/decoder.cpp | 92 ++++++++++++------- hotspot/src/share/vm/utilities/decoder.hpp | 66 ++++++++----- .../src/share/vm/utilities/decoder_elf.hpp | 4 +- hotspot/src/share/vm/utilities/vmError.hpp | 3 +- 6 files changed, 110 insertions(+), 64 deletions(-) diff --git a/hotspot/src/os/bsd/vm/decoder_machO.hpp b/hotspot/src/os/bsd/vm/decoder_machO.hpp index 48d0a9b98e0..9fb16899c4f 100644 --- a/hotspot/src/os/bsd/vm/decoder_machO.hpp +++ b/hotspot/src/os/bsd/vm/decoder_machO.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -29,8 +29,9 @@ #include "utilities/decoder.hpp" -// Just a placehold for now -class MachODecoder: public NullDecoder { +// Just a placehold for now, a real implementation should derive +// from AbstractDecoder +class MachODecoder : public NullDecoder { public: MachODecoder() { } ~MachODecoder() { } diff --git a/hotspot/src/os/windows/vm/decoder_windows.hpp b/hotspot/src/os/windows/vm/decoder_windows.hpp index 8ba488fc58e..05a5dc25fc4 100644 --- a/hotspot/src/os/windows/vm/decoder_windows.hpp +++ b/hotspot/src/os/windows/vm/decoder_windows.hpp @@ -36,7 +36,7 @@ typedef BOOL (WINAPI *pfn_SymInitialize)(HANDLE, PCTSTR, BOOL); typedef BOOL (WINAPI *pfn_SymGetSymFromAddr64)(HANDLE, DWORD64, PDWORD64, PIMAGEHLP_SYMBOL64); typedef DWORD (WINAPI *pfn_UndecorateSymbolName)(const char*, char*, DWORD, DWORD); -class WindowsDecoder: public NullDecoder { +class WindowsDecoder : public AbstractDecoder { public: WindowsDecoder(); diff --git a/hotspot/src/share/vm/utilities/decoder.cpp b/hotspot/src/share/vm/utilities/decoder.cpp index 712c54cc736..cf7be329f84 100644 --- a/hotspot/src/share/vm/utilities/decoder.cpp +++ b/hotspot/src/share/vm/utilities/decoder.cpp @@ -25,7 +25,9 @@ #include "precompiled.hpp" #include "prims/jvm.h" #include "runtime/mutexLocker.hpp" +#include "runtime/os.hpp" #include "utilities/decoder.hpp" +#include "utilities/vmError.hpp" #if defined(_WINDOWS) #include "decoder_windows.hpp" @@ -35,74 +37,94 @@ #include "decoder_elf.hpp" #endif -NullDecoder* Decoder::_decoder = NULL; -NullDecoder Decoder::_do_nothing_decoder; -Mutex* Decoder::_decoder_lock = new Mutex(Mutex::safepoint, - "DecoderLock"); +AbstractDecoder* Decoder::_shared_decoder = NULL; +AbstractDecoder* Decoder::_error_handler_decoder = NULL; +NullDecoder Decoder::_do_nothing_decoder; +Mutex* Decoder::_shared_decoder_lock = new Mutex(Mutex::native, + "SharedDecoderLock"); -// _decoder_lock should already acquired before enter this method -NullDecoder* Decoder::get_decoder() { - assert(_decoder_lock != NULL && _decoder_lock->owned_by_self(), +AbstractDecoder* Decoder::get_shared_instance() { + assert(_shared_decoder_lock != NULL && _shared_decoder_lock->owned_by_self(), "Require DecoderLock to enter"); - if (_decoder != NULL) { - return _decoder; + if (_shared_decoder == NULL) { + _shared_decoder = create_decoder(); } + return _shared_decoder; +} - // Decoder is a secondary service. Although, it is good to have, - // but we can live without it. +AbstractDecoder* Decoder::get_error_handler_instance() { + if (_error_handler_decoder == NULL) { + _error_handler_decoder = create_decoder(); + } + return _error_handler_decoder; +} + + +AbstractDecoder* Decoder::create_decoder() { + AbstractDecoder* decoder; #if defined(_WINDOWS) - _decoder = new (std::nothrow) WindowsDecoder(); + decoder = new (std::nothrow) WindowsDecoder(); #elif defined (__APPLE__) - _decoder = new (std::nothrow)MachODecoder(); + decoder = new (std::nothrow)MachODecoder(); #else - _decoder = new (std::nothrow)ElfDecoder(); + decoder = new (std::nothrow)ElfDecoder(); #endif - if (_decoder == NULL || _decoder->has_error()) { - if (_decoder != NULL) { - delete _decoder; + if (decoder == NULL || decoder->has_error()) { + if (decoder != NULL) { + delete decoder; } - _decoder = &_do_nothing_decoder; + decoder = &_do_nothing_decoder; } - return _decoder; + return decoder; } bool Decoder::decode(address addr, char* buf, int buflen, int* offset, const char* modulepath) { - assert(_decoder_lock != NULL, "Just check"); - MutexLockerEx locker(_decoder_lock, true); - NullDecoder* decoder = get_decoder(); + assert(_shared_decoder_lock != NULL, "Just check"); + bool error_handling_thread = os::current_thread_id() == VMError::first_error_tid; + MutexLockerEx locker(error_handling_thread ? NULL : _shared_decoder_lock, true); + AbstractDecoder* decoder = error_handling_thread ? + get_error_handler_instance(): get_shared_instance(); assert(decoder != NULL, "null decoder"); return decoder->decode(addr, buf, buflen, offset, modulepath); } bool Decoder::demangle(const char* symbol, char* buf, int buflen) { - assert(_decoder_lock != NULL, "Just check"); - MutexLockerEx locker(_decoder_lock, true); - NullDecoder* decoder = get_decoder(); + assert(_shared_decoder_lock != NULL, "Just check"); + bool error_handling_thread = os::current_thread_id() == VMError::first_error_tid; + MutexLockerEx locker(error_handling_thread ? NULL : _shared_decoder_lock, true); + AbstractDecoder* decoder = error_handling_thread ? + get_error_handler_instance(): get_shared_instance(); assert(decoder != NULL, "null decoder"); return decoder->demangle(symbol, buf, buflen); } bool Decoder::can_decode_C_frame_in_vm() { - assert(_decoder_lock != NULL, "Just check"); - MutexLockerEx locker(_decoder_lock, true); - NullDecoder* decoder = get_decoder(); + assert(_shared_decoder_lock != NULL, "Just check"); + bool error_handling_thread = os::current_thread_id() == VMError::first_error_tid; + MutexLockerEx locker(error_handling_thread ? NULL : _shared_decoder_lock, true); + AbstractDecoder* decoder = error_handling_thread ? + get_error_handler_instance(): get_shared_instance(); assert(decoder != NULL, "null decoder"); return decoder->can_decode_C_frame_in_vm(); } -// shutdown real decoder and replace it with -// _do_nothing_decoder +/* + * Shutdown shared decoder and replace it with + * _do_nothing_decoder. Do nothing with error handler + * instance, since the JVM is going down. + */ void Decoder::shutdown() { - assert(_decoder_lock != NULL, "Just check"); - MutexLockerEx locker(_decoder_lock, true); + assert(_shared_decoder_lock != NULL, "Just check"); + MutexLockerEx locker(_shared_decoder_lock, true); - if (_decoder != NULL && _decoder != &_do_nothing_decoder) { - delete _decoder; + if (_shared_decoder != NULL && + _shared_decoder != &_do_nothing_decoder) { + delete _shared_decoder; } - _decoder = &_do_nothing_decoder; + _shared_decoder = &_do_nothing_decoder; } diff --git a/hotspot/src/share/vm/utilities/decoder.hpp b/hotspot/src/share/vm/utilities/decoder.hpp index 82179a6863b..56ff91907cc 100644 --- a/hotspot/src/share/vm/utilities/decoder.hpp +++ b/hotspot/src/share/vm/utilities/decoder.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -29,7 +29,7 @@ #include "memory/allocation.hpp" #include "runtime/mutex.hpp" -class NullDecoder: public CHeapObj { +class AbstractDecoder : public CHeapObj { public: // status code for decoding native C frame enum decoder_status { @@ -43,6 +43,34 @@ public: helper_init_error // SymInitialize failed (Windows only) }; + // decode an pc address to corresponding function name and an offset from the beginning of + // the function + virtual bool decode(address pc, char* buf, int buflen, int* offset, + const char* modulepath = NULL) = 0; + // demangle a C++ symbol + virtual bool demangle(const char* symbol, char* buf, int buflen) = 0; + // if the decoder can decode symbols in vm + virtual bool can_decode_C_frame_in_vm() const = 0; + + virtual decoder_status status() const { + return _decoder_status; + } + + virtual bool has_error() const { + return is_error(_decoder_status); + } + + static bool is_error(decoder_status status) { + return (status > 0); + } + +protected: + decoder_status _decoder_status; +}; + +// Do nothing decoder +class NullDecoder : public AbstractDecoder { +public: NullDecoder() { _decoder_status = not_available; } @@ -61,40 +89,34 @@ public: virtual bool can_decode_C_frame_in_vm() const { return false; } - - virtual decoder_status status() const { - return _decoder_status; - } - - virtual bool has_error() const { - return is_error(_decoder_status); - } - - static bool is_error(decoder_status status) { - return (status > 0); - } - -protected: - decoder_status _decoder_status; }; -class Decoder: AllStatic { +class Decoder : AllStatic { public: static bool decode(address pc, char* buf, int buflen, int* offset, const char* modulepath = NULL); static bool demangle(const char* symbol, char* buf, int buflen); static bool can_decode_C_frame_in_vm(); + // shutdown shared instance static void shutdown(); protected: - static NullDecoder* get_decoder(); + // shared decoder instance, _shared_instance_lock is needed + static AbstractDecoder* get_shared_instance(); + // a private instance for error handler. Error handler can be + // triggered almost everywhere, including signal handler, where + // no lock can be taken. So the shared decoder can not be used + // in this scenario. + static AbstractDecoder* get_error_handler_instance(); + static AbstractDecoder* create_decoder(); private: - static NullDecoder* _decoder; - static NullDecoder _do_nothing_decoder; + static AbstractDecoder* _shared_decoder; + static AbstractDecoder* _error_handler_decoder; + static NullDecoder _do_nothing_decoder; protected: - static Mutex* _decoder_lock; + static Mutex* _shared_decoder_lock; }; #endif // SHARE_VM_UTILITIES_DECODER_HPP diff --git a/hotspot/src/share/vm/utilities/decoder_elf.hpp b/hotspot/src/share/vm/utilities/decoder_elf.hpp index f0dff753411..971cd3c2272 100644 --- a/hotspot/src/share/vm/utilities/decoder_elf.hpp +++ b/hotspot/src/share/vm/utilities/decoder_elf.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2012, 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 @@ -30,7 +30,7 @@ #include "utilities/decoder.hpp" #include "utilities/elfFile.hpp" -class ElfDecoder: public NullDecoder { +class ElfDecoder : public AbstractDecoder { public: ElfDecoder() { diff --git a/hotspot/src/share/vm/utilities/vmError.hpp b/hotspot/src/share/vm/utilities/vmError.hpp index 28f486940a4..6d84e1498e6 100644 --- a/hotspot/src/share/vm/utilities/vmError.hpp +++ b/hotspot/src/share/vm/utilities/vmError.hpp @@ -27,11 +27,12 @@ #include "utilities/globalDefinitions.hpp" - +class Decoder; class VM_ReportJavaOutOfMemory; class VMError : public StackObj { friend class VM_ReportJavaOutOfMemory; + friend class Decoder; enum ErrorType { internal_error = 0xe0000000, From 9ace5d5b19858a3d4f707d0ff6434e15df2e8df2 Mon Sep 17 00:00:00 2001 From: Alan Bateman Date: Thu, 9 Feb 2012 16:38:36 +0000 Subject: [PATCH 27/82] 7144086: TEST_BUG: java/nio/file/WatchService/SensitivityModifier.java failing intermittently Reviewed-by: chegar --- jdk/test/java/nio/file/WatchService/SensitivityModifier.java | 1 + 1 file changed, 1 insertion(+) diff --git a/jdk/test/java/nio/file/WatchService/SensitivityModifier.java b/jdk/test/java/nio/file/WatchService/SensitivityModifier.java index b0cafb330c2..f990870acae 100644 --- a/jdk/test/java/nio/file/WatchService/SensitivityModifier.java +++ b/jdk/test/java/nio/file/WatchService/SensitivityModifier.java @@ -96,6 +96,7 @@ public class SensitivityModifier { // drain events (to avoid interference) do { + key.pollEvents(); key.reset(); key = watcher.poll(1, TimeUnit.SECONDS); } while (key != null); From 9b65dbabc1e9632f223f46c990d18b924d43953a Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Fri, 10 Feb 2012 11:41:22 +0800 Subject: [PATCH 28/82] 6879539: enable empty password support for pkcs12 keystore Reviewed-by: vinnie, weijun --- .../com/sun/crypto/provider/PBEKey.java | 9 +- .../crypto/provider/PKCS12PBECipherCore.java | 12 +- .../sun/security/pkcs12/PKCS12KeyStore.java | 52 ++- jdk/test/sun/security/pkcs12/Bug6415637.java | 313 ++++++++++++++++++ 4 files changed, 366 insertions(+), 20 deletions(-) create mode 100644 jdk/test/sun/security/pkcs12/Bug6415637.java diff --git a/jdk/src/share/classes/com/sun/crypto/provider/PBEKey.java b/jdk/src/share/classes/com/sun/crypto/provider/PBEKey.java index a650133fe4a..22a315e8378 100644 --- a/jdk/src/share/classes/com/sun/crypto/provider/PBEKey.java +++ b/jdk/src/share/classes/com/sun/crypto/provider/PBEKey.java @@ -55,9 +55,12 @@ final class PBEKey implements SecretKey { // Should allow an empty password. passwd = new char[0]; } - for (int i=0; i '\u007E')) { - throw new InvalidKeySpecException("Password is not ASCII"); + // Accept "\0" to signify "zero-length password with no terminator". + if (!(passwd.length == 1 && passwd[0] == 0)) { + for (int i=0; i '\u007E')) { + throw new InvalidKeySpecException("Password is not ASCII"); + } } } this.key = new byte[passwd.length]; diff --git a/jdk/src/share/classes/com/sun/crypto/provider/PKCS12PBECipherCore.java b/jdk/src/share/classes/com/sun/crypto/provider/PKCS12PBECipherCore.java index e091e90e2c1..7c15de2c954 100644 --- a/jdk/src/share/classes/com/sun/crypto/provider/PKCS12PBECipherCore.java +++ b/jdk/src/share/classes/com/sun/crypto/provider/PKCS12PBECipherCore.java @@ -60,11 +60,16 @@ final class PKCS12PBECipherCore { static byte[] derive(char[] chars, byte[] salt, int ic, int n, int type) { - // Add in trailing NULL terminator. + // Add in trailing NULL terminator. Special case: + // no terminator if password is "\0". int length = chars.length*2; - if (length != 0) { + if (length == 2 && chars[0] == 0) { + chars = new char[0]; + length = 0; + } else { length += 2; } + byte[] passwd = new byte[length]; for (int i = 0, j = 0; i < chars.length; i++, j+=2) { passwd[j] = (byte) ((chars[i] >>> 8) & 0xFF); @@ -133,6 +138,9 @@ final class PKCS12PBECipherCore { } private static void concat(byte[] src, byte[] dst, int start, int len) { + if (src.length == 0) { + return; + } int loop = len / src.length; int off, i; for (i = 0, off = 0; i < loop; i++, off += src.length) diff --git a/jdk/src/share/classes/sun/security/pkcs12/PKCS12KeyStore.java b/jdk/src/share/classes/sun/security/pkcs12/PKCS12KeyStore.java index f6bada9390f..e4ba4252590 100644 --- a/jdk/src/share/classes/sun/security/pkcs12/PKCS12KeyStore.java +++ b/jdk/src/share/classes/sun/security/pkcs12/PKCS12KeyStore.java @@ -253,11 +253,25 @@ public final class PKCS12KeyStore extends KeyStoreSpi { } try { - // Use JCE - SecretKey skey = getPBEKey(password); - Cipher cipher = Cipher.getInstance(algOid.toString()); - cipher.init(Cipher.DECRYPT_MODE, skey, algParams); - byte[] privateKeyInfo = cipher.doFinal(encryptedKey); + byte[] privateKeyInfo; + while (true) { + try { + // Use JCE + SecretKey skey = getPBEKey(password); + Cipher cipher = Cipher.getInstance(algOid.toString()); + cipher.init(Cipher.DECRYPT_MODE, skey, algParams); + privateKeyInfo = cipher.doFinal(encryptedKey); + break; + } catch (Exception e) { + if (password.length == 0) { + // Retry using an empty password + // without a NULL terminator. + password = new char[1]; + continue; + } + throw e; + } + } PKCS8EncodedKeySpec kspec = new PKCS8EncodedKeySpec(privateKeyInfo); @@ -1251,16 +1265,24 @@ public final class PKCS12KeyStore extends KeyStoreSpi { ObjectIdentifier algOid = in.getOID(); AlgorithmParameters algParams = parseAlgParameters(in); - try { - // Use JCE - SecretKey skey = getPBEKey(password); - Cipher cipher = Cipher.getInstance(algOid.toString()); - cipher.init(Cipher.DECRYPT_MODE, skey, algParams); - safeContentsData = cipher.doFinal(safeContentsData); - - } catch (Exception e) { - throw new IOException("failed to decrypt safe" - + " contents entry: " + e, e); + while (true) { + try { + // Use JCE + SecretKey skey = getPBEKey(password); + Cipher cipher = Cipher.getInstance(algOid.toString()); + cipher.init(Cipher.DECRYPT_MODE, skey, algParams); + safeContentsData = cipher.doFinal(safeContentsData); + break; + } catch (Exception e) { + if (password.length == 0) { + // Retry using an empty password + // without a NULL terminator. + password = new char[1]; + continue; + } + throw new IOException( + "failed to decrypt safe contents entry: " + e, e); + } } } else { throw new IOException("public key protected PKCS12" + diff --git a/jdk/test/sun/security/pkcs12/Bug6415637.java b/jdk/test/sun/security/pkcs12/Bug6415637.java new file mode 100644 index 00000000000..3e4603804e5 --- /dev/null +++ b/jdk/test/sun/security/pkcs12/Bug6415637.java @@ -0,0 +1,313 @@ +/* + * Copyright (c) 2012, 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 6415637 + * @summary Support PKCS#12 key stores protected with an empty password + */ + +import java.io.ByteArrayInputStream; +import java.math.BigInteger; +import java.security.KeyStore; +import java.security.cert.X509Certificate; +import java.security.interfaces.RSAPrivateCrtKey; + +public class Bug6415637 { + + public static void main(String[] args) throws Exception { + check(WITH_NULL); + check(WITHOUT_NULL); + } + + private static void check(String encodedBlob) throws Exception { + byte[] blob = new byte[encodedBlob.length() * 2]; + for (int i = 0; i < blob.length; ) { + final char ch = encodedBlob.charAt(i / 2); + blob[i++] = (byte) (ch >> 8); + blob[i++] = (byte) ch; + } + KeyStore store = KeyStore.getInstance("PKCS12"); + store.load(new ByteArrayInputStream(blob), new char[0]); + if (!store.aliases().nextElement().equals("test")) + throw new Exception("test alias not found"); + KeyStore.PrivateKeyEntry e = + (KeyStore.PrivateKeyEntry) store.getEntry("test", + new KeyStore.PasswordProtection(new char[0])); + X509Certificate cert = (X509Certificate) e.getCertificateChain()[0]; + if (!cert.getSubjectDN().toString().equals("CN=Test Key")) + throw new Exception("invalid certificate subject DN"); + RSAPrivateCrtKey key = (RSAPrivateCrtKey) e.getPrivateKey(); + if (!key.getPublicExponent().equals(BigInteger.valueOf(65537))) + throw new Exception("invalid public exponent"); + } + + private static final String WITH_NULL = + "\u3082\u097c\u0201\u0330\u8209\u3606\u092a\u8648\u86f7\u0d01" + + "\u0701\ua082\u0927\u0482\u0923\u3082\u091f\u3082\u0564\u0609" + + "\u2a86\u4886\uf70d\u0107\u01a0\u8205\u5504\u8205\u5130\u8205" + + "\u4d30\u8205\u4906\u0b2a\u8648\u86f7\u0d01\u0c0a\u0102\ua082" + + "\u04fa\u3082\u04f6\u3028\u060a\u2a86\u4886\uf70d\u010c\u0103" + + "\u301a\u0414\u8317\ucfd6\u89ab\uc03b\u79d6\u4c45\u1b10\uc3bd" + + "\u3923\ub806\u0202\u0400\u0482\u04c8\ud51d\uf953\ud79e\u92c6" + + "\u83c0\u92dc\ucd05\u69ab\ucc1b\ud538\u2ed9\u7796\ua426\uc14e" + + "\udcbf\ue541\u40be\ud264\u3b5b\uf51f\u8e1a\u892f\u2813\ucdd6" + + "\uf72e\uef55\u35ef\u4620\ude18\ued5e\ufae0\ubed4\uf84e\u276b" + + "\u3596\uc33f\ub251\ue617\u6e00\ua80f\u6c82\u4acd\u7303\u26be" + + "\uffb5\u1e49\u5fb1\uf87c\ua873\ue60a\u7415\u655c\u39f1\ucf16" + + "\u8f5c\u85c6\u4100\u4130\u565b\u649a\u60d6\u6054\u868d\u7267" + + "\u97a8\u8492\uc5a0\udb5e\u2880\udf55\ub0ee\ua641\u8224\u76d2" + + "\u9b1e\u2a67\u1e32\ue1fc\u0a77\u435b\u669f\ued00\u6c30\u963f" + + "\u7ee3\uc5c8\u198f\u8ede\u30e1\u015d\u1195\uc850\u3371\ub9e5" + + "\u6968\u84c3\ub0e4\u22b7\u2a08\u4a9d\u9166\ua9ba\ud945\u0529" + + "\ue1e7\u8aba\ub4ef\u7445\udc9a\ucf73\ud77b\ufafe\ue1df\u3180" + + "\u9585\ued73\uca40\u06b0\ufdee\u95ba\u1aa3\ubd67\ua5c1\u84b4" + + "\u4b50\uc1e1\u4547\ud837\u21bc\uac0d\u0a65\uebb5\u7281\ud9bc" + + "\u2e2c\ua9bc\u7714\u0fc0\uab41\uce09\ud5e8\u5f8c\uc35d\uba6e" + + "\u98a2\u95c3\u87ff\uba8c\u056a\udc9f\uf254\u3d38\uf40a\u77dd" + + "\u4e30\u01de\ubef7\ud288\ue59c\ua143\ub30b\ud0ae\u63b9\u138b" + + "\uc793\u3474\u18ca\udeed\u78d9\u2ae8\u63cc\ua5d1\u6779\u0229" + + "\u7b72\ucfd4\ueecb\ue167\u08c0\u7556\u181d\u8d62\uc401\ub092" + + "\u8cf5\ued71\uf29f\u843e\u13e1\u7e7b\uf589\u0329\u92bd\ud0e3" + + "\u8dcc\u7541\uf195\ueef2\u3f3a\ueb01\uf5b0\u1869\u2216\uf351" + + "\u488d\udffb\u6243\u1121\u9447\u8a3a\u006f\u008c\ue2b3\ued31" + + "\u7f57\u6492\ue02f\u6f68\u387d\u58c0\uaadf\u2ee3\uf304\u3de9" + + "\u9741\u47fa\udde8\ufe8a\u679a\u597d\u8c7c\u9c71\u570e\u1dbd" + + "\ud555\ue853\uff63\u0fcb\u4b28\u3691\u33c8\uc31f\uc510\u6cba" + + "\ud92c\u6462\u733a\u739e\uc792\ud861\u743e\u3bd3\u006b\u2276" + + "\u9fb3\u0a31\u1eb3\ub97e\u4a80\uc076\uaabc\u35a0\u678d\u17c3" + + "\ua225\ua77c\u7d9c\uef2d\u83e2\u6996\uba70\uf6f8\u79a1\u9399" + + "\uc86b\u1cc5\ub2a5\u02c1\ud676\ua274\u4933\u6c60\u6832\ub0be" + + "\u5354\u5af9\uae23\u0963\u722d\u9ad2\u4461\ub768\u2068\u0ccb" + + "\u94fd\u88ac\u0f58\u3bc0\u212d\u30c8\u8860\uf7c9\u1dde\ub6b4" + + "\u3549\u5bcd\ucf83\u9420\u3a40\u16ad\uc4d7\ucd87\ue73a\ue1c7" + + "\u21df\u7f4f\u8659\u9f79\u5b36\uf206\uac66\uc9f3\u6336\u164d" + + "\u9046\uf4d5\u285d\ufcd8\ubd55\u1fb9\ua533\u9101\u1e87\uc7b0" + + "\u64e9\u3817\u216c\u8d41\uba51\u743a\uc74e\ue4ab\u2820\u972f" + + "\ue191\u85b4\u0ea7\ud896\u23cf\u7df5\u1653\ua9f3\ub724\ucbc9" + + "\u9738\ud2f8\u464e\ucf12\u99b8\u64e0\uf03b\u8d02\u85a8\uab52" + + "\u8da3\uea34\ube99\ue5f8\u2b38\ub082\u399d\ue61e\u64a1\u7f90" + + "\u26e9\ueb74\u6107\ufe2f\u82ca\u87a5\u3028\u8e1f\ue859\u61d4" + + "\ud26d\u23a9\uaadc\u02a7\u8ab2\u43d4\uf6b9\udf7a\u8935\u45a4" + + "\ufad6\ue7e4\u92b7\u35d7\u1044\u8ed3\u74ef\uaaa9\u713f\u6ebc" + + "\u1158\u5e5c\u7522\ufe17\ua515\u59a1\u75dd\ue7ac\uafd9\u16a9" + + "\u190e\u18fc\uc041\ufc9e\u3e16\u60c4\ufe51\u6d53\ufa52\u4c08" + + "\uce2a\ue546\u017b\ud96b\ube18\u8cb9\udd50\ued40\u14b0\u7da1" + + "\u2f2c\ubf9d\uc7c7\u1b73\ua155\ucaf8\ue54d\uebb0\u160a\ubd64" + + "\u5ef7\ue1cf\u4633\u86c1\ubc91\u839d\ub148\u9f31\uf2b1\ud133" + + "\u168f\u9374\u4667\u6aa9\u0482\ua2a6\ub5c0\ud9b7\ua070\uf6bd" + + "\u16fe\u0f41\u986b\u3d33\u7cb9\u291d\u24f0\u704a\uc946\u10a2" + + "\udbcf\u6c5f\u5a83\u5507\u036e\ube9f\uf60a\u9da8\u72dd\u23c9" + + "\u8878\udd67\uf486\u1384\u751f\u4694\uee3c\udc2e\ud5d7\ud99a" + + "\u5ee2\u5455\ub82d\u1837\u336d\u5724\u635b\ubd0b\u2e7c\u92be" + + "\u2110\u9c0e\u1662\u43f6\u62ae\u32e3\uaea4\u1cc5\uadc0\u7511" + + "\u6ad4\u0228\ue399\u5741\u2050\ue31a\u7dc8\uf6db\u67bb\u994a" + + "\u5b5a\uaac6\u2210\u95b0\u462e\u0684\u335e\uac36\u7ab9\uab1e" + + "\u0b75\u0f05\u74c5\ufcb3\ua0a5\ube7e\u45f8\u92d5\u3399\u7dd6" + + "\uf96e\u7e01\u7823\u6690\u231c\u4c47\u2d10\u7e7f\u5eb8\u70dd" + + "\u98d2\u6204\u3a92\u3990\u502b\u7cdb\u952a\ufa97\uea3b\ud990" + + "\u436f\uf33a\u070d\u2aff\u7497\u2591\u37e4\ua590\ue7ba\u2c1e" + + "\u53d9\u73fa\udc53\u944f\ua3a5\u5093\u33a4\uf080\u1193\u37f2" + + "\u7642\ub033\u7f90\u9b44\uff89\ue6ef\u81be\u9e6e\u68a4\u5a00" + + "\u9232\u4372\u40aa\u2748\u229d\u534d\u316b\u6e89\ufcb7\uff2e" + + "\ub654\u1649\ucb13\u3c28\u4940\u43aa\uc07d\u247c\u313c\u3017" + + "\u0609\u2a86\u4886\uf70d\u0109\u1431\u0a1e\u0800\u7400\u6500" + + "\u7300\u7430\u2106\u092a\u8648\u86f7\u0d01\u0915\u3114\u0412" + + "\u5469\u6d65\u2031\u3330\u3833\u3132\u3234\u3236\u3437\u3082" + + "\u03b3\u0609\u2a86\u4886\uf70d\u0107\u06a0\u8203\ua430\u8203" + + "\ua002\u0100\u3082\u0399\u0609\u2a86\u4886\uf70d\u0107\u0130" + + "\u2806\u0a2a\u8648\u86f7\u0d01\u0c01\u0630\u1a04\u14de\ud8d8" + + "\ua792\uf9d9\u6875\ua51d\u98ec\udf03\uc2b6\u5100\u8a02\u0204" + + "\u0080\u8203\u6074\ub909\u3c60\ua522\ue4ac\u0f60\u2396\u7baa" + + "\ud208\ub76c\u89a5\ue4ef\u205d\u2062\u4a5b\ua684\uceae\u01b9" + + "\u1e7a\u6e03\ud996\u555a\u615b\uba70\u406f\u80a9\u901e\ua947" + + "\u5b8f\u73f3\udea3\ud8b1\u9782\uac87\u231a\udcd2\u3ef0\u3a17" + + "\u4092\u509f\u0e79\u4cd7\u8516\u5111\uebe1\u86e0\uc548\u5ffc" + + "\u9a99\u11ed\uef13\u17af\u2707\u8984\u8770\u7064\u1943\u1dd3" + + "\u45cf\u9f80\u65f8\u9b3e\u1f70\u6bd0\uc726\u5506\ufb20\u6bdc" + + "\uba8c\u0b19\ucd01\ud0f0\u7040\udf63\u48a5\udf5f\u6559\u1b33" + + "\ubdae\u8183\uc13f\ued10\ud6dc\ud0f0\u6a7f\ubc36\uc7ca\u320f" + + "\u50b8\ud422\ufd99\u8843\u65e8\ue201\u843b\u64ee\ub891\u3ba2" + + "\uecae\ufda0\u72d6\u8394\u2551\ufc44\u3778\u27c3\u061a\u6d3b" + + "\ubd80\ue010\u06df\u39e7\u3d6a\u5ae2\u93fa\u4de4\u938f\u6f27" + + "\ufd39\u4380\u60da\uf215\u79d4\uf6f1\ua02f\u959a\ua0ea\u1c38" + + "\u80e3\u2744\u7506\u54b3\u77ad\u18ce\ucfec\u555e\u7bbe\u2e2f" + + "\u9900\ub2ef\ua5b9\ubdf0\u5e15\ua681\u92c7\u4f86\u2e1a\ub893" + + "\u01fc\u01d2\ub674\uff19\u04c3\ua1a0\u2cea\u72e0\ua8f1\u1358" + + "\ube79\u7caa\u269d\u728a\ue435\u37bd\u6495\uc106\u8830\u9b17" + + "\ue16d\uef78\uae2b\u5313\u1c96\uc0ee\u3098\ud743\ucd1c\u7407" + + "\uf4f9\uee72\ub95e\u31e7\u6435\u0173\u0336\u93c5\u8a1b\u05b4" + + "\u4359\uc4be\ud92b\u8d21\u83a9\u32b7\u6433\ua9bc\u27c2\ud842" + + "\ua4f2\u81c5\ua86c\u2fd2\uba30\u53bd\uc277\u659f\u203b\u60e5" + + "\u37f7\u0984\u31c2\u838a\u2107\u5840\u6411\u1b8d\u044e\ub0b6" + + "\uf558\ue6d3\u62bb\u5464\uf83a\u4d5b\uf153\u9e18\ua353\ubd05" + + "\uf204\ud543\u037d\ue5aa\u473a\ueb13\uac19\u0494\ua08e\u76c3" + + "\ufbd7\u9f1c\u8ca9\u57ad\ud218\uc018\u67ac\u0ae9\ub559\ufe38" + + "\u5641\uec0c\ue0ee\u606c\u1989\ue5a2\uff09\u8c61\u1386\ueb51" + + "\u7cbd\u95cd\u80c5\u3532\u8605\u596d\u4cfd\u7797\u1e82\ud2fe" + + "\uad6b\ua16e\ub6cf\u8fce\ud5a9\u207f\u1d0a\udabe\uc3a6\u5633" + + "\u2023\u925f\u809f\uee7c\u5362\u5fd9\u8dfc\u6b5f\uc95b\u0ae9" + + "\u7b26\u9e5b\u97e8\u9d6e\uaf91\u6d1a\u1d19\ufc27\u0815\uccbc" + + "\u83d4\u2ce2\ue06e\u21a1\u88da\u09af\u9671\uc510\uac23\u398d" + + "\ubea2\ua9a1\uf0d3\u490d\ub94b\u7ff7\u6636\ub1fa\u9b10\u1be3" + + "\u179b\u6a8a\u4a6c\ude1f\u5da7\u7c02\u96ec\u70ac\u5045\udd2c" + + "\u9f6d\uc37d\u5ba6\u4895\ue142\u0db9\uf2dc\uba2e\ud054\ud33e" + + "\u1ed9\u144b\u5d85\u9156\u3a90\ue8cd\u0a01\u67f5\ua81b\u4f56" + + "\u99dd\u4950\ua551\uacdb\udf31\u1f05\u7169\u3231\u0071\u80ec" + + "\ua4e9\ud74e\u62cf\u8931\u11f1\uc925\u0319\uabd4\ufb86\u73c2" + + "\u1479\u005b\uf05d\u4f8d\u44e4\u942b\ud338\ud05d\u2b3b\uf6f5" + + "\udc0d\uf741\u798b\ud8e9\u36a5\u577b\u8a95\ud773\uffcb\u17b3" + + "\u7174\u9616\u9b5e\ua577\u983c\u6e7a\u6cc8\u4a04\u042b\u503e" + + "\ud744\ub65e\ue5de\ufa24\u8c71\u1127\ud47f\ud290\ufd4c\u5cbb" + + "\u0e21\u77fd\u6553\ub82b\ucb49\u41e7\u8e3d\u4539\u925d\u6ba9" + + "\uae47\u391c\ua79e\ub6e2\u7142\u7cb3\u02f5\u6495\u7a85\u2dea" + + "\u787b\u22b7\u6ec2\uea8d\uf930\u3d30\u2130\u0906\u052b\u0e03" + + "\u021a\u0500\u0414\ubfef\u99f5\u0bb0\uc9b3\uf96a\ue267\u6bc0" + + "\u0202\u6d78\ub923\u0414\u5500\u095a\u2a04\u2d7e\u708d\u9779" + + "\u9bdb\u2c4f\u82f2\uf89f\u0202\u0400"; + + private static final String WITHOUT_NULL = + "\u3082\u097c\u0201\u0330\u8209\u3606\u092a\u8648\u86f7\u0d01" + + "\u0701\ua082\u0927\u0482\u0923\u3082\u091f\u3082\u0564\u0609" + + "\u2a86\u4886\uf70d\u0107\u01a0\u8205\u5504\u8205\u5130\u8205" + + "\u4d30\u8205\u4906\u0b2a\u8648\u86f7\u0d01\u0c0a\u0102\ua082" + + "\u04fa\u3082\u04f6\u3028\u060a\u2a86\u4886\uf70d\u010c\u0103" + + "\u301a\u0414\ud258\ubbe7\ub641\ud196\u4969\u3c88\u70f1\u8c97" + + "\u95b1\u8bf3\u0202\u0400\u0482\u04c8\u096a\u4686\uf519\u61da" + + "\u1b3b\uebfd\u89b1\u044b\u3bd8\u79a7\ud022\ud880\ud173\ucde1" + + "\ud2c1\u2c5d\u8ebb\u6bd4\u46db\ub90b\u04b9\ub091\ud1f3\ud468" + + "\u3e93\u2c88\uca5a\u1c54\u5342\u1eca\u8565\ubbbd\ua022\u1ead" + + "\ud0bb\u1a8c\u69cf\uf0f4\ucbfb\u488a\ube99\uf190\ue01c\ud87d" + + "\u78ca\u9e5c\u82f9\u76ad\u811f\u37d0\u272b\u0481\u500c\u0a27" + + "\u08d3\ub637\u3e39\u6db1\ubcba\ue354\u6924\ua9d5\u3555\u20d6" + + "\u4c6b\u3189\u5f91\u382c\uf351\u4de2\ubade\u2a14\uea84\u16b6" + + "\uf7f7\u36de\ubba6\ue952\u5f5d\u8243\u2318\ucf3d\u8ac8\u33d3" + + "\u706c\ue3db\u6619\u7935\u7300\u89b3\u0bcd\uca9f\u0333\ua450" + + "\u1be1\u3e42\ub465\uced5\ub055\u5843\uf40f\ua0f2\u6fea\u94fa" + + "\ua51e\u4b5d\u93c9\ucb2e\u977e\uafd9\u2a2f\u784b\u0320\u5550" + + "\u273f\u469f\uc42b\u2ce7\uedea\u4e0d\u54a5\u1a25\u4fac\ue346" + + "\u2102\u7ab6\uea86\u554f\u7706\u8a80\uf6dd\u04f8\u3b37\u005a" + + "\u4562\u2ef8\u59f9\u32b7\u31c0\ue7dc\ucbde\ue0e1\u2fd9\u0960" + + "\u3e7a\ub4e5\u2a58\u1e2b\uef14\u9a44\u5444\u806d\uc475\u12ab" + + "\ucc3d\ua03b\ubd52\ubf1c\ua9a6\u58aa\uee8b\u96c2\ud0c9\ua029" + + "\u1db4\ub118\u4807\uecaa\ue182\uabb7\ud9ed\u66c5\u2c80\uc6a6" + + "\u3f54\ubc73\u2632\ue1b0\u0d74\u001c\u5740\uc74b\ufadb\u25b4" + + "\ua10e\u3191\u69e6\u0861\u452b\u955c\uac56\ud3c4\u86b7\u45f8" + + "\u777a\uc336\u8cc7\ud471\u76b6\u11d8\ueb84\u14e4\uf44f\uc9ff" + + "\u8929\u0d84\ubcfe\u8cc2\u9d07\u94e6\u1cf9\u19b5\u773a\u012d" + + "\u0453\u4ff3\u40f2\ub144\ufc80\u571c\u0e13\uf890\u9fed\u2045" + + "\u7baf\ufd88\u4920\u2b86\u491d\uecf8\ua5d9\u1e12\u48c7\u2c84" + + "\u3fbe\u4df5\u11ce\u7b81\u83fc\u3efa\u697d\u1f3d\u8d81\u01b0" + + "\u0bf1\u9012\u697f\u3b25\u3574\u5286\udded\u5be0\u7e92\u0a02" + + "\ua486\ud19b\ue0b5\ua05c\u5ac2\u0ad5\u0d04\ua763\ub5c8\uf7e6" + + "\u6e77\u2df3\ub9e7\uda30\ufccb\u7642\u5dc1\udf1f\uc922\uff69" + + "\u4471\u4749\u937a\ud77d\u7c0d\u917c\uf2ef\u122c\u13b2\u8943" + + "\u33aa\uad59\u86e8\u21c4\ueaa0\uf200\ue5f3\u6da0\ue8ef\uce7e" + + "\u37b2\u3ddf\u0480\u08fc\uf89a\ud927\u3f5b\u75d3\ubdfe\u6ebd" + + "\ufab1\u9f54\u1c20\u625b\u1391\u2af0\u43ba\u4395\udf22\u299e" + + "\uf3bf\u7750\u5f68\u0120\u0ee0\u6960\ud939\u621f\uf845\u0025" + + "\ue33c\u7ed9\ueadf\u0005\u6306\u7274\u5e67\ucf7a\uf3c6\u7371" + + "\u487b\u79d7\u2142\ubc1a\ubfe4\u3536\u15db\ufe23\u4352\u6321" + + "\u329d\uc251\u84c8\ufc0e\uc0ca\u5be6\uf530\u0177\ud9cb\ud132" + + "\uf752\u3f26\uda90\ud9cf\u2e46\u3e09\u5d9a\u6902\udb3e\ub06c" + + "\u722d\uf498\u3e93\u6cae\u43b5\u535a\u1cd1\uf0b2\u8d80\u9e53" + + "\ue02e\uf782\u01ce\u5063\u73d1\u5571\uf0e7\ufa22\u7e48\u0c31" + + "\u4642\u29fd\udcab\ue8d4\u7a77\u0880\u4855\u88c7\u7aa5\u0d9c" + + "\uf8b7\uc91c\u127d\u2dd7\ude53\u9d3f\u132b\u965c\ubc80\udd97" + + "\u87bf\ua0e8\ub2a2\u4e1f\u98fd\u72f3\u16ea\uc415\u5be3\ue8df" + + "\u5681\u1f11\u4e3a\uac5d\u1684\u6602\ueb14\u0a96\ufcef\uaebf" + + "\u1f2e\ud1a9\u435c\uf4e5\ub6b4\uaae2\u8244\u96a4\u0d3a\u752f" + + "\uce21\u1bc9\u219e\uf17b\ud95e\ucd12\u1b0a\ucb85\ub0cd\u4ecb" + + "\u6bb4\u5f7c\u2a93\ubb24\u9d7c\u6822\u80cd\u3f54\u78ad\u4fde" + + "\ud57f\uec1d\ub54c\u0d78\u5946\u84c1\ua9ad\u0dea\u0292\ub279" + + "\u1c76\u817e\ub910\ub1fa\ub1c0\u839d\u9eca\u6f83\u8211\u4112" + + "\u440c\u4fbd\u6ef2\u897d\udfa9\ude9e\u1aef\u0f21\u26fb\uaca4" + + "\u637e\ub072\u264f\ud24d\u9357\uc801\u0b84\u2d34\ueddf\u6063" + + "\udc5d\u90dd\u5c62\ufb48\u8c5e\u7c4e\u3bdb\ub590\u7a75\udbd1" + + "\udd78\uc8be\u5915\u7c8b\u8874\u578d\u3116\ub65a\uab8e\ud2ef" + + "\u5d35\ubf8b\u2828\u8983\ua790\uedcf\u9698\ue023\u5786\u627b" + + "\u9037\u1db7\u900e\u1f45\u0001\u7cf8\u14fd\ue437\u0dfd\ucacc" + + "\u5edf\u1742\u7f6e\u612a\ud57d\udca0\u73a4\ud601\uc7f0\uca0e" + + "\u5a44\u00b4\u233a\u84f2\u95b5\u5f16\uc291\u04fb\u369d\u6b99" + + "\ue127\u493f\u66be\u86e9\u9672\u2849\u64a7\u851b\ue420\u8491" + + "\ueb07\u6563\uc753\uc28e\ucad5\uec05\u6920\u8955\u5605\u25f6" + + "\u6193\ubee5\u7a1a\ub73d\ucc27\uc8ce\u7179\u57c1\u7a2a\u37c1" + + "\ua6c7\u2d8a\u4025\uc97d\u8c9d\u7b4b\u1ad5\uc6d7\u50fc\u246d" + + "\u91a9\ua55d\u677a\udc83\u04c7\u3e14\u9950\u420c\udf02\u749b" + + "\ude88\u5459\u2074\ua4ae\ud12d\uaf60\uba98\u630d\u313c\u3017" + + "\u0609\u2a86\u4886\uf70d\u0109\u1431\u0a1e\u0800\u7400\u6500" + + "\u7300\u7430\u2106\u092a\u8648\u86f7\u0d01\u0915\u3114\u0412" + + "\u5469\u6d65\u2031\u3330\u3833\u3132\u3431\u3138\u3238\u3082" + + "\u03b3\u0609\u2a86\u4886\uf70d\u0107\u06a0\u8203\ua430\u8203" + + "\ua002\u0100\u3082\u0399\u0609\u2a86\u4886\uf70d\u0107\u0130" + + "\u2806\u0a2a\u8648\u86f7\u0d01\u0c01\u0630\u1a04\u14af\ud4f5" + + "\u0ff4\u0ede\u0da0\u6cc5\ufd9d\u3502\uae5e\u4cef\u3102\u0204" + + "\u0080\u8203\u6028\ua7e6\u088b\u56b6\uf453\u9747\u68ec\uc064" + + "\u2254\u693f\u25c5\uaa39\u3d87\uc97c\uc558\u5194\u7553\ude3a" + + "\u4575\u9d85\ud843\u2bd0\ua2e8\u244f\u8593\uac84\u54b4\ubdc6" + + "\ucea6\uba1a\ud3da\ua510\uee9d\uaf31\ub5c2\u3329\u0fed\u0e08" + + "\u426b\u46fe\udcc5\u0979\ua9ed\u3123\u9a50\ud222\u3fc0\u771a" + + "\u6f55\u9664\ud56f\u6b03\u6020\u78a4\u63b2\ue35e\u0816\u43a7" + + "\u1909\u52e1\u8183\u1b8d\u9f5b\u19e4\uad73\u8461\ucc86\u3b49" + + "\u322e\ue9d9\u3c66\uea22\u091e\u6621\ua8bf\u0169\u72d0\u535e" + + "\u77dc\u1002\ubded\u7a91\u6cee\u58fa\uc295\uae8e\ue009\uabe9" + + "\u6638\ucaea\u8bbf\uca27\udef5\u2881\u72ec\u8aa5\u582b\u9d6e" + + "\u26bb\u3c70\u8bd6\uf5ec\u34ae\ua967\u5bb1\u22cb\u4b74\u0e50" + + "\u5062\uc6f7\u7cb4\u58a3\uf43d\u57c0\u9654\u2f9c\u9308\u4546" + + "\u6f4a\u37fe\u8d5d\u1465\u8621\u4cd8\u68d6\u0456\u96a4\ud3e2" + + "\u76d1\u2675\u7654\u7649\u10e9\u9d0e\u8b04\uffb6\u020a\u2eb4" + + "\uf24f\u150e\u7f0d\uf41b\u2c76\u538f\uc2df\u79dc\u0472\u1119" + + "\uc148\ue2e8\u1820\ucd45\u08a7\u6bcd\u6eb0\ubd0a\ufff4\uec28" + + "\u819b\u2adb\uefc8\ue8f7\ue233\u6535\uc938\u9771\u3681\u87cf" + + "\u3a24\u4c71\ue1df\u3e19\u259c\uae5b\u27ed\u8a67\uf3e6\u7af0" + + "\u48e1\uc542\uc471\ud8f4\ue317\u46e9\u0b4f\uec45\ua1d3\u2b88" + + "\u8a22\udda1\u7c1a\u273c\ua0f7\u8bac\u3771\u28d2\u6ef8\u28d2" + + "\ud83c\u196f\ue3fd\u9c79\u4305\u01b8\u3490\u0a91\ue4f3\uebc6" + + "\u25a2\u7dd2\u72db\u7531\ucfca\u432f\u2beb\uc649\uf9c5\uc533" + + "\u9f3a\ua611\u935c\ubca6\ud293\u54d6\u0dd1\u0aff\u82fb\u2d69" + + "\u3da0\u3b33\u0986\u45b3\u3353\ub968\u7348\u454f\u9117\ub3dc" + + "\ud7af\u06ca\ua34a\u9357\ue22f\uad3d\u4c76\ub386\ua8d7\u2a90" + + "\u6d17\u9321\u7b00\u21e4\u1994\u9d18\u6439\u04c8\u8282\ub269" + + "\uf786\u75c6\ua505\u983a\ua075\uffa0\ud662\u6ae5\ub126\u96d1" + + "\u9e5e\u346b\ub7ee\ub0a3\u4ee8\ud204\u77ec\u2325\u5da8\ua326" + + "\ua018\u0fd8\ue50e\u93cc\ucc40\u2d89\u2ffb\u54e0\u091a\u19fd" + + "\u45d7\uc0ab\u77a2\u66ae\u794b\u6644\u21c3\ud782\u1e9e\u53e5" + + "\u782e\u55e8\ud44e\u93e8\u379e\u5aa8\u353b\u95de\u7bc1\ucaf3" + + "\u5223\ub5e9\uacbb\ub86b\u6014\u0626\ue7ad\ufd93\ue43a\ud864" + + "\u1e6d\u14b2\ua12a\u94c5\u2ed9\ua7f7\u14f4\u0cbd\uca3b\u7c21" + + "\ua85a\uf834\u6c99\ue1aa\u3832\u2515\u8170\u3c93\u7def\u94fe" + + "\u9c3d\u4ab0\u73ed\u6c72\u8b94\ua407\uc719\uad1e\u6306\u4167" + + "\u921e\uae53\u3fd4\uf569\u6f0b\u82b0\u0ca6\ud61f\ud526\u23c9" + + "\u168d\u4baf\ucc4f\ud8a2\uc64a\ud649\u55e3\u7019\u8f20\u680c" + + "\u5581\u2cb1\ub3a4\u3e37\u5fd3\ua3ca\uc115\u979c\uf910\u3797" + + "\u05cb\u51d6\u74a4\uc5c0\u597b\uf27f\ud5e2\ue8ac\u4f3d\uc0c3" + + "\u9594\u7799\u6876\ub1a3\u059a\uff03\uc2ee\uc8c2\uf224\u3720" + + "\u9177\uabdb\u9202\u18d8\uffbe\u0516\u2a76\uedb5\ufe9e\u6d65" + + "\u4c35\ue4cb\u75aa\u02be\ud24c\ua482\ufc67\ue4f9\u70c7\u3567" + + "\ufc3f\uaa89\ue80a\u6507\u0a65\u4e18\uf919\u071d\u423c\u1756" + + "\u30e5\u37f3\u19b3\u10fb\u6c30\u3d30\u2130\u0906\u052b\u0e03" + + "\u021a\u0500\u0414\ufd05\u4444\ud347\u673c\u6da4\udb7c\u0733" + + "\ud7bf\ud263\uc6b2\u0414\udd17\u155e\u2d4c\u25cb\ua028\u1a23" + + "\ub8b0\uf6be\u925f\ude3a\u0202\u0400"; + +} From 1cfc57d91b158931a9dc6a98edc46e825f48956e Mon Sep 17 00:00:00 2001 From: Prasannaa Date: Fri, 10 Feb 2012 11:03:20 +0000 Subject: [PATCH 29/82] 7144475: fix some warnings in java.awt, javax.print.attribute.standard, and sun.beans.infos Co-authored-by: Martijn Verburg Co-authored-by: Goerge Albrecht Co-authored-by: Graham Allan Co-authored-by: Iordanis Giannakakis Co-authored-by: Jose Llarena Co-authored-by: Abrahamn Marin Perez Reviewed-by: chegar, prr, alanb, anthony --- jdk/src/share/classes/java/awt/List.java | 14 +++++++------- jdk/src/share/classes/java/awt/Window.java | 6 +++--- .../share/classes/java/awt/color/ICC_Profile.java | 6 +++--- .../attribute/standard/PrinterStateReasons.java | 3 +-- .../standard/ReferenceUriSchemesSupported.java | 2 +- .../classes/sun/beans/infos/ComponentBeanInfo.java | 2 +- 6 files changed, 16 insertions(+), 17 deletions(-) diff --git a/jdk/src/share/classes/java/awt/List.java b/jdk/src/share/classes/java/awt/List.java index 917977b157e..d5b60ae56c6 100644 --- a/jdk/src/share/classes/java/awt/List.java +++ b/jdk/src/share/classes/java/awt/List.java @@ -115,7 +115,7 @@ public class List extends Component implements ItemSelectable, Accessible { * @see #addItem(String) * @see #getItem(int) */ - Vector items = new Vector(); + Vector items = new Vector<>(); /** * This field will represent the number of visible rows in the @@ -306,7 +306,7 @@ public class List extends Component implements ItemSelectable, Accessible { // to insure that it cannot be overridden by client subclasses. // DO NOT INVOKE CLIENT CODE ON THIS THREAD! final String getItemImpl(int index) { - return (String)items.elementAt(index); + return items.elementAt(index); } /** @@ -415,7 +415,7 @@ public class List extends Component implements ItemSelectable, Accessible { if (peer != null) { peer.removeAll(); } - items = new Vector(); + items = new Vector<>(); selected = new int[0]; } @@ -490,9 +490,9 @@ public class List extends Component implements ItemSelectable, Accessible { public synchronized int[] getSelectedIndexes() { ListPeer peer = (ListPeer)this.peer; if (peer != null) { - selected = ((ListPeer)peer).getSelectedIndexes(); + selected = peer.getSelectedIndexes(); } - return (int[])selected.clone(); + return selected.clone(); } /** @@ -908,7 +908,7 @@ public class List extends Component implements ItemSelectable, Accessible { * @since 1.4 */ public synchronized ItemListener[] getItemListeners() { - return (ItemListener[])(getListeners(ItemListener.class)); + return getListeners(ItemListener.class); } /** @@ -975,7 +975,7 @@ public class List extends Component implements ItemSelectable, Accessible { * @since 1.4 */ public synchronized ActionListener[] getActionListeners() { - return (ActionListener[])(getListeners(ActionListener.class)); + return getListeners(ActionListener.class); } /** diff --git a/jdk/src/share/classes/java/awt/Window.java b/jdk/src/share/classes/java/awt/Window.java index d2c97dbf8ab..646d9ded822 100644 --- a/jdk/src/share/classes/java/awt/Window.java +++ b/jdk/src/share/classes/java/awt/Window.java @@ -398,10 +398,10 @@ public class Window extends Container implements Accessible { initIDs(); } - String s = (String) java.security.AccessController.doPrivileged( + String s = java.security.AccessController.doPrivileged( new GetPropertyAction("java.awt.syncLWRequests")); systemSyncLWRequests = (s != null && s.equals("true")); - s = (String) java.security.AccessController.doPrivileged( + s = java.security.AccessController.doPrivileged( new GetPropertyAction("java.awt.Window.locationByPlatform")); locationByPlatformProp = (s != null && s.equals("true")); } @@ -1378,7 +1378,7 @@ public class Window extends Container implements Accessible { // make sure the privileged action is only // for getting the property! We don't want the // above checkTopLevelWindow call to always succeed! - warningString = (String) AccessController.doPrivileged( + warningString = AccessController.doPrivileged( new GetPropertyAction("awt.appletWarning", "Java Applet Window")); } diff --git a/jdk/src/share/classes/java/awt/color/ICC_Profile.java b/jdk/src/share/classes/java/awt/color/ICC_Profile.java index 81212fbfeaf..c06ddf61c97 100644 --- a/jdk/src/share/classes/java/awt/color/ICC_Profile.java +++ b/jdk/src/share/classes/java/awt/color/ICC_Profile.java @@ -921,9 +921,9 @@ public class ICC_Profile implements Serializable { */ private static ICC_Profile getStandardProfile(final String name) { - return (ICC_Profile) AccessController.doPrivileged( - new PrivilegedAction() { - public Object run() { + return AccessController.doPrivileged( + new PrivilegedAction() { + public ICC_Profile run() { ICC_Profile p = null; try { p = getInstance (name); diff --git a/jdk/src/share/classes/javax/print/attribute/standard/PrinterStateReasons.java b/jdk/src/share/classes/javax/print/attribute/standard/PrinterStateReasons.java index f49210d081d..339be3621d9 100644 --- a/jdk/src/share/classes/javax/print/attribute/standard/PrinterStateReasons.java +++ b/jdk/src/share/classes/javax/print/attribute/standard/PrinterStateReasons.java @@ -180,8 +180,7 @@ public final class PrinterStateReasons if (severity == null) { throw new NullPointerException("severity is null"); } - return super.put((PrinterStateReason) reason, - (Severity) severity); + return super.put(reason, severity); } /** diff --git a/jdk/src/share/classes/javax/print/attribute/standard/ReferenceUriSchemesSupported.java b/jdk/src/share/classes/javax/print/attribute/standard/ReferenceUriSchemesSupported.java index 70d09510de2..b52b2abbca0 100644 --- a/jdk/src/share/classes/javax/print/attribute/standard/ReferenceUriSchemesSupported.java +++ b/jdk/src/share/classes/javax/print/attribute/standard/ReferenceUriSchemesSupported.java @@ -141,7 +141,7 @@ public class ReferenceUriSchemesSupported * Returns the string table for class ReferenceUriSchemesSupported. */ protected String[] getStringTable() { - return (String[])myStringTable.clone(); + return myStringTable.clone(); } /** diff --git a/jdk/src/share/classes/sun/beans/infos/ComponentBeanInfo.java b/jdk/src/share/classes/sun/beans/infos/ComponentBeanInfo.java index e16511f9854..ae6631f1f31 100644 --- a/jdk/src/share/classes/sun/beans/infos/ComponentBeanInfo.java +++ b/jdk/src/share/classes/sun/beans/infos/ComponentBeanInfo.java @@ -32,7 +32,7 @@ import java.beans.*; */ public class ComponentBeanInfo extends SimpleBeanInfo { - private static final Class beanClass = java.awt.Component.class; + private static final Class beanClass = java.awt.Component.class; public PropertyDescriptor[] getPropertyDescriptors() { try { From f67d19788e63e9f0532ed395975fc3757ee66606 Mon Sep 17 00:00:00 2001 From: Alexander Scherbatiy Date: Fri, 10 Feb 2012 18:34:43 +0400 Subject: [PATCH 30/82] 7109991: SwingUtilities.isXMouseButton behaves unexpectedly starting from JDK8 b08 Reviewed-by: rupashka --- .../classes/java/awt/event/InputEvent.java | 23 ++++++----- .../classes/java/awt/event/MouseEvent.java | 39 ++++++++++--------- 2 files changed, 35 insertions(+), 27 deletions(-) diff --git a/jdk/src/share/classes/java/awt/event/InputEvent.java b/jdk/src/share/classes/java/awt/event/InputEvent.java index c98c872ed8b..f645c3a10a6 100644 --- a/jdk/src/share/classes/java/awt/event/InputEvent.java +++ b/jdk/src/share/classes/java/awt/event/InputEvent.java @@ -321,14 +321,15 @@ public abstract class InputEvent extends ComponentEvent { * @param when a long int that gives the time the event occurred. * Passing negative or zero value * is not recommended - * @param modifiers the modifier keys down during event (e.g. shift, ctrl, - * alt, meta) - * Passing negative parameter is not recommended. - * Zero value means no modifiers. - * Either extended _DOWN_MASK or old _MASK modifiers - * should be used, but both models should not be mixed - * in one event. Use of the extended modifiers is - * preferred + * @param modifiers a modifier mask describing the modifier keys and mouse + * buttons (for example, shift, ctrl, alt, and meta) that + * are down during the event. + * Only extended modifiers are allowed to be used as a + * value for this parameter (see the {@link InputEvent#getModifiersEx} + * class for the description of extended modifiers). + * Passing negative parameter + * is not recommended. + * Zero value means that no modifiers were passed * @throws IllegalArgumentException if source is null * @see #getSource() * @see #getID() @@ -416,9 +417,13 @@ public abstract class InputEvent extends ComponentEvent { /** * Returns the extended modifier mask for this event. + *

+ * Extended modifiers are the modifiers that ends with the _DOWN_MASK suffix, + * such as ALT_DOWN_MASK, BUTTON1_DOWN_MASK, and others. + *

* Extended modifiers represent the state of all modal keys, * such as ALT, CTRL, META, and the mouse buttons just after - * the event occurred + * the event occurred. *

* For example, if the user presses button 1 followed by * button 2, and then releases them in the same order, diff --git a/jdk/src/share/classes/java/awt/event/MouseEvent.java b/jdk/src/share/classes/java/awt/event/MouseEvent.java index 988eda60a8b..15cb6ee0309 100644 --- a/jdk/src/share/classes/java/awt/event/MouseEvent.java +++ b/jdk/src/share/classes/java/awt/event/MouseEvent.java @@ -488,14 +488,15 @@ public class MouseEvent extends InputEvent { * @param when A long integer that gives the time the event occurred. * Passing negative or zero value * is not recommended - * @param modifiers The modifier keys down during event (e.g. shift, ctrl, - * alt, meta) + * @param modifiers a modifier mask describing the modifier keys and mouse + * buttons (for example, shift, ctrl, alt, and meta) that + * are down during the event. + * Only extended modifiers are allowed to be used as a + * value for this parameter (see the {@link InputEvent#getModifiersEx} + * class for the description of extended modifiers). * Passing negative parameter * is not recommended. - * Zero value means that no modifiers were passed. - * Use either an extended _DOWN_MASK or old _MASK modifiers, - * however do not mix models in the one event. - * The extended modifiers are preferred for using + * Zero value means that no modifiers were passed * @param x The horizontal x coordinate for the mouse location. * It is allowed to pass negative values * @param y The vertical y coordinate for the mouse location. @@ -586,14 +587,15 @@ public class MouseEvent extends InputEvent { * @param when A long integer that gives the time the event occurred. * Passing negative or zero value * is not recommended - * @param modifiers The modifier keys down during event (e.g. shift, ctrl, - * alt, meta) + * @param modifiers a modifier mask describing the modifier keys and mouse + * buttons (for example, shift, ctrl, alt, and meta) that + * are down during the event. + * Only extended modifiers are allowed to be used as a + * value for this parameter (see the {@link InputEvent#getModifiersEx} + * class for the description of extended modifiers). * Passing negative parameter * is not recommended. - * Zero value means that no modifiers were passed. - * Use either an extended _DOWN_MASK or old _MASK modifiers, - * however do not mix models in the one event. - * The extended modifiers are preferred for using + * Zero value means that no modifiers were passed * @param x The horizontal x coordinate for the mouse location. * It is allowed to pass negative values * @param y The vertical y coordinate for the mouse location. @@ -657,14 +659,15 @@ public class MouseEvent extends InputEvent { * @param when A long integer that gives the time the event occurred. * Passing negative or zero value * is not recommended - * @param modifiers The modifier keys down during event (e.g. shift, ctrl, - * alt, meta) + * @param modifiers a modifier mask describing the modifier keys and mouse + * buttons (for example, shift, ctrl, alt, and meta) that + * are down during the event. + * Only extended modifiers are allowed to be used as a + * value for this parameter (see the {@link InputEvent#getModifiersEx} + * class for the description of extended modifiers). * Passing negative parameter * is not recommended. - * Zero value means that no modifiers were passed. - * Use either an extended _DOWN_MASK or old _MASK modifiers, - * however do not mix models in the one event. - * The extended modifiers are preferred for using + * Zero value means that no modifiers were passed * @param x The horizontal x coordinate for the mouse location. * It is allowed to pass negative values * @param y The vertical y coordinate for the mouse location. From 4659df3c49fc2842511fd76530dbaf6437373b5e Mon Sep 17 00:00:00 2001 From: Alejandro Murillo Date: Fri, 10 Feb 2012 11:46:20 -0800 Subject: [PATCH 31/82] 7144322: new hotspot build - hs23-b16 Reviewed-by: jcoomes --- hotspot/make/hotspot_version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hotspot/make/hotspot_version b/hotspot/make/hotspot_version index 1d2a06ce086..f92de62e153 100644 --- a/hotspot/make/hotspot_version +++ b/hotspot/make/hotspot_version @@ -35,7 +35,7 @@ HOTSPOT_VM_COPYRIGHT=Copyright 2011 HS_MAJOR_VER=23 HS_MINOR_VER=0 -HS_BUILD_NUMBER=15 +HS_BUILD_NUMBER=16 JDK_MAJOR_VER=1 JDK_MINOR_VER=8 From 2d533fa2a9157354a78b237c77b41775ff9ea9ed Mon Sep 17 00:00:00 2001 From: Vladimir Kozlov Date: Fri, 10 Feb 2012 12:53:43 -0800 Subject: [PATCH 32/82] 7129284: +DoEscapeAnalysis regression w/ early build of 7u4 (HotSpot 23) on Linux Removed code which tried to create edges from fields of destination objects of arraycopy to fields of source objects. Added 30 sec time limit for EA graph construction. Reviewed-by: never --- hotspot/src/share/vm/opto/escape.cpp | 160 ++++++++++++--------------- 1 file changed, 73 insertions(+), 87 deletions(-) diff --git a/hotspot/src/share/vm/opto/escape.cpp b/hotspot/src/share/vm/opto/escape.cpp index 514a7acbb40..27fd8171a8c 100644 --- a/hotspot/src/share/vm/opto/escape.cpp +++ b/hotspot/src/share/vm/opto/escape.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2012, 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 @@ -1687,12 +1687,23 @@ bool ConnectionGraph::compute_escape() { // Observed 8 passes in jvm2008 compiler.compiler. // Set limit to 20 to catch situation when something // did go wrong and recompile the method without EA. + // Also limit build time to 30 sec (60 in debug VM). #define CG_BUILD_ITER_LIMIT 20 +#ifdef ASSERT +#define CG_BUILD_TIME_LIMIT 60.0 +#else +#define CG_BUILD_TIME_LIMIT 30.0 +#endif + uint length = worklist.length(); int iterations = 0; - while(_progress && (iterations++ < CG_BUILD_ITER_LIMIT)) { + elapsedTimer time; + while(_progress && + (iterations++ < CG_BUILD_ITER_LIMIT) && + (time.seconds() < CG_BUILD_TIME_LIMIT)) { + time.start(); _progress = false; for( uint next = 0; next < length; ++next ) { int ni = worklist.at(next); @@ -1701,18 +1712,19 @@ bool ConnectionGraph::compute_escape() { assert(n != NULL, "should be known node"); build_connection_graph(n, igvn); } + time.stop(); } - if (iterations >= CG_BUILD_ITER_LIMIT) { - assert(iterations < CG_BUILD_ITER_LIMIT, - err_msg("infinite EA connection graph build with %d nodes and worklist size %d", - nodes_size(), length)); + if ((iterations >= CG_BUILD_ITER_LIMIT) || + (time.seconds() >= CG_BUILD_TIME_LIMIT)) { + assert(false, err_msg("infinite EA connection graph build (%f sec, %d iterations) with %d nodes and worklist size %d", + time.seconds(), iterations, nodes_size(), length)); // Possible infinite build_connection_graph loop, - // retry compilation without escape analysis. - C->record_failure(C2Compiler::retry_no_escape_analysis()); + // bailout (no changes to ideal graph were made). _collecting = false; return false; } #undef CG_BUILD_ITER_LIMIT +#undef CG_BUILD_TIME_LIMIT // 5. Propagate escaped states. worklist.clear(); @@ -2292,9 +2304,35 @@ void ConnectionGraph::process_call_arguments(CallNode *call, PhaseTransform *pha PointsToNode::EscapeState arg_esc = ptnode_adr(arg->_idx)->escape_state(); if (!arg->is_top() && at->isa_ptr() && aat->isa_ptr() && (is_arraycopy || arg_esc < PointsToNode::ArgEscape)) { - +#ifdef ASSERT assert(aat == Type::TOP || aat == TypePtr::NULL_PTR || aat->isa_ptr() != NULL, "expecting an Ptr"); + if (!(is_arraycopy || + call->as_CallLeaf()->_name != NULL && + (strcmp(call->as_CallLeaf()->_name, "g1_wb_pre") == 0 || + strcmp(call->as_CallLeaf()->_name, "g1_wb_post") == 0 )) + ) { + call->dump(); + assert(false, "EA: unexpected CallLeaf"); + } +#endif + if (arg_esc < PointsToNode::ArgEscape) { + set_escape_state(arg->_idx, PointsToNode::ArgEscape); + Node* arg_base = arg; + if (arg->is_AddP()) { + // + // The inline_native_clone() case when the arraycopy stub is called + // after the allocation before Initialize and CheckCastPP nodes. + // Or normal arraycopy for object arrays case. + // + // Set AddP's base (Allocate) as not scalar replaceable since + // pointer to the base (with offset) is passed as argument. + // + arg_base = get_addp_base(arg); + set_escape_state(arg_base->_idx, PointsToNode::ArgEscape); + } + } + bool arg_has_oops = aat->isa_oopptr() && (aat->isa_oopptr()->klass() == NULL || aat->isa_instptr() || (aat->isa_aryptr() && aat->isa_aryptr()->klass()->is_obj_array_klass())); @@ -2307,85 +2345,33 @@ void ConnectionGraph::process_call_arguments(CallNode *call, PhaseTransform *pha // arraycopy(char[],0,Object*,0,size); // arraycopy(Object*,0,char[],0,size); // - // Don't add edges from dst's fields in such cases. + // Do nothing special in such cases. // - bool arg_is_arraycopy_dest = src_has_oops && is_arraycopy && - arg_has_oops && (i > TypeFunc::Parms); -#ifdef ASSERT - if (!(is_arraycopy || - call->as_CallLeaf()->_name != NULL && - (strcmp(call->as_CallLeaf()->_name, "g1_wb_pre") == 0 || - strcmp(call->as_CallLeaf()->_name, "g1_wb_post") == 0 )) - ) { - call->dump(); - assert(false, "EA: unexpected CallLeaf"); - } -#endif - // Always process arraycopy's destination object since - // we need to add all possible edges to references in - // source object. - if (arg_esc >= PointsToNode::ArgEscape && - !arg_is_arraycopy_dest) { - continue; - } - set_escape_state(arg->_idx, PointsToNode::ArgEscape); - Node* arg_base = arg; - if (arg->is_AddP()) { - // - // The inline_native_clone() case when the arraycopy stub is called - // after the allocation before Initialize and CheckCastPP nodes. - // Or normal arraycopy for object arrays case. - // - // Set AddP's base (Allocate) as not scalar replaceable since - // pointer to the base (with offset) is passed as argument. - // - arg_base = get_addp_base(arg); - } - VectorSet argset = *PointsTo(arg_base); // Clone set - for( VectorSetI j(&argset); j.test(); ++j ) { - uint pd = j.elem; // Destination object - set_escape_state(pd, PointsToNode::ArgEscape); - - if (arg_is_arraycopy_dest) { - PointsToNode* ptd = ptnode_adr(pd); - // Conservatively reference an unknown object since - // not all source's fields/elements may be known. - add_edge_from_fields(pd, _phantom_object, Type::OffsetBot); - - Node *src = call->in(TypeFunc::Parms)->uncast(); - Node* src_base = src; - if (src->is_AddP()) { - src_base = get_addp_base(src); - } - // Create edges from destination's fields to - // everything known source's fields could point to. - for( VectorSetI s(PointsTo(src_base)); s.test(); ++s ) { - uint ps = s.elem; - bool has_bottom_offset = false; - for (uint fd = 0; fd < ptd->edge_count(); fd++) { - assert(ptd->edge_type(fd) == PointsToNode::FieldEdge, "expecting a field edge"); - int fdi = ptd->edge_target(fd); - PointsToNode* pfd = ptnode_adr(fdi); - int offset = pfd->offset(); - if (offset == Type::OffsetBot) - has_bottom_offset = true; - assert(offset != -1, "offset should be set"); - add_deferred_edge_to_fields(fdi, ps, offset); - } - // Destination object may not have access (no field edge) - // to fields which are accessed in source object. - // As result no edges will be created to those source's - // fields and escape state of destination object will - // not be propagated to those fields. - // - // Mark source object as global escape except in - // the case with Type::OffsetBot field (which is - // common case for array elements access) when - // edges are created to all source's fields. - if (!has_bottom_offset) { - set_escape_state(ps, PointsToNode::GlobalEscape); - } - } + if (is_arraycopy && (i > TypeFunc::Parms) && + src_has_oops && arg_has_oops) { + // Destination object's fields reference an unknown object. + Node* arg_base = arg; + if (arg->is_AddP()) { + arg_base = get_addp_base(arg); + } + for (VectorSetI s(PointsTo(arg_base)); s.test(); ++s) { + uint ps = s.elem; + set_escape_state(ps, PointsToNode::ArgEscape); + add_edge_from_fields(ps, _phantom_object, Type::OffsetBot); + } + // Conservatively all values in source object fields globally escape + // since we don't know if values in destination object fields + // escape (it could be traced but it is too expensive). + Node* src = call->in(TypeFunc::Parms)->uncast(); + Node* src_base = src; + if (src->is_AddP()) { + src_base = get_addp_base(src); + } + for (VectorSetI s(PointsTo(src_base)); s.test(); ++s) { + uint ps = s.elem; + set_escape_state(ps, PointsToNode::ArgEscape); + // Use OffsetTop to indicate fields global escape. + add_edge_from_fields(ps, _phantom_object, Type::OffsetTop); } } } From b33087c6d38a88a57d4a51a0c5e3963646d461b2 Mon Sep 17 00:00:00 2001 From: Andrew Haley Date: Fri, 10 Feb 2012 17:20:05 -0800 Subject: [PATCH 33/82] 7140985: HSDIS does not handle caller options correctly Fix typo. Reviewed-by: jrose, kvn --- hotspot/src/share/tools/hsdis/hsdis.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hotspot/src/share/tools/hsdis/hsdis.c b/hotspot/src/share/tools/hsdis/hsdis.c index daea404f955..8034ac15af5 100644 --- a/hotspot/src/share/tools/hsdis/hsdis.c +++ b/hotspot/src/share/tools/hsdis/hsdis.c @@ -356,7 +356,7 @@ static void parse_caller_options(struct hsdis_app_data* app_data, const char* ca if (plen > mach_size) plen = mach_size; strncpy(mach_option, p, plen); mach_option[plen] = '\0'; - } else if (plen > 6 && strncmp(p, "hsdis-", 6)) { + } else if (plen > 6 && strncmp(p, "hsdis-", 6) == 0) { // do not pass these to the next level } else { /* just copy it; {i386,sparc}-dis.c might like to see it */ From 533795bb75dbb6a69b8b5ac6e03cf70374165401 Mon Sep 17 00:00:00 2001 From: Bradford Wetmore Date: Fri, 10 Feb 2012 19:07:23 -0800 Subject: [PATCH 34/82] 7142509: Cipher.doFinal(ByteBuffer,ByteBuffer) fails to process when in.remaining() == 0 Reviewed-by: valeriep --- .../share/classes/javax/crypto/CipherSpi.java | 10 +- .../crypto/CipherSpi/DirectBBRemaining.java | 181 ++++++++++++++++++ 2 files changed, 186 insertions(+), 5 deletions(-) create mode 100644 jdk/test/javax/crypto/CipherSpi/DirectBBRemaining.java diff --git a/jdk/src/share/classes/javax/crypto/CipherSpi.java b/jdk/src/share/classes/javax/crypto/CipherSpi.java index c3442ea2d81..e563e920eb6 100644 --- a/jdk/src/share/classes/javax/crypto/CipherSpi.java +++ b/jdk/src/share/classes/javax/crypto/CipherSpi.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -775,7 +775,7 @@ public abstract class CipherSpi { int outOfs = output.arrayOffset() + outPos; byte[] inArray = new byte[getTempArraySize(inLen)]; int total = 0; - while (inLen > 0) { + do { int chunk = Math.min(inLen, inArray.length); input.get(inArray, 0, chunk); int n; @@ -787,7 +787,7 @@ public abstract class CipherSpi { total += n; outOfs += n; inLen -= chunk; - } + } while (inLen > 0); output.position(outPos + total); return total; } else { // output is not backed by an accessible byte[] @@ -804,7 +804,7 @@ public abstract class CipherSpi { int outSize = outArray.length; int total = 0; boolean resized = false; - while (inLen > 0) { + do { int chunk = Math.min(inLen, outSize); if ((a1 == false) && (resized == false)) { input.get(inArray, 0, chunk); @@ -834,7 +834,7 @@ public abstract class CipherSpi { int newOut = engineGetOutputSize(chunk); outArray = new byte[newOut]; } - } + } while (inLen > 0); input.position(inLimit); return total; } diff --git a/jdk/test/javax/crypto/CipherSpi/DirectBBRemaining.java b/jdk/test/javax/crypto/CipherSpi/DirectBBRemaining.java new file mode 100644 index 00000000000..9cc840664c0 --- /dev/null +++ b/jdk/test/javax/crypto/CipherSpi/DirectBBRemaining.java @@ -0,0 +1,181 @@ +/* + * Copyright (c) 2012, 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 7142509 + * @summary Cipher.doFinal(ByteBuffer,ByteBuffer) fails to + * process when in.remaining() == 0 + */ + +import java.nio.ByteBuffer; +import java.security.SecureRandom; +import java.util.Arrays; +import java.util.Random; + +import javax.crypto.Cipher; +import javax.crypto.SecretKey; +import javax.crypto.spec.SecretKeySpec; + +/* + * Simple test case to show that Cipher.doFinal(ByteBuffer, ByteBuffer) fails to + * process the data internally buffered inBB the cipher when input.remaining() + * == 0 and at least one buffer is a direct buffer. + */ +public class DirectBBRemaining { + + private static Random random = new SecureRandom(); + private static int testSizes = 40; + private static int outputFrequency = 5; + + public static void main(String args[]) throws Exception { + boolean failedOnce = false; + Exception failedReason = null; + + byte[] keyBytes = new byte[8]; + random.nextBytes(keyBytes); + SecretKey key = new SecretKeySpec(keyBytes, "DES"); + + Cipher cipher = Cipher.getInstance("DES/CBC/PKCS5Padding", "SunJCE"); + cipher.init(Cipher.ENCRYPT_MODE, key); + + /* + * Iterate through various sizes to make sure that the code does empty + * blocks, single partial blocks, 1 full block, full + partial blocks, + * multiple full blocks, etc. 5 blocks (using DES) is probably overkill + * but will feel more confident the fix isn't breaking anything. + */ + System.out.println("Output test results for every " + + outputFrequency + " tests..."); + + for (int size = 0; size <= testSizes; size++) { + boolean output = (size % outputFrequency) == 0; + if (output) { + System.out.print("\nTesting buffer size: " + size + ":"); + } + + int outSize = cipher.getOutputSize(size); + + try { + encrypt(cipher, size, + ByteBuffer.allocate(size), + ByteBuffer.allocate(outSize), + ByteBuffer.allocateDirect(size), + ByteBuffer.allocateDirect(outSize), + output); + } catch (Exception e) { + System.out.print("\n Failed with size " + size); + failedOnce = true; + failedReason = e; + + // If we got an exception, let's be safe for future + // testing and reset the cipher to a known good state. + cipher.init(Cipher.ENCRYPT_MODE, key); + } + } + if (failedOnce) { + throw failedReason; + } + System.out.println("\nTest Passed..."); + } + + private enum TestVariant { + + HEAP_HEAP, HEAP_DIRECT, DIRECT_HEAP, DIRECT_DIRECT + }; + + private static void encrypt(Cipher cipher, int size, + ByteBuffer heapIn, ByteBuffer heapOut, + ByteBuffer directIn, ByteBuffer directOut, + boolean output) throws Exception { + + ByteBuffer inBB = null; + ByteBuffer outBB = null; + + // Set up data and encrypt to known/expected values. + byte[] testdata = new byte[size]; + random.nextBytes(testdata); + byte[] expected = cipher.doFinal(testdata); + + for (TestVariant tv : TestVariant.values()) { + if (output) { + System.out.print(" " + tv); + } + + switch (tv) { + case HEAP_HEAP: + inBB = heapIn; + outBB = heapOut; + break; + case HEAP_DIRECT: + inBB = heapIn; + outBB = directOut; + break; + case DIRECT_HEAP: + inBB = directIn; + outBB = heapOut; + break; + case DIRECT_DIRECT: + inBB = directIn; + outBB = directOut; + break; + } + + inBB.clear(); + outBB.clear(); + + inBB.put(testdata); + inBB.flip(); + + // Process all data in one shot, but don't call doFinal() yet. + // May store up to n-1 bytes (w/block size n) internally. + cipher.update(inBB, outBB); + if (inBB.hasRemaining()) { + throw new Exception("buffer not empty"); + } + + // finish encryption and process all data buffered + cipher.doFinal(inBB, outBB); + outBB.flip(); + + // validate output size + if (outBB.remaining() != expected.length) { + throw new Exception( + "incomplete encryption output, expected " + + expected.length + " bytes but was only " + + outBB.remaining() + " bytes"); + } + + // validate output data + byte[] encrypted = new byte[outBB.remaining()]; + outBB.get(encrypted); + if (!Arrays.equals(expected, encrypted)) { + throw new Exception("bad encryption output"); + } + + if (!Arrays.equals(cipher.doFinal(), cipher.doFinal())) { + throw new Exception("Internal buffers still held data!"); + } + } + } +} From 7ddcb409b62118b1f7bfeb475edd840837092be2 Mon Sep 17 00:00:00 2001 From: Xue-Lei Andrew Fan Date: Fri, 10 Feb 2012 22:17:44 -0800 Subject: [PATCH 35/82] 7144781: incorrect URLs in JSSE java doc Reviewed-by: wetmore, skannan --- jdk/src/share/classes/javax/net/ssl/ExtendedSSLSession.java | 6 +++--- jdk/src/share/classes/javax/net/ssl/SSLParameters.java | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/jdk/src/share/classes/javax/net/ssl/ExtendedSSLSession.java b/jdk/src/share/classes/javax/net/ssl/ExtendedSSLSession.java index a9a5ed2968a..8afd963458d 100644 --- a/jdk/src/share/classes/javax/net/ssl/ExtendedSSLSession.java +++ b/jdk/src/share/classes/javax/net/ssl/ExtendedSSLSession.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -43,7 +43,7 @@ public abstract class ExtendedSSLSession implements SSLSession { * The signature algorithm name must be a standard Java Security * name (such as "SHA1withRSA", "SHA256withECDSA", and so on). * See Appendix A in the + * "{@docRoot}/../technotes/guides/security/crypto/CryptoSpec.html#AppA"> * Java Cryptography Architecture API Specification & Reference * for information about standard algorithm names. *

@@ -71,7 +71,7 @@ public abstract class ExtendedSSLSession implements SSLSession { * The signature algorithm name must be a standard Java Security * name (such as "SHA1withRSA", "SHA256withECDSA", and so on). * See Appendix A in the + * "{@docRoot}/../technotes/guides/security/crypto/CryptoSpec.html#AppA"> * Java Cryptography Architecture API Specification & Reference * for information about standard algorithm names. * diff --git a/jdk/src/share/classes/javax/net/ssl/SSLParameters.java b/jdk/src/share/classes/javax/net/ssl/SSLParameters.java index 4bb20a164eb..0cb5b7d424c 100644 --- a/jdk/src/share/classes/javax/net/ssl/SSLParameters.java +++ b/jdk/src/share/classes/javax/net/ssl/SSLParameters.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2012, 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 @@ -242,7 +242,7 @@ public class SSLParameters { * * @param algorithm The standard string name of the endpoint * identification algorithm (or null). See Appendix A in the + * "{@docRoot}/../technotes/guides/security/crypto/CryptoSpec.html#AppA"> * Java Cryptography Architecture API Specification & Reference * for information about standard algorithm names. * From cfe8581b9b20c8dbda9225d035ed78f831832f41 Mon Sep 17 00:00:00 2001 From: Chris Hegarty Date: Sun, 12 Feb 2012 08:47:36 +0000 Subject: [PATCH 36/82] 7133367: ResponseCache.put should not be called when setUseCaches(false) Reviewed-by: michaelm --- .../www/protocol/http/HttpURLConnection.java | 4 +- .../sun/net/www/protocol/http/NoCache.java | 85 +++++++++++++++++++ 2 files changed, 87 insertions(+), 2 deletions(-) create mode 100644 jdk/test/sun/net/www/protocol/http/NoCache.java diff --git a/jdk/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java b/jdk/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java index 719ddc46a74..50cecb0e079 100644 --- a/jdk/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java +++ b/jdk/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java @@ -270,7 +270,7 @@ public class HttpURLConnection extends java.net.HttpURLConnection { protected Proxy instProxy; private CookieHandler cookieHandler; - private ResponseCache cacheHandler; + private final ResponseCache cacheHandler; // the cached response, and cached response headers and body protected CacheResponse cachedResponse; @@ -1579,7 +1579,7 @@ public class HttpURLConnection extends java.net.HttpURLConnection { if (respCode == 200 || respCode == 203 || respCode == 206 || respCode == 300 || respCode == 301 || respCode == 410) { - if (cacheHandler != null) { + if (cacheHandler != null && getUseCaches()) { // give cache a chance to save response in cache URI uri = ParseUtil.toURI(url); if (uri != null) { diff --git a/jdk/test/sun/net/www/protocol/http/NoCache.java b/jdk/test/sun/net/www/protocol/http/NoCache.java new file mode 100644 index 00000000000..f452bc3d497 --- /dev/null +++ b/jdk/test/sun/net/www/protocol/http/NoCache.java @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2012, 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 7133367 + * @summary ResponseCache.put should not be called when setUseCaches(false) + */ + +import java.net.*; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import com.sun.net.httpserver.HttpExchange; +import com.sun.net.httpserver.HttpHandler; +import com.sun.net.httpserver.HttpServer; + +public class NoCache +{ + public static void main(String[] args) throws IOException { + ResponseCache.setDefault(new ThrowingCache()); + + HttpServer server = startHttpServer(); + try { + URL url = new URL("http://" + InetAddress.getLocalHost().getHostAddress() + + ":" + server.getAddress().getPort() + "/NoCache/"); + URLConnection uc = url.openConnection(); + uc.setUseCaches(false); + uc.getInputStream().close(); + } finally { + server.stop(0); + // clear the system-wide cache handler, samevm/agentvm mode + ResponseCache.setDefault(null); + } + } + + static class ThrowingCache extends ResponseCache { + @Override + public CacheResponse get(URI uri, String rqstMethod, + Map> rqstHeaders) { + throw new RuntimeException("ResponseCache.get should not be called"); + } + + @Override + public CacheRequest put(URI uri, URLConnection conn) { + throw new RuntimeException("ResponseCache.put should not be called"); + } + } + + // HTTP Server + static HttpServer startHttpServer() throws IOException { + HttpServer httpServer = HttpServer.create(new InetSocketAddress(0), 0); + httpServer.createContext("/NoCache/", new SimpleHandler()); + httpServer.start(); + return httpServer; + } + + static class SimpleHandler implements HttpHandler { + @Override + public void handle(HttpExchange t) throws IOException { + t.sendResponseHeaders(200, -1); + t.close(); + } + } +} From 6e1303417cff4faa5a64404ba1cb5d014f295358 Mon Sep 17 00:00:00 2001 From: Alan Bateman Date: Sun, 12 Feb 2012 21:09:09 +0000 Subject: [PATCH 37/82] 7144895: ProblemList.txt updates (2/2012) Reviewed-by: darcy, ohair --- jdk/test/Makefile | 4 +- jdk/test/ProblemList.txt | 158 +++++---------------------------------- jdk/test/TEST.ROOT | 6 ++ 3 files changed, 25 insertions(+), 143 deletions(-) diff --git a/jdk/test/Makefile b/jdk/test/Makefile index 75979ce82f1..9f443817469 100644 --- a/jdk/test/Makefile +++ b/jdk/test/Makefile @@ -517,14 +517,14 @@ jdk_nio1: $(call TestDirs, java/nio/file) JDK_ALL_TARGETS += jdk_nio2 JDK_DEFAULT_TARGETS += jdk_nio2 jdk_nio2: $(call TestDirs, java/nio/Buffer java/nio/ByteOrder \ - java/nio/channels java/nio/MappedByteBuffer) + java/nio/channels java/nio/MappedByteBuffer sun/nio/ch) $(call SharedLibraryPermissions,java/nio/channels) $(call RunAgentvmBatch) # Stable agentvm testruns (minus items from PROBLEM_LIST) JDK_ALL_TARGETS += jdk_nio3 JDK_DEFAULT_TARGETS += jdk_nio3 -jdk_nio3: $(call TestDirs, sun/nio) +jdk_nio3: $(call TestDirs, java/nio/charset sun/nio/cs) $(call RunAgentvmBatch) # All nio tests diff --git a/jdk/test/ProblemList.txt b/jdk/test/ProblemList.txt index 7e59e1d21ad..901ff09abb5 100644 --- a/jdk/test/ProblemList.txt +++ b/jdk/test/ProblemList.txt @@ -211,78 +211,9 @@ java/lang/management/MemoryMXBean/CollectionUsageThreshold.java generic-all # jdk_management -# Failing, bug was filed: 6959636 -javax/management/loading/LibraryLoader/LibraryLoaderTest.java generic-all - -# Access denied messages on windows/mks, filed 6954450 -sun/management/jmxremote/bootstrap/RmiSslNoKeyStoreTest.sh windows-all - -# Fails on linux: KO: StringMonitor notification missed or not emitted -javax/management/monitor/NonComparableAttributeValueTest.java generic-all - -# Port conflict? Fails with communication error -sun/management/jmxremote/bootstrap/PasswordFilePermissionTest.sh generic-all - -# Fails on Windows 2000, Test failed for iiop java.lang.NullPointerException -# at org.omg.stub.javax.management.remote.rmi._RMIConnectionImpl_Tie._invoke(Unknown Source) -# at com.sun.corba.se.impl.protocol.CorbaServerRequestDispatcherImpl.dispatchToServant(CorbaServerRequestDispatcherImpl.java:653) -javax/management/remote/mandatory/connection/ReconnectTest.java generic-all - -# Solaris 10 sparc, NPE from org.omg.stub.javax.management.remote.rmi._RMIConnectionImpl_Tie._invoke -javax/management/remote/mandatory/threads/ExecutorTest.java generic-all - -# Linux 32bit Fedora 9, IllegalStateException -javax/management/monitor/RuntimeExceptionTest.java generic-all - -# Problems with rmi connection, othervm -javax/management/remote/mandatory/subjectDelegation/SubjectDelegation2Test.java generic-all - -# Fails with port already in use -sun/management/jmxremote/bootstrap/SSLConfigFilePermissionTest.sh generic-all - -# Fails with port already in use -sun/management/jmxremote/bootstrap/RmiRegistrySslTest.sh generic-all - -# Windows, connection can't last that long -javax/management/eventService/LeaseTest.java generic-all - -# Linux othervm, X64, java.lang.Exception: Failed: ratio=102.4027795593753 -javax/management/remote/mandatory/notif/ListenerScaleTest.java generic-all - -# Windows run seems to have triggered a hotspot gc error (see 6801625) -com/sun/management/HotSpotDiagnosticMXBean/DumpHeap.sh generic-all - -# rmi problem? othervm, java.lang.reflect.UndeclaredThrowableException -javax/management/remote/mandatory/subjectDelegation/SubjectDelegation3Test.java generic-all - -# Linux Fedora 9 32bit NPE in rmi server somehere??? othervm -javax/management/remote/mandatory/notif/NotificationBufferDeadlockTest.java generic-all - -# Times out on solaris sparc, with othervm -javax/management/eventService/AddRemoveListenerTest.java generic-all - -# Linux i586 and x64 -server, timed out waiting for threads to expire? othervm -javax/management/eventService/EventClientThreadTest.java generic-all - -# Linux i586 -server, Expected to receive 20, but got 21, othervm -# Fails on Linux X64 -server 20!=21 -javax/management/eventService/FetchingTest.java generic-all - -# NPE on windows 2000 i586 -client and -server -javax/management/eventService/CustomForwarderTest.java windows-all - -# Windows i586 failure, callback did not complete -javax/management/eventService/LeaseManagerDeadlockTest.java windows-all - -# Port already in use -sun/management/jmxremote/bootstrap/LocalManagementTest.sh generic-all - -# Failed to initialize connector (also overflowing jtreg io buffers) -sun/management/jmxremote/bootstrap/RmiBootstrapTest.sh generic-all -sun/management/jmxremote/bootstrap/RmiSslBootstrapTest.sh generic-all - -# Windows X64, java.lang.IllegalStateException -javax/management/monitor/AttributeArbitraryDataTypeTest.java generic-all +# 7073626 +sun/management/jmxremote/bootstrap/RmiBootstrapTest.sh windows-all +sun/management/jmxremote/bootstrap/RmiSslBootstrapTest.sh windows-all ############################################################################ @@ -410,71 +341,11 @@ java/nio/channels/FileChannel/ReleaseOnCloseDeadlock.java windows-all # jdk_rmi -# Port already in use, fails on sparc, othervm -java/rmi/reliability/benchmark/runRmiBench.sh generic-all - -# Already in use port issues? othervm solaris -java/rmi/activation/rmidViaInheritedChannel/InheritedChannelNotServerSocket.java generic-all -java/rmi/activation/rmidViaInheritedChannel/RmidViaInheritedChannel.java generic-all - -java/rmi/transport/rapidExportUnexport/RapidExportUnexport.java generic-all -java/rmi/transport/dgcDeadLock/TestImpl_Stub.java generic-all - -# Address already in use, othervm mode, solaris -java/rmi/activation/Activatable/elucidateNoSuchMethod/ElucidateNoSuchMethod.java generic-all -java/rmi/activation/Activatable/forceLogSnapshot/ForceLogSnapshot.java generic-all - -# Registry already running on port, solaris -java/rmi/Naming/legalRegistryNames/LegalRegistryNames.java generic-all - -# Fails on Linux 32 and 64bit -server?, impl not garbage collected??? -java/rmi/transport/pinLastArguments/PinLastArguments.java generic-all - -# Times out on solaris sparc -java/rmi/server/RemoteServer/AddrInUse.java generic-all - -# Connection error on Windows i586 -server -# Also connection errors in othervm on Solaris 10 sparc, same port??? -sun/rmi/transport/tcp/DeadCachedConnection.java generic-all - -# Connection errors in othervm on Solaris 10 sparc, same port??? -java/rmi/activation/Activatable/checkActivateRef/CheckActivateRef.java generic-all -java/rmi/activation/Activatable/checkAnnotations/CheckAnnotations.java generic-all -java/rmi/activation/Activatable/checkImplClassLoader/CheckImplClassLoader.java generic-all -java/rmi/activation/Activatable/checkRegisterInLog/CheckRegisterInLog.java generic-all -java/rmi/activation/Activatable/createPrivateActivable/CreatePrivateActivatable.java generic-all -java/rmi/activation/Activatable/downloadParameterClass/DownloadParameterClass.java generic-all -java/rmi/activation/Activatable/extLoadedImpl/ext.sh generic-all -java/rmi/activation/Activatable/inactiveGroup/InactiveGroup.java generic-all -java/rmi/activation/Activatable/lookupActivationSystem/LookupActivationSystem.java generic-all -java/rmi/activation/Activatable/nestedActivate/NestedActivate.java generic-all -java/rmi/activation/Activatable/restartCrashedService/RestartCrashedService.java generic-all -java/rmi/activation/Activatable/restartLatecomer/RestartLatecomer.java generic-all -java/rmi/activation/Activatable/shutdownGracefully/ShutdownGracefully.java generic-all -java/rmi/activation/Activatable/unregisterInactive/UnregisterInactive.java generic-all -java/rmi/activation/ActivateFailedException/activateFails/ActivateFails.java generic-all -java/rmi/activation/ActivationGroup/downloadActivationGroup/DownloadActivationGroup.java generic-all -java/rmi/activation/ActivationSystem/activeGroup/IdempotentActiveGroup.java generic-all -java/rmi/reliability/juicer/AppleUserImpl.java generic-all -java/rmi/server/RMISocketFactory/useSocketFactory/unicast/UseCustomSocketFactory.java generic-all -java/rmi/server/UnicastRemoteObject/keepAliveDuringCall/KeepAliveDuringCall.java generic-all -java/rmi/transport/handshakeTimeout/HandshakeTimeout.java generic-all -java/rmi/activation/Activatable/restartService/RestartService.java generic-all -java/rmi/activation/ActivationSystem/modifyDescriptor/ModifyDescriptor.java generic-all -java/rmi/activation/ActivationSystem/stubClassesPermitted/StubClassesPermitted.java generic-all -java/rmi/activation/ActivationSystem/unregisterGroup/UnregisterGroup.java generic-all -java/rmi/activation/CommandEnvironment/SetChildEnv.java generic-all -java/rmi/registry/classPathCodebase/ClassPathCodebase.java generic-all -java/rmi/registry/reexport/Reexport.java generic-all +# 7140992 java/rmi/server/Unreferenced/finiteGCLatency/FiniteGCLatency.java generic-all -java/rmi/server/Unreferenced/leaseCheckInterval/LeaseCheckInterval.java generic-all -java/rmi/server/Unreferenced/unreferencedContext/UnreferencedContext.java generic-all -java/rmi/server/useCustomRef/UseCustomRef.java generic-all -java/rmi/transport/checkFQDN/CheckFQDN.java generic-all -java/rmi/transport/checkLeaseInfoLeak/CheckLeaseLeak.java generic-all -java/rmi/server/RMISocketFactory/useSocketFactory/activatable/UseCustomSocketFactory.java generic-all -java/rmi/server/RMISocketFactory/useSocketFactory/registry/UseCustomSocketFactory.java generic-all -java/rmi/server/UnicastRemoteObject/unexportObject/UnexportLeak.java generic-all + +# 6948101 +java/rmi/transport/pinLastArguments/PinLastArguments.java generic-all # 7132247 java/rmi/registry/readTest/readTest.sh windows-all @@ -557,6 +428,9 @@ java/text/Bidi/Bug6665028.java linux-x64 # jdk_tools +# 6461635 +com/sun/tools/attach/BasicTests.sh generic-all + # Filed 6952105 com/sun/jdi/SuspendThreadTest.java generic-all @@ -572,6 +446,9 @@ com/sun/jdi/FieldWatchpoints.java generic-all # Filed 6402201 com/sun/jdi/ProcessAttachTest.sh generic-all +# 7144833 +sun/tools/jcmd/jcmd-Defaults.sh generic-all + # Filed 6986875 sun/tools/jps/jps-Vvml.sh generic-all @@ -581,6 +458,10 @@ sun/tools/jconsole/ResourceCheckTest.sh generic-all # 7132203 sun/jvmstat/monitor/MonitoredVm/CR6672135.java generic-all +# Tests take too long +tools/pack200/CommandLineTests.java generic-all +tools/pack200/Pack200Test.java generic-all + ############################################################################ # jdk_util @@ -588,11 +469,6 @@ sun/jvmstat/monitor/MonitoredVm/CR6672135.java generic-all # Filed 6933803 java/util/concurrent/ThreadPoolExecutor/CoreThreadTimeOut.java generic-all -# Filed 7022325 -# Fails with assertion error on windows -# 11 separate stacktraces created... file reuse problem? -java/util/zip/ZipFile/ReadLongZipFileName.java generic-all - # Filed 6772009 java/util/concurrent/locks/ReentrantLock/CancelledLockLoops.java generic-all diff --git a/jdk/test/TEST.ROOT b/jdk/test/TEST.ROOT index 6512c34009f..8aa398f60bb 100644 --- a/jdk/test/TEST.ROOT +++ b/jdk/test/TEST.ROOT @@ -4,3 +4,9 @@ # The list of keywords supported in the entire test suite keys=2d dnd i18n + +# Tests that must run in othervm mode +othervm.dirs=java/rmi sun/rmi javax/management + +# Tests that cannot run concurrently +exclusiveAccess.dirs=java/rmi sun/rmi sun/management/jmxremote sun/tools/jstatd From e565fbba32126091b5a79df474838170e5ffdc9a Mon Sep 17 00:00:00 2001 From: Poonam Bajaj Date: Sun, 12 Feb 2012 19:33:11 -0800 Subject: [PATCH 38/82] 7009098: SA cannot open core files larger than 2GB on Linux 32-bit Added Large File Support by compiling libsaproc.so with -D_FILE_OFFSET_BITS=64, and a small change with which SA should first load libraries from the path specified with SA_ALTROOT. Reviewed-by: dholmes, kevinw, dcubed, minqi --- hotspot/agent/src/os/linux/Makefile | 4 ++-- hotspot/agent/src/os/linux/libproc_impl.c | 11 ++++++----- hotspot/make/linux/makefiles/saproc.make | 3 ++- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/hotspot/agent/src/os/linux/Makefile b/hotspot/agent/src/os/linux/Makefile index cd9d9c1171d..b79effe952c 100644 --- a/hotspot/agent/src/os/linux/Makefile +++ b/hotspot/agent/src/os/linux/Makefile @@ -1,5 +1,5 @@ # -# Copyright (c) 2002, 2009, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -40,7 +40,7 @@ OBJS = $(SOURCES:.c=.o) LIBS = -lthread_db -CFLAGS = -c -fPIC -g -D_GNU_SOURCE -D$(ARCH) $(INCLUDES) +CFLAGS = -c -fPIC -g -D_GNU_SOURCE -D$(ARCH) $(INCLUDES) -D_FILE_OFFSET_BITS=64 LIBSA = $(ARCH)/libsaproc.so diff --git a/hotspot/agent/src/os/linux/libproc_impl.c b/hotspot/agent/src/os/linux/libproc_impl.c index 971a8283519..6ac43acc8e3 100644 --- a/hotspot/agent/src/os/linux/libproc_impl.c +++ b/hotspot/agent/src/os/linux/libproc_impl.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2012, 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 @@ -50,10 +50,6 @@ int pathmap_open(const char* name) { char alt_path[PATH_MAX + 1]; init_alt_root(); - fd = open(name, O_RDONLY); - if (fd >= 0) { - return fd; - } if (alt_root_len > 0) { strcpy(alt_path, alt_root); @@ -73,6 +69,11 @@ int pathmap_open(const char* name) { return fd; } } + } else { + fd = open(name, O_RDONLY); + if (fd >= 0) { + return fd; + } } return -1; diff --git a/hotspot/make/linux/makefiles/saproc.make b/hotspot/make/linux/makefiles/saproc.make index 4bca4538f9b..36a06aeae08 100644 --- a/hotspot/make/linux/makefiles/saproc.make +++ b/hotspot/make/linux/makefiles/saproc.make @@ -1,5 +1,5 @@ # -# Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -75,6 +75,7 @@ $(LIBSAPROC): $(SASRCFILES) $(SAMAPFILE) fi @echo Making SA debugger back-end... $(QUIETLY) $(CC) -D$(BUILDARCH) -D_GNU_SOURCE \ + -D_FILE_OFFSET_BITS=64 \ $(SYMFLAG) $(ARCHFLAG) $(SHARED_FLAG) $(PICFLAG) \ -I$(SASRCDIR) \ -I$(GENERATED) \ From 7abee00e9754ce45b8586ecc31bd40e7be24f86a Mon Sep 17 00:00:00 2001 From: Mani Sarkar Date: Sun, 12 Feb 2012 21:56:24 -0800 Subject: [PATCH 39/82] 7143230: fix warnings in java.util.jar, sun.tools.jar, zipfs demo, etc Co-authored-by: Michael Barker Co-authored-by: Carl Jokl Co-authored-by: Dinuk Weerasinghe Co-authored-by: Markus Stoy Co-authored-by: Tom Anderson Reviewed-by: alanb, chegar, lancea, smarks --- .../classes/java/util/jar/Attributes.java | 14 +-- .../classes/java/util/jar/JarVerifier.java | 117 +++++++++--------- .../classes/sun/tools/jar/CommandLine.java | 8 +- .../share/classes/sun/tools/jar/Manifest.java | 14 +-- .../classes/sun/tools/jar/SignatureFile.java | 26 ++-- .../MemoryMonitor/MemoryMonitor.java | 14 +-- .../src/com/sun/nio/zipfs/ZipFileStore.java | 2 +- .../src/com/sun/nio/zipfs/ZipFileSystem.java | 4 +- .../sun/nio/zipfs/ZipFileSystemProvider.java | 2 +- .../zipfs/src/com/sun/nio/zipfs/ZipInfo.java | 4 +- 10 files changed, 102 insertions(+), 103 deletions(-) diff --git a/jdk/src/share/classes/java/util/jar/Attributes.java b/jdk/src/share/classes/java/util/jar/Attributes.java index e09071172b6..1eb28d41678 100644 --- a/jdk/src/share/classes/java/util/jar/Attributes.java +++ b/jdk/src/share/classes/java/util/jar/Attributes.java @@ -71,7 +71,7 @@ public class Attributes implements Map, Cloneable { * @param size the initial number of attributes */ public Attributes(int size) { - map = new HashMap(size); + map = new HashMap<>(size); } /** @@ -81,7 +81,7 @@ public class Attributes implements Map, Cloneable { * @param attr the specified Attributes */ public Attributes(Attributes attr) { - map = new HashMap(attr); + map = new HashMap<>(attr); } @@ -296,9 +296,9 @@ public class Attributes implements Map, Cloneable { * XXX Need to handle UTF8 values and break up lines longer than 72 bytes */ void write(DataOutputStream os) throws IOException { - Iterator it = entrySet().iterator(); + Iterator> it = entrySet().iterator(); while (it.hasNext()) { - Map.Entry e = (Map.Entry)it.next(); + Map.Entry e = it.next(); StringBuffer buffer = new StringBuffer( ((Name)e.getKey()).toString()); buffer.append(": "); @@ -340,9 +340,9 @@ public class Attributes implements Map, Cloneable { // write out all attributes except for the version // we wrote out earlier - Iterator it = entrySet().iterator(); + Iterator> it = entrySet().iterator(); while (it.hasNext()) { - Map.Entry e = (Map.Entry)it.next(); + Map.Entry e = it.next(); String name = ((Name)e.getKey()).toString(); if ((version != null) && ! (name.equalsIgnoreCase(vername))) { @@ -499,7 +499,7 @@ public class Attributes implements Map, Cloneable { */ public boolean equals(Object o) { if (o instanceof Name) { - Comparator c = ASCIICaseInsensitiveComparator.CASE_INSENSITIVE_ORDER; + Comparator c = ASCIICaseInsensitiveComparator.CASE_INSENSITIVE_ORDER; return c.compare(name, ((Name)o).name) == 0; } else { return false; diff --git a/jdk/src/share/classes/java/util/jar/JarVerifier.java b/jdk/src/share/classes/java/util/jar/JarVerifier.java index 6a9a8b55667..5c80d5013db 100644 --- a/jdk/src/share/classes/java/util/jar/JarVerifier.java +++ b/jdk/src/share/classes/java/util/jar/JarVerifier.java @@ -48,21 +48,21 @@ class JarVerifier { /* a table mapping names to code signers, for jar entries that have had their actual hashes verified */ - private Hashtable verifiedSigners; + private Hashtable verifiedSigners; /* a table mapping names to code signers, for jar entries that have passed the .SF/.DSA/.EC -> MANIFEST check */ - private Hashtable sigFileSigners; + private Hashtable sigFileSigners; /* a hash table to hold .SF bytes */ - private Hashtable sigFileData; + private Hashtable sigFileData; /** "queue" of pending PKCS7 blocks that we couldn't parse * until we parsed the .SF file */ - private ArrayList pendingBlocks; + private ArrayList pendingBlocks; /* cache of CodeSigner objects */ - private ArrayList signerCache; + private ArrayList signerCache; /* Are we parsing a block? */ private boolean parsingBlockOrSF = false; @@ -94,10 +94,10 @@ class JarVerifier { public JarVerifier(byte rawBytes[]) { manifestRawBytes = rawBytes; - sigFileSigners = new Hashtable(); - verifiedSigners = new Hashtable(); - sigFileData = new Hashtable(11); - pendingBlocks = new ArrayList(); + sigFileSigners = new Hashtable<>(); + verifiedSigners = new Hashtable<>(); + sigFileData = new Hashtable<>(11); + pendingBlocks = new ArrayList<>(); baos = new ByteArrayOutputStream(); manifestDigests = new ArrayList<>(); } @@ -248,10 +248,9 @@ class JarVerifier { sigFileData.put(key, bytes); // check pending blocks, we can now process // anyone waiting for this .SF file - Iterator it = pendingBlocks.iterator(); + Iterator it = pendingBlocks.iterator(); while (it.hasNext()) { - SignatureFileVerifier sfv = - (SignatureFileVerifier) it.next(); + SignatureFileVerifier sfv = it.next(); if (sfv.needSignatureFile(key)) { if (debug != null) { debug.println( @@ -270,7 +269,7 @@ class JarVerifier { String key = uname.substring(0, uname.lastIndexOf(".")); if (signerCache == null) - signerCache = new ArrayList(); + signerCache = new ArrayList<>(); if (manDig == null) { synchronized(manifestRawBytes) { @@ -287,7 +286,7 @@ class JarVerifier { if (sfv.needSignatureFileBytes()) { // see if we have already parsed an external .SF file - byte[] bytes = (byte[]) sigFileData.get(key); + byte[] bytes = sigFileData.get(key); if (bytes == null) { // put this block on queue for later processing @@ -343,7 +342,7 @@ class JarVerifier { */ public CodeSigner[] getCodeSigners(String name) { - return (CodeSigner[])verifiedSigners.get(name); + return verifiedSigners.get(name); } public CodeSigner[] getCodeSigners(JarFile jar, JarEntry entry) @@ -376,15 +375,14 @@ class JarVerifier { CodeSigner[] signers) { if (signers != null) { - ArrayList certChains = new ArrayList(); + ArrayList certChains = new ArrayList<>(); for (int i = 0; i < signers.length; i++) { certChains.addAll( signers[i].getSignerCertPath().getCertificates()); } // Convert into a Certificate[] - return (java.security.cert.Certificate[]) - certChains.toArray( + return certChains.toArray( new java.security.cert.Certificate[certChains.size()]); } return null; @@ -418,8 +416,8 @@ class JarVerifier { // MANIFEST.MF is always treated as signed and verified, // move its signers from sigFileSigners to verifiedSigners. if (sigFileSigners.containsKey(JarFile.MANIFEST_NAME)) { - verifiedSigners.put(JarFile.MANIFEST_NAME, - sigFileSigners.remove(JarFile.MANIFEST_NAME)); + CodeSigner[] codeSigners = sigFileSigners.remove(JarFile.MANIFEST_NAME); + verifiedSigners.put(JarFile.MANIFEST_NAME, codeSigners); } } @@ -493,10 +491,10 @@ class JarVerifier { // Extended JavaUtilJarAccess CodeSource API Support - private Map urlToCodeSourceMap = new HashMap(); - private Map signerToCodeSource = new HashMap(); + private Map> urlToCodeSourceMap = new HashMap<>(); + private Map signerToCodeSource = new HashMap<>(); private URL lastURL; - private Map lastURLMap; + private Map lastURLMap; /* * Create a unique mapping from codeSigner cache entries to CodeSource. @@ -504,19 +502,19 @@ class JarVerifier { * and shared JAR file although in practice there will be a single URL in use. */ private synchronized CodeSource mapSignersToCodeSource(URL url, CodeSigner[] signers) { - Map map; + Map map; if (url == lastURL) { map = lastURLMap; } else { - map = (Map) urlToCodeSourceMap.get(url); + map = urlToCodeSourceMap.get(url); if (map == null) { - map = new HashMap(); + map = new HashMap<>(); urlToCodeSourceMap.put(url, map); } lastURLMap = map; lastURL = url; } - CodeSource cs = (CodeSource) map.get(signers); + CodeSource cs = map.get(signers); if (cs == null) { cs = new VerifierCodeSource(csdomain, url, signers); signerToCodeSource.put(signers, cs); @@ -524,16 +522,16 @@ class JarVerifier { return cs; } - private CodeSource[] mapSignersToCodeSources(URL url, List signers, boolean unsigned) { - List sources = new ArrayList(); + private CodeSource[] mapSignersToCodeSources(URL url, List signers, boolean unsigned) { + List sources = new ArrayList<>(); for (int i = 0; i < signers.size(); i++) { - sources.add(mapSignersToCodeSource(url, (CodeSigner[]) signers.get(i))); + sources.add(mapSignersToCodeSource(url, signers.get(i))); } if (unsigned) { sources.add(mapSignersToCodeSource(url, null)); } - return (CodeSource[]) sources.toArray(new CodeSource[sources.size()]); + return sources.toArray(new CodeSource[sources.size()]); } private CodeSigner[] emptySigner = new CodeSigner[0]; @@ -553,7 +551,7 @@ class JarVerifier { * but this handles a CodeSource of any type, just in case. */ CodeSource[] sources = mapSignersToCodeSources(cs.getLocation(), getJarCodeSigners(), true); - List sourceList = new ArrayList(); + List sourceList = new ArrayList<>(); for (int i = 0; i < sources.length; i++) { sourceList.add(sources[i]); } @@ -574,6 +572,7 @@ class JarVerifier { * signing data that can be compared by object reference identity. */ private static class VerifierCodeSource extends CodeSource { + private static final long serialVersionUID = -9047366145967768825L; URL vlocation; CodeSigner[] vsigners; @@ -641,16 +640,16 @@ class JarVerifier { return vcerts; } } - private Map signerMap; + private Map signerMap; - private synchronized Map signerMap() { + private synchronized Map signerMap() { if (signerMap == null) { /* * Snapshot signer state so it doesn't change on us. We care * only about the asserted signatures. Verification of * signature validity happens via the JarEntry apis. */ - signerMap = new HashMap(verifiedSigners.size() + sigFileSigners.size()); + signerMap = new HashMap<>(verifiedSigners.size() + sigFileSigners.size()); signerMap.putAll(verifiedSigners); signerMap.putAll(sigFileSigners); } @@ -658,15 +657,15 @@ class JarVerifier { } public synchronized Enumeration entryNames(JarFile jar, final CodeSource[] cs) { - final Map map = signerMap(); - final Iterator itor = map.entrySet().iterator(); + final Map map = signerMap(); + final Iterator> itor = map.entrySet().iterator(); boolean matchUnsigned = false; /* * Grab a single copy of the CodeSigner arrays. Check * to see if we can optimize CodeSigner equality test. */ - List req = new ArrayList(cs.length); + List req = new ArrayList<>(cs.length); for (int i = 0; i < cs.length; i++) { CodeSigner[] match = findMatchingSigners(cs[i]); if (match != null) { @@ -678,8 +677,8 @@ class JarVerifier { } } - final List signersReq = req; - final Enumeration enum2 = (matchUnsigned) ? unsignedEntryNames(jar) : emptyEnumeration; + final List signersReq = req; + final Enumeration enum2 = (matchUnsigned) ? unsignedEntryNames(jar) : emptyEnumeration; return new Enumeration() { @@ -691,14 +690,14 @@ class JarVerifier { } while (itor.hasNext()) { - Map.Entry e = (Map.Entry) itor.next(); - if (signersReq.contains((CodeSigner[]) e.getValue())) { - name = (String) e.getKey(); + Map.Entry e = itor.next(); + if (signersReq.contains(e.getValue())) { + name = e.getKey(); return true; } } while (enum2.hasMoreElements()) { - name = (String) enum2.nextElement(); + name = enum2.nextElement(); return true; } return false; @@ -719,13 +718,13 @@ class JarVerifier { * Like entries() but screens out internal JAR mechanism entries * and includes signed entries with no ZIP data. */ - public Enumeration entries2(final JarFile jar, Enumeration e) { - final Map map = new HashMap(); + public Enumeration entries2(final JarFile jar, Enumeration e) { + final Map map = new HashMap<>(); map.putAll(signerMap()); - final Enumeration enum_ = e; + final Enumeration enum_ = e; return new Enumeration() { - Enumeration signers = null; + Enumeration signers = null; JarEntry entry; public boolean hasMoreElements() { @@ -733,7 +732,7 @@ class JarVerifier { return true; } while (enum_.hasMoreElements()) { - ZipEntry ze = (ZipEntry) enum_.nextElement(); + ZipEntry ze = enum_.nextElement(); if (JarVerifier.isSigningRelated(ze.getName())) { continue; } @@ -744,7 +743,7 @@ class JarVerifier { signers = Collections.enumeration(map.keySet()); } while (signers.hasMoreElements()) { - String name = (String) signers.nextElement(); + String name = signers.nextElement(); entry = jar.newEntry(new ZipEntry(name)); return true; } @@ -764,7 +763,7 @@ class JarVerifier { } }; } - private Enumeration emptyEnumeration = new Enumeration() { + private Enumeration emptyEnumeration = new Enumeration() { public boolean hasMoreElements() { return false; @@ -797,8 +796,8 @@ class JarVerifier { } private Enumeration unsignedEntryNames(JarFile jar) { - final Map map = signerMap(); - final Enumeration entries = jar.entries(); + final Map map = signerMap(); + final Enumeration entries = jar.entries(); return new Enumeration() { String name; @@ -813,7 +812,7 @@ class JarVerifier { } while (entries.hasMoreElements()) { String value; - ZipEntry e = (ZipEntry) entries.nextElement(); + ZipEntry e = entries.nextElement(); value = e.getName(); if (e.isDirectory() || isSigningRelated(value)) { continue; @@ -836,14 +835,14 @@ class JarVerifier { } }; } - private List jarCodeSigners; + private List jarCodeSigners; - private synchronized List getJarCodeSigners() { + private synchronized List getJarCodeSigners() { CodeSigner[] signers; if (jarCodeSigners == null) { - HashSet set = new HashSet(); + HashSet set = new HashSet<>(); set.addAll(signerMap().values()); - jarCodeSigners = new ArrayList(); + jarCodeSigners = new ArrayList<>(); jarCodeSigners.addAll(set); } return jarCodeSigners; @@ -858,7 +857,7 @@ class JarVerifier { public CodeSource getCodeSource(URL url, String name) { CodeSigner[] signers; - signers = (CodeSigner[]) signerMap().get(name); + signers = signerMap().get(name); return mapSignersToCodeSource(url, signers); } diff --git a/jdk/src/share/classes/sun/tools/jar/CommandLine.java b/jdk/src/share/classes/sun/tools/jar/CommandLine.java index acb13082f7b..b9ddeb84b54 100644 --- a/jdk/src/share/classes/sun/tools/jar/CommandLine.java +++ b/jdk/src/share/classes/sun/tools/jar/CommandLine.java @@ -55,7 +55,7 @@ public class CommandLine { public static String[] parse(String[] args) throws IOException { - ArrayList newArgs = new ArrayList(args.length); + List newArgs = new ArrayList<>(args.length); for (int i = 0; i < args.length; i++) { String arg = args[i]; if (arg.length() > 1 && arg.charAt(0) == '@') { @@ -69,10 +69,10 @@ public class CommandLine { newArgs.add(arg); } } - return (String[])newArgs.toArray(new String[newArgs.size()]); + return newArgs.toArray(new String[newArgs.size()]); } - private static void loadCmdFile(String name, List args) + private static void loadCmdFile(String name, List args) throws IOException { Reader r = new BufferedReader(new FileReader(name)); @@ -83,7 +83,7 @@ public class CommandLine { st.commentChar('#'); st.quoteChar('"'); st.quoteChar('\''); - while (st.nextToken() != st.TT_EOF) { + while (st.nextToken() != StreamTokenizer.TT_EOF) { args.add(st.sval); } r.close(); diff --git a/jdk/src/share/classes/sun/tools/jar/Manifest.java b/jdk/src/share/classes/sun/tools/jar/Manifest.java index 370c9edb6b0..b49d1e8eda0 100644 --- a/jdk/src/share/classes/sun/tools/jar/Manifest.java +++ b/jdk/src/share/classes/sun/tools/jar/Manifest.java @@ -47,10 +47,10 @@ public class Manifest { /* list of headers that all pertain to a particular * file in the archive */ - private Vector entries = new Vector(); + private Vector entries = new Vector<>(); private byte[] tmpbuf = new byte[512]; /* a hashtable of entries, for fast lookup */ - private Hashtable tableEntries = new Hashtable(); + private Hashtable tableEntries = new Hashtable<>(); static final String[] hashes = {"SHA"}; static final byte[] EOL = {(byte)'\r', (byte)'\n'}; @@ -115,14 +115,14 @@ public class Manifest { } public MessageHeader getEntry(String name) { - return (MessageHeader) tableEntries.get(name); + return tableEntries.get(name); } public MessageHeader entryAt(int i) { - return (MessageHeader) entries.elementAt(i); + return entries.elementAt(i); } - public Enumeration entries() { + public Enumeration entries() { return entries.elements(); } @@ -214,7 +214,7 @@ public class Manifest { /* the first header in the file should be the global one. * It should say "Manifest-Version: x.x"; if not add it */ - MessageHeader globals = (MessageHeader) entries.elementAt(0); + MessageHeader globals = entries.elementAt(0); if (globals.findValue("Manifest-Version") == null) { /* Assume this is a user-defined manifest. If it has a Name: <..> @@ -238,7 +238,7 @@ public class Manifest { globals.print(ps); for (int i = 1; i < entries.size(); ++i) { - MessageHeader mh = (MessageHeader) entries.elementAt(i); + MessageHeader mh = entries.elementAt(i); mh.print(ps); } } diff --git a/jdk/src/share/classes/sun/tools/jar/SignatureFile.java b/jdk/src/share/classes/sun/tools/jar/SignatureFile.java index 0ce8951b60a..fd67ce195d4 100644 --- a/jdk/src/share/classes/sun/tools/jar/SignatureFile.java +++ b/jdk/src/share/classes/sun/tools/jar/SignatureFile.java @@ -47,7 +47,7 @@ import sun.security.x509.AlgorithmId; * *

Each entry section contains the name of an entry (which must * have a counterpart in the manifest). Like the manifest it contains - * a hash, the hash of the manifest section correspondind to the + * a hash, the hash of the manifest section corresponding to the * name. Since the manifest entry contains the hash of the data, this * is equivalent to a signature of the data, plus the attributes of * the manifest entry. @@ -66,7 +66,7 @@ public class SignatureFile { /* list of headers that all pertain to a particular file in the * archive */ - private Vector entries = new Vector(); + private Vector entries = new Vector<>(); /* Right now we only support SHA hashes */ static final String[] hashes = {"SHA"}; @@ -98,7 +98,7 @@ public class SignatureFile { * character in length. */ private SignatureFile(String name) throws JarException { - entries = new Vector(); + entries = new Vector<>(); if (name != null) { if (name.length() > 8 || name.indexOf('.') != -1) { @@ -142,9 +142,9 @@ public class SignatureFile { this(name, true); this.manifest = manifest; - Enumeration enum_ = manifest.entries(); + Enumeration enum_ = manifest.entries(); while (enum_.hasMoreElements()) { - MessageHeader mh = (MessageHeader)enum_.nextElement(); + MessageHeader mh = enum_.nextElement(); String entryName = mh.findValue("Name"); if (entryName != null) { add(entryName); @@ -269,9 +269,9 @@ public class SignatureFile { *the entry does not exist. */ public MessageHeader getEntry(String name) { - Enumeration enum_ = entries(); + Enumeration enum_ = entries(); while(enum_.hasMoreElements()) { - MessageHeader mh = (MessageHeader)enum_.nextElement(); + MessageHeader mh = enum_.nextElement(); if (name.equals(mh.findValue("Name"))) { return mh; } @@ -282,13 +282,13 @@ public class SignatureFile { /** * Returns the n-th entry. The global header is a entry 0. */ public MessageHeader entryAt(int n) { - return (MessageHeader) entries.elementAt(n); + return entries.elementAt(n); } /** * Returns an enumeration of the entries. */ - public Enumeration entries() { + public Enumeration entries() { return entries.elements(); } @@ -322,11 +322,11 @@ public class SignatureFile { } } - private Hashtable digests = new Hashtable(); + private Hashtable digests = new Hashtable<>(); private MessageDigest getDigest(String algorithm) throws NoSuchAlgorithmException { - MessageDigest dig = (MessageDigest)digests.get(algorithm); + MessageDigest dig = digests.get(algorithm); if (dig == null) { dig = MessageDigest.getInstance(algorithm); digests.put(algorithm, dig); @@ -344,7 +344,7 @@ public class SignatureFile { /* the first header in the file should be the global one. * It should say "SignatureFile-Version: x.x"; barf if not */ - MessageHeader globals = (MessageHeader) entries.elementAt(0); + MessageHeader globals = entries.elementAt(0); if (globals.findValue("Signature-Version") == null) { throw new JarException("Signature file requires " + "Signature-Version: 1.0 in 1st header"); @@ -354,7 +354,7 @@ public class SignatureFile { globals.print(ps); for (int i = 1; i < entries.size(); ++i) { - MessageHeader mh = (MessageHeader) entries.elementAt(i); + MessageHeader mh = entries.elementAt(i); mh.print(ps); } } diff --git a/jdk/src/share/demo/management/MemoryMonitor/MemoryMonitor.java b/jdk/src/share/demo/management/MemoryMonitor/MemoryMonitor.java index 717e34b13cf..ca6ab6e410f 100644 --- a/jdk/src/share/demo/management/MemoryMonitor/MemoryMonitor.java +++ b/jdk/src/share/demo/management/MemoryMonitor/MemoryMonitor.java @@ -213,10 +213,10 @@ public class MemoryMonitor extends JPanel { // Calculate remaining size float ssH = ascent + descent; - float remainingHeight = (float) (y2 - (ssH*2) - 0.5f); + float remainingHeight = y2 - (ssH*2) - 0.5f; float blockHeight = remainingHeight/10; float blockWidth = 20.0f; - float remainingWidth = (float) (x2 - blockWidth - 10); + float remainingWidth = x2 - blockWidth - 10; // .. Memory Free .. big.setColor(mfColor); @@ -224,7 +224,7 @@ public class MemoryMonitor extends JPanel { int i = 0; for ( ; i < MemUsage ; i++) { mfRect.setRect(x1+5,(float) y1+ssH+i*blockHeight, - blockWidth,(float) blockHeight-1); + blockWidth, blockHeight-1); big.fill(mfRect); } @@ -232,13 +232,13 @@ public class MemoryMonitor extends JPanel { big.setColor(Color.green); for ( ; i < 10; i++) { muRect.setRect(x1+5,(float) y1 + ssH+i*blockHeight, - blockWidth,(float) blockHeight-1); + blockWidth, blockHeight-1); big.fill(muRect); } // .. Draw History Graph .. if (remainingWidth <= 30) remainingWidth = (float)30; - if (remainingHeight <= ssH) remainingHeight = (float)ssH; + if (remainingHeight <= ssH) remainingHeight = ssH; big.setColor(graphColor); int graphX = x1+30; int graphY = y1 + (int) ssH; @@ -347,8 +347,8 @@ public class MemoryMonitor extends JPanel { big = bimg.createGraphics(); big.setFont(font); FontMetrics fm = big.getFontMetrics(font); - ascent = (int) fm.getAscent(); - descent = (int) fm.getDescent(); + ascent = fm.getAscent(); + descent = fm.getDescent(); } repaint(); try { diff --git a/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileStore.java b/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileStore.java index 996f7cc0ef9..5f79218631c 100644 --- a/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileStore.java +++ b/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileStore.java @@ -61,7 +61,7 @@ public class ZipFileStore extends FileStore { private final ZipFileSystem zfs; ZipFileStore(ZipPath zpath) { - this.zfs = (ZipFileSystem)zpath.getFileSystem(); + this.zfs = zpath.getFileSystem(); } @Override diff --git a/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystem.java b/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystem.java index d09da8e6dd9..d68388a97f3 100644 --- a/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystem.java +++ b/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystem.java @@ -1609,7 +1609,7 @@ public class ZipFileSystem extends FileSystem { synchronized (inflaters) { int size = inflaters.size(); if (size > 0) { - Inflater inf = (Inflater)inflaters.remove(size - 1); + Inflater inf = inflaters.remove(size - 1); return inf; } else { return new Inflater(true); @@ -1638,7 +1638,7 @@ public class ZipFileSystem extends FileSystem { synchronized (deflaters) { int size = deflaters.size(); if (size > 0) { - Deflater def = (Deflater)deflaters.remove(size - 1); + Deflater def = deflaters.remove(size - 1); return def; } else { return new Deflater(Deflater.DEFAULT_COMPRESSION, true); diff --git a/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystemProvider.java b/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystemProvider.java index 49d9ee7b908..49bb826e003 100644 --- a/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystemProvider.java +++ b/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystemProvider.java @@ -211,7 +211,7 @@ public class ZipFileSystemProvider extends FileSystemProvider { public V getFileAttributeView(Path path, Class type, LinkOption... options) { - return (V)ZipFileAttributeView.get(toZipPath(path), type); + return ZipFileAttributeView.get(toZipPath(path), type); } @Override diff --git a/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipInfo.java b/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipInfo.java index 71274e2a111..a869d3af50c 100644 --- a/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipInfo.java +++ b/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipInfo.java @@ -78,12 +78,12 @@ public class ZipInfo { // twice long len = LOCHDR + CENNAM(cen, pos) + CENEXT(cen, pos) + CENHDR; if (zfs.readFullyAt(buf, 0, len, locoff(cen, pos)) != len) - zfs.zerror("read loc header failed"); + ZipFileSystem.zerror("read loc header failed"); if (LOCEXT(buf) > CENEXT(cen, pos) + CENHDR) { // have to read the second time; len = LOCHDR + LOCNAM(buf) + LOCEXT(buf); if (zfs.readFullyAt(buf, 0, len, locoff(cen, pos)) != len) - zfs.zerror("read loc header failed"); + ZipFileSystem.zerror("read loc header failed"); } printLOC(buf); pos += CENHDR + CENNAM(cen, pos) + CENEXT(cen, pos) + CENCOM(cen, pos); From 425b53e0624959e7c99c8d26aed0b6a45f71c934 Mon Sep 17 00:00:00 2001 From: Christian Thalinger Date: Mon, 13 Feb 2012 02:29:22 -0800 Subject: [PATCH 40/82] 7141329: Strange values of stack_size in -XX:+TraceMethodHandles output Reviewed-by: kvn, never --- hotspot/src/cpu/x86/vm/methodHandles_x86.cpp | 66 ++++++-------------- 1 file changed, 19 insertions(+), 47 deletions(-) diff --git a/hotspot/src/cpu/x86/vm/methodHandles_x86.cpp b/hotspot/src/cpu/x86/vm/methodHandles_x86.cpp index 55f0eb0ee9e..60c4b0196d7 100644 --- a/hotspot/src/cpu/x86/vm/methodHandles_x86.cpp +++ b/hotspot/src/cpu/x86/vm/methodHandles_x86.cpp @@ -1018,41 +1018,26 @@ extern "C" void print_method_handle(oop mh); void trace_method_handle_stub(const char* adaptername, oop mh, intptr_t* saved_regs, - intptr_t* entry_sp, - intptr_t* saved_sp, - intptr_t* saved_bp) { + intptr_t* entry_sp) { // called as a leaf from native code: do not block the JVM! bool has_mh = (strstr(adaptername, "return/") == NULL); // return adapters don't have rcx_mh + const char* mh_reg_name = has_mh ? "rcx_mh" : "rcx"; + tty->print_cr("MH %s %s="PTR_FORMAT" sp="PTR_FORMAT, adaptername, mh_reg_name, mh, entry_sp); - intptr_t* last_sp = (intptr_t*) saved_bp[frame::interpreter_frame_last_sp_offset]; - intptr_t* base_sp = last_sp; - typedef MethodHandles::RicochetFrame RicochetFrame; - RicochetFrame* rfp = (RicochetFrame*)((address)saved_bp - RicochetFrame::sender_link_offset_in_bytes()); - if (Universe::heap()->is_in((address) rfp->saved_args_base())) { - // Probably an interpreter frame. - base_sp = (intptr_t*) saved_bp[frame::interpreter_frame_monitor_block_top_offset]; - } - intptr_t mh_reg = (intptr_t)mh; - const char* mh_reg_name = "rcx_mh"; - if (!has_mh) mh_reg_name = "rcx"; - tty->print_cr("MH %s %s="PTR_FORMAT" sp=("PTR_FORMAT"+"INTX_FORMAT") stack_size="INTX_FORMAT" bp="PTR_FORMAT, - adaptername, mh_reg_name, mh_reg, - (intptr_t)entry_sp, (intptr_t)(saved_sp - entry_sp), (intptr_t)(base_sp - last_sp), (intptr_t)saved_bp); if (Verbose) { - tty->print(" reg dump: "); - int saved_regs_count = (entry_sp-1) - saved_regs; - // 32 bit: rdi rsi rbp rsp; rbx rdx rcx (*) rax - int i; - for (i = 0; i <= saved_regs_count; i++) { - if (i > 0 && i % 4 == 0 && i != saved_regs_count) { + tty->print_cr("Registers:"); + const int saved_regs_count = RegisterImpl::number_of_registers; + for (int i = 0; i < saved_regs_count; i++) { + Register r = as_Register(i); + // The registers are stored in reverse order on the stack (by pusha). + tty->print("%3s=" PTR_FORMAT, r->name(), saved_regs[((saved_regs_count - 1) - i)]); + if ((i + 1) % 4 == 0) { tty->cr(); - tty->print(" + dump: "); + } else { + tty->print(", "); } - tty->print(" %d: "PTR_FORMAT, i, saved_regs[i]); } tty->cr(); - if (last_sp != saved_sp && last_sp != NULL) - tty->print_cr("*** last_sp="PTR_FORMAT, (intptr_t)last_sp); { // dumping last frame with frame::describe @@ -1102,14 +1087,7 @@ void trace_method_handle_stub(const char* adaptername, values.describe(-1, dump_sp, "sp for #1"); } - // mark saved_sp if seems valid - if (has_mh) { - if ((saved_sp >= dump_sp - UNREASONABLE_STACK_MOVE) && (saved_sp < dump_fp)) { - values.describe(-1, saved_sp, "*saved_sp"); - } - } - - tty->print_cr(" stack layout:"); + tty->print_cr("Stack layout:"); values.print(p); } if (has_mh) @@ -1125,16 +1103,12 @@ struct MethodHandleStubArguments { oopDesc* mh; intptr_t* saved_regs; intptr_t* entry_sp; - intptr_t* saved_sp; - intptr_t* saved_bp; }; void trace_method_handle_stub_wrapper(MethodHandleStubArguments* args) { trace_method_handle_stub(args->adaptername, args->mh, args->saved_regs, - args->entry_sp, - args->saved_sp, - args->saved_bp); + args->entry_sp); } void MethodHandles::trace_method_handle(MacroAssembler* _masm, const char* adaptername) { @@ -1157,20 +1131,18 @@ void MethodHandles::trace_method_handle(MacroAssembler* _masm, const char* adapt __ fst_d(Address(rsp, 0)); } - // incoming state: + // Incoming state: // rcx: method handle - // r13 or rsi: saved sp - // To avoid calling convention issues, build a record on the stack and pass the pointer to that instead. - // Note: fix the increment below if pushing more arguments - __ push(rbp); // saved_bp - __ push(saved_last_sp_register()); // saved_sp + // + // To avoid calling convention issues, build a record on the stack + // and pass the pointer to that instead. __ push(rbp); // entry_sp (with extra align space) __ push(rbx); // pusha saved_regs __ push(rcx); // mh __ push(rcx); // slot for adaptername __ movptr(Address(rsp, 0), (intptr_t) adaptername); __ super_call_VM_leaf(CAST_FROM_FN_PTR(address, trace_method_handle_stub_wrapper), rsp); - __ increment(rsp, 6 * wordSize); // MethodHandleStubArguments + __ increment(rsp, sizeof(MethodHandleStubArguments)); if (UseSSE >= 2) { __ movdbl(xmm0, Address(rsp, 0)); From df753a2942e6f40dd7859fe295ac2f0d5ea51aaa Mon Sep 17 00:00:00 2001 From: Christian Thalinger Date: Mon, 13 Feb 2012 04:30:59 -0800 Subject: [PATCH 41/82] 7143766: add ALT_JDK_IMAGE_DIR and improve test_jdk Reviewed-by: rbackman, jrose, dholmes --- hotspot/make/Makefile | 17 ++++++++++++----- hotspot/make/bsd/makefiles/defs.make | 3 +++ hotspot/make/bsd/makefiles/top.make | 4 ++-- hotspot/make/defs.make | 3 +++ hotspot/make/linux/makefiles/top.make | 4 ++-- hotspot/make/solaris/makefiles/top.make | 4 ++-- 6 files changed, 24 insertions(+), 11 deletions(-) diff --git a/hotspot/make/Makefile b/hotspot/make/Makefile index afbe68ee0c5..8bebef46972 100644 --- a/hotspot/make/Makefile +++ b/hotspot/make/Makefile @@ -402,7 +402,6 @@ $(EXPORT_INCLUDE_DIR)/%: $(HS_ALT_SRC)/share/vm/jfr/agent/% $(install-file) else $(EXPORT_INCLUDE_DIR)/jfr.h: - endif # Doc files (jvmti.html) @@ -448,12 +447,18 @@ $(JDK_IMAGE_DIR)/jre/lib/rt.jar: ($(CD) $(JDK_IMAGE_DIR) && $(TAR) -xf -) test_jdk: - ifneq ($(ZERO_BUILD), true) ifeq ($(ARCH_DATA_MODEL), 32) - $(JDK_IMAGE_DIR)/bin/java -client -version + ifneq ($(ZERO_BUILD), true) + $(JDK_IMAGE_DIR)/bin/java -d32 -client -Xinternalversion + $(JDK_IMAGE_DIR)/bin/java -d32 -client -version + endif + $(JDK_IMAGE_DIR)/bin/java -d32 -server -Xinternalversion + $(JDK_IMAGE_DIR)/bin/java -d32 -server -version + endif + ifeq ($(ARCH_DATA_MODEL), 64) + $(JDK_IMAGE_DIR)/bin/java -d64 -server -Xinternalversion + $(JDK_IMAGE_DIR)/bin/java -d64 -server -version endif - endif - $(JDK_IMAGE_DIR)/bin/java -server -version copy_product_jdk:: $(RM) -r $(JDK_IMAGE_DIR) @@ -545,6 +550,7 @@ SLASH_JAVA.desc = Root of all build tools, e.g. /java or J: OUTPUTDIR.desc = Output directory, default is build/ BOOTDIR.desc = JDK used to compile agent java source and test with JDK_IMPORT_PATH.desc = Promoted JDK to copy for 'create_jdk' +JDK_IMAGE_DIR.desc = Directory to place JDK to copy EXPORT_PATH.desc = Directory to place files to export for JDK build # Make variables to print out (description and value) @@ -553,6 +559,7 @@ VARIABLE_PRINTVAL_LIST += \ OUTPUTDIR \ BOOTDIR \ JDK_IMPORT_PATH \ + JDK_IMAGE_DIR \ EXPORT_PATH # Make variables that should refer to directories that exist diff --git a/hotspot/make/bsd/makefiles/defs.make b/hotspot/make/bsd/makefiles/defs.make index f442a059635..7048970bcf8 100644 --- a/hotspot/make/bsd/makefiles/defs.make +++ b/hotspot/make/bsd/makefiles/defs.make @@ -191,6 +191,9 @@ ifeq ($(OS_VENDOR), Darwin) # Set universal image dir JDK_IMAGE_DIR=$(OUTPUTDIR)/jdk-universal$(EXPORT_SUBDIR) + ifneq ($(ALT_JDK_IMAGE_DIR),) + JDK_IMAGE_DIR=$(ALT_JDK_IMAGE_DIR) + endif # Binaries to 'universalize' if built UNIVERSAL_LIPO_LIST += $(EXPORT_JRE_LIB_DIR)/libjsig.$(LIBRARY_SUFFIX) diff --git a/hotspot/make/bsd/makefiles/top.make b/hotspot/make/bsd/makefiles/top.make index 7b237c467d7..934e5d1f470 100644 --- a/hotspot/make/bsd/makefiles/top.make +++ b/hotspot/make/bsd/makefiles/top.make @@ -124,8 +124,8 @@ the_vm: vm_build_preliminaries $(adjust-mflags) @$(UpdatePCH) @$(MAKE) -f vm.make $(MFLAGS-adjusted) -install: the_vm - @$(MAKE) -f vm.make install +install gamma: the_vm + @$(MAKE) -f vm.make $@ # next rules support "make foo.[ois]" diff --git a/hotspot/make/defs.make b/hotspot/make/defs.make index af6d7be1984..a0aa0e5c859 100644 --- a/hotspot/make/defs.make +++ b/hotspot/make/defs.make @@ -193,6 +193,9 @@ endif # Default jdk image if one is created for you with create_jdk JDK_IMAGE_DIR=$(OUTPUTDIR)/jdk-$(PLATFORM) +ifneq ($(ALT_JDK_IMAGE_DIR),) + JDK_IMAGE_DIR=$(ALT_JDK_IMAGE_DIR) +endif # The platform dependent defs.make defines platform specific variable such # as ARCH, EXPORT_LIST etc. We must place the include here after BOOTDIR is defined. diff --git a/hotspot/make/linux/makefiles/top.make b/hotspot/make/linux/makefiles/top.make index d89f8ff75d2..3f6e73ebc1b 100644 --- a/hotspot/make/linux/makefiles/top.make +++ b/hotspot/make/linux/makefiles/top.make @@ -115,8 +115,8 @@ the_vm: vm_build_preliminaries $(adjust-mflags) @$(UpdatePCH) @$(MAKE) -f vm.make $(MFLAGS-adjusted) -install: the_vm - @$(MAKE) -f vm.make install +install gamma: the_vm + @$(MAKE) -f vm.make $@ # next rules support "make foo.[ois]" diff --git a/hotspot/make/solaris/makefiles/top.make b/hotspot/make/solaris/makefiles/top.make index 64797bbb2fd..bbe10798ff5 100644 --- a/hotspot/make/solaris/makefiles/top.make +++ b/hotspot/make/solaris/makefiles/top.make @@ -107,8 +107,8 @@ $(adjust-mflags): $(GAMMADIR)/make/$(Platform_os_family)/makefiles/adjust-mflags the_vm: vm_build_preliminaries $(adjust-mflags) @$(MAKE) -f vm.make $(MFLAGS-adjusted) -install: the_vm - @$(MAKE) -f vm.make install +install gamma: the_vm + @$(MAKE) -f vm.make $@ # next rules support "make foo.[oi]" From 2ac69799ec22c3f01e6ada494aab9e2815443f28 Mon Sep 17 00:00:00 2001 From: Oleg Pekhovskiy Date: Mon, 13 Feb 2012 17:49:23 +0400 Subject: [PATCH 42/82] 7143070: test/java/awt/print/PaintSetEnabledDeadlock/PaintSetEnabledDeadlock.java freezes on exit Reviewed-by: anthony --- .../PaintSetEnabledDeadlock.java | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/jdk/test/java/awt/print/PaintSetEnabledDeadlock/PaintSetEnabledDeadlock.java b/jdk/test/java/awt/print/PaintSetEnabledDeadlock/PaintSetEnabledDeadlock.java index 294f455567b..595cfc99cb3 100644 --- a/jdk/test/java/awt/print/PaintSetEnabledDeadlock/PaintSetEnabledDeadlock.java +++ b/jdk/test/java/awt/print/PaintSetEnabledDeadlock/PaintSetEnabledDeadlock.java @@ -54,9 +54,12 @@ public class PaintSetEnabledDeadlock extends Frame { Util.clickOnComp(frame.button, robot); } - frame.panel.stop(); + boolean ret = frame.panel.stop(); frame.dispose(); + if (!ret) { + throw new RuntimeException("Test failed!"); + } System.out.println("Test passed."); } @@ -140,17 +143,19 @@ class TestPanel extends Panel implements Runnable { } } - public void stop() { + public boolean stop() { active = false; try { - synchronized (sync) { - sync.notify(); - } - synchronized (thread) { - thread.wait(); + sync(); + thread.join(1000); + if (thread.isAlive()) { + thread.interrupt(); + return false; } } catch (InterruptedException ex) { + return false; } + return true; } public void draw() { From 7c7523d9686f9369c218246631551058093009c1 Mon Sep 17 00:00:00 2001 From: Vinnie Ryan Date: Mon, 13 Feb 2012 14:26:25 +0000 Subject: [PATCH 43/82] 7142339: PKCS7.java is needlessly creating SHA1PRNG SecureRandom instances when timestamping is not done Reviewed-by: xuelei, wetmore --- .../classes/sun/security/pkcs/PKCS7.java | 25 +++++++++++-------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/jdk/src/share/classes/sun/security/pkcs/PKCS7.java b/jdk/src/share/classes/sun/security/pkcs/PKCS7.java index a3198784729..657842c0017 100644 --- a/jdk/src/share/classes/sun/security/pkcs/PKCS7.java +++ b/jdk/src/share/classes/sun/security/pkcs/PKCS7.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2012, 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 @@ -72,16 +72,19 @@ public class PKCS7 { /* * Random number generator for creating nonce values + * (Lazy initialization) */ - private static final SecureRandom RANDOM; - static { - SecureRandom tmp = null; - try { - tmp = SecureRandom.getInstance("SHA1PRNG"); - } catch (NoSuchAlgorithmException e) { - // should not happen + private static class SecureRandomHolder { + static final SecureRandom RANDOM; + static { + SecureRandom tmp = null; + try { + tmp = SecureRandom.getInstance("SHA1PRNG"); + } catch (NoSuchAlgorithmException e) { + // should not happen + } + RANDOM = tmp; } - RANDOM = tmp; } /* @@ -862,8 +865,8 @@ public class PKCS7 { // Generate a nonce BigInteger nonce = null; - if (RANDOM != null) { - nonce = new BigInteger(64, RANDOM); + if (SecureRandomHolder.RANDOM != null) { + nonce = new BigInteger(64, SecureRandomHolder.RANDOM); tsQuery.setNonce(nonce); } tsQuery.requestCertificate(true); From cfdca5342c7209e2ab85b720629baa6a821a5af2 Mon Sep 17 00:00:00 2001 From: Coleen Phillimore Date: Mon, 13 Feb 2012 12:30:47 -0500 Subject: [PATCH 44/82] 7059899: Stack overflows in Java code cause 64-bit JVMs to exit due to SIGSEGV Increase StackShadowPages to accomodate the JDK changes to increase buffer size in socketWrite Reviewed-by: acorn, phh --- hotspot/src/cpu/x86/vm/globals_x86.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hotspot/src/cpu/x86/vm/globals_x86.hpp b/hotspot/src/cpu/x86/vm/globals_x86.hpp index d40f5592df5..7b3f6cf8ce8 100644 --- a/hotspot/src/cpu/x86/vm/globals_x86.hpp +++ b/hotspot/src/cpu/x86/vm/globals_x86.hpp @@ -60,7 +60,7 @@ define_pd_global(intx, StackRedPages, 1); #ifdef AMD64 // Very large C++ stack frames using solaris-amd64 optimized builds // due to lack of optimization caused by C++ compiler bugs -define_pd_global(intx, StackShadowPages, SOLARIS_ONLY(20) NOT_SOLARIS(6) DEBUG_ONLY(+2)); +define_pd_global(intx, StackShadowPages, NOT_WIN64(20) WIN64_ONLY(6) DEBUG_ONLY(+2)); #else define_pd_global(intx, StackShadowPages, 3 DEBUG_ONLY(+5)); #endif // AMD64 From 95cfa1c3a78497a68d6a3df0d5ca8887538be61e Mon Sep 17 00:00:00 2001 From: Keith McGuigan Date: Mon, 13 Feb 2012 14:03:12 -0500 Subject: [PATCH 45/82] 7069991: Setup make/jprt.properties files for jdk8 Change default release value to jdk8 (but overrideable) Reviewed-by: phh, jcoomes, dholmes, ohair --- hotspot/make/jprt.properties | 124 +---------------------------------- 1 file changed, 3 insertions(+), 121 deletions(-) diff --git a/hotspot/make/jprt.properties b/hotspot/make/jprt.properties index fb1d001bb30..338f6d261b3 100644 --- a/hotspot/make/jprt.properties +++ b/hotspot/make/jprt.properties @@ -38,7 +38,9 @@ jprt.need.sibling.build=false # This tells jprt what default release we want to build -jprt.tools.default.release=${jprt.submit.release} +jprt.hotspot.default.release=jdk7 + +jprt.tools.default.release=${jprt.submit.option.release?${jprt.submit.option.release}:${jprt.hotspot.default.release}} # Disable syncing the source after builds and tests are done. @@ -52,126 +54,46 @@ jprt.sync.push=false # Define the Solaris platforms we want for the various releases jprt.my.solaris.sparc.jdk8=solaris_sparc_5.10 jprt.my.solaris.sparc.jdk7=solaris_sparc_5.10 -jprt.my.solaris.sparc.jdk7b107=solaris_sparc_5.10 -jprt.my.solaris.sparc.jdk7temp=solaris_sparc_5.10 -jprt.my.solaris.sparc.jdk6=solaris_sparc_5.8 -jprt.my.solaris.sparc.jdk6perf=solaris_sparc_5.8 -jprt.my.solaris.sparc.jdk6u10=solaris_sparc_5.8 -jprt.my.solaris.sparc.jdk6u14=solaris_sparc_5.8 -jprt.my.solaris.sparc.jdk6u18=solaris_sparc_5.8 -jprt.my.solaris.sparc.jdk6u20=solaris_sparc_5.8 -jprt.my.solaris.sparc.ejdk7=${jprt.my.solaris.sparc.jdk7} -jprt.my.solaris.sparc.ejdk6=${jprt.my.solaris.sparc.jdk6} jprt.my.solaris.sparc=${jprt.my.solaris.sparc.${jprt.tools.default.release}} jprt.my.solaris.sparcv9.jdk8=solaris_sparcv9_5.10 jprt.my.solaris.sparcv9.jdk7=solaris_sparcv9_5.10 -jprt.my.solaris.sparcv9.jdk7b107=solaris_sparcv9_5.10 -jprt.my.solaris.sparcv9.jdk7temp=solaris_sparcv9_5.10 -jprt.my.solaris.sparcv9.jdk6=solaris_sparcv9_5.8 -jprt.my.solaris.sparcv9.jdk6perf=solaris_sparcv9_5.8 -jprt.my.solaris.sparcv9.jdk6u10=solaris_sparcv9_5.8 -jprt.my.solaris.sparcv9.jdk6u14=solaris_sparcv9_5.8 -jprt.my.solaris.sparcv9.jdk6u18=solaris_sparcv9_5.8 -jprt.my.solaris.sparcv9.jdk6u20=solaris_sparcv9_5.8 -jprt.my.solaris.sparcv9.ejdk7=${jprt.my.solaris.sparcv9.jdk7} -jprt.my.solaris.sparcv9.ejdk6=${jprt.my.solaris.sparcv9.jdk6} jprt.my.solaris.sparcv9=${jprt.my.solaris.sparcv9.${jprt.tools.default.release}} jprt.my.solaris.i586.jdk8=solaris_i586_5.10 jprt.my.solaris.i586.jdk7=solaris_i586_5.10 -jprt.my.solaris.i586.jdk7b107=solaris_i586_5.10 -jprt.my.solaris.i586.jdk7temp=solaris_i586_5.10 -jprt.my.solaris.i586.jdk6=solaris_i586_5.8 -jprt.my.solaris.i586.jdk6perf=solaris_i586_5.8 -jprt.my.solaris.i586.jdk6u10=solaris_i586_5.8 -jprt.my.solaris.i586.jdk6u14=solaris_i586_5.8 -jprt.my.solaris.i586.jdk6u18=solaris_i586_5.8 -jprt.my.solaris.i586.jdk6u20=solaris_i586_5.8 -jprt.my.solaris.i586.ejdk7=${jprt.my.solaris.i586.jdk7} -jprt.my.solaris.i586.ejdk6=${jprt.my.solaris.i586.jdk6} jprt.my.solaris.i586=${jprt.my.solaris.i586.${jprt.tools.default.release}} jprt.my.solaris.x64.jdk8=solaris_x64_5.10 jprt.my.solaris.x64.jdk7=solaris_x64_5.10 -jprt.my.solaris.x64.jdk7b107=solaris_x64_5.10 -jprt.my.solaris.x64.jdk7temp=solaris_x64_5.10 -jprt.my.solaris.x64.jdk6=solaris_x64_5.10 -jprt.my.solaris.x64.jdk6perf=solaris_x64_5.10 -jprt.my.solaris.x64.jdk6u10=solaris_x64_5.10 -jprt.my.solaris.x64.jdk6u14=solaris_x64_5.10 -jprt.my.solaris.x64.jdk6u18=solaris_x64_5.10 -jprt.my.solaris.x64.jdk6u20=solaris_x64_5.10 -jprt.my.solaris.x64.ejdk7=${jprt.my.solaris.x64.jdk7} -jprt.my.solaris.x64.ejdk6=${jprt.my.solaris.x64.jdk6} jprt.my.solaris.x64=${jprt.my.solaris.x64.${jprt.tools.default.release}} jprt.my.linux.i586.jdk8=linux_i586_2.6 jprt.my.linux.i586.jdk7=linux_i586_2.6 -jprt.my.linux.i586.jdk7b107=linux_i586_2.6 -jprt.my.linux.i586.jdk7temp=linux_i586_2.6 -jprt.my.linux.i586.jdk6=linux_i586_2.4 -jprt.my.linux.i586.jdk6perf=linux_i586_2.4 -jprt.my.linux.i586.jdk6u10=linux_i586_2.4 -jprt.my.linux.i586.jdk6u14=linux_i586_2.4 -jprt.my.linux.i586.jdk6u18=linux_i586_2.4 -jprt.my.linux.i586.jdk6u20=linux_i586_2.4 -jprt.my.linux.i586.ejdk7=linux_i586_2.6 -jprt.my.linux.i586.ejdk6=linux_i586_2.6 jprt.my.linux.i586=${jprt.my.linux.i586.${jprt.tools.default.release}} jprt.my.linux.x64.jdk8=linux_x64_2.6 jprt.my.linux.x64.jdk7=linux_x64_2.6 -jprt.my.linux.x64.jdk7b107=linux_x64_2.6 -jprt.my.linux.x64.jdk7temp=linux_x64_2.6 -jprt.my.linux.x64.jdk6=linux_x64_2.4 -jprt.my.linux.x64.jdk6perf=linux_x64_2.4 -jprt.my.linux.x64.jdk6u10=linux_x64_2.4 -jprt.my.linux.x64.jdk6u14=linux_x64_2.4 -jprt.my.linux.x64.jdk6u18=linux_x64_2.4 -jprt.my.linux.x64.jdk6u20=linux_x64_2.4 -jprt.my.linux.x64.ejdk7=${jprt.my.linux.x64.jdk7} -jprt.my.linux.x64.ejdk6=${jprt.my.linux.x64.jdk6} jprt.my.linux.x64=${jprt.my.linux.x64.${jprt.tools.default.release}} jprt.my.linux.ppc.jdk8=linux_ppc_2.6 jprt.my.linux.ppc.jdk7=linux_ppc_2.6 -jprt.my.linux.ppc.jdk7b107=linux_ppc_2.6 -jprt.my.linux.ppc.jdk7temp=linux_ppc_2.6 -jprt.my.linux.ppc.ejdk6=linux_ppc_2.6 -jprt.my.linux.ppc.ejdk7=linux_ppc_2.6 jprt.my.linux.ppc=${jprt.my.linux.ppc.${jprt.tools.default.release}} jprt.my.linux.ppcv2.jdk8=linux_ppcv2_2.6 jprt.my.linux.ppcv2.jdk7=linux_ppcv2_2.6 -jprt.my.linux.ppcv2.jdk7b107=linux_ppcv2_2.6 -jprt.my.linux.ppcv2.jdk7temp=linux_ppcv2_2.6 -jprt.my.linux.ppcv2.ejdk6=linux_ppcv2_2.6 -jprt.my.linux.ppcv2.ejdk7=linux_ppcv2_2.6 jprt.my.linux.ppcv2=${jprt.my.linux.ppcv2.${jprt.tools.default.release}} jprt.my.linux.ppcsflt.jdk8=linux_ppcsflt_2.6 jprt.my.linux.ppcsflt.jdk7=linux_ppcsflt_2.6 -jprt.my.linux.ppcsflt.jdk7b107=linux_ppcsflt_2.6 -jprt.my.linux.ppcsflt.jdk7temp=linux_ppcsflt_2.6 -jprt.my.linux.ppcsflt.ejdk6=linux_ppcsflt_2.6 -jprt.my.linux.ppcsflt.ejdk7=linux_ppcsflt_2.6 jprt.my.linux.ppcsflt=${jprt.my.linux.ppcsflt.${jprt.tools.default.release}} jprt.my.linux.armvfp.jdk8=linux_armvfp_2.6 jprt.my.linux.armvfp.jdk7=linux_armvfp_2.6 -jprt.my.linux.armvfp.jdk7b107=linux_armvfp_2.6 -jprt.my.linux.armvfp.jdk7temp=linux_armvfp_2.6 -jprt.my.linux.armvfp.ejdk6=linux_armvfp_2.6 -jprt.my.linux.armvfp.ejdk7=linux_armvfp_2.6 jprt.my.linux.armvfp=${jprt.my.linux.armvfp.${jprt.tools.default.release}} jprt.my.linux.armsflt.jdk8=linux_armsflt_2.6 jprt.my.linux.armsflt.jdk7=linux_armsflt_2.6 -jprt.my.linux.armsflt.jdk7b107=linux_armsflt_2.6 -jprt.my.linux.armsflt.jdk7temp=linux_armsflt_2.6 -jprt.my.linux.armsflt.ejdk6=linux_armsflt_2.6 -jprt.my.linux.armsflt.ejdk7=linux_armsflt_2.6 jprt.my.linux.armsflt=${jprt.my.linux.armsflt.${jprt.tools.default.release}} jprt.my.macosx.x64.jdk8=macosx_x64_10.7 @@ -180,30 +102,10 @@ jprt.my.macosx.x64=${jprt.my.macosx.x64.${jprt.tools.default.release}} jprt.my.windows.i586.jdk8=windows_i586_5.1 jprt.my.windows.i586.jdk7=windows_i586_5.1 -jprt.my.windows.i586.jdk7b107=windows_i586_5.0 -jprt.my.windows.i586.jdk7temp=windows_i586_5.0 -jprt.my.windows.i586.jdk6=windows_i586_5.0 -jprt.my.windows.i586.jdk6perf=windows_i586_5.0 -jprt.my.windows.i586.jdk6u10=windows_i586_5.0 -jprt.my.windows.i586.jdk6u14=windows_i586_5.0 -jprt.my.windows.i586.jdk6u18=windows_i586_5.0 -jprt.my.windows.i586.jdk6u20=windows_i586_5.0 -jprt.my.windows.i586.ejdk7=${jprt.my.windows.i586.jdk7} -jprt.my.windows.i586.ejdk6=${jprt.my.windows.i586.jdk6} jprt.my.windows.i586=${jprt.my.windows.i586.${jprt.tools.default.release}} jprt.my.windows.x64.jdk8=windows_x64_5.2 jprt.my.windows.x64.jdk7=windows_x64_5.2 -jprt.my.windows.x64.jdk7b107=windows_x64_5.2 -jprt.my.windows.x64.jdk7temp=windows_x64_5.2 -jprt.my.windows.x64.jdk6=windows_x64_5.2 -jprt.my.windows.x64.jdk6perf=windows_x64_5.2 -jprt.my.windows.x64.jdk6u10=windows_x64_5.2 -jprt.my.windows.x64.jdk6u14=windows_x64_5.2 -jprt.my.windows.x64.jdk6u18=windows_x64_5.2 -jprt.my.windows.x64.jdk6u20=windows_x64_5.2 -jprt.my.windows.x64.ejdk7=${jprt.my.windows.x64.jdk7} -jprt.my.windows.x64.ejdk6=${jprt.my.windows.x64.jdk6} jprt.my.windows.x64=${jprt.my.windows.x64.${jprt.tools.default.release}} # Standard list of jprt build targets for this source tree @@ -539,16 +441,6 @@ jprt.test.targets.embedded= \ jprt.test.targets.jdk8=${jprt.test.targets.standard} jprt.test.targets.jdk7=${jprt.test.targets.standard} -jprt.test.targets.jdk7temp=${jprt.test.targets.standard} -jprt.test.targets.jdk7b105=${jprt.test.targets.standard} -jprt.test.targets.jdk6=${jprt.test.targets.standard} -jprt.test.targets.jdk6perf=${jprt.test.targets.standard} -jprt.test.targets.jdk6u10=${jprt.test.targets.standard} -jprt.test.targets.jdk6u14=${jprt.test.targets.standard} -jprt.test.targets.jdk6u18=${jprt.test.targets.standard} -jprt.test.targets.jdk6u20=${jprt.test.targets.standard} -jprt.test.targets.ejdk6=${jprt.test.targets.embedded} -jprt.test.targets.ejdk7=${jprt.test.targets.embedded} jprt.test.targets=${jprt.test.targets.${jprt.tools.default.release}} # The default test/Makefile targets that should be run @@ -593,15 +485,5 @@ jprt.make.rule.test.targets.embedded = \ jprt.make.rule.test.targets.jdk8=${jprt.make.rule.test.targets.standard} jprt.make.rule.test.targets.jdk7=${jprt.make.rule.test.targets.standard} -jprt.make.rule.test.targets.jdk7temp=${jprt.make.rule.test.targets.standard} -jprt.make.rule.test.targets.jdk7b107=${jprt.make.rule.test.targets.standard} -jprt.make.rule.test.targets.jdk6=${jprt.make.rule.test.targets.standard} -jprt.make.rule.test.targets.jdk6perf=${jprt.make.rule.test.targets.standard} -jprt.make.rule.test.targets.jdk6u10=${jprt.make.rule.test.targets.standard} -jprt.make.rule.test.targets.jdk6u14=${jprt.make.rule.test.targets.standard} -jprt.make.rule.test.targets.jdk6u18=${jprt.make.rule.test.targets.standard} -jprt.make.rule.test.targets.jdk6u20=${jprt.make.rule.test.targets.standard} -jprt.make.rule.test.targets.ejdk6=${jprt.make.rule.test.targets.embedded} -jprt.make.rule.test.targets.ejdk7=${jprt.make.rule.test.targets.embedded} jprt.make.rule.test.targets=${jprt.make.rule.test.targets.${jprt.tools.default.release}} From e7ece2a7428c0b4676f7c58797b9225e629d1633 Mon Sep 17 00:00:00 2001 From: Roland Westrelin Date: Tue, 14 Feb 2012 09:43:25 +0100 Subject: [PATCH 46/82] 7144405: JumbleGC002 assert(m->offset() == pc_offset) failed: oopmap not found Oop map needs pc stored in frame anchor in StubGenerator::generate_throw_exception() Reviewed-by: twisti, never, kvn --- hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp b/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp index 4baaf0e313f..d68bdac6db8 100644 --- a/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp +++ b/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp @@ -2997,7 +2997,7 @@ class StubGenerator: public StubCodeGenerator { // Generate oop map OopMap* map = new OopMap(framesize, 0); - oop_maps->add_gc_map(__ pc() - start, map); + oop_maps->add_gc_map(the_pc - start, map); __ reset_last_Java_frame(true, true); From abfc726cc44496d2d0b98e65654743154d3b046f Mon Sep 17 00:00:00 2001 From: Vinnie Ryan Date: Tue, 14 Feb 2012 11:47:41 +0000 Subject: [PATCH 47/82] 7142888: sun/security/tools/jarsigner/ec.sh fail on sparc Reviewed-by: xuelei --- jdk/test/sun/security/tools/jarsigner/ec.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/jdk/test/sun/security/tools/jarsigner/ec.sh b/jdk/test/sun/security/tools/jarsigner/ec.sh index 7e400c9b902..fc66bbc8f9e 100644 --- a/jdk/test/sun/security/tools/jarsigner/ec.sh +++ b/jdk/test/sun/security/tools/jarsigner/ec.sh @@ -1,5 +1,5 @@ # -# Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2009, 2012, 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 @@ -55,7 +55,8 @@ $JAR cvf $JFILE A $KT -alias a -dname CN=a -keyalg ec -genkey -validity 300 || exit 11 $KT -alias b -dname CN=b -keyalg ec -genkey -validity 300 || exit 12 -$KT -alias c -dname CN=c -keyalg ec -genkey -validity 300 || exit 13 +# Ensure that key length is sufficient for the intended hash (SHA512withECDSA) +$KT -alias c -dname CN=c -keyalg ec -genkey -validity 300 -keysize 521 || exit 13 $KT -alias x -dname CN=x -keyalg ec -genkey -validity 300 || exit 14 $JARSIGNER -keystore $KS -storepass changeit $JFILE a -debug -strict || exit 21 From 7c6f3c6cb27ad89b750a8ce3756f587ff8b8a17e Mon Sep 17 00:00:00 2001 From: Alexander Scherbatiy Date: Tue, 14 Feb 2012 18:44:57 +0400 Subject: [PATCH 48/82] 7133577: [macosx] closed/javax/swing/JTree/4314199/bug4314199.java fails on MacOS Reviewed-by: rupashka --- .../javax/swing/JTree/4314199/bug4314199.html | 8 ++ .../javax/swing/JTree/4314199/bug4314199.java | 92 +++++++++++++++++++ 2 files changed, 100 insertions(+) create mode 100644 jdk/test/javax/swing/JTree/4314199/bug4314199.html create mode 100644 jdk/test/javax/swing/JTree/4314199/bug4314199.java diff --git a/jdk/test/javax/swing/JTree/4314199/bug4314199.html b/jdk/test/javax/swing/JTree/4314199/bug4314199.html new file mode 100644 index 00000000000..b1fb60e4896 --- /dev/null +++ b/jdk/test/javax/swing/JTree/4314199/bug4314199.html @@ -0,0 +1,8 @@ + + +Select the last tree node (marked "Here") and click on the menu. +Look at the vertical line connecting nodes "Bug" and "Here". If +this line disappears when the menu drops down, test fails. + + + diff --git a/jdk/test/javax/swing/JTree/4314199/bug4314199.java b/jdk/test/javax/swing/JTree/4314199/bug4314199.java new file mode 100644 index 00000000000..ecf0dabb342 --- /dev/null +++ b/jdk/test/javax/swing/JTree/4314199/bug4314199.java @@ -0,0 +1,92 @@ +/* + * Copyright (c) 2012, 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 4314199 + * @summary Tests that JTree repaints correctly in a container with a JMenu + * @author Peter Zhelezniakov + * @run applet/manual=yesno bug4314199.html + */ + +import javax.swing.*; +import javax.swing.tree.*; + +public class bug4314199 extends JApplet { + + public void init() { + + try { + UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel"); + SwingUtilities.invokeAndWait(new Runnable() { + + public void run() { + createAndShowGUI(); + } + }); + } catch (final Exception e) { + SwingUtilities.invokeLater(new Runnable() { + + public void run() { + createAndShowMessage("Test fails because of exception: " + + e.getMessage()); + } + }); + } + + } + + private void createAndShowMessage(String message) { + getContentPane().add(new JLabel(message)); + } + + private void createAndShowGUI() { + JMenuBar mb = new JMenuBar(); + + // needed to exactly align left edge of menu and angled line of tree + mb.add(Box.createHorizontalStrut(27)); + + JMenu mn = new JMenu("Menu"); + JMenuItem mi = new JMenuItem("MenuItem"); + mn.add(mi); + mb.add(mn); + setJMenuBar(mb); + + DefaultMutableTreeNode n1 = new DefaultMutableTreeNode("Root"); + DefaultMutableTreeNode n2 = new DefaultMutableTreeNode("Duke"); + n1.add(n2); + DefaultMutableTreeNode n3 = new DefaultMutableTreeNode("Bug"); + n2.add(n3); + n3.add(new DefaultMutableTreeNode("Blah")); + n3.add(new DefaultMutableTreeNode("Blah")); + n3.add(new DefaultMutableTreeNode("Blah")); + DefaultMutableTreeNode n4 = new DefaultMutableTreeNode("Here"); + n2.add(n4); + + JTree tree = new JTree(new DefaultTreeModel(n1)); + tree.putClientProperty("JTree.lineStyle", "Angled"); + tree.expandPath(new TreePath(new Object[]{n1, n2, n3})); + setContentPane(tree); + } +} From 476ee444493cde3188251469dc2ca5ddde8c021e Mon Sep 17 00:00:00 2001 From: Frederic Parain Date: Tue, 14 Feb 2012 06:54:27 -0800 Subject: [PATCH 49/82] 7143760: Memory leak in GarbageCollectionNotifications Reviewed-by: dholmes, dcubed, kamg --- hotspot/src/share/vm/services/gcNotifier.cpp | 39 +++++++++++++++----- hotspot/src/share/vm/services/gcNotifier.hpp | 3 +- 2 files changed, 32 insertions(+), 10 deletions(-) diff --git a/hotspot/src/share/vm/services/gcNotifier.cpp b/hotspot/src/share/vm/services/gcNotifier.cpp index b282980e0ae..1670242019f 100644 --- a/hotspot/src/share/vm/services/gcNotifier.cpp +++ b/hotspot/src/share/vm/services/gcNotifier.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2012, 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 @@ -180,17 +180,43 @@ static Handle createGcInfo(GCMemoryManager *gcManager, GCStatInfo *gcStatInfo,TR } void GCNotifier::sendNotification(TRAPS) { + GCNotifier::sendNotificationInternal(THREAD); + // Clearing pending exception to avoid premature termination of + // the service thread + if (HAS_PENDING_EXCEPTION) { + CLEAR_PENDING_EXCEPTION; + } +} + +class NotificationMark : public StackObj { + // This class is used in GCNotifier::sendNotificationInternal to ensure that + // the GCNotificationRequest object is properly cleaned up, whatever path + // is used to exit the method. + GCNotificationRequest* _request; +public: + NotificationMark(GCNotificationRequest* r) { + _request = r; + } + ~NotificationMark() { + assert(_request != NULL, "Sanity check"); + delete _request; + } +}; + +void GCNotifier::sendNotificationInternal(TRAPS) { ResourceMark rm(THREAD); + HandleMark hm(THREAD); GCNotificationRequest *request = getRequest(); - if(request != NULL) { - Handle objGcInfo = createGcInfo(request->gcManager,request->gcStatInfo,THREAD); + if (request != NULL) { + NotificationMark nm(request); + Handle objGcInfo = createGcInfo(request->gcManager, request->gcStatInfo, THREAD); Handle objName = java_lang_String::create_from_platform_dependent_str(request->gcManager->name(), CHECK); Handle objAction = java_lang_String::create_from_platform_dependent_str(request->gcAction, CHECK); Handle objCause = java_lang_String::create_from_platform_dependent_str(request->gcCause, CHECK); klassOop k = Management::sun_management_GarbageCollectorImpl_klass(CHECK); - instanceKlassHandle gc_mbean_klass (THREAD, k); + instanceKlassHandle gc_mbean_klass(THREAD, k); instanceOop gc_mbean = request->gcManager->get_memory_manager_instance(THREAD); instanceHandle gc_mbean_h(THREAD, gc_mbean); @@ -213,11 +239,6 @@ void GCNotifier::sendNotification(TRAPS) { vmSymbols::createGCNotification_signature(), &args, CHECK); - if (HAS_PENDING_EXCEPTION) { - CLEAR_PENDING_EXCEPTION; - } - - delete request; } } diff --git a/hotspot/src/share/vm/services/gcNotifier.hpp b/hotspot/src/share/vm/services/gcNotifier.hpp index 7e0d8462e8f..c26765e824e 100644 --- a/hotspot/src/share/vm/services/gcNotifier.hpp +++ b/hotspot/src/share/vm/services/gcNotifier.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -60,6 +60,7 @@ private: static GCNotificationRequest *last_request; static void addRequest(GCNotificationRequest *request); static GCNotificationRequest *getRequest(); + static void sendNotificationInternal(TRAPS); public: static void pushNotification(GCMemoryManager *manager, const char *action, const char *cause); static bool has_event(); From 52739303dbf0a2f46a97bcec7d1ba6e00734ad97 Mon Sep 17 00:00:00 2001 From: Frederic Parain Date: Tue, 14 Feb 2012 07:28:29 -0800 Subject: [PATCH 50/82] 7140868: TEST_BUG: jcmd tests need to use -XX:+UsePerfData Reviewed-by: fparain, dholmes --- jdk/test/sun/tools/jcmd/jcmd-Defaults.sh | 4 ++-- jdk/test/sun/tools/jcmd/jcmd-f.sh | 2 +- jdk/test/sun/tools/jcmd/jcmd-help-help.sh | 2 +- jdk/test/sun/tools/jcmd/jcmd-help.sh | 4 ++-- jdk/test/sun/tools/jcmd/jcmd-pid.sh | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/jdk/test/sun/tools/jcmd/jcmd-Defaults.sh b/jdk/test/sun/tools/jcmd/jcmd-Defaults.sh index 277c8548c0c..cf791358922 100644 --- a/jdk/test/sun/tools/jcmd/jcmd-Defaults.sh +++ b/jdk/test/sun/tools/jcmd/jcmd-Defaults.sh @@ -28,6 +28,6 @@ JCMD="${TESTJAVA}/bin/jcmd" -${JCMD} 2>&1 | awk -f ${TESTSRC}/jcmd_Output1.awk +${JCMD} -J-XX:+UsePerfData 2>&1 | awk -f ${TESTSRC}/jcmd_Output1.awk -${JCMD} -l 2>&1 | awk -f ${TESTSRC}/jcmd_Output1.awk +${JCMD} -J-XX:+UsePerfData -l 2>&1 | awk -f ${TESTSRC}/jcmd_Output1.awk diff --git a/jdk/test/sun/tools/jcmd/jcmd-f.sh b/jdk/test/sun/tools/jcmd/jcmd-f.sh index acbe0b322fe..5cbd1b93236 100644 --- a/jdk/test/sun/tools/jcmd/jcmd-f.sh +++ b/jdk/test/sun/tools/jcmd/jcmd-f.sh @@ -46,7 +46,7 @@ failed=0 # -f