From 3bd08574dcbb3234c5adb04ab9f35d7b646d692e Mon Sep 17 00:00:00 2001
From: Joseph Provino
Date: Tue, 27 Jan 2015 13:50:31 -0500
Subject: [PATCH 01/61] 8064947: Clean up BarrierSet ctor/dtor
Make abstract base call contructors protected and require a "kind" argument.
Reviewed-by: jmasa, jwilhelm
---
.../g1/g1SATBCardTableModRefBS.cpp | 12 ++++--------
.../g1/g1SATBCardTableModRefBS.hpp | 7 ++++---
.../parallelScavenge/cardTableExtension.hpp | 4 ++--
hotspot/src/share/vm/memory/barrierSet.hpp | 9 +++++----
hotspot/src/share/vm/memory/cardTableModRefBS.cpp | 8 +++-----
hotspot/src/share/vm/memory/cardTableModRefBS.hpp | 14 ++++++++------
hotspot/src/share/vm/memory/modRefBarrierSet.hpp | 9 ++++++---
7 files changed, 32 insertions(+), 31 deletions(-)
diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.cpp
index c6a1aef2420..13cc179ac94 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.cpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -32,11 +32,8 @@
#include "runtime/orderAccess.inline.hpp"
#include "runtime/thread.inline.hpp"
-G1SATBCardTableModRefBS::G1SATBCardTableModRefBS(MemRegion whole_heap) :
- CardTableModRefBS(whole_heap)
-{
- _kind = G1SATBCT;
-}
+G1SATBCardTableModRefBS::G1SATBCardTableModRefBS(MemRegion whole_heap, BarrierSet::Name kind) :
+ CardTableModRefBS(whole_heap, kind) { }
void G1SATBCardTableModRefBS::enqueue(oop pre_val) {
// Nulls should have been already filtered.
@@ -132,11 +129,10 @@ void G1SATBCardTableLoggingModRefBSChangedListener::on_commit(uint start_idx, si
G1SATBCardTableLoggingModRefBS::
G1SATBCardTableLoggingModRefBS(MemRegion whole_heap) :
- G1SATBCardTableModRefBS(whole_heap),
+ G1SATBCardTableModRefBS(whole_heap, BarrierSet::G1SATBCTLogging),
_dcqs(JavaThread::dirty_card_queue_set()),
_listener()
{
- _kind = G1SATBCTLogging;
_listener.set_card_table(this);
}
diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.hpp
index c4d9318b071..50203ce928a 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.hpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -43,6 +43,9 @@ protected:
g1_young_gen = CT_MR_BS_last_reserved << 1
};
+ G1SATBCardTableModRefBS(MemRegion whole_heap, BarrierSet::Name kind);
+ ~G1SATBCardTableModRefBS() { }
+
public:
static int g1_young_card_val() { return g1_young_gen; }
@@ -50,8 +53,6 @@ public:
// pre-marking object graph.
static void enqueue(oop pre_val);
- G1SATBCardTableModRefBS(MemRegion whole_heap);
-
bool is_a(BarrierSet::Name bsn) {
return bsn == BarrierSet::G1SATBCT || CardTableModRefBS::is_a(bsn);
}
diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/cardTableExtension.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/cardTableExtension.hpp
index 1fc55ad081b..d2d3319da75 100644
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/cardTableExtension.hpp
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/cardTableExtension.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -54,7 +54,7 @@ class CardTableExtension : public CardTableModRefBS {
};
CardTableExtension(MemRegion whole_heap) :
- CardTableModRefBS(whole_heap) { }
+ CardTableModRefBS(whole_heap, BarrierSet::CardTableModRef) { }
// Too risky for the 4/10/02 putback
// BarrierSet::Name kind() { return BarrierSet::CardTableExtension; }
diff --git a/hotspot/src/share/vm/memory/barrierSet.hpp b/hotspot/src/share/vm/memory/barrierSet.hpp
index 08d354c36df..6743f786fb5 100644
--- a/hotspot/src/share/vm/memory/barrierSet.hpp
+++ b/hotspot/src/share/vm/memory/barrierSet.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -40,8 +40,7 @@ public:
CardTableExtension,
G1SATBCT,
G1SATBCTLogging,
- Other,
- Uninit
+ Other
};
enum Flags {
@@ -57,9 +56,11 @@ protected:
static const int _max_covered_regions = 2;
Name _kind;
+ BarrierSet(Name kind) : _kind(kind) { }
+ ~BarrierSet() { }
+
public:
- BarrierSet() { _kind = Uninit; }
// To get around prohibition on RTTI.
BarrierSet::Name kind() { return _kind; }
virtual bool is_a(BarrierSet::Name bsn) = 0;
diff --git a/hotspot/src/share/vm/memory/cardTableModRefBS.cpp b/hotspot/src/share/vm/memory/cardTableModRefBS.cpp
index d3586332b2f..4539d53c898 100644
--- a/hotspot/src/share/vm/memory/cardTableModRefBS.cpp
+++ b/hotspot/src/share/vm/memory/cardTableModRefBS.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -53,8 +53,8 @@ size_t CardTableModRefBS::compute_byte_map_size()
return align_size_up(_guard_index + 1, MAX2(_page_size, granularity));
}
-CardTableModRefBS::CardTableModRefBS(MemRegion whole_heap) :
- ModRefBarrierSet(),
+CardTableModRefBS::CardTableModRefBS(MemRegion whole_heap, BarrierSet::Name kind) :
+ ModRefBarrierSet(kind),
_whole_heap(whole_heap),
_guard_index(0),
_guard_region(),
@@ -72,8 +72,6 @@ CardTableModRefBS::CardTableModRefBS(MemRegion whole_heap) :
_lowest_non_clean_base_chunk_index(NULL),
_last_LNC_resizing_collection(NULL)
{
- _kind = BarrierSet::CardTableModRef;
-
assert((uintptr_t(_whole_heap.start()) & (card_size - 1)) == 0, "heap must start at card boundary");
assert((uintptr_t(_whole_heap.end()) & (card_size - 1)) == 0, "heap must end at card boundary");
diff --git a/hotspot/src/share/vm/memory/cardTableModRefBS.hpp b/hotspot/src/share/vm/memory/cardTableModRefBS.hpp
index 73f922b47dd..e0890ed1f6e 100644
--- a/hotspot/src/share/vm/memory/cardTableModRefBS.hpp
+++ b/hotspot/src/share/vm/memory/cardTableModRefBS.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -284,20 +284,22 @@ public:
return bsn == BarrierSet::CardTableModRef || ModRefBarrierSet::is_a(bsn);
}
- CardTableModRefBS(MemRegion whole_heap);
- ~CardTableModRefBS();
-
virtual void initialize();
// *** Barrier set functions.
bool has_write_ref_pre_barrier() { return false; }
+protected:
+
+ CardTableModRefBS(MemRegion whole_heap, BarrierSet::Name kind);
+ ~CardTableModRefBS();
+
// Record a reference update. Note that these versions are precise!
// The scanning code has to handle the fact that the write barrier may be
// either precise or imprecise. We make non-virtual inline variants of
// these functions here for performance.
-protected:
+
void write_ref_field_work(oop obj, size_t offset, oop newVal);
virtual void write_ref_field_work(void* field, oop newVal, bool release = false);
public:
@@ -478,7 +480,7 @@ protected:
bool card_may_have_been_dirty(jbyte cv);
public:
CardTableModRefBSForCTRS(MemRegion whole_heap) :
- CardTableModRefBS(whole_heap) {}
+ CardTableModRefBS(whole_heap, BarrierSet::CardTableModRef) {}
void set_CTRS(CardTableRS* rs) { _rs = rs; }
};
diff --git a/hotspot/src/share/vm/memory/modRefBarrierSet.hpp b/hotspot/src/share/vm/memory/modRefBarrierSet.hpp
index a320e61c854..394d2c513a6 100644
--- a/hotspot/src/share/vm/memory/modRefBarrierSet.hpp
+++ b/hotspot/src/share/vm/memory/modRefBarrierSet.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -37,8 +37,6 @@ class Generation;
class ModRefBarrierSet: public BarrierSet {
public:
- ModRefBarrierSet() { _kind = BarrierSet::ModRef; }
-
bool is_a(BarrierSet::Name bsn) {
return bsn == BarrierSet::ModRef;
}
@@ -59,7 +57,12 @@ public:
void read_ref_field(void* field) {}
void read_prim_field(HeapWord* field, size_t bytes) {}
+
protected:
+
+ ModRefBarrierSet(BarrierSet::Name kind) : BarrierSet(kind) { }
+ ~ModRefBarrierSet() { }
+
virtual void write_ref_field_work(void* field, oop new_val, bool release = false) = 0;
public:
void write_prim_field(HeapWord* field, size_t bytes,
From 155c09ca6b977282b391c9f1a1073b8b269cc9c1 Mon Sep 17 00:00:00 2001
From: Claes Redestad
Date: Thu, 29 Jan 2015 15:05:25 +0100
Subject: [PATCH 02/61] 8069273: Decrease Hot Card Cache Lock contention
Reviewed-by: tschatzl, mgerdin
---
.../gc_implementation/g1/g1HotCardCache.cpp | 90 +++++++++----------
.../gc_implementation/g1/g1HotCardCache.hpp | 44 ++++++---
hotspot/src/share/vm/runtime/mutexLocker.cpp | 4 +-
hotspot/src/share/vm/runtime/mutexLocker.hpp | 3 +-
4 files changed, 75 insertions(+), 66 deletions(-)
diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1HotCardCache.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1HotCardCache.cpp
index b64f56146ee..e601ac369e4 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/g1HotCardCache.cpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1HotCardCache.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -36,11 +36,10 @@ void G1HotCardCache::initialize(G1RegionToSpaceMapper* card_counts_storage) {
if (default_use_cache()) {
_use_cache = true;
- _hot_cache_size = (1 << G1ConcRSLogCacheSize);
+ _hot_cache_size = (size_t)1 << G1ConcRSLogCacheSize;
_hot_cache = NEW_C_HEAP_ARRAY(jbyte*, _hot_cache_size, mtGC);
- _n_hot = 0;
- _hot_cache_idx = 0;
+ reset_hot_cache_internal();
// For refining the cards in the hot cache in parallel
_hot_cache_par_chunk_size = ClaimChunkSize;
@@ -64,26 +63,21 @@ jbyte* G1HotCardCache::insert(jbyte* card_ptr) {
// return it for immediate refining.
return card_ptr;
}
-
// Otherwise, the card is hot.
- jbyte* res = NULL;
- MutexLockerEx x(HotCardCache_lock, Mutex::_no_safepoint_check_flag);
- if (_n_hot == _hot_cache_size) {
- res = _hot_cache[_hot_cache_idx];
- _n_hot--;
- }
+ size_t index = Atomic::add(1, &_hot_cache_idx) - 1;
+ size_t masked_index = index & (_hot_cache_size - 1);
+ jbyte* current_ptr = _hot_cache[masked_index];
- // Now _n_hot < _hot_cache_size, and we can insert at _hot_cache_idx.
- _hot_cache[_hot_cache_idx] = card_ptr;
- _hot_cache_idx++;
-
- if (_hot_cache_idx == _hot_cache_size) {
- // Wrap around
- _hot_cache_idx = 0;
- }
- _n_hot++;
-
- return res;
+ // Try to store the new card pointer into the cache. Compare-and-swap to guard
+ // against the unlikely event of a race resulting in another card pointer to
+ // have already been written to the cache. In this case we will return
+ // card_ptr in favor of the other option, which would be starting over. This
+ // should be OK since card_ptr will likely be the older card already when/if
+ // this ever happens.
+ jbyte* previous_ptr = (jbyte*)Atomic::cmpxchg_ptr(card_ptr,
+ &_hot_cache[masked_index],
+ current_ptr);
+ return (previous_ptr == current_ptr) ? previous_ptr : card_ptr;
}
void G1HotCardCache::drain(uint worker_i,
@@ -96,38 +90,38 @@ void G1HotCardCache::drain(uint worker_i,
assert(_hot_cache != NULL, "Logic");
assert(!use_cache(), "cache should be disabled");
- int start_idx;
- while ((start_idx = _hot_cache_par_claimed_idx) < _n_hot) { // read once
- int end_idx = start_idx + _hot_cache_par_chunk_size;
+ while (_hot_cache_par_claimed_idx < _hot_cache_size) {
+ size_t end_idx = Atomic::add(_hot_cache_par_chunk_size,
+ &_hot_cache_par_claimed_idx);
+ size_t start_idx = end_idx - _hot_cache_par_chunk_size;
+ // The current worker has successfully claimed the chunk [start_idx..end_idx)
+ end_idx = MIN2(end_idx, _hot_cache_size);
+ for (size_t i = start_idx; i < end_idx; i++) {
+ jbyte* card_ptr = _hot_cache[i];
+ if (card_ptr != NULL) {
+ if (g1rs->refine_card(card_ptr, worker_i, true)) {
+ // The part of the heap spanned by the card contains references
+ // that point into the current collection set.
+ // We need to record the card pointer in the DirtyCardQueueSet
+ // that we use for such cards.
+ //
+ // The only time we care about recording cards that contain
+ // references that point into the collection set is during
+ // RSet updating while within an evacuation pause.
+ // In this case worker_i should be the id of a GC worker thread
+ assert(SafepointSynchronize::is_at_safepoint(), "Should be at a safepoint");
+ assert(worker_i < ParallelGCThreads,
+ err_msg("incorrect worker id: %u", worker_i));
- if (start_idx ==
- Atomic::cmpxchg(end_idx, &_hot_cache_par_claimed_idx, start_idx)) {
- // The current worker has successfully claimed the chunk [start_idx..end_idx)
- end_idx = MIN2(end_idx, _n_hot);
- for (int i = start_idx; i < end_idx; i++) {
- jbyte* card_ptr = _hot_cache[i];
- if (card_ptr != NULL) {
- if (g1rs->refine_card(card_ptr, worker_i, true)) {
- // The part of the heap spanned by the card contains references
- // that point into the current collection set.
- // We need to record the card pointer in the DirtyCardQueueSet
- // that we use for such cards.
- //
- // The only time we care about recording cards that contain
- // references that point into the collection set is during
- // RSet updating while within an evacuation pause.
- // In this case worker_i should be the id of a GC worker thread
- assert(SafepointSynchronize::is_at_safepoint(), "Should be at a safepoint");
- assert(worker_i < ParallelGCThreads,
- err_msg("incorrect worker id: %u", worker_i));
-
- into_cset_dcq->enqueue(card_ptr);
- }
+ into_cset_dcq->enqueue(card_ptr);
}
+ } else {
+ break;
}
}
}
+
// The existing entries in the hot card cache, which were just refined
// above, are discarded prior to re-enabling the cache near the end of the GC.
}
diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1HotCardCache.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1HotCardCache.hpp
index 691966a172f..b065e36ce9a 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/g1HotCardCache.hpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1HotCardCache.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -54,21 +54,30 @@ class HeapRegion;
// code, increasing throughput.
class G1HotCardCache: public CHeapObj {
- G1CollectedHeap* _g1h;
+
+ G1CollectedHeap* _g1h;
+
+ bool _use_cache;
+
+ G1CardCounts _card_counts;
// The card cache table
- jbyte** _hot_cache;
+ jbyte** _hot_cache;
- int _hot_cache_size;
- int _n_hot;
- int _hot_cache_idx;
+ size_t _hot_cache_size;
- int _hot_cache_par_chunk_size;
- volatile int _hot_cache_par_claimed_idx;
+ int _hot_cache_par_chunk_size;
- bool _use_cache;
+ // Avoids false sharing when concurrently updating _hot_cache_idx or
+ // _hot_cache_par_claimed_idx. These are never updated at the same time
+ // thus it's not necessary to separate them as well
+ char _pad_before[DEFAULT_CACHE_LINE_SIZE];
- G1CardCounts _card_counts;
+ volatile size_t _hot_cache_idx;
+
+ volatile size_t _hot_cache_par_claimed_idx;
+
+ char _pad_after[DEFAULT_CACHE_LINE_SIZE];
// The number of cached cards a thread claims when flushing the cache
static const int ClaimChunkSize = 32;
@@ -113,16 +122,25 @@ class G1HotCardCache: public CHeapObj {
void reset_hot_cache() {
assert(SafepointSynchronize::is_at_safepoint(), "Should be at a safepoint");
assert(Thread::current()->is_VM_thread(), "Current thread should be the VMthread");
- _hot_cache_idx = 0; _n_hot = 0;
+ if (default_use_cache()) {
+ reset_hot_cache_internal();
+ }
}
- bool hot_cache_is_empty() { return _n_hot == 0; }
-
// Zeros the values in the card counts table for entire committed heap
void reset_card_counts();
// Zeros the values in the card counts table for the given region
void reset_card_counts(HeapRegion* hr);
+
+ private:
+ void reset_hot_cache_internal() {
+ assert(_hot_cache != NULL, "Logic");
+ _hot_cache_idx = 0;
+ for (size_t i = 0; i < _hot_cache_size; i++) {
+ _hot_cache[i] = NULL;
+ }
+ }
};
#endif // SHARE_VM_GC_IMPLEMENTATION_G1_G1HOTCARDCACHE_HPP
diff --git a/hotspot/src/share/vm/runtime/mutexLocker.cpp b/hotspot/src/share/vm/runtime/mutexLocker.cpp
index 11badd0c17b..351a4eb3702 100644
--- a/hotspot/src/share/vm/runtime/mutexLocker.cpp
+++ b/hotspot/src/share/vm/runtime/mutexLocker.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -120,7 +120,6 @@ Monitor* SecondaryFreeList_lock = NULL;
Mutex* OldSets_lock = NULL;
Monitor* RootRegionScan_lock = NULL;
Mutex* MMUTracker_lock = NULL;
-Mutex* HotCardCache_lock = NULL;
Monitor* GCTaskManager_lock = NULL;
@@ -199,7 +198,6 @@ void mutex_init() {
def(OldSets_lock , Mutex , leaf , true, Monitor::_safepoint_check_never);
def(RootRegionScan_lock , Monitor, leaf , true, Monitor::_safepoint_check_never);
def(MMUTracker_lock , Mutex , leaf , true, Monitor::_safepoint_check_never);
- def(HotCardCache_lock , Mutex , special , true, Monitor::_safepoint_check_never);
def(EvacFailureStack_lock , Mutex , nonleaf , true, Monitor::_safepoint_check_never);
def(StringDedupQueue_lock , Monitor, leaf, true, Monitor::_safepoint_check_never);
diff --git a/hotspot/src/share/vm/runtime/mutexLocker.hpp b/hotspot/src/share/vm/runtime/mutexLocker.hpp
index 8ec82fc63dd..39b5571e305 100644
--- a/hotspot/src/share/vm/runtime/mutexLocker.hpp
+++ b/hotspot/src/share/vm/runtime/mutexLocker.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -122,7 +122,6 @@ extern Mutex* OldSets_lock; // protects the old region sets
extern Monitor* RootRegionScan_lock; // used to notify that the CM threads have finished scanning the IM snapshot regions
extern Mutex* MMUTracker_lock; // protects the MMU
// tracker data structures
-extern Mutex* HotCardCache_lock; // protects the hot card cache
extern Mutex* Management_lock; // a lock used to serialize JVM management
extern Monitor* Service_lock; // a lock used for service thread operation
From 1a1ddd0d4bfcd8a90bc3d25932339cf9fc67e7f6 Mon Sep 17 00:00:00 2001
From: Kim Barrett
Date: Thu, 29 Jan 2015 00:08:38 -0500
Subject: [PATCH 03/61] 8068942: Improve validation of -XX:G1ConfidencePercent
value
Validate during argument processing and simplify usage by assuming validated.
Reviewed-by: jmasa, tschatzl
---
.../g1/g1CollectorPolicy.cpp | 15 +---
hotspot/src/share/vm/runtime/arguments.cpp | 1 +
hotspot/test/TEST.groups | 1 +
.../gc/arguments/TestG1PercentageOptions.java | 89 +++++++++++++++++++
4 files changed, 95 insertions(+), 11 deletions(-)
create mode 100644 hotspot/test/gc/arguments/TestG1PercentageOptions.java
diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp
index 175c5eb9448..2507d4e3e28 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp
@@ -139,6 +139,8 @@ G1CollectorPolicy::G1CollectorPolicy() :
_survivor_cset_region_length(0),
_old_cset_region_length(0),
+ _sigma(G1ConfidencePercent / 100.0),
+
_collection_set(NULL),
_collection_set_bytes_used_before(0),
@@ -161,17 +163,8 @@ G1CollectorPolicy::G1CollectorPolicy() :
_gc_overhead_perc(0.0) {
- uintx confidence_perc = G1ConfidencePercent;
- // Put an artificial ceiling on this so that it's not set to a silly value.
- if (confidence_perc > 100) {
- confidence_perc = 100;
- warning("G1ConfidencePercent is set to a value that is too large, "
- "it's been updated to %u", confidence_perc);
- }
- // '_sigma' must be initialized before the SurvRateGroups below because they
- // indirecty access '_sigma' trough the 'this' pointer in their constructor.
- _sigma = (double) confidence_perc / 100.0;
-
+ // SurvRateGroups below must be initialized after '_sigma' because they
+ // indirectly access '_sigma' through this object passed to their constructor.
_short_lived_surv_rate_group =
new SurvRateGroup(this, "Short Lived", G1YoungSurvRateNumRegionsSummary);
_survivor_surv_rate_group =
diff --git a/hotspot/src/share/vm/runtime/arguments.cpp b/hotspot/src/share/vm/runtime/arguments.cpp
index 0c31c9bc112..0a965e8076b 100644
--- a/hotspot/src/share/vm/runtime/arguments.cpp
+++ b/hotspot/src/share/vm/runtime/arguments.cpp
@@ -2316,6 +2316,7 @@ bool Arguments::check_vm_args_consistency() {
status = status && verify_percentage(G1MaxNewSizePercent, "G1MaxNewSizePercent");
status = status && verify_interval(G1NewSizePercent, 0, G1MaxNewSizePercent, "G1NewSizePercent");
+ status = status && verify_percentage(G1ConfidencePercent, "G1ConfidencePercent");
status = status && verify_percentage(InitiatingHeapOccupancyPercent,
"InitiatingHeapOccupancyPercent");
status = status && verify_min_value(G1RefProcDrainInterval, 1,
diff --git a/hotspot/test/TEST.groups b/hotspot/test/TEST.groups
index 8c52e3ac175..3eaca1c8bb1 100644
--- a/hotspot/test/TEST.groups
+++ b/hotspot/test/TEST.groups
@@ -224,6 +224,7 @@ needs_g1gc = \
gc/arguments/TestAlignmentToUseLargePages.java \
gc/arguments/TestG1HeapRegionSize.java \
gc/arguments/TestG1HeapSizeFlags.java \
+ gc/arguments/TestG1PercentageOptions.java \
gc/arguments/TestMaxHeapSizeTools.java \
gc/arguments/TestMaxNewSize.java \
gc/arguments/TestParallelGCThreads.java \
diff --git a/hotspot/test/gc/arguments/TestG1PercentageOptions.java b/hotspot/test/gc/arguments/TestG1PercentageOptions.java
new file mode 100644
index 00000000000..f66656f80da
--- /dev/null
+++ b/hotspot/test/gc/arguments/TestG1PercentageOptions.java
@@ -0,0 +1,89 @@
+/*
+* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* This code is free software; you can redistribute it and/or modify it
+* under the terms of the GNU General Public License version 2 only, as
+* published by the Free Software Foundation.
+*
+* 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 TestG1PercentageOptions
+ * @key gc
+ * @bug 8068942
+ * @summary Test argument processing of various percentage options
+ * @library /testlibrary
+ * @run driver TestG1PercentageOptions
+ */
+
+import com.oracle.java.testlibrary.*;
+
+public class TestG1PercentageOptions {
+
+ private static final class OptionDescription {
+ public final String name;
+ public final String[] valid;
+ public final String[] invalid;
+
+ OptionDescription(String name_, String[] valid_, String[] invalid_) {
+ name = name_;
+ valid = valid_;
+ invalid = invalid_;
+ }
+ }
+
+ private static final String[] defaultValid = new String[] {
+ "0", "1", "50", "95", "100" };
+ private static final String[] defaultInvalid = new String[] {
+ "-10", "110", "bad" };
+
+ // All of the G1 product arguments that are percentages.
+ private static final OptionDescription[] percentOptions = new OptionDescription[] {
+ new OptionDescription("G1ConfidencePercent", defaultValid, defaultInvalid)
+ // Other percentage options are not yet validated by argument processing.
+ };
+
+ private static void check(String flag, boolean is_valid) throws Exception {
+ String[] flags = new String[] { "-XX:+UseG1GC", flag, "-version" };
+ ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(flags);
+ OutputAnalyzer output = new OutputAnalyzer(pb.start());
+ if (is_valid) {
+ output.shouldHaveExitValue(0);
+ } else {
+ output.shouldHaveExitValue(1);
+ }
+ }
+
+ private static
+ void check(String name, String value, boolean is_valid) throws Exception {
+ check("-XX:" + name + "=" + value, is_valid);
+ }
+
+ public static void main(String args[]) throws Exception {
+ for (OptionDescription option : percentOptions) {
+ for (String value : option.valid) {
+ check(option.name, value, true);
+ }
+ for (String value : option.invalid) {
+ check(option.name, value, false);
+ }
+ check("-XX:" + option.name, false);
+ check("-XX:+" + option.name, false);
+ check("-XX:-" + option.name, false);
+ }
+ }
+}
From d57245dcbbcba811a45f46559b568d8a5f3dbffe Mon Sep 17 00:00:00 2001
From: Coleen Phillimore
Date: Thu, 29 Jan 2015 14:37:14 -0500
Subject: [PATCH 04/61] 8049632: JDK 1.8.0 b132 :Linux x64 : Crash in
ClassFileParser::copy_localvariable_table(..)
Use resource allocated hashtable for local variable table checking
Reviewed-by: kamg, sspitsyn
---
.../share/vm/classfile/classFileParser.cpp | 136 +++-----
.../LocalVariableTable/DuplicateLVT.cod | 293 ++++++++++++++++++
.../LocalVariableTable/DuplicateLVTT.cod | 293 ++++++++++++++++++
.../LocalVariableTable/NotFoundLVTT.cod | 292 +++++++++++++++++
.../runtime/LocalVariableTable/TestLVT.java | 83 +++++
.../runtime/LocalVariableTable/testcase.jar | Bin 0 -> 3387 bytes
6 files changed, 1001 insertions(+), 96 deletions(-)
create mode 100644 hotspot/test/runtime/LocalVariableTable/DuplicateLVT.cod
create mode 100644 hotspot/test/runtime/LocalVariableTable/DuplicateLVTT.cod
create mode 100644 hotspot/test/runtime/LocalVariableTable/NotFoundLVTT.cod
create mode 100644 hotspot/test/runtime/LocalVariableTable/TestLVT.java
create mode 100644 hotspot/test/runtime/LocalVariableTable/testcase.jar
diff --git a/hotspot/src/share/vm/classfile/classFileParser.cpp b/hotspot/src/share/vm/classfile/classFileParser.cpp
index f80d0fcc00e..13449eef879 100644
--- a/hotspot/src/share/vm/classfile/classFileParser.cpp
+++ b/hotspot/src/share/vm/classfile/classFileParser.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -62,6 +62,7 @@
#include "utilities/globalDefinitions.hpp"
#include "utilities/macros.hpp"
#include "utilities/ostream.hpp"
+#include "utilities/resourceHash.hpp"
#if INCLUDE_CDS
#include "classfile/systemDictionaryShared.hpp"
#endif
@@ -693,7 +694,6 @@ void ClassFileParser::patch_constant_pool(constantPoolHandle cp, int index, Hand
}
-
class NameSigHash: public ResourceObj {
public:
Symbol* _name; // name
@@ -1370,6 +1370,33 @@ void ClassFileParser::parse_linenumber_table(
}
+class LVT_Hash : public AllStatic {
+ public:
+
+ static bool equals(LocalVariableTableElement const& e0, LocalVariableTableElement const& e1) {
+ /*
+ * 3-tuple start_bci/length/slot has to be unique key,
+ * so the following comparison seems to be redundant:
+ * && elem->name_cp_index == entry->_elem->name_cp_index
+ */
+ return (e0.start_bci == e1.start_bci &&
+ e0.length == e1.length &&
+ e0.name_cp_index == e1.name_cp_index &&
+ e0.slot == e1.slot);
+ }
+
+ static unsigned int hash(LocalVariableTableElement const& e0) {
+ unsigned int raw_hash = e0.start_bci;
+
+ raw_hash = e0.length + raw_hash * 37;
+ raw_hash = e0.name_cp_index + raw_hash * 37;
+ raw_hash = e0.slot + raw_hash * 37;
+
+ return raw_hash;
+ }
+};
+
+
// Class file LocalVariableTable elements.
class Classfile_LVT_Element VALUE_OBJ_CLASS_SPEC {
public:
@@ -1380,88 +1407,6 @@ class Classfile_LVT_Element VALUE_OBJ_CLASS_SPEC {
u2 slot;
};
-
-class LVT_Hash: public CHeapObj {
- public:
- LocalVariableTableElement *_elem; // element
- LVT_Hash* _next; // Next entry in hash table
-};
-
-unsigned int hash(LocalVariableTableElement *elem) {
- unsigned int raw_hash = elem->start_bci;
-
- raw_hash = elem->length + raw_hash * 37;
- raw_hash = elem->name_cp_index + raw_hash * 37;
- raw_hash = elem->slot + raw_hash * 37;
-
- return raw_hash % HASH_ROW_SIZE;
-}
-
-void initialize_hashtable(LVT_Hash** table) {
- for (int i = 0; i < HASH_ROW_SIZE; i++) {
- table[i] = NULL;
- }
-}
-
-void clear_hashtable(LVT_Hash** table) {
- for (int i = 0; i < HASH_ROW_SIZE; i++) {
- LVT_Hash* current = table[i];
- LVT_Hash* next;
- while (current != NULL) {
- next = current->_next;
- current->_next = NULL;
- delete(current);
- current = next;
- }
- table[i] = NULL;
- }
-}
-
-LVT_Hash* LVT_lookup(LocalVariableTableElement *elem, int index, LVT_Hash** table) {
- LVT_Hash* entry = table[index];
-
- /*
- * 3-tuple start_bci/length/slot has to be unique key,
- * so the following comparison seems to be redundant:
- * && elem->name_cp_index == entry->_elem->name_cp_index
- */
- while (entry != NULL) {
- if (elem->start_bci == entry->_elem->start_bci
- && elem->length == entry->_elem->length
- && elem->name_cp_index == entry->_elem->name_cp_index
- && elem->slot == entry->_elem->slot
- ) {
- return entry;
- }
- entry = entry->_next;
- }
- return NULL;
-}
-
-// Return false if the local variable is found in table.
-// Return true if no duplicate is found.
-// And local variable is added as a new entry in table.
-bool LVT_put_after_lookup(LocalVariableTableElement *elem, LVT_Hash** table) {
- // First lookup for duplicates
- int index = hash(elem);
- LVT_Hash* entry = LVT_lookup(elem, index, table);
-
- if (entry != NULL) {
- return false;
- }
- // No duplicate is found, allocate a new entry and fill it.
- if ((entry = new LVT_Hash()) == NULL) {
- return false;
- }
- entry->_elem = elem;
-
- // Insert into hash table
- entry->_next = table[index];
- table[index] = entry;
-
- return true;
-}
-
void copy_lvt_element(Classfile_LVT_Element *src, LocalVariableTableElement *lvt) {
lvt->start_bci = Bytes::get_Java_u2((u1*) &src->start_bci);
lvt->length = Bytes::get_Java_u2((u1*) &src->length);
@@ -1861,8 +1806,12 @@ void ClassFileParser::copy_localvariable_table(ConstMethod* cm,
u2** localvariable_type_table_start,
TRAPS) {
- LVT_Hash** lvt_Hash = NEW_RESOURCE_ARRAY(LVT_Hash*, HASH_ROW_SIZE);
- initialize_hashtable(lvt_Hash);
+ ResourceMark rm(THREAD);
+
+ typedef ResourceHashtable LVT_HashTable;
+
+ LVT_HashTable* table = new LVT_HashTable();
// To fill LocalVariableTable in
Classfile_LVT_Element* cf_lvt;
@@ -1872,11 +1821,10 @@ void ClassFileParser::copy_localvariable_table(ConstMethod* cm,
cf_lvt = (Classfile_LVT_Element *) localvariable_table_start[tbl_no];
for (int idx = 0; idx < localvariable_table_length[tbl_no]; idx++, lvt++) {
copy_lvt_element(&cf_lvt[idx], lvt);
- // If no duplicates, add LVT elem in hashtable lvt_Hash.
- if (LVT_put_after_lookup(lvt, lvt_Hash) == false
+ // If no duplicates, add LVT elem in hashtable.
+ if (table->put(*lvt, lvt) == false
&& _need_verify
&& _major_version >= JAVA_1_5_VERSION) {
- clear_hashtable(lvt_Hash);
classfile_parse_error("Duplicated LocalVariableTable attribute "
"entry for '%s' in class file %s",
_cp->symbol_at(lvt->name_cp_index)->as_utf8(),
@@ -1893,29 +1841,25 @@ void ClassFileParser::copy_localvariable_table(ConstMethod* cm,
cf_lvtt = (Classfile_LVT_Element *) localvariable_type_table_start[tbl_no];
for (int idx = 0; idx < localvariable_type_table_length[tbl_no]; idx++) {
copy_lvt_element(&cf_lvtt[idx], &lvtt_elem);
- int index = hash(&lvtt_elem);
- LVT_Hash* entry = LVT_lookup(&lvtt_elem, index, lvt_Hash);
+ LocalVariableTableElement** entry = table->get(lvtt_elem);
if (entry == NULL) {
if (_need_verify) {
- clear_hashtable(lvt_Hash);
classfile_parse_error("LVTT entry for '%s' in class file %s "
"does not match any LVT entry",
_cp->symbol_at(lvtt_elem.name_cp_index)->as_utf8(),
CHECK);
}
- } else if (entry->_elem->signature_cp_index != 0 && _need_verify) {
- clear_hashtable(lvt_Hash);
+ } else if ((*entry)->signature_cp_index != 0 && _need_verify) {
classfile_parse_error("Duplicated LocalVariableTypeTable attribute "
"entry for '%s' in class file %s",
_cp->symbol_at(lvtt_elem.name_cp_index)->as_utf8(),
CHECK);
} else {
// to add generic signatures into LocalVariableTable
- entry->_elem->signature_cp_index = lvtt_elem.descriptor_cp_index;
+ (*entry)->signature_cp_index = lvtt_elem.descriptor_cp_index;
}
}
}
- clear_hashtable(lvt_Hash);
}
diff --git a/hotspot/test/runtime/LocalVariableTable/DuplicateLVT.cod b/hotspot/test/runtime/LocalVariableTable/DuplicateLVT.cod
new file mode 100644
index 00000000000..6fca8eeab51
--- /dev/null
+++ b/hotspot/test/runtime/LocalVariableTable/DuplicateLVT.cod
@@ -0,0 +1,293 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * 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.
+ */
+
+// This creates a duplicate LVT entry
+
+class DuplicateLVT {
+ 0xCAFEBABE;
+ 0; // minor version
+ 52; // version
+ [] { // Constant Pool
+ ; // first element is empty
+ Method #34 #68; // #1
+ double 0x3FF199999999999A;; // #2
+ float 0x3F99999A; // #4
+ long 0xFFFFFFFFCAFEBABE;; // #5
+ class #69; // #7
+ Method #7 #68; // #8
+ String #70; // #9
+ Method #7 #71; // #10
+ Field #72 #73; // #11
+ class #74; // #12
+ Method #12 #68; // #13
+ String #75; // #14
+ Method #12 #76; // #15
+ Method #12 #77; // #16
+ Method #12 #78; // #17
+ Method #79 #80; // #18
+ String #81; // #19
+ Method #12 #82; // #20
+ String #83; // #21
+ Method #12 #84; // #22
+ String #85; // #23
+ Method #12 #86; // #24
+ String #87; // #25
+ Method #12 #88; // #26
+ String #89; // #27
+ String #90; // #28
+ Method #12 #91; // #29
+ String #92; // #30
+ String #93; // #31
+ Method #12 #94; // #32
+ class #95; // #33
+ class #96; // #34
+ Utf8 ""; // #35
+ Utf8 "()V"; // #36
+ Utf8 "Code"; // #37
+ Utf8 "LineNumberTable"; // #38
+ Utf8 "LocalVariableTable"; // #39
+ Utf8 "this"; // #40
+ Utf8 "LDuplicateLVT;"; // #41
+ Utf8 "main"; // #42
+ Utf8 "([Ljava/lang/String;)V"; // #43
+ Utf8 "args"; // #44
+ Utf8 "[Ljava/lang/String;"; // #45
+ Utf8 "b"; // #46
+ Utf8 "Z"; // #47
+ Utf8 "by"; // #48
+ Utf8 "B"; // #49
+ Utf8 "c"; // #50
+ Utf8 "C"; // #51
+ Utf8 "d"; // #52
+ Utf8 "D"; // #53
+ Utf8 "f"; // #54
+ Utf8 "F"; // #55
+ Utf8 "i"; // #56
+ Utf8 "I"; // #57
+ Utf8 "l"; // #58
+ Utf8 "J"; // #59
+ Utf8 "s"; // #60
+ Utf8 "S"; // #61
+ Utf8 "list"; // #62
+ Utf8 "Ljava/util/ArrayList;"; // #63
+ Utf8 "LocalVariableTypeTable"; // #64
+ Utf8 "Ljava/util/ArrayList;"; // #65
+ Utf8 "SourceFile"; // #66
+ Utf8 "DuplicateLVT.java"; // #67
+ NameAndType #35 #36; // #68
+ Utf8 "java/util/ArrayList"; // #69
+ Utf8 "me"; // #70
+ NameAndType #97 #98; // #71
+ class #99; // #72
+ NameAndType #100 #101; // #73
+ Utf8 "java/lang/StringBuilder"; // #74
+ Utf8 "b="; // #75
+ NameAndType #102 #103; // #76
+ NameAndType #102 #104; // #77
+ NameAndType #105 #106; // #78
+ class #107; // #79
+ NameAndType #108 #109; // #80
+ Utf8 "by="; // #81
+ NameAndType #102 #110; // #82
+ Utf8 "c="; // #83
+ NameAndType #102 #111; // #84
+ Utf8 "d="; // #85
+ NameAndType #102 #112; // #86
+ Utf8 "f="; // #87
+ NameAndType #102 #113; // #88
+ Utf8 "i="; // #89
+ Utf8 "l="; // #90
+ NameAndType #102 #114; // #91
+ Utf8 "s="; // #92
+ Utf8 "ArrayList="; // #93
+ NameAndType #102 #115; // #94
+ Utf8 "DuplicateLVT"; // #95
+ Utf8 "java/lang/Object"; // #96
+ Utf8 "add"; // #97
+ Utf8 "(Ljava/lang/Object;)Z"; // #98
+ Utf8 "java/lang/System"; // #99
+ Utf8 "out"; // #100
+ Utf8 "Ljava/io/PrintStream;"; // #101
+ Utf8 "append"; // #102
+ Utf8 "(Ljava/lang/String;)Ljava/lang/StringBuilder;"; // #103
+ Utf8 "(Z)Ljava/lang/StringBuilder;"; // #104
+ Utf8 "toString"; // #105
+ Utf8 "()Ljava/lang/String;"; // #106
+ Utf8 "java/io/PrintStream"; // #107
+ Utf8 "println"; // #108
+ Utf8 "(Ljava/lang/String;)V"; // #109
+ Utf8 "(I)Ljava/lang/StringBuilder;"; // #110
+ Utf8 "(C)Ljava/lang/StringBuilder;"; // #111
+ Utf8 "(D)Ljava/lang/StringBuilder;"; // #112
+ Utf8 "(F)Ljava/lang/StringBuilder;"; // #113
+ Utf8 "(J)Ljava/lang/StringBuilder;"; // #114
+ Utf8 "(Ljava/lang/Object;)Ljava/lang/StringBuilder;"; // #115
+ } // Constant Pool
+
+ 0x0021; // access
+ #33;// this_cpx
+ #34;// super_cpx
+
+ [] { // Interfaces
+ } // Interfaces
+
+ [] { // fields
+ } // fields
+
+ [] { // methods
+ { // Member
+ 0x0001; // access
+ #35; // name_cpx
+ #36; // sig_cpx
+ [] { // Attributes
+ Attr(#37) { // Code
+ 1; // max_stack
+ 1; // max_locals
+ Bytes[]{
+ 0x2AB70001B1;
+ };
+ [] { // Traps
+ } // end Traps
+ [] { // Attributes
+ Attr(#38) { // LineNumberTable
+ [] { // LineNumberTable
+ 0 26;
+ }
+ } // end LineNumberTable
+ ;
+ Attr(#39) { // LocalVariableTable
+ [] { // LocalVariableTable
+ 0 5 40 41 0;
+ }
+ } // end LocalVariableTable
+ } // Attributes
+ } // end Code
+ } // Attributes
+ } // Member
+ ;
+ { // Member
+ 0x0009; // access
+ #42; // name_cpx
+ #43; // sig_cpx
+ [] { // Attributes
+ Attr(#37) { // Code
+ 4; // max_stack
+ 12; // max_locals
+ Bytes[]{
+ 0x043C10423D10583E;
+ 0x1400023904120438;
+ 0x06102A3607140005;
+ 0x37081058360ABB00;
+ 0x0759B700083A0B19;
+ 0x0B1209B6000A57B2;
+ 0x000BBB000C59B700;
+ 0x0D120EB6000F1BB6;
+ 0x0010B60011B60012;
+ 0xB2000BBB000C59B7;
+ 0x000D1213B6000F1C;
+ 0xB60014B60011B600;
+ 0x12B2000BBB000C59;
+ 0xB7000D1215B6000F;
+ 0x1DB60016B60011B6;
+ 0x0012B2000BBB000C;
+ 0x59B7000D1217B600;
+ 0x0F1804B60018B600;
+ 0x11B60012B2000BBB;
+ 0x000C59B7000D1219;
+ 0xB6000F1706B6001A;
+ 0xB60011B60012B200;
+ 0x0BBB000C59B7000D;
+ 0x121BB6000F1507B6;
+ 0x0014B60011B60012;
+ 0xB2000BBB000C59B7;
+ 0x000D121CB6000F16;
+ 0x08B6001DB60011B6;
+ 0x0012B2000BBB000C;
+ 0x59B7000D121EB600;
+ 0x0F150AB60014B600;
+ 0x11B60012B2000BBB;
+ 0x000C59B7000D121F;
+ 0xB6000F190BB60020;
+ 0xB60011B60012B1;
+ };
+ [] { // Traps
+ } // end Traps
+ [] { // Attributes
+ Attr(#38) { // LineNumberTable
+ [] { // LineNumberTable
+ 0 28;
+ 2 29;
+ 5 30;
+ 8 31;
+ 13 32;
+ 17 33;
+ 21 34;
+ 26 35;
+ 30 36;
+ 39 37;
+ 47 39;
+ 72 40;
+ 97 41;
+ 122 42;
+ 148 43;
+ 174 44;
+ 200 45;
+ 226 46;
+ 252 47;
+ 278 48;
+ }
+ } // end LineNumberTable
+ ;
+ Attr(#39) { // LocalVariableTable
+ [] { // LocalVariableTable
+ 0 279 44 45 0;
+ 2 277 46 47 1;
+ 5 274 48 49 2;
+ 5 274 48 49 2;
+ 8 271 50 51 3;
+ 13 266 52 53 4;
+ 17 262 54 55 6;
+ 21 258 56 57 7;
+ 26 253 58 59 8;
+ 30 249 60 61 10;
+ 39 240 62 63 11;
+ }
+ } // end LocalVariableTable
+ ;
+ Attr(#64) { // LocalVariableTypeTable
+ [] { // LocalVariableTypeTable
+ 39 240 62 65 11;
+ }
+ } // end LocalVariableTypeTable
+ } // Attributes
+ } // end Code
+ } // Attributes
+ } // Member
+ } // methods
+
+ [] { // Attributes
+ Attr(#66) { // SourceFile
+ #67;
+ } // end SourceFile
+ } // Attributes
+} // end class DuplicateLVT
diff --git a/hotspot/test/runtime/LocalVariableTable/DuplicateLVTT.cod b/hotspot/test/runtime/LocalVariableTable/DuplicateLVTT.cod
new file mode 100644
index 00000000000..191c115a4e8
--- /dev/null
+++ b/hotspot/test/runtime/LocalVariableTable/DuplicateLVTT.cod
@@ -0,0 +1,293 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * 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.
+ */
+
+// There's a duplicate LVTT entry below.
+
+class DuplicateLVTT {
+ 0xCAFEBABE;
+ 0; // minor version
+ 52; // version
+ [] { // Constant Pool
+ ; // first element is empty
+ Method #34 #68; // #1
+ double 0x3FF199999999999A;; // #2
+ float 0x3F99999A; // #4
+ long 0xFFFFFFFFCAFEBABE;; // #5
+ class #69; // #7
+ Method #7 #68; // #8
+ String #70; // #9
+ Method #7 #71; // #10
+ Field #72 #73; // #11
+ class #74; // #12
+ Method #12 #68; // #13
+ String #75; // #14
+ Method #12 #76; // #15
+ Method #12 #77; // #16
+ Method #12 #78; // #17
+ Method #79 #80; // #18
+ String #81; // #19
+ Method #12 #82; // #20
+ String #83; // #21
+ Method #12 #84; // #22
+ String #85; // #23
+ Method #12 #86; // #24
+ String #87; // #25
+ Method #12 #88; // #26
+ String #89; // #27
+ String #90; // #28
+ Method #12 #91; // #29
+ String #92; // #30
+ String #93; // #31
+ Method #12 #94; // #32
+ class #95; // #33
+ class #96; // #34
+ Utf8 ""; // #35
+ Utf8 "()V"; // #36
+ Utf8 "Code"; // #37
+ Utf8 "LineNumberTable"; // #38
+ Utf8 "LocalVariableTable"; // #39
+ Utf8 "this"; // #40
+ Utf8 "LDuplicateLVTT;"; // #41
+ Utf8 "main"; // #42
+ Utf8 "([Ljava/lang/String;)V"; // #43
+ Utf8 "args"; // #44
+ Utf8 "[Ljava/lang/String;"; // #45
+ Utf8 "b"; // #46
+ Utf8 "Z"; // #47
+ Utf8 "by"; // #48
+ Utf8 "B"; // #49
+ Utf8 "c"; // #50
+ Utf8 "C"; // #51
+ Utf8 "d"; // #52
+ Utf8 "D"; // #53
+ Utf8 "f"; // #54
+ Utf8 "F"; // #55
+ Utf8 "i"; // #56
+ Utf8 "I"; // #57
+ Utf8 "l"; // #58
+ Utf8 "J"; // #59
+ Utf8 "s"; // #60
+ Utf8 "S"; // #61
+ Utf8 "list"; // #62
+ Utf8 "Ljava/util/ArrayList;"; // #63
+ Utf8 "LocalVariableTypeTable"; // #64
+ Utf8 "Ljava/util/ArrayList;"; // #65
+ Utf8 "SourceFile"; // #66
+ Utf8 "DuplicateLVTT.java"; // #67
+ NameAndType #35 #36; // #68
+ Utf8 "java/util/ArrayList"; // #69
+ Utf8 "me"; // #70
+ NameAndType #97 #98; // #71
+ class #99; // #72
+ NameAndType #100 #101; // #73
+ Utf8 "java/lang/StringBuilder"; // #74
+ Utf8 "b="; // #75
+ NameAndType #102 #103; // #76
+ NameAndType #102 #104; // #77
+ NameAndType #105 #106; // #78
+ class #107; // #79
+ NameAndType #108 #109; // #80
+ Utf8 "by="; // #81
+ NameAndType #102 #110; // #82
+ Utf8 "c="; // #83
+ NameAndType #102 #111; // #84
+ Utf8 "d="; // #85
+ NameAndType #102 #112; // #86
+ Utf8 "f="; // #87
+ NameAndType #102 #113; // #88
+ Utf8 "i="; // #89
+ Utf8 "l="; // #90
+ NameAndType #102 #114; // #91
+ Utf8 "s="; // #92
+ Utf8 "ArrayList="; // #93
+ NameAndType #102 #115; // #94
+ Utf8 "DuplicateLVTT"; // #95
+ Utf8 "java/lang/Object"; // #96
+ Utf8 "add"; // #97
+ Utf8 "(Ljava/lang/Object;)Z"; // #98
+ Utf8 "java/lang/System"; // #99
+ Utf8 "out"; // #100
+ Utf8 "Ljava/io/PrintStream;"; // #101
+ Utf8 "append"; // #102
+ Utf8 "(Ljava/lang/String;)Ljava/lang/StringBuilder;"; // #103
+ Utf8 "(Z)Ljava/lang/StringBuilder;"; // #104
+ Utf8 "toString"; // #105
+ Utf8 "()Ljava/lang/String;"; // #106
+ Utf8 "java/io/PrintStream"; // #107
+ Utf8 "println"; // #108
+ Utf8 "(Ljava/lang/String;)V"; // #109
+ Utf8 "(I)Ljava/lang/StringBuilder;"; // #110
+ Utf8 "(C)Ljava/lang/StringBuilder;"; // #111
+ Utf8 "(D)Ljava/lang/StringBuilder;"; // #112
+ Utf8 "(F)Ljava/lang/StringBuilder;"; // #113
+ Utf8 "(J)Ljava/lang/StringBuilder;"; // #114
+ Utf8 "(Ljava/lang/Object;)Ljava/lang/StringBuilder;"; // #115
+ } // Constant Pool
+
+ 0x0021; // access
+ #33;// this_cpx
+ #34;// super_cpx
+
+ [] { // Interfaces
+ } // Interfaces
+
+ [] { // fields
+ } // fields
+
+ [] { // methods
+ { // Member
+ 0x0001; // access
+ #35; // name_cpx
+ #36; // sig_cpx
+ [] { // Attributes
+ Attr(#37) { // Code
+ 1; // max_stack
+ 1; // max_locals
+ Bytes[]{
+ 0x2AB70001B1;
+ };
+ [] { // Traps
+ } // end Traps
+ [] { // Attributes
+ Attr(#38) { // LineNumberTable
+ [] { // LineNumberTable
+ 0 26;
+ }
+ } // end LineNumberTable
+ ;
+ Attr(#39) { // LocalVariableTable
+ [] { // LocalVariableTable
+ 0 5 40 41 0;
+ }
+ } // end LocalVariableTable
+ } // Attributes
+ } // end Code
+ } // Attributes
+ } // Member
+ ;
+ { // Member
+ 0x0009; // access
+ #42; // name_cpx
+ #43; // sig_cpx
+ [] { // Attributes
+ Attr(#37) { // Code
+ 4; // max_stack
+ 12; // max_locals
+ Bytes[]{
+ 0x043C10423D10583E;
+ 0x1400023904120438;
+ 0x06102A3607140005;
+ 0x37081058360ABB00;
+ 0x0759B700083A0B19;
+ 0x0B1209B6000A57B2;
+ 0x000BBB000C59B700;
+ 0x0D120EB6000F1BB6;
+ 0x0010B60011B60012;
+ 0xB2000BBB000C59B7;
+ 0x000D1213B6000F1C;
+ 0xB60014B60011B600;
+ 0x12B2000BBB000C59;
+ 0xB7000D1215B6000F;
+ 0x1DB60016B60011B6;
+ 0x0012B2000BBB000C;
+ 0x59B7000D1217B600;
+ 0x0F1804B60018B600;
+ 0x11B60012B2000BBB;
+ 0x000C59B7000D1219;
+ 0xB6000F1706B6001A;
+ 0xB60011B60012B200;
+ 0x0BBB000C59B7000D;
+ 0x121BB6000F1507B6;
+ 0x0014B60011B60012;
+ 0xB2000BBB000C59B7;
+ 0x000D121CB6000F16;
+ 0x08B6001DB60011B6;
+ 0x0012B2000BBB000C;
+ 0x59B7000D121EB600;
+ 0x0F150AB60014B600;
+ 0x11B60012B2000BBB;
+ 0x000C59B7000D121F;
+ 0xB6000F190BB60020;
+ 0xB60011B60012B1;
+ };
+ [] { // Traps
+ } // end Traps
+ [] { // Attributes
+ Attr(#38) { // LineNumberTable
+ [] { // LineNumberTable
+ 0 28;
+ 2 29;
+ 5 30;
+ 8 31;
+ 13 32;
+ 17 33;
+ 21 34;
+ 26 35;
+ 30 36;
+ 39 37;
+ 47 39;
+ 72 40;
+ 97 41;
+ 122 42;
+ 148 43;
+ 174 44;
+ 200 45;
+ 226 46;
+ 252 47;
+ 278 48;
+ }
+ } // end LineNumberTable
+ ;
+ Attr(#39) { // LocalVariableTable
+ [] { // LocalVariableTable
+ 0 279 44 45 0;
+ 2 277 46 47 1;
+ 5 274 48 49 2;
+ 8 271 50 51 3;
+ 13 266 52 53 4;
+ 17 262 54 55 6;
+ 21 258 56 57 7;
+ 26 253 58 59 8;
+ 30 249 60 61 10;
+ 39 240 62 63 11;
+ }
+ } // end LocalVariableTable
+ ;
+ Attr(#64) { // LocalVariableTypeTable
+ [] { // LocalVariableTypeTable
+ 39 240 62 65 11;
+ 39 240 62 65 11;
+ }
+ } // end LocalVariableTypeTable
+ } // Attributes
+ } // end Code
+ } // Attributes
+ } // Member
+ } // methods
+
+ [] { // Attributes
+ Attr(#66) { // SourceFile
+ #67;
+ } // end SourceFile
+ } // Attributes
+} // end class DuplicateLVTT
diff --git a/hotspot/test/runtime/LocalVariableTable/NotFoundLVTT.cod b/hotspot/test/runtime/LocalVariableTable/NotFoundLVTT.cod
new file mode 100644
index 00000000000..ebe0c33275f
--- /dev/null
+++ b/hotspot/test/runtime/LocalVariableTable/NotFoundLVTT.cod
@@ -0,0 +1,292 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * 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.
+ */
+
+// The LVTT entry points to a non-existant LVT entry
+
+class NotFoundLVTT {
+ 0xCAFEBABE;
+ 0; // minor version
+ 52; // version
+ [] { // Constant Pool
+ ; // first element is empty
+ Method #34 #68; // #1
+ double 0x3FF199999999999A;; // #2
+ float 0x3F99999A; // #4
+ long 0xFFFFFFFFCAFEBABE;; // #5
+ class #69; // #7
+ Method #7 #68; // #8
+ String #70; // #9
+ Method #7 #71; // #10
+ Field #72 #73; // #11
+ class #74; // #12
+ Method #12 #68; // #13
+ String #75; // #14
+ Method #12 #76; // #15
+ Method #12 #77; // #16
+ Method #12 #78; // #17
+ Method #79 #80; // #18
+ String #81; // #19
+ Method #12 #82; // #20
+ String #83; // #21
+ Method #12 #84; // #22
+ String #85; // #23
+ Method #12 #86; // #24
+ String #87; // #25
+ Method #12 #88; // #26
+ String #89; // #27
+ String #90; // #28
+ Method #12 #91; // #29
+ String #92; // #30
+ String #93; // #31
+ Method #12 #94; // #32
+ class #95; // #33
+ class #96; // #34
+ Utf8 ""; // #35
+ Utf8 "()V"; // #36
+ Utf8 "Code"; // #37
+ Utf8 "LineNumberTable"; // #38
+ Utf8 "LocalVariableTable"; // #39
+ Utf8 "this"; // #40
+ Utf8 "LNotFoundLVTT;"; // #41
+ Utf8 "main"; // #42
+ Utf8 "([Ljava/lang/String;)V"; // #43
+ Utf8 "args"; // #44
+ Utf8 "[Ljava/lang/String;"; // #45
+ Utf8 "b"; // #46
+ Utf8 "Z"; // #47
+ Utf8 "by"; // #48
+ Utf8 "B"; // #49
+ Utf8 "c"; // #50
+ Utf8 "C"; // #51
+ Utf8 "d"; // #52
+ Utf8 "D"; // #53
+ Utf8 "f"; // #54
+ Utf8 "F"; // #55
+ Utf8 "i"; // #56
+ Utf8 "I"; // #57
+ Utf8 "l"; // #58
+ Utf8 "J"; // #59
+ Utf8 "s"; // #60
+ Utf8 "S"; // #61
+ Utf8 "list"; // #62
+ Utf8 "Ljava/util/ArrayList;"; // #63
+ Utf8 "LocalVariableTypeTable"; // #64
+ Utf8 "Ljava/util/ArrayList;"; // #65
+ Utf8 "SourceFile"; // #66
+ Utf8 "NotFoundLVTT.java"; // #67
+ NameAndType #35 #36; // #68
+ Utf8 "java/util/ArrayList"; // #69
+ Utf8 "me"; // #70
+ NameAndType #97 #98; // #71
+ class #99; // #72
+ NameAndType #100 #101; // #73
+ Utf8 "java/lang/StringBuilder"; // #74
+ Utf8 "b="; // #75
+ NameAndType #102 #103; // #76
+ NameAndType #102 #104; // #77
+ NameAndType #105 #106; // #78
+ class #107; // #79
+ NameAndType #108 #109; // #80
+ Utf8 "by="; // #81
+ NameAndType #102 #110; // #82
+ Utf8 "c="; // #83
+ NameAndType #102 #111; // #84
+ Utf8 "d="; // #85
+ NameAndType #102 #112; // #86
+ Utf8 "f="; // #87
+ NameAndType #102 #113; // #88
+ Utf8 "i="; // #89
+ Utf8 "l="; // #90
+ NameAndType #102 #114; // #91
+ Utf8 "s="; // #92
+ Utf8 "ArrayList="; // #93
+ NameAndType #102 #115; // #94
+ Utf8 "NotFoundLVTT"; // #95
+ Utf8 "java/lang/Object"; // #96
+ Utf8 "add"; // #97
+ Utf8 "(Ljava/lang/Object;)Z"; // #98
+ Utf8 "java/lang/System"; // #99
+ Utf8 "out"; // #100
+ Utf8 "Ljava/io/PrintStream;"; // #101
+ Utf8 "append"; // #102
+ Utf8 "(Ljava/lang/String;)Ljava/lang/StringBuilder;"; // #103
+ Utf8 "(Z)Ljava/lang/StringBuilder;"; // #104
+ Utf8 "toString"; // #105
+ Utf8 "()Ljava/lang/String;"; // #106
+ Utf8 "java/io/PrintStream"; // #107
+ Utf8 "println"; // #108
+ Utf8 "(Ljava/lang/String;)V"; // #109
+ Utf8 "(I)Ljava/lang/StringBuilder;"; // #110
+ Utf8 "(C)Ljava/lang/StringBuilder;"; // #111
+ Utf8 "(D)Ljava/lang/StringBuilder;"; // #112
+ Utf8 "(F)Ljava/lang/StringBuilder;"; // #113
+ Utf8 "(J)Ljava/lang/StringBuilder;"; // #114
+ Utf8 "(Ljava/lang/Object;)Ljava/lang/StringBuilder;"; // #115
+ } // Constant Pool
+
+ 0x0021; // access
+ #33;// this_cpx
+ #34;// super_cpx
+
+ [] { // Interfaces
+ } // Interfaces
+
+ [] { // fields
+ } // fields
+
+ [] { // methods
+ { // Member
+ 0x0001; // access
+ #35; // name_cpx
+ #36; // sig_cpx
+ [] { // Attributes
+ Attr(#37) { // Code
+ 1; // max_stack
+ 1; // max_locals
+ Bytes[]{
+ 0x2AB70001B1;
+ };
+ [] { // Traps
+ } // end Traps
+ [] { // Attributes
+ Attr(#38) { // LineNumberTable
+ [] { // LineNumberTable
+ 0 26;
+ }
+ } // end LineNumberTable
+ ;
+ Attr(#39) { // LocalVariableTable
+ [] { // LocalVariableTable
+ 0 5 40 41 0;
+ }
+ } // end LocalVariableTable
+ } // Attributes
+ } // end Code
+ } // Attributes
+ } // Member
+ ;
+ { // Member
+ 0x0009; // access
+ #42; // name_cpx
+ #43; // sig_cpx
+ [] { // Attributes
+ Attr(#37) { // Code
+ 4; // max_stack
+ 12; // max_locals
+ Bytes[]{
+ 0x043C10423D10583E;
+ 0x1400023904120438;
+ 0x06102A3607140005;
+ 0x37081058360ABB00;
+ 0x0759B700083A0B19;
+ 0x0B1209B6000A57B2;
+ 0x000BBB000C59B700;
+ 0x0D120EB6000F1BB6;
+ 0x0010B60011B60012;
+ 0xB2000BBB000C59B7;
+ 0x000D1213B6000F1C;
+ 0xB60014B60011B600;
+ 0x12B2000BBB000C59;
+ 0xB7000D1215B6000F;
+ 0x1DB60016B60011B6;
+ 0x0012B2000BBB000C;
+ 0x59B7000D1217B600;
+ 0x0F1804B60018B600;
+ 0x11B60012B2000BBB;
+ 0x000C59B7000D1219;
+ 0xB6000F1706B6001A;
+ 0xB60011B60012B200;
+ 0x0BBB000C59B7000D;
+ 0x121BB6000F1507B6;
+ 0x0014B60011B60012;
+ 0xB2000BBB000C59B7;
+ 0x000D121CB6000F16;
+ 0x08B6001DB60011B6;
+ 0x0012B2000BBB000C;
+ 0x59B7000D121EB600;
+ 0x0F150AB60014B600;
+ 0x11B60012B2000BBB;
+ 0x000C59B7000D121F;
+ 0xB6000F190BB60020;
+ 0xB60011B60012B1;
+ };
+ [] { // Traps
+ } // end Traps
+ [] { // Attributes
+ Attr(#38) { // LineNumberTable
+ [] { // LineNumberTable
+ 0 28;
+ 2 29;
+ 5 30;
+ 8 31;
+ 13 32;
+ 17 33;
+ 21 34;
+ 26 35;
+ 30 36;
+ 39 37;
+ 47 39;
+ 72 40;
+ 97 41;
+ 122 42;
+ 148 43;
+ 174 44;
+ 200 45;
+ 226 46;
+ 252 47;
+ 278 48;
+ }
+ } // end LineNumberTable
+ ;
+ Attr(#39) { // LocalVariableTable
+ [] { // LocalVariableTable
+ 0 279 44 45 0;
+ 2 277 46 47 1;
+ 5 274 48 49 2;
+ 8 271 50 51 3;
+ 13 266 52 53 4;
+ 17 262 54 55 6;
+ 21 258 56 57 7;
+ 26 253 58 59 8;
+ 30 249 60 61 10;
+ 39 240 62 63 11;
+ }
+ } // end LocalVariableTable
+ ;
+ Attr(#64) { // LocalVariableTypeTable
+ [] { // LocalVariableTypeTable
+ 38 240 62 65 11;
+ }
+ } // end LocalVariableTypeTable
+ } // Attributes
+ } // end Code
+ } // Attributes
+ } // Member
+ } // methods
+
+ [] { // Attributes
+ Attr(#66) { // SourceFile
+ #67;
+ } // end SourceFile
+ } // Attributes
+} // end class NotFoundLVTT
diff --git a/hotspot/test/runtime/LocalVariableTable/TestLVT.java b/hotspot/test/runtime/LocalVariableTable/TestLVT.java
new file mode 100644
index 00000000000..337de2c8750
--- /dev/null
+++ b/hotspot/test/runtime/LocalVariableTable/TestLVT.java
@@ -0,0 +1,83 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * 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 8049632
+ * @summary Test ClassFileParser::copy_localvariable_table cases
+ * @library /testlibrary
+ * @compile -g -XDignore.symbol.file TestLVT.java
+ * @run main TestLVT
+ */
+
+import com.oracle.java.testlibrary.*;
+import java.util.*;
+
+public class TestLVT {
+ public static void main(String[] args) throws Exception {
+ test(); // Test good LVT in this test
+
+ String jarFile = System.getProperty("test.src") + "/testcase.jar";
+
+ // java -cp $testSrc/testcase.jar DuplicateLVT
+ ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-cp", jarFile, "DuplicateLVT");
+ new OutputAnalyzer(pb.start())
+ .shouldContain("Duplicated LocalVariableTable attribute entry for 'by' in class file DuplicateLVT")
+ .shouldHaveExitValue(1);
+
+ // java -cp $testclasses/testcase.jar DuplicateLVTT
+ pb = ProcessTools.createJavaProcessBuilder("-cp", jarFile, "DuplicateLVTT");
+ new OutputAnalyzer(pb.start())
+ .shouldContain("Duplicated LocalVariableTypeTable attribute entry for 'list' in class file DuplicateLVTT")
+ .shouldHaveExitValue(1);
+
+ // java -cp $testclasses/testcase.jar NotFoundLVTT
+ pb = ProcessTools.createJavaProcessBuilder("-cp", jarFile, "NotFoundLVTT");
+ new OutputAnalyzer(pb.start())
+ .shouldContain("LVTT entry for 'list' in class file NotFoundLVTT does not match any LVT entry")
+ .shouldHaveExitValue(1);
+ }
+
+ public static void test() {
+ boolean b = true;
+ byte by = 0x42;
+ char c = 'X';
+ double d = 1.1;
+ float f = (float) 1.2;
+ int i = 42;
+ long l = 0xCAFEBABE;
+ short s = 88;
+ ArrayList list = new ArrayList();
+ list.add("me");
+
+ System.out.println("b=" + b);
+ System.out.println("by=" + by);
+ System.out.println("c=" + c);
+ System.out.println("d=" + d);
+ System.out.println("f=" + f);
+ System.out.println("i=" + i);
+ System.out.println("l=" + l);
+ System.out.println("s=" + s);
+ System.out.println("ArrayList=" + list);
+ }
+}
diff --git a/hotspot/test/runtime/LocalVariableTable/testcase.jar b/hotspot/test/runtime/LocalVariableTable/testcase.jar
new file mode 100644
index 0000000000000000000000000000000000000000..cec87c8596b7dfd4abfdf7946da5ded1334ff04c
GIT binary patch
literal 3387
zcmZ{n2UJtp7KQ^PNG}qapdbP&NN=Hx3PLDJkPa$6bm^U;muDc
~DZC;|eJ`jUAw4m#`YyY5=&u6zD-_c?2Qd;iw}Mgs%`=;-JGAC1(YfMY=q
z00IzNCh8Kp`cSFEZUBG=U;sNoN0~wW*EECwD+ZHi{17A5^>v|I#wL;o=q94K2M&{v
z9At(`h`s6UuQ!q&mYZGlmDEFA(nSmgQ~~KNKJuD?RZV}OC
ztQcgOn{$C%14Dfb$McVm0!p%%1
zk?wYWe&MFKjXBJDBJ}CT9P4w~G6d;dT4-;=8?$Z+f^`g~V-bp%cQ4lAe-x5Y9t0
zbKHC9RNh8dIQy3utL`Tq#%!0#ZEqAXvt++=Uur4XQC>UfU6`F2ZKWacr`&;c0+)^=
zF18jQY&uLGt*g#5gKXRk(hO@aEf$`c>_EquGC!A}&X5%!3-20{e=r}7ezY)Gf-cD9
z6MJ#j*SO={#iu4}X0;OU&WpV;T(2={HU8QXBLJkXHyiUEqP9vHL{J?W;anKv>deM0
ztFt$pJP4f=4VraXF?L?36ktWH$q~zyjZ)sC`IY7#)wU3)K)-WZpp^AnLfsK#A}E1DW0_o04e&Z0apC+1J$oGt
z(tlz+2x#9o8$hhfU~J4A>>TPPt!EUsY#3c+hI=ya+FyCY&*4c>rp!)A5`VxS@Z4?N6oV_%$yZ7DpKR?H-LR#xf?}%U
zMd~U_hF7-fQI^OV8An{!?x4m4y$vc375ME_B5!1EO{$%8*@+w;MXrS-;QWx^)?w*%U)gG*cpdX5U%cpPW<#lSK^W-=y8N1#
zA0$Mh&dr@4&+nYA^ad55&gz3F@GsDrSYDNqEKR+Y;3E|~*-01VTZlxY&n!M>PT4!p
zvIim_FkWsG;2{>{ql0wNkjqZVZs5;NfCLmaj`-D{V
zy)--Eyh42ZsQ!>Ga#^-S&NO!|hx>r8x&ZY=uR83>K2z&eff^&{kq<6*I`E3^#npf}
z)6S2=t2UN46U_no?StNIxi2U8h#R5ri_1P9q|WetG5Fd<3*zNW96B6CF@}|tx$$>%=tcFQzKtxGm*REZ(DwVb`>4;&HBB@R`TW60
zv=jdP?RJ5GoIR&1o~y#NzzOyTw=u;wCH9U=G`WljGuEppKEC+w+G(yQV6`E;vRAo_
zd}nm3!a@Dj1LD71XHDN(KG5yY!_~FmdY|<JV0aP9DcHRIGAJSezUwRw`c=%akr
z+7}|#A&W-DWxDTfm8srYSk8u)jQ+DlAzuwYMsf4MhBQu3Mgc`#_M{V#eS{ZhNC_HD
zyUy*K^>dB>;1_a-@kjoGYRWa5gQ0rNj}W(|N+y42*>d;3!1KYcWNM$gEqj3XQ|kV#
z(6_S0$B9(j7_X?`fKW@#i71|EL+*7&+q9R~t%)rjootx4sKhzNINUWEoH6eRONS|U
znMY@iT3LWfeQKw{K*yn|(1+FamFAQSTXbEgMKDN%TGoR!j;=i~eh;xmGI;q=3t+%L`wPiVGWYCWjqxZJ>PDh$R#R8tdv=9`xe;GTa=VPBJt8voxS(x_p
zF?_>{jsRmA^~b>R3pG{GhVFy=cB>21MT>-OTi!s|M5-xJ5^IaTH9xPJ*6o*1F6`jWa-XPk`=oNuzED>6h~
z3BM`qk?t#;NN(S{J;HauAn4PY)8>MM4Ab5cs^KlxN_io9yjMaVXE=REDsdF@JB`D7
zW#i4fPi>{=)??>i9&Y#d?5XI_Gx4pmr6rrfPt&3q^i;ZSquL0{OMG{&6hHaWk)f>>
z8IvPJ%ejA_0R0c2xMFx(21{mGUy0dvLnfVN@DHh4o4R`1Fz91iDX>9gUew)i)`GYEaMYhJ(1k#gcSeo}8XNEtZX9Gbv#M}B8DB9j<#hSWvaLF`9-?UVV+q$z%M51NXy-ZCb3)?O
zoMlk(Gd{I-yy=II*82b-(jwc$OI8*dPHL|?Dm=ej(-OV$m2>#^T#5IC{@Cr=
zptzZ<6*X4^UtL?kqwb@qSZl*y8d9G-^WNiX%**>I2R>`)@4W}^`kbVh)Qbt_
zU4p*GXZWNjAR=N3ijXhG%B$S`JC8`zk@gIcb83fLH-&xLZ2Cmyl_N@xeFKElEj=5|
zUj@$#ZB`1!z)0x<-x!mR^lbbbX@ufjEtk?cgrdap-I4d~nu!Vy7GpfqcC__LYALOl
z4*qtM(++RJro^Z#d(MtP&;O8pH@b9(g6!8nk)@&r1AaF8f4g{!(f>JqICqNeH-P;t
zJ?^(DHvgaajXeAzJ!blkuR!tT$NN8}V*C?t$isiT^y7MpOE_MOC@$fjh$8Rgxc;vK
nbbJ9y$vS>AKPMnh{=fNm0W*Ms$Y%%ufXLTnDga=ak@ECk@^8OV
literal 0
HcmV?d00001
From 62166e9f598a192f573906a5b144f783918fac03 Mon Sep 17 00:00:00 2001
From: Christian Tornqvist
Date: Thu, 29 Jan 2015 14:50:43 -0800
Subject: [PATCH 05/61] 8071584: [TESTBUG] runtime/Unsafe/AllocateMemory.java
crashed on OOM during compilation
Reviewed-by: dholmes, gtriantafill, jprovino
---
hotspot/test/runtime/Unsafe/AllocateMemory.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/hotspot/test/runtime/Unsafe/AllocateMemory.java b/hotspot/test/runtime/Unsafe/AllocateMemory.java
index 0c2b28f3911..9f4cf530bd6 100644
--- a/hotspot/test/runtime/Unsafe/AllocateMemory.java
+++ b/hotspot/test/runtime/Unsafe/AllocateMemory.java
@@ -25,7 +25,7 @@
* @test
* @summary Verifies behaviour of Unsafe.allocateMemory
* @library /testlibrary
- * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:MallocMaxTestWords=20m AllocateMemory
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:MallocMaxTestWords=100m AllocateMemory
*/
import com.oracle.java.testlibrary.*;
@@ -56,7 +56,7 @@ public class AllocateMemory {
// allocateMemory() should throw an OutOfMemoryError when the underlying malloc fails,
// we test this by limiting the malloc using -XX:MallocMaxTestWords
try {
- address = unsafe.allocateMemory(20 * 1024 * 1024 * 8);
+ address = unsafe.allocateMemory(100 * 1024 * 1024 * 8);
} catch (OutOfMemoryError e) {
// Expected
return;
From 2989b5405dee12590af1b8d9275d7cecb5fdcf8b Mon Sep 17 00:00:00 2001
From: Jaroslav Bachorik
Date: Fri, 30 Jan 2015 22:01:32 +0100
Subject: [PATCH 06/61] 8071641:
java/lang/management/ThreadMXBean/SynchronizationStatistics.java
intermittently failed with NPE
Reviewed-by: sjiang, dfuchs
---
.../ThreadMXBean/SynchronizationStatistics.java | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/jdk/test/java/lang/management/ThreadMXBean/SynchronizationStatistics.java b/jdk/test/java/lang/management/ThreadMXBean/SynchronizationStatistics.java
index f998b7e2375..6cb4bfb0720 100644
--- a/jdk/test/java/lang/management/ThreadMXBean/SynchronizationStatistics.java
+++ b/jdk/test/java/lang/management/ThreadMXBean/SynchronizationStatistics.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -75,7 +75,7 @@ public class SynchronizationStatistics {
}
private static void waitForThreadState(Thread t, Thread.State state) throws InterruptedException {
- while (!t.isInterrupted() && t.getState() != state) {
+ while (t.getState() != state) {
Thread.sleep(3);
}
}
@@ -109,7 +109,9 @@ public class SynchronizationStatistics {
synchronized(lock1) {
p.arriveAndAwaitAdvance(); // phase[1]
waitForThreadState(lt, Thread.State.BLOCKED);
- lockName = mbean.getThreadInfo(tid).getLockName();
+ do {
+ lockName = mbean.getThreadInfo(tid).getLockName();
+ } while (lockName == null);
}
p.arriveAndAwaitAdvance(); // phase[2]
@@ -159,7 +161,9 @@ public class SynchronizationStatistics {
synchronized(lock1) {
p.arriveAndAwaitAdvance(); // phase[1]
waitForThreadState(lt, Thread.State.BLOCKED);
- lockName = mbean.getThreadInfo(tid).getLockName();
+ do {
+ lockName = mbean.getThreadInfo(tid).getLockName();
+ } while (lockName == null);
}
p.arriveAndAwaitAdvance(); // phase[2]
@@ -168,7 +172,9 @@ public class SynchronizationStatistics {
synchronized(lock2) {
p.arriveAndAwaitAdvance(); // phase [3]
waitForThreadState(lt, Thread.State.BLOCKED);
- lockName = mbean.getThreadInfo(tid).getLockName();
+ do {
+ lockName = mbean.getThreadInfo(tid).getLockName();
+ } while (lockName == null);
}
p.arriveAndAwaitAdvance(); // phase [4]
testBlocked(ti, () -> mbean.getThreadInfo(tid), lockName, lock2);
From 45a6ed8315939ff5922e2ddbc0b3f8451554ce92 Mon Sep 17 00:00:00 2001
From: Katja Kantserova
Date: Fri, 30 Jan 2015 09:31:18 +0100
Subject: [PATCH 07/61] 8068613: Wrong number of objects pending finalization
start
Repeat until expected result, instead of fail after sleep()
Reviewed-by: sla
---
.../lang/management/MemoryMXBean/Pending.java | 71 ++++++-------------
1 file changed, 22 insertions(+), 49 deletions(-)
diff --git a/jdk/test/java/lang/management/MemoryMXBean/Pending.java b/jdk/test/java/lang/management/MemoryMXBean/Pending.java
index 678bc7e4ca7..f468aa36449 100644
--- a/jdk/test/java/lang/management/MemoryMXBean/Pending.java
+++ b/jdk/test/java/lang/management/MemoryMXBean/Pending.java
@@ -39,7 +39,7 @@ import java.lang.management.*;
public class Pending {
final static int NO_REF_COUNT = 600;
- final static int REF_COUNT = 600;
+ final static int REF_COUNT = 500;
final static int TOTAL_FINALIZABLE = (NO_REF_COUNT + REF_COUNT);
private static int finalized = 0;
private static MemoryMXBean mbean
@@ -83,31 +83,22 @@ public class Pending {
// Clean the memory and remove all objects that are pending
// finalization
System.gc();
- Runtime.getRuntime().runFinalization();
-
- // Let the finalizer to finish
- try {
- Thread.sleep(200);
- } catch (Exception e) {
- throw e;
- }
-
- // Create a number of new objects but no references to them
- int startCount = mbean.getObjectPendingFinalizationCount();
+ Snapshot snapshot = getSnapshotAfterFinalization();
System.out.println("Number of objects pending for finalization:");
- System.out.println(" Before creating object: " + startCount +
- " finalized = " + finalized);
+ System.out.println(" Before creating object: " + snapshot);
printFinalizerInstanceCount();
+ // Create objects without saving reference. Should be removed at next GC.
for (int i = 0; i < NO_REF_COUNT; i++) {
new MyObject();
}
- Snapshot snapshot = getSnapshot();
+ snapshot = getSnapshot();
System.out.println(" Afer creating objects with no ref: " + snapshot);
printFinalizerInstanceCount();
+ // Create objects and save references.
objs = new Object[REF_COUNT];
for (int i = 0; i < REF_COUNT; i++) {
objs[i] = new MyObject();
@@ -139,9 +130,8 @@ public class Pending {
+ TOTAL_FINALIZABLE);
}
- if (startCount != 0 || snapshot.curPending != 0) {
+ if (snapshot.curPending != 0) {
throw new RuntimeException("Wrong number of objects pending "
- + "finalization start = " + startCount
+ " end = " + snapshot);
}
@@ -161,29 +151,8 @@ public class Pending {
snapshot.curFinalized != expectedTotal && i <= MAX_GC_LOOP;
i++) {
System.gc();
+ snapshot = getSnapshotAfterFinalization();
- // Pause to give a chance to Finalizer thread to run
- pause();
-
- printFinalizerInstanceCount();
- // Race condition may occur; attempt to check this
- // a few times before throwing exception.
- for (int j = 0; j < 5; j++) {
- // poll for another current pending count
- snapshot = getSnapshot();
- if (snapshot.curFinalized == expectedTotal ||
- snapshot.curPending != 0) {
- break;
- }
- }
- System.out.println(" After GC " + i + ": " + snapshot);
-
- Runtime.getRuntime().runFinalization();
-
- // Pause to give a chance to Finalizer thread to run
- pause();
-
- snapshot = getSnapshot();
if (snapshot.curFinalized == expectedTotal &&
snapshot.curPending != 0) {
throw new RuntimeException(
@@ -237,17 +206,21 @@ public class Pending {
}
}
- private static Object pauseObj = new Object();
- private static void pause() {
- // Enter lock a without blocking
- synchronized (pauseObj) {
- try {
- // may need to tune this timeout for different platforms
- pauseObj.wait(20);
- } catch (Exception e) {
- System.err.println("Unexpected exception.");
- e.printStackTrace(System.err);
+ // Repeat getSnapshot until no pending finalization.
+ private static Snapshot getSnapshotAfterFinalization() throws Exception {
+ int loopCount = 0;
+ Snapshot snapshot = null;
+ while (loopCount < 100) {
+ Runtime.getRuntime().runFinalization();
+ Thread.sleep(50);
+ snapshot = getSnapshot();
+ if (snapshot.curPending == 0) {
+ return snapshot;
}
+ ++loopCount;
+ System.out.println("Waiting for curPending to be 0. snapshot=" + snapshot);
}
+ String msg = "Objects pending finalization is not 0. snapshot=%s";
+ throw new RuntimeException(String.format(msg, snapshot));
}
}
From 8563f899e6fcad3fdc8cb4db78203314e9ff2ade Mon Sep 17 00:00:00 2001
From: Katja Kantserova
Date: Fri, 30 Jan 2015 09:32:23 +0100
Subject: [PATCH 08/61] 8071784:
serviceability/attach/AttachWithStalePidFile.java should be quarantined
Reviewed-by: sla, jbachorik
---
hotspot/test/serviceability/attach/AttachWithStalePidFile.java | 1 +
1 file changed, 1 insertion(+)
diff --git a/hotspot/test/serviceability/attach/AttachWithStalePidFile.java b/hotspot/test/serviceability/attach/AttachWithStalePidFile.java
index 69dff6d9888..51798e6afe0 100644
--- a/hotspot/test/serviceability/attach/AttachWithStalePidFile.java
+++ b/hotspot/test/serviceability/attach/AttachWithStalePidFile.java
@@ -26,6 +26,7 @@
* @bug 7162400
* @key regression
* @summary Regression test for attach issue where stale pid files in /tmp lead to connection issues
+ * @ignore 8024055
* @library /testlibrary
* @build com.oracle.java.testlibrary.* AttachWithStalePidFileTarget
* @run main AttachWithStalePidFile
From 353ca5002c67d827b0d83d1970d4b1f6d5b68102 Mon Sep 17 00:00:00 2001
From: Mikael Auno
Date: Fri, 30 Jan 2015 20:20:11 +0100
Subject: [PATCH 09/61] 8071909: Port testlibrary improvments in jdk/test to
hotspot/test as required for DCMD test port
Reviewed-by: jbachorik, egahlin, ykantser, mtobiass
---
.../java/testlibrary/OutputAnalyzer.java | 68 +++++++++++++++++++
.../oracle/java/testlibrary/ProcessTools.java | 45 +++++++-----
2 files changed, 97 insertions(+), 16 deletions(-)
diff --git a/hotspot/test/testlibrary/com/oracle/java/testlibrary/OutputAnalyzer.java b/hotspot/test/testlibrary/com/oracle/java/testlibrary/OutputAnalyzer.java
index b81f21a0184..191a75c5b92 100644
--- a/hotspot/test/testlibrary/com/oracle/java/testlibrary/OutputAnalyzer.java
+++ b/hotspot/test/testlibrary/com/oracle/java/testlibrary/OutputAnalyzer.java
@@ -24,6 +24,8 @@
package com.oracle.java.testlibrary;
import java.io.IOException;
+import java.util.Arrays;
+import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@@ -69,6 +71,58 @@ public final class OutputAnalyzer {
}
/**
+ * Verify that the stdout contents of output buffer is empty
+ *
+ * @throws RuntimeException
+ * If stdout was not empty
+ */
+ public void stdoutShouldBeEmpty() {
+ if (!getStdout().isEmpty()) {
+ reportDiagnosticSummary();
+ throw new RuntimeException("stdout was not empty");
+ }
+ }
+
+ /**
+ * Verify that the stderr contents of output buffer is empty
+ *
+ * @throws RuntimeException
+ * If stderr was not empty
+ */
+ public void stderrShouldBeEmpty() {
+ if (!getStderr().isEmpty()) {
+ reportDiagnosticSummary();
+ throw new RuntimeException("stderr was not empty");
+ }
+ }
+
+ /**
+ * Verify that the stdout contents of output buffer is not empty
+ *
+ * @throws RuntimeException
+ * If stdout was empty
+ */
+ public void stdoutShouldNotBeEmpty() {
+ if (getStdout().isEmpty()) {
+ reportDiagnosticSummary();
+ throw new RuntimeException("stdout was empty");
+ }
+ }
+
+ /**
+ * Verify that the stderr contents of output buffer is not empty
+ *
+ * @throws RuntimeException
+ * If stderr was empty
+ */
+ public void stderrShouldNotBeEmpty() {
+ if (getStderr().isEmpty()) {
+ reportDiagnosticSummary();
+ throw new RuntimeException("stderr was empty");
+ }
+ }
+
+ /**
* Verify that the stdout and stderr contents of output buffer contains the string
*
* @param expectedString String that buffer should contain
@@ -365,4 +419,18 @@ public final class OutputAnalyzer {
public int getExitValue() {
return exitValue;
}
+
+ /**
+ * Get the contents of the output buffer (stdout and stderr) as list of strings.
+ * Output will be split by newlines.
+ *
+ * @return Contents of the output buffer as list of strings
+ */
+ public List asLines() {
+ return asLines(getOutput());
+ }
+
+ private List asLines(String buffer) {
+ return Arrays.asList(buffer.split("(\\r\\n|\\n|\\r)"));
+ }
}
diff --git a/hotspot/test/testlibrary/com/oracle/java/testlibrary/ProcessTools.java b/hotspot/test/testlibrary/com/oracle/java/testlibrary/ProcessTools.java
index c63076ec8e6..167d6d134b1 100644
--- a/hotspot/test/testlibrary/com/oracle/java/testlibrary/ProcessTools.java
+++ b/hotspot/test/testlibrary/com/oracle/java/testlibrary/ProcessTools.java
@@ -184,23 +184,36 @@ public final class ProcessTools {
return executeProcess(pb);
}
- /**
- * Executes a process, waits for it to finish and returns the process output.
- * @param pb The ProcessBuilder to execute.
- * @return The output from the process.
- */
- public static OutputAnalyzer executeProcess(ProcessBuilder pb) throws Throwable {
- OutputAnalyzer output = null;
- try {
- output = new OutputAnalyzer(pb.start());
- return output;
- } catch (Throwable t) {
- System.out.println("executeProcess() failed: " + t);
- throw t;
- } finally {
- System.out.println(getProcessLog(pb, output));
+ /**
+ * Executes a process, waits for it to finish and returns the process output.
+ * The process will have exited before this method returns.
+ * @param pb The ProcessBuilder to execute.
+ * @return The {@linkplain OutputAnalyzer} instance wrapping the process.
+ */
+ public static OutputAnalyzer executeProcess(ProcessBuilder pb) throws Exception {
+ OutputAnalyzer output = null;
+ Process p = null;
+ boolean failed = false;
+ try {
+ p = pb.start();
+ output = new OutputAnalyzer(p);
+ p.waitFor();
+
+ return output;
+ } catch (Throwable t) {
+ if (p != null) {
+ p.destroyForcibly().waitFor();
+ }
+
+ failed = true;
+ System.out.println("executeProcess() failed: " + t);
+ throw t;
+ } finally {
+ if (failed) {
+ System.err.println(getProcessLog(pb, output));
+ }
+ }
}
- }
/**
* Executes a process, waits for it to finish and returns the process output.
From 2f12527848d3cddda2544002746b6de59cd02582 Mon Sep 17 00:00:00 2001
From: Mikael Auno
Date: Fri, 30 Jan 2015 20:00:57 +0100
Subject: [PATCH 10/61] 8071908: Port internal Diagnostic Command tests and
test framework to jtreg
Reviewed-by: jbachorik, egahlin, ykantser, mtobiass
---
hotspot/test/TEST.groups | 2 +-
.../test/serviceability/dcmd/DcmdUtil.java | 73 -------
.../dcmd/compiler/CodeCacheTest.java | 69 ++++---
.../dcmd/compiler/CodelistTest.java | 36 ++--
.../dcmd/compiler/CompilerQueueTest.java | 56 +++---
.../dcmd/compiler/MethodIdentifierParser.java | 4 +-
.../dcmd/framework/HelpTest.java | 69 +++++++
.../dcmd/framework/InvalidCommandTest.java | 66 +++++++
.../dcmd/framework/VMVersionTest.java | 66 +++++++
.../dcmd/gc/ClassHistogramAllTest.java | 40 ++++
.../dcmd/gc/ClassHistogramTest.java | 89 +++++++++
.../dcmd/gc/HeapDumpAllTest.java | 41 ++++
.../serviceability/dcmd/gc/HeapDumpTest.java | 90 +++++++++
.../dcmd/gc/RunFinalizationTest.java | 98 +++++++++
.../serviceability/dcmd/gc/RunGCTest.java | 65 ++++++
.../dcmd/thread/PrintConcurrentLocksTest.java | 39 ++++
.../serviceability/dcmd/thread/PrintTest.java | 174 ++++++++++++++++
.../dcmd/{ => vm}/ClassLoaderStatsTest.java | 49 +++--
.../dcmd/vm/CommandLineTest.java | 49 +++++
.../DynLibsTest.java} | 37 ++--
.../serviceability/dcmd/vm/FlagsTest.java | 56 ++++++
.../dcmd/vm/SystemPropertiesTest.java | 53 +++++
.../serviceability/dcmd/vm/UptimeTest.java | 89 +++++++++
.../testlibrary/dcmd/CommandExecutor.java | 57 ++++++
.../dcmd/CommandExecutorException.java | 36 ++++
.../testlibrary/dcmd/FileJcmdExecutor.java | 81 ++++++++
.../java/testlibrary/dcmd/JMXExecutor.java | 187 ++++++++++++++++++
.../java/testlibrary/dcmd/JcmdExecutor.java | 58 ++++++
.../dcmd/MainClassJcmdExecutor.java | 57 ++++++
.../testlibrary/dcmd/PidJcmdExecutor.java | 63 ++++++
30 files changed, 1774 insertions(+), 175 deletions(-)
delete mode 100644 hotspot/test/serviceability/dcmd/DcmdUtil.java
create mode 100644 hotspot/test/serviceability/dcmd/framework/HelpTest.java
create mode 100644 hotspot/test/serviceability/dcmd/framework/InvalidCommandTest.java
create mode 100644 hotspot/test/serviceability/dcmd/framework/VMVersionTest.java
create mode 100644 hotspot/test/serviceability/dcmd/gc/ClassHistogramAllTest.java
create mode 100644 hotspot/test/serviceability/dcmd/gc/ClassHistogramTest.java
create mode 100644 hotspot/test/serviceability/dcmd/gc/HeapDumpAllTest.java
create mode 100644 hotspot/test/serviceability/dcmd/gc/HeapDumpTest.java
create mode 100644 hotspot/test/serviceability/dcmd/gc/RunFinalizationTest.java
create mode 100644 hotspot/test/serviceability/dcmd/gc/RunGCTest.java
create mode 100644 hotspot/test/serviceability/dcmd/thread/PrintConcurrentLocksTest.java
create mode 100644 hotspot/test/serviceability/dcmd/thread/PrintTest.java
rename hotspot/test/serviceability/dcmd/{ => vm}/ClassLoaderStatsTest.java (79%)
create mode 100644 hotspot/test/serviceability/dcmd/vm/CommandLineTest.java
rename hotspot/test/serviceability/dcmd/{DynLibDcmdTest.java => vm/DynLibsTest.java} (67%)
create mode 100644 hotspot/test/serviceability/dcmd/vm/FlagsTest.java
create mode 100644 hotspot/test/serviceability/dcmd/vm/SystemPropertiesTest.java
create mode 100644 hotspot/test/serviceability/dcmd/vm/UptimeTest.java
create mode 100644 hotspot/test/testlibrary/com/oracle/java/testlibrary/dcmd/CommandExecutor.java
create mode 100644 hotspot/test/testlibrary/com/oracle/java/testlibrary/dcmd/CommandExecutorException.java
create mode 100644 hotspot/test/testlibrary/com/oracle/java/testlibrary/dcmd/FileJcmdExecutor.java
create mode 100644 hotspot/test/testlibrary/com/oracle/java/testlibrary/dcmd/JMXExecutor.java
create mode 100644 hotspot/test/testlibrary/com/oracle/java/testlibrary/dcmd/JcmdExecutor.java
create mode 100644 hotspot/test/testlibrary/com/oracle/java/testlibrary/dcmd/MainClassJcmdExecutor.java
create mode 100644 hotspot/test/testlibrary/com/oracle/java/testlibrary/dcmd/PidJcmdExecutor.java
diff --git a/hotspot/test/TEST.groups b/hotspot/test/TEST.groups
index 8c52e3ac175..80eb42eb8c0 100644
--- a/hotspot/test/TEST.groups
+++ b/hotspot/test/TEST.groups
@@ -97,7 +97,7 @@ needs_jdk = \
runtime/XCheckJniJsig/XCheckJSig.java \
serviceability/attach/AttachWithStalePidFile.java \
serviceability/sa/jmap-hprof/JMapHProfLargeHeapTest.java \
- serviceability/dcmd/DynLibDcmdTest.java
+ serviceability/dcmd/vm/DynLibsTest.java
# JRE adds further tests to compact3
diff --git a/hotspot/test/serviceability/dcmd/DcmdUtil.java b/hotspot/test/serviceability/dcmd/DcmdUtil.java
deleted file mode 100644
index 39ddb06b274..00000000000
--- a/hotspot/test/serviceability/dcmd/DcmdUtil.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-import sun.management.ManagementFactoryHelper;
-
-import com.sun.management.DiagnosticCommandMBean;
-
-public class DcmdUtil
-{
- public static String executeDcmd(String cmd, String ... args) {
- DiagnosticCommandMBean dcmd = ManagementFactoryHelper.getDiagnosticCommandMBean();
- Object[] dcmdArgs = {args};
- String[] signature = {String[].class.getName()};
-
- try {
- System.out.print("> " + cmd + " ");
- for (String s : args) {
- System.out.print(s + " ");
- }
- System.out.println(":");
- String result = (String) dcmd.invoke(transform(cmd), dcmdArgs, signature);
- System.out.println(result);
- return result;
- } catch(Exception ex) {
- ex.printStackTrace();
- }
- return null;
- }
-
- private static String transform(String name) {
- StringBuilder sb = new StringBuilder();
- boolean toLower = true;
- boolean toUpper = false;
- for (int i = 0; i < name.length(); i++) {
- char c = name.charAt(i);
- if (c == '.' || c == '_') {
- toLower = false;
- toUpper = true;
- } else {
- if (toUpper) {
- toUpper = false;
- sb.append(Character.toUpperCase(c));
- } else if(toLower) {
- sb.append(Character.toLowerCase(c));
- } else {
- sb.append(c);
- }
- }
- }
- return sb.toString();
- }
-
-}
diff --git a/hotspot/test/serviceability/dcmd/compiler/CodeCacheTest.java b/hotspot/test/serviceability/dcmd/compiler/CodeCacheTest.java
index 06f7101a35a..f7b4dd6b923 100644
--- a/hotspot/test/serviceability/dcmd/compiler/CodeCacheTest.java
+++ b/hotspot/test/serviceability/dcmd/compiler/CodeCacheTest.java
@@ -24,17 +24,23 @@
/*
* @test CodeCacheTest
* @bug 8054889
- * @library ..
- * @build DcmdUtil CodeCacheTest
- * @run main/othervm -XX:+SegmentedCodeCache CodeCacheTest
- * @run main/othervm -XX:-SegmentedCodeCache CodeCacheTest
- * @run main/othervm -Xint -XX:+SegmentedCodeCache CodeCacheTest
+ * @library /testlibrary
+ * @build com.oracle.java.testlibrary.*
+ * @build com.oracle.java.testlibrary.dcmd.*
+ * @run testng/othervm -XX:+SegmentedCodeCache CodeCacheTest
+ * @run testng/othervm -XX:-SegmentedCodeCache CodeCacheTest
+ * @run testng/othervm -Xint -XX:+SegmentedCodeCache CodeCacheTest
* @summary Test of diagnostic command Compiler.codecache
*/
-import java.io.BufferedReader;
-import java.io.StringReader;
-import java.lang.reflect.Method;
+import org.testng.annotations.Test;
+import org.testng.Assert;
+
+import com.oracle.java.testlibrary.OutputAnalyzer;
+import com.oracle.java.testlibrary.dcmd.CommandExecutor;
+import com.oracle.java.testlibrary.dcmd.JMXExecutor;
+
+import java.util.Iterator;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@@ -72,7 +78,7 @@ public class CodeCacheTest {
private static boolean getFlagBool(String flag, String where) {
Matcher m = Pattern.compile(flag + "\\s+:?= (true|false)").matcher(where);
if (!m.find()) {
- throw new RuntimeException("Could not find value for flag " + flag + " in output string");
+ Assert.fail("Could not find value for flag " + flag + " in output string");
}
return m.group(1).equals("true");
}
@@ -80,16 +86,16 @@ public class CodeCacheTest {
private static int getFlagInt(String flag, String where) {
Matcher m = Pattern.compile(flag + "\\s+:?=\\s+\\d+").matcher(where);
if (!m.find()) {
- throw new RuntimeException("Could not find value for flag " + flag + " in output string");
+ Assert.fail("Could not find value for flag " + flag + " in output string");
}
String match = m.group();
return Integer.parseInt(match.substring(match.lastIndexOf(" ") + 1, match.length()));
}
- public static void main(String arg[]) throws Exception {
+ public void run(CommandExecutor executor) {
// Get number of code cache segments
int segmentsCount = 0;
- String flags = DcmdUtil.executeDcmd("VM.flags", "-all");
+ String flags = executor.execute("VM.flags -all").getOutput();
if (!getFlagBool("SegmentedCodeCache", flags) || !getFlagBool("UseCompiler", flags)) {
// No segmentation
segmentsCount = 1;
@@ -102,29 +108,29 @@ public class CodeCacheTest {
}
// Get output from dcmd (diagnostic command)
- String result = DcmdUtil.executeDcmd("Compiler.codecache");
- BufferedReader r = new BufferedReader(new StringReader(result));
+ OutputAnalyzer output = executor.execute("Compiler.codecache");
+ Iterator lines = output.asLines().iterator();
// Validate code cache segments
String line;
Matcher m;
for (int s = 0; s < segmentsCount; ++s) {
// Validate first line
- line = r.readLine();
+ line = lines.next();
m = line1.matcher(line);
if (m.matches()) {
for (int i = 2; i <= 5; i++) {
int val = Integer.parseInt(m.group(i));
if (val < 0) {
- throw new Exception("Failed parsing dcmd codecache output");
+ Assert.fail("Failed parsing dcmd codecache output");
}
}
} else {
- throw new Exception("Regexp 1 failed");
+ Assert.fail("Regexp 1 failed to match line: " + line);
}
// Validate second line
- line = r.readLine();
+ line = lines.next();
m = line2.matcher(line);
if (m.matches()) {
String start = m.group(1);
@@ -133,44 +139,49 @@ public class CodeCacheTest {
// Lexical compare of hex numbers to check that they look sane.
if (start.compareTo(mark) > 1) {
- throw new Exception("Failed parsing dcmd codecache output");
+ Assert.fail("Failed parsing dcmd codecache output");
}
if (mark.compareTo(top) > 1) {
- throw new Exception("Failed parsing dcmd codecache output");
+ Assert.fail("Failed parsing dcmd codecache output");
}
} else {
- throw new Exception("Regexp 2 failed line: " + line);
+ Assert.fail("Regexp 2 failed to match line: " + line);
}
}
// Validate third line
- line = r.readLine();
+ line = lines.next();
m = line3.matcher(line);
if (m.matches()) {
int blobs = Integer.parseInt(m.group(1));
if (blobs <= 0) {
- throw new Exception("Failed parsing dcmd codecache output");
+ Assert.fail("Failed parsing dcmd codecache output");
}
int nmethods = Integer.parseInt(m.group(2));
if (nmethods < 0) {
- throw new Exception("Failed parsing dcmd codecache output");
+ Assert.fail("Failed parsing dcmd codecache output");
}
int adapters = Integer.parseInt(m.group(3));
if (adapters <= 0) {
- throw new Exception("Failed parsing dcmd codecache output");
+ Assert.fail("Failed parsing dcmd codecache output");
}
if (blobs < (nmethods + adapters)) {
- throw new Exception("Failed parsing dcmd codecache output");
+ Assert.fail("Failed parsing dcmd codecache output");
}
} else {
- throw new Exception("Regexp 3 failed");
+ Assert.fail("Regexp 3 failed to match line: " + line);
}
// Validate fourth line
- line = r.readLine();
+ line = lines.next();
m = line4.matcher(line);
if (!m.matches()) {
- throw new Exception("Regexp 4 failed");
+ Assert.fail("Regexp 4 failed to match line: " + line);
}
}
+
+ @Test
+ public void jmx() {
+ run(new JMXExecutor());
+ }
}
diff --git a/hotspot/test/serviceability/dcmd/compiler/CodelistTest.java b/hotspot/test/serviceability/dcmd/compiler/CodelistTest.java
index 6dcb3458de8..57f5521094f 100644
--- a/hotspot/test/serviceability/dcmd/compiler/CodelistTest.java
+++ b/hotspot/test/serviceability/dcmd/compiler/CodelistTest.java
@@ -24,14 +24,21 @@
/*
* @test CodelistTest
* @bug 8054889
- * @library ..
- * @build DcmdUtil MethodIdentifierParser CodelistTest
- * @run main CodelistTest
+ * @library /testlibrary
+ * @build com.oracle.java.testlibrary.*
+ * @build com.oracle.java.testlibrary.dcmd.*
+ * @build MethodIdentifierParser
+ * @run testng CodelistTest
* @summary Test of diagnostic command Compiler.codelist
*/
-import java.io.BufferedReader;
-import java.io.StringReader;
+import org.testng.annotations.Test;
+import org.testng.Assert;
+
+import com.oracle.java.testlibrary.OutputAnalyzer;
+import com.oracle.java.testlibrary.dcmd.CommandExecutor;
+import com.oracle.java.testlibrary.dcmd.JMXExecutor;
+
import java.lang.reflect.Method;
public class CodelistTest {
@@ -51,19 +58,17 @@ public class CodelistTest {
*
*/
- public static void main(String arg[]) throws Exception {
+ public void run(CommandExecutor executor) {
int ok = 0;
int fail = 0;
// Get output from dcmd (diagnostic command)
- String result = DcmdUtil.executeDcmd("Compiler.codelist");
- BufferedReader r = new BufferedReader(new StringReader(result));
+ OutputAnalyzer output = executor.execute("Compiler.codelist");
// Grab a method name from the output
- String line;
int count = 0;
- while((line = r.readLine()) != null) {
+ for (String line : output.asLines()) {
count++;
String[] parts = line.split(" ");
@@ -83,14 +88,16 @@ public class CodelistTest {
}
MethodIdentifierParser mf = new MethodIdentifierParser(methodPrintedInLogFormat);
- Method m;
+ Method m = null;
try {
m = mf.getMethod();
} catch (NoSuchMethodException e) {
m = null;
+ } catch (ClassNotFoundException e) {
+ Assert.fail("Test error: Caught unexpected exception", e);
}
if (m == null) {
- throw new Exception("Test failed on: " + methodPrintedInLogFormat);
+ Assert.fail("Test failed on: " + methodPrintedInLogFormat);
}
if (count > 10) {
// Testing 10 entries is enough. Lets not waste time.
@@ -98,4 +105,9 @@ public class CodelistTest {
}
}
}
+
+ @Test
+ public void jmx() {
+ run(new JMXExecutor());
+ }
}
diff --git a/hotspot/test/serviceability/dcmd/compiler/CompilerQueueTest.java b/hotspot/test/serviceability/dcmd/compiler/CompilerQueueTest.java
index 3bd7cf3ede1..0b15dceb1c3 100644
--- a/hotspot/test/serviceability/dcmd/compiler/CompilerQueueTest.java
+++ b/hotspot/test/serviceability/dcmd/compiler/CompilerQueueTest.java
@@ -24,17 +24,22 @@
/*
* @test CompilerQueueTest
* @bug 8054889
- * @library ..
+ * @library /testlibrary
* @ignore 8069160
- * @build DcmdUtil CompilerQueueTest
- * @run main CompilerQueueTest
- * @run main/othervm -XX:-TieredCompilation CompilerQueueTest
- * @run main/othervm -Xint CompilerQueueTest
+ * @build com.oracle.java.testlibrary.*
+ * @build com.oracle.java.testlibrary.dcmd.*
+ * @run testng CompilerQueueTest
+ * @run testng/othervm -XX:-TieredCompilation CompilerQueueTest
+ * @run testng/othervm -Xint CompilerQueueTest
* @summary Test of diagnostic command Compiler.queue
*/
-import java.io.BufferedReader;
-import java.io.StringReader;
+import com.oracle.java.testlibrary.OutputAnalyzer;
+import com.oracle.java.testlibrary.dcmd.CommandExecutor;
+import com.oracle.java.testlibrary.dcmd.JMXExecutor;
+import org.testng.annotations.Test;
+
+import java.util.Iterator;
public class CompilerQueueTest {
@@ -60,52 +65,55 @@ public class CompilerQueueTest {
*
**/
- public static void main(String arg[]) throws Exception {
+ public void run(CommandExecutor executor) {
// Get output from dcmd (diagnostic command)
- String result = DcmdUtil.executeDcmd("Compiler.queue");
- BufferedReader r = new BufferedReader(new StringReader(result));
+ OutputAnalyzer output = executor.execute("Compiler.queue");
+ Iterator lines = output.asLines().iterator();
- String str = r.readLine();
-
- while (str != null) {
+ while (lines.hasNext()) {
+ String str = lines.next();
if (str.startsWith("Contents of C")) {
- match(r.readLine(), "----------------------------");
- str = r.readLine();
+ match(lines.next(), "----------------------------");
+ str = lines.next();
if (!str.equals("Empty")) {
while (str.charAt(0) != '-') {
validateMethodLine(str);
- str = r.readLine();
+ str = lines.next();
}
} else {
- str = r.readLine();
+ str = lines.next();
}
match(str,"----------------------------");
- str = r.readLine();
} else {
- throw new Exception("Failed parsing dcmd queue, line: " + str);
+ Assert.fail("Failed parsing dcmd queue, line: " + str);
}
}
}
- private static void validateMethodLine(String str) throws Exception {
+ private static void validateMethodLine(String str) {
// Skip until package/class name begins. Trim to remove whitespace that
// may differ.
String name = str.substring(14).trim();
int sep = name.indexOf("::");
if (sep == -1) {
- throw new Exception("Failed dcmd queue, didn't find separator :: in: " + name);
+ Assert.fail("Failed dcmd queue, didn't find separator :: in: " + name);
}
try {
Class.forName(name.substring(0, sep));
} catch (ClassNotFoundException e) {
- throw new Exception("Failed dcmd queue, Class for name: " + str);
+ Assert.fail("Failed dcmd queue, Class for name: " + str);
}
}
- public static void match(String line, String str) throws Exception {
+ public static void match(String line, String str) {
if (!line.equals(str)) {
- throw new Exception("String equals: " + line + ", " + str);
+ Assert.fail("String equals: " + line + ", " + str);
}
}
+
+ @Test
+ public void jmx() {
+ run(new JMXExecutor());
+ }
}
diff --git a/hotspot/test/serviceability/dcmd/compiler/MethodIdentifierParser.java b/hotspot/test/serviceability/dcmd/compiler/MethodIdentifierParser.java
index f00c0dd9863..b6ef4d370c9 100644
--- a/hotspot/test/serviceability/dcmd/compiler/MethodIdentifierParser.java
+++ b/hotspot/test/serviceability/dcmd/compiler/MethodIdentifierParser.java
@@ -51,11 +51,11 @@ public class MethodIdentifierParser {
// Add sanity check for extracted fields
}
- public Method getMethod() throws NoSuchMethodException, SecurityException, ClassNotFoundException, Exception {
+ public Method getMethod() throws NoSuchMethodException, SecurityException, ClassNotFoundException {
try {
return Class.forName(className).getDeclaredMethod(methodName, getParamenterDescriptorArray());
} catch (UnexpectedTokenException e) {
- throw new Exception("Parse failed");
+ throw new RuntimeException("Parse failed");
}
}
diff --git a/hotspot/test/serviceability/dcmd/framework/HelpTest.java b/hotspot/test/serviceability/dcmd/framework/HelpTest.java
new file mode 100644
index 00000000000..3c4df10dabb
--- /dev/null
+++ b/hotspot/test/serviceability/dcmd/framework/HelpTest.java
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import com.oracle.java.testlibrary.OutputAnalyzer;
+import com.oracle.java.testlibrary.dcmd.CommandExecutor;
+import com.oracle.java.testlibrary.dcmd.PidJcmdExecutor;
+import com.oracle.java.testlibrary.dcmd.MainClassJcmdExecutor;
+import com.oracle.java.testlibrary.dcmd.FileJcmdExecutor;
+import com.oracle.java.testlibrary.dcmd.JMXExecutor;
+import org.testng.annotations.Test;
+
+/*
+ * @test
+ * @summary Test of diagnostic command help (tests all DCMD executors)
+ * @library /testlibrary
+ * @build com.oracle.java.testlibrary.*
+ * @build com.oracle.java.testlibrary.dcmd.*
+ * @run testng HelpTest
+ */
+public class HelpTest {
+ public void run(CommandExecutor executor) {
+ OutputAnalyzer output = executor.execute("help");
+
+ output.shouldContain("The following commands are available");
+ output.shouldContain("help");
+ output.shouldContain("VM.version");
+ }
+
+ @Test
+ public void pid() {
+ run(new PidJcmdExecutor());
+ }
+
+ @Test
+ public void mainClass() {
+ run(new MainClassJcmdExecutor());
+ }
+
+ @Test
+ public void file() {
+ run(new FileJcmdExecutor());
+ }
+
+ @Test
+ public void jmx() {
+ run(new JMXExecutor());
+ }
+
+}
diff --git a/hotspot/test/serviceability/dcmd/framework/InvalidCommandTest.java b/hotspot/test/serviceability/dcmd/framework/InvalidCommandTest.java
new file mode 100644
index 00000000000..d073ac0ffd1
--- /dev/null
+++ b/hotspot/test/serviceability/dcmd/framework/InvalidCommandTest.java
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import com.oracle.java.testlibrary.OutputAnalyzer;
+import com.oracle.java.testlibrary.dcmd.CommandExecutor;
+import com.oracle.java.testlibrary.dcmd.PidJcmdExecutor;
+import com.oracle.java.testlibrary.dcmd.MainClassJcmdExecutor;
+import com.oracle.java.testlibrary.dcmd.FileJcmdExecutor;
+import com.oracle.java.testlibrary.dcmd.JMXExecutor;
+import org.testng.annotations.Test;
+
+/*
+ * @test
+ * @summary Test of invalid diagnostic command (tests all DCMD executors)
+ * @library /testlibrary
+ * @build com.oracle.java.testlibrary.*
+ * @build com.oracle.java.testlibrary.dcmd.*
+ * @run testng InvalidCommandTest
+ */
+public class InvalidCommandTest {
+
+ public void run(CommandExecutor executor) {
+ OutputAnalyzer output = executor.execute("asdf");
+ output.shouldContain("Unknown diagnostic command");
+ }
+
+ @Test
+ public void pid() {
+ run(new PidJcmdExecutor());
+ }
+
+ @Test
+ public void mainClass() {
+ run(new MainClassJcmdExecutor());
+ }
+
+ @Test
+ public void file() {
+ run(new FileJcmdExecutor());
+ }
+
+ @Test
+ public void jmx() {
+ run(new JMXExecutor());
+ }
+}
diff --git a/hotspot/test/serviceability/dcmd/framework/VMVersionTest.java b/hotspot/test/serviceability/dcmd/framework/VMVersionTest.java
new file mode 100644
index 00000000000..ca834db2d34
--- /dev/null
+++ b/hotspot/test/serviceability/dcmd/framework/VMVersionTest.java
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import com.oracle.java.testlibrary.OutputAnalyzer;
+import com.oracle.java.testlibrary.dcmd.CommandExecutor;
+import com.oracle.java.testlibrary.dcmd.PidJcmdExecutor;
+import com.oracle.java.testlibrary.dcmd.MainClassJcmdExecutor;
+import com.oracle.java.testlibrary.dcmd.FileJcmdExecutor;
+import com.oracle.java.testlibrary.dcmd.JMXExecutor;
+
+import org.testng.annotations.Test;
+
+/*
+ * @test
+ * @summary Test of diagnostic command VM.version (tests all DCMD executors)
+ * @library /testlibrary
+ * @build com.oracle.java.testlibrary.*
+ * @build com.oracle.java.testlibrary.dcmd.*
+ * @run testng VMVersionTest
+ */
+public class VMVersionTest {
+ public void run(CommandExecutor executor) {
+ OutputAnalyzer output = executor.execute("VM.version");
+ output.shouldMatch(".*(?:HotSpot|OpenJDK).*VM.*");
+ }
+
+ @Test
+ public void pid() {
+ run(new PidJcmdExecutor());
+ }
+
+ @Test
+ public void mainClass() {
+ run(new MainClassJcmdExecutor());
+ }
+
+ @Test
+ public void file() {
+ run(new FileJcmdExecutor());
+ }
+
+ @Test
+ public void jmx() {
+ run(new JMXExecutor());
+ }
+}
diff --git a/hotspot/test/serviceability/dcmd/gc/ClassHistogramAllTest.java b/hotspot/test/serviceability/dcmd/gc/ClassHistogramAllTest.java
new file mode 100644
index 00000000000..f205dec936a
--- /dev/null
+++ b/hotspot/test/serviceability/dcmd/gc/ClassHistogramAllTest.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * 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
+ * @summary Test of diagnostic command GC.class_histogram -all=true
+ * @library /testlibrary
+ * @build com.oracle.java.testlibrary.*
+ * @build com.oracle.java.testlibrary.dcmd.*
+ * @build ClassHistogramTest
+ * @run testng ClassHistogramAllTest
+ */
+public class ClassHistogramAllTest extends ClassHistogramTest {
+ public ClassHistogramAllTest() {
+ super();
+ classHistogramArgs = "-all=true";
+ }
+
+ /* See ClassHistogramTest for test cases */
+}
diff --git a/hotspot/test/serviceability/dcmd/gc/ClassHistogramTest.java b/hotspot/test/serviceability/dcmd/gc/ClassHistogramTest.java
new file mode 100644
index 00000000000..a4f618acbd1
--- /dev/null
+++ b/hotspot/test/serviceability/dcmd/gc/ClassHistogramTest.java
@@ -0,0 +1,89 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import org.testng.annotations.Test;
+
+import java.util.regex.Pattern;
+
+import com.oracle.java.testlibrary.OutputAnalyzer;
+import com.oracle.java.testlibrary.dcmd.CommandExecutor;
+import com.oracle.java.testlibrary.dcmd.JMXExecutor;
+
+/*
+ * @test
+ * @summary Test of diagnostic command GC.class_histogram
+ * @library /testlibrary
+ * @build com.oracle.java.testlibrary.*
+ * @build com.oracle.java.testlibrary.dcmd.*
+ * @run testng ClassHistogramTest
+ */
+public class ClassHistogramTest {
+ public static class TestClass {}
+ public static TestClass[] instances = new TestClass[1024];
+ protected String classHistogramArgs = "";
+
+ static {
+ for (int i = 0; i < instances.length; ++i) {
+ instances[i] = new TestClass();
+ }
+ }
+
+ public void run(CommandExecutor executor) {
+ OutputAnalyzer output = executor.execute("GC.class_histogram " + classHistogramArgs);
+
+ /*
+ * example output:
+ * num #instances #bytes class name
+ * ----------------------------------------------
+ * 1: 1647 1133752 [B
+ * 2: 6198 383168 [C
+ * 3: 1464 165744 java.lang.Class
+ * 4: 6151 147624 java.lang.String
+ * 5: 2304 73728 java.util.concurrent.ConcurrentHashMap$Node
+ * 6: 1199 64280 [Ljava.lang.Object;
+ * ...
+ */
+
+ /* Require at least one java.lang.Class */
+ output.shouldMatch("^\\s+\\d+:\\s+\\d+\\s+\\d+\\s+java.lang.Class\\s*$");
+
+ /* Require at least one java.lang.String */
+ output.shouldMatch("^\\s+\\d+:\\s+\\d+\\s+\\d+\\s+java.lang.String\\s*$");
+
+ /* Require at least one java.lang.Object */
+ output.shouldMatch("^\\s+\\d+:\\s+\\d+\\s+\\d+\\s+java.lang.Object\\s*$");
+
+ /* Require at exactly one TestClass[] */
+ output.shouldMatch("^\\s+\\d+:\\s+1\\s+\\d+\\s+" +
+ Pattern.quote(TestClass[].class.getName()) + "\\s*$");
+
+ /* Require at exactly 1024 TestClass */
+ output.shouldMatch("^\\s+\\d+:\\s+1024\\s+\\d+\\s+" +
+ Pattern.quote(TestClass.class.getName()) + "\\s*$");
+ }
+
+ @Test
+ public void jmx() {
+ run(new JMXExecutor());
+ }
+}
diff --git a/hotspot/test/serviceability/dcmd/gc/HeapDumpAllTest.java b/hotspot/test/serviceability/dcmd/gc/HeapDumpAllTest.java
new file mode 100644
index 00000000000..4894200205f
--- /dev/null
+++ b/hotspot/test/serviceability/dcmd/gc/HeapDumpAllTest.java
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * 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
+ * @summary Test of diagnostic command GC.heap_dump -all=true
+ * @library /testlibrary
+ * @build com.oracle.java.testlibrary.*
+ * @build com.oracle.java.testlibrary.dcmd.*
+ * @build HeapDumpTest
+ * @run testng HeapDumpAllTest
+ */
+public class HeapDumpAllTest extends HeapDumpTest {
+ public HeapDumpAllTest() {
+ super();
+ heapDumpArgs = "-all=true";
+ }
+
+ /* See HeapDumpTest for test cases */
+}
+
diff --git a/hotspot/test/serviceability/dcmd/gc/HeapDumpTest.java b/hotspot/test/serviceability/dcmd/gc/HeapDumpTest.java
new file mode 100644
index 00000000000..d616e6590ae
--- /dev/null
+++ b/hotspot/test/serviceability/dcmd/gc/HeapDumpTest.java
@@ -0,0 +1,90 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import org.testng.annotations.Test;
+import org.testng.Assert;
+
+import java.io.IOException;
+
+import com.oracle.java.testlibrary.JDKToolFinder;
+import com.oracle.java.testlibrary.OutputAnalyzer;
+import com.oracle.java.testlibrary.dcmd.CommandExecutor;
+import com.oracle.java.testlibrary.dcmd.PidJcmdExecutor;
+
+/*
+ * @test
+ * @summary Test of diagnostic command GC.heap_dump
+ * @library /testlibrary
+ * @build com.oracle.java.testlibrary.*
+ * @build com.oracle.java.testlibrary.dcmd.*
+ * @run testng HeapDumpTest
+ */
+public class HeapDumpTest {
+ protected String heapDumpArgs = "";
+
+ public void run(CommandExecutor executor) {
+ String fileName = "jcmd.gc.heap_dump." + System.currentTimeMillis() + ".hprof";
+ String cmd = "GC.heap_dump " + heapDumpArgs + " " + fileName;
+ executor.execute(cmd);
+
+ verifyHeapDump(fileName);
+ }
+
+ private void verifyHeapDump(String fileName) {
+ String jhat = JDKToolFinder.getTestJDKTool("jhat");
+ String[] cmd = { jhat, "-parseonly", "true", fileName };
+
+ ProcessBuilder pb = new ProcessBuilder(cmd);
+ pb.redirectErrorStream(true);
+ Process p = null;
+ OutputAnalyzer output = null;
+
+ try {
+ p = pb.start();
+ output = new OutputAnalyzer(p);
+
+ /*
+ * Some hprof dumps of all objects contain constantPoolOop references that cannot be resolved, so we ignore
+ * failures about resolving constantPoolOop fields using a negative lookahead
+ */
+ output.shouldNotMatch(".*WARNING(?!.*Failed to resolve object.*constantPoolOop.*).*");
+ } catch (IOException e) {
+ Assert.fail("Test error: Caught exception while reading stdout/err of jhat", e);
+ } finally {
+ if (p != null) {
+ p.destroy();
+ }
+ }
+
+ if (output.getExitValue() != 0) {
+ Assert.fail("Test error: jhat exit code was nonzero");
+ }
+ }
+
+ /* GC.heap_dump is not available over JMX, running jcmd pid executor instead */
+ @Test
+ public void pid() {
+ run(new PidJcmdExecutor());
+ }
+}
+
diff --git a/hotspot/test/serviceability/dcmd/gc/RunFinalizationTest.java b/hotspot/test/serviceability/dcmd/gc/RunFinalizationTest.java
new file mode 100644
index 00000000000..6e8f4668302
--- /dev/null
+++ b/hotspot/test/serviceability/dcmd/gc/RunFinalizationTest.java
@@ -0,0 +1,98 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import org.testng.annotations.Test;
+import org.testng.Assert;
+
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.locks.Condition;
+import java.util.concurrent.locks.ReentrantLock;
+
+import com.oracle.java.testlibrary.dcmd.CommandExecutor;
+import com.oracle.java.testlibrary.dcmd.JMXExecutor;
+
+/*
+ * @test
+ * @summary Test of diagnostic command GC.run_finalization
+ * @library /testlibrary
+ * @build com.oracle.java.testlibrary.*
+ * @build com.oracle.java.testlibrary.dcmd.*
+ * @run testng RunFinalizationTest
+ */
+public class RunFinalizationTest {
+ static ReentrantLock lock = new ReentrantLock();
+ static Condition cond = lock.newCondition();
+ static volatile boolean wasFinalized = false;
+ static volatile boolean wasInitialized = false;
+
+ class MyObject {
+ public MyObject() {
+ /* Make sure object allocation/deallocation is not optimized out */
+ wasInitialized = true;
+ }
+
+ protected void finalize() {
+ lock.lock();
+ wasFinalized = true;
+ cond.signalAll();
+ lock.unlock();
+ }
+ }
+
+ public static MyObject o;
+
+ public void run(CommandExecutor executor) {
+ lock.lock();
+ o = new MyObject();
+ o = null;
+ System.gc();
+ executor.execute("GC.run_finalization");
+
+ int waited = 0;
+ int waitTime = 15;
+
+ try {
+ System.out.println("Waiting for signal from finalizer");
+
+ while (!cond.await(waitTime, TimeUnit.SECONDS)) {
+ waited += waitTime;
+ System.out.println(String.format("Waited %d seconds", waited));
+ }
+
+ System.out.println("Received signal");
+ } catch (InterruptedException e) {
+ Assert.fail("Test error: Interrupted while waiting for signal from finalizer", e);
+ } finally {
+ lock.unlock();
+ }
+
+ if (!wasFinalized) {
+ Assert.fail("Test failure: Object was not finalized");
+ }
+ }
+
+ @Test
+ public void jmx() {
+ run(new JMXExecutor());
+ }
+}
diff --git a/hotspot/test/serviceability/dcmd/gc/RunGCTest.java b/hotspot/test/serviceability/dcmd/gc/RunGCTest.java
new file mode 100644
index 00000000000..eb90bc0ee8f
--- /dev/null
+++ b/hotspot/test/serviceability/dcmd/gc/RunGCTest.java
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import org.testng.annotations.Test;
+import org.testng.Assert;
+
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+
+import com.oracle.java.testlibrary.OutputAnalyzer;
+import com.oracle.java.testlibrary.dcmd.CommandExecutor;
+import com.oracle.java.testlibrary.dcmd.JMXExecutor;
+
+/*
+ * @test
+ * @summary Test of diagnostic command GC.run
+ * @library /testlibrary
+ * @build com.oracle.java.testlibrary.*
+ * @build com.oracle.java.testlibrary.dcmd.*
+ * @run testng/othervm -XX:+PrintGCDetails -Xloggc:RunGC.gclog RunGCTest
+ */
+public class RunGCTest {
+ public void run(CommandExecutor executor) {
+ executor.execute("GC.run");
+
+ Path gcLogPath = Paths.get("RunGC.gclog").toAbsolutePath();
+ String gcLog = null;
+
+ try {
+ gcLog = new String(Files.readAllBytes(gcLogPath));
+ } catch (IOException e) {
+ Assert.fail("Test error: Could not read GC log file: " + gcLogPath, e);
+ }
+
+ OutputAnalyzer output = new OutputAnalyzer(gcLog, "");
+ output.shouldMatch(".*\\[Full GC \\(System(\\.gc\\(\\))?.*");
+ }
+
+ @Test
+ public void jmx() {
+ run(new JMXExecutor());
+ }
+}
diff --git a/hotspot/test/serviceability/dcmd/thread/PrintConcurrentLocksTest.java b/hotspot/test/serviceability/dcmd/thread/PrintConcurrentLocksTest.java
new file mode 100644
index 00000000000..8d9b8d861f3
--- /dev/null
+++ b/hotspot/test/serviceability/dcmd/thread/PrintConcurrentLocksTest.java
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * 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
+ * @summary Test of diagnostic command Thread.print -l=true
+ * @library /testlibrary
+ * @build com.oracle.java.testlibrary.*
+ * @build com.oracle.java.testlibrary.dcmd.*
+ * @build PrintTest
+ * @run testng PrintConcurrentLocksTest
+ */
+public class PrintConcurrentLocksTest extends PrintTest {
+ public PrintConcurrentLocksTest() {
+ jucLocks = true;
+ }
+
+ /* See PrintTest for test cases */
+}
diff --git a/hotspot/test/serviceability/dcmd/thread/PrintTest.java b/hotspot/test/serviceability/dcmd/thread/PrintTest.java
new file mode 100644
index 00000000000..faf1a71d73f
--- /dev/null
+++ b/hotspot/test/serviceability/dcmd/thread/PrintTest.java
@@ -0,0 +1,174 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import org.testng.annotations.Test;
+import org.testng.Assert;
+
+import com.oracle.java.testlibrary.OutputAnalyzer;
+
+import com.oracle.java.testlibrary.dcmd.CommandExecutor;
+import com.oracle.java.testlibrary.dcmd.JMXExecutor;
+
+import java.util.concurrent.BrokenBarrierException;
+import java.util.concurrent.CyclicBarrier;
+import java.util.concurrent.locks.ReentrantLock;
+import java.util.regex.Pattern;
+
+/*
+ * @test
+ * @summary Test of diagnostic command Thread.print
+ * @library /testlibrary
+ * @build com.oracle.java.testlibrary.*
+ * @build com.oracle.java.testlibrary.dcmd.*
+ * @run testng PrintTest
+ */
+public class PrintTest {
+ protected boolean jucLocks = false;
+
+ CyclicBarrier readyBarrier = new CyclicBarrier(3);
+ CyclicBarrier doneBarrier = new CyclicBarrier(3);
+
+ private void waitForBarrier(CyclicBarrier b) {
+ try {
+ b.await();
+ } catch (InterruptedException | BrokenBarrierException e) {
+ Assert.fail("Test error: Caught unexpected exception:", e);
+ }
+ }
+
+ class MonitorThread extends Thread {
+ Object lock = new Object();
+
+ public void run() {
+ /* Hold lock on "lock" to show up in thread dump */
+ synchronized (lock) {
+ /* Signal that we're ready for thread dump */
+ waitForBarrier(readyBarrier);
+
+ /* Released when the thread dump has been taken */
+ waitForBarrier(doneBarrier);
+ }
+ }
+ }
+
+ class LockThread extends Thread {
+ ReentrantLock lock = new ReentrantLock();
+
+ public void run() {
+ /* Hold lock "lock" to show up in thread dump */
+ lock.lock();
+
+ /* Signal that we're ready for thread dump */
+ waitForBarrier(readyBarrier);
+
+ /* Released when the thread dump has been taken */
+ waitForBarrier(doneBarrier);
+
+ lock.unlock();
+ }
+ }
+
+ public void run(CommandExecutor executor) {
+ MonitorThread mThread = new MonitorThread();
+ mThread.start();
+ LockThread lThread = new LockThread();
+ lThread.start();
+
+ /* Wait for threads to get ready */
+ waitForBarrier(readyBarrier);
+
+ /* Execute */
+ OutputAnalyzer output = executor.execute("Thread.print" + (jucLocks ? " -l=true" : ""));
+
+ /* Signal that we've got the thread dump */
+ waitForBarrier(doneBarrier);
+
+ /*
+ * Example output (trimmed) with arrows indicating the rows we are looking for:
+ *
+ * ...
+ * "Thread-2" #24 prio=5 os_prio=0 tid=0x00007f913411f800 nid=0x4fc9 waiting on condition [0x00007f91fbffe000]
+ * java.lang.Thread.State: WAITING (parking)
+ * at sun.misc.Unsafe.park(Native Method)
+ * - parking to wait for <0x000000071a0868a8> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
+ * at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
+ * at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
+ * at java.util.concurrent.CyclicBarrier.dowait(CyclicBarrier.java:234)
+ * at java.util.concurrent.CyclicBarrier.await(CyclicBarrier.java:362)
+ * at Print.waitForBarrier(Print.java:26)
+ * at Print.access$000(Print.java:18)
+ * at Print$LockThread.run(Print.java:58)
+ *
+ * --> Locked ownable synchronizers:
+ * --> - <0x000000071a294930> (a java.util.concurrent.locks.ReentrantLock$NonfairSync)
+ *
+ * "Thread-1" #23 prio=5 os_prio=0 tid=0x00007f913411e800 nid=0x4fc8 waiting on condition [0x00007f9200113000]
+ * java.lang.Thread.State: WAITING (parking)
+ * at sun.misc.Unsafe.park(Native Method)
+ * - parking to wait for <0x000000071a0868a8> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
+ * at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
+ * at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
+ * at java.util.concurrent.CyclicBarrier.dowait(CyclicBarrier.java:234)
+ * at java.util.concurrent.CyclicBarrier.await(CyclicBarrier.java:362)
+ * at Print.waitForBarrier(Print.java:26)
+ * at Print.access$000(Print.java:18)
+ * at Print$MonitorThread.run(Print.java:42)
+ * --> - locked <0x000000071a294390> (a java.lang.Object)
+ *
+ * Locked ownable synchronizers:
+ * - None
+ *
+ * "MainThread" #22 prio=5 os_prio=0 tid=0x00007f923015b000 nid=0x4fc7 in Object.wait() [0x00007f9200840000]
+ * java.lang.Thread.State: WAITING (on object monitor)
+ * at java.lang.Object.wait(Native Method)
+ * - waiting on <0x000000071a70ad98> (a java.lang.UNIXProcess)
+ * at java.lang.Object.wait(Object.java:502)
+ * at java.lang.UNIXProcess.waitFor(UNIXProcess.java:397)
+ * - locked <0x000000071a70ad98> (a java.lang.UNIXProcess)
+ * at com.oracle.java.testlibrary.dcmd.JcmdExecutor.executeImpl(JcmdExecutor.java:32)
+ * at com.oracle.java.testlibrary.dcmd.CommandExecutor.execute(CommandExecutor.java:24)
+ * --> at Print.run(Print.java:74)
+ * at Print.file(Print.java:112)
+ * ...
+
+ */
+ output.shouldMatch(".*at " + Pattern.quote(PrintTest.class.getName()) + "\\.run.*");
+ output.shouldMatch(".*- locked <0x\\p{XDigit}+> \\(a " + Pattern.quote(mThread.lock.getClass().getName()) + "\\).*");
+
+ String jucLockPattern1 = ".*Locked ownable synchronizers:.*";
+ String jucLockPattern2 = ".*- <0x\\p{XDigit}+> \\(a " + Pattern.quote(lThread.lock.getClass().getName()) + ".*";
+
+ if (jucLocks) {
+ output.shouldMatch(jucLockPattern1);
+ output.shouldMatch(jucLockPattern2);
+ } else {
+ output.shouldNotMatch(jucLockPattern1);
+ output.shouldNotMatch(jucLockPattern2);
+ }
+ }
+
+ @Test
+ public void jmx() {
+ run(new JMXExecutor());
+ }
+}
diff --git a/hotspot/test/serviceability/dcmd/ClassLoaderStatsTest.java b/hotspot/test/serviceability/dcmd/vm/ClassLoaderStatsTest.java
similarity index 79%
rename from hotspot/test/serviceability/dcmd/ClassLoaderStatsTest.java
rename to hotspot/test/serviceability/dcmd/vm/ClassLoaderStatsTest.java
index 0b229a8a9a1..50c4f6cf5f1 100644
--- a/hotspot/test/serviceability/dcmd/ClassLoaderStatsTest.java
+++ b/hotspot/test/serviceability/dcmd/vm/ClassLoaderStatsTest.java
@@ -23,18 +23,26 @@
/*
* @test
- *
- * @build ClassLoaderStatsTest DcmdUtil
- * @run main ClassLoaderStatsTest
+ * @summary Test of diagnostic command VM.classloader_stats
+ * @library /testlibrary
+ * @build com.oracle.java.testlibrary.*
+ * @build com.oracle.java.testlibrary.dcmd.*
+ * @run testng ClassLoaderStatsTest
*/
-import java.io.BufferedReader;
+import org.testng.annotations.Test;
+import org.testng.Assert;
+
+import com.oracle.java.testlibrary.OutputAnalyzer;
+import com.oracle.java.testlibrary.dcmd.CommandExecutor;
+import com.oracle.java.testlibrary.dcmd.JMXExecutor;
+
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
-import java.io.StringReader;
import java.nio.ByteBuffer;
import java.nio.channels.FileChannel;
+import java.util.Iterator;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@@ -57,36 +65,36 @@ public class ClassLoaderStatsTest {
public static DummyClassLoader dummyloader;
- public static void main(String arg[]) throws Exception {
+ public void run(CommandExecutor executor) throws ClassNotFoundException {
// create a classloader and load our special class
dummyloader = new DummyClassLoader();
Class> c = Class.forName("TestClass", true, dummyloader);
if (c.getClassLoader() != dummyloader) {
- throw new RuntimeException("TestClass defined by wrong classloader: " + c.getClassLoader());
+ Assert.fail("TestClass defined by wrong classloader: " + c.getClassLoader());
}
- String result = DcmdUtil.executeDcmd("VM.classloader_stats");
- BufferedReader r = new BufferedReader(new StringReader(result));
- String line;
- while((line = r.readLine()) != null) {
+ OutputAnalyzer output = executor.execute("VM.classloader_stats");
+ Iterator lines = output.asLines().iterator();
+ while (lines.hasNext()) {
+ String line = lines.next();
Matcher m = clLine.matcher(line);
if (m.matches()) {
// verify that DummyClassLoader has loaded 1 class and 1 anonymous class
if (m.group(4).equals("ClassLoaderStatsTest$DummyClassLoader")) {
System.out.println("line: " + line);
if (!m.group(1).equals("1")) {
- throw new Exception("Should have loaded 1 class: " + line);
+ Assert.fail("Should have loaded 1 class: " + line);
}
checkPositiveInt(m.group(2));
checkPositiveInt(m.group(3));
- String next = r.readLine();
+ String next = lines.next();
System.out.println("next: " + next);
Matcher m1 = anonLine.matcher(next);
m1.matches();
if (!m1.group(1).equals("1")) {
- throw new Exception("Should have loaded 1 anonymous class, but found : " + m1.group(1));
+ Assert.fail("Should have loaded 1 anonymous class, but found : " + m1.group(1));
}
checkPositiveInt(m1.group(2));
checkPositiveInt(m1.group(3));
@@ -95,9 +103,9 @@ public class ClassLoaderStatsTest {
}
}
- private static void checkPositiveInt(String s) throws Exception {
+ private static void checkPositiveInt(String s) {
if (Integer.parseInt(s) <= 0) {
- throw new Exception("Value should have been > 0: " + s);
+ Assert.fail("Value should have been > 0: " + s);
}
}
@@ -114,8 +122,11 @@ public class ClassLoaderStatsTest {
{
return fc.map(FileChannel.MapMode.READ_ONLY, 0, fc.size());
} catch (IOException e) {
- throw new RuntimeException("Can't open file: " + name, e);
+ Assert.fail("Can't open file: " + name, e);
}
+
+ /* Will not reach here as Assert.fail() throws exception */
+ return null;
}
protected Class> loadClass(String name, boolean resolve)
@@ -144,6 +155,10 @@ public class ClassLoaderStatsTest {
}
} /* DummyClassLoader */
+ @Test
+ public void jmx() throws ClassNotFoundException {
+ run(new JMXExecutor());
+ }
}
class TestClass {
diff --git a/hotspot/test/serviceability/dcmd/vm/CommandLineTest.java b/hotspot/test/serviceability/dcmd/vm/CommandLineTest.java
new file mode 100644
index 00000000000..cf22153f640
--- /dev/null
+++ b/hotspot/test/serviceability/dcmd/vm/CommandLineTest.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import com.oracle.java.testlibrary.OutputAnalyzer;
+import org.testng.annotations.Test;
+
+import com.oracle.java.testlibrary.dcmd.CommandExecutor;
+import com.oracle.java.testlibrary.dcmd.JMXExecutor;
+
+/*
+ * @test
+ * @summary Test of diagnostic command VM.command_line
+ * @library /testlibrary
+ * @build com.oracle.java.testlibrary.*
+ * @build com.oracle.java.testlibrary.dcmd.*
+ * @run testng/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+ThereShouldNotBeAnyVMOptionNamedLikeThis CommandLineTest
+ */
+public class CommandLineTest {
+ public void run(CommandExecutor executor) {
+ OutputAnalyzer output = executor.execute("VM.command_line");
+ output.shouldContain("-XX:+IgnoreUnrecognizedVMOptions");
+ output.shouldContain("-XX:+ThereShouldNotBeAnyVMOptionNamedLikeThis");
+ }
+
+ @Test
+ public void jmx() {
+ run(new JMXExecutor());
+ }
+}
diff --git a/hotspot/test/serviceability/dcmd/DynLibDcmdTest.java b/hotspot/test/serviceability/dcmd/vm/DynLibsTest.java
similarity index 67%
rename from hotspot/test/serviceability/dcmd/DynLibDcmdTest.java
rename to hotspot/test/serviceability/dcmd/vm/DynLibsTest.java
index 2f6b08ddd94..3f8c8ddfca7 100644
--- a/hotspot/test/serviceability/dcmd/DynLibDcmdTest.java
+++ b/hotspot/test/serviceability/dcmd/vm/DynLibsTest.java
@@ -1,6 +1,10 @@
-import java.util.HashSet;
-import java.util.Set;
+import org.testng.annotations.Test;
+import org.testng.Assert;
+
+import com.oracle.java.testlibrary.OutputAnalyzer;
import com.oracle.java.testlibrary.Platform;
+import com.oracle.java.testlibrary.dcmd.CommandExecutor;
+import com.oracle.java.testlibrary.dcmd.JMXExecutor;
/*
* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
@@ -29,14 +33,15 @@ import com.oracle.java.testlibrary.Platform;
* @test
* @summary Test of VM.dynlib diagnostic command via MBean
* @library /testlibrary
- * @build com.oracle.java.testlibrary.* DcmdUtil
- * @run main DynLibDcmdTest
+ * @build com.oracle.java.testlibrary.*
+ * @build com.oracle.java.testlibrary.dcmd.*
+ * @run testng DynLibsTest
*/
-public class DynLibDcmdTest {
+public class DynLibsTest {
- public static void main(String[] args) throws Exception {
- String result = DcmdUtil.executeDcmd("VM.dynlibs");
+ public void run(CommandExecutor executor) {
+ OutputAnalyzer output = executor.execute("VM.dynlibs");
String osDependentBaseString = null;
if (Platform.isAix()) {
@@ -52,18 +57,16 @@ public class DynLibDcmdTest {
}
if (osDependentBaseString == null) {
- throw new Exception("Unsupported OS");
+ Assert.fail("Unsupported OS");
}
- Set expectedContent = new HashSet<>();
- expectedContent.add(String.format(osDependentBaseString, "jvm"));
- expectedContent.add(String.format(osDependentBaseString, "java"));
- expectedContent.add(String.format(osDependentBaseString, "management"));
+ output.shouldContain(String.format(osDependentBaseString, "jvm"));
+ output.shouldContain(String.format(osDependentBaseString, "java"));
+ output.shouldContain(String.format(osDependentBaseString, "management"));
+ }
- for(String expected : expectedContent) {
- if (!result.contains(expected)) {
- throw new Exception("Dynamic library list output did not contain the expected string: '" + expected + "'");
- }
- }
+ @Test
+ public void jmx() {
+ run(new JMXExecutor());
}
}
diff --git a/hotspot/test/serviceability/dcmd/vm/FlagsTest.java b/hotspot/test/serviceability/dcmd/vm/FlagsTest.java
new file mode 100644
index 00000000000..960104e4415
--- /dev/null
+++ b/hotspot/test/serviceability/dcmd/vm/FlagsTest.java
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import com.oracle.java.testlibrary.OutputAnalyzer;
+import com.oracle.java.testlibrary.dcmd.CommandExecutor;
+import com.oracle.java.testlibrary.dcmd.JMXExecutor;
+import org.testng.annotations.Test;
+
+/*
+ * @test
+ * @summary Test of diagnostic command VM.flags
+ * @library /testlibrary
+ * @build com.oracle.java.testlibrary.*
+ * @build com.oracle.java.testlibrary.dcmd.*
+ * @run testng/othervm -Xmx129m -XX:+PrintGC -XX:+UnlockDiagnosticVMOptions -XX:+IgnoreUnrecognizedVMOptions -XX:+ThereShouldNotBeAnyVMOptionNamedLikeThis_Right -XX:-TieredCompilation FlagsTest
+ */
+public class FlagsTest {
+ public void run(CommandExecutor executor) {
+ OutputAnalyzer output = executor.execute("VM.flags");
+
+ /* The following are interpreted by the JVM as actual "flags" */
+ output.shouldContain("-XX:+PrintGC");
+ output.shouldContain("-XX:+UnlockDiagnosticVMOptions");
+ output.shouldContain("-XX:+IgnoreUnrecognizedVMOptions");
+ output.shouldContain("-XX:-TieredCompilation");
+
+ /* The following are not */
+ output.shouldNotContain("-Xmx129m");
+ output.shouldNotContain("-XX:+ThereShouldNotBeAnyVMOptionNamedLikeThis_Right");
+ }
+
+ @Test
+ public void jmx() {
+ run(new JMXExecutor());
+ }
+}
diff --git a/hotspot/test/serviceability/dcmd/vm/SystemPropertiesTest.java b/hotspot/test/serviceability/dcmd/vm/SystemPropertiesTest.java
new file mode 100644
index 00000000000..8b21ae9f28c
--- /dev/null
+++ b/hotspot/test/serviceability/dcmd/vm/SystemPropertiesTest.java
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import org.testng.annotations.Test;
+
+import com.oracle.java.testlibrary.OutputAnalyzer;
+import com.oracle.java.testlibrary.dcmd.CommandExecutor;
+import com.oracle.java.testlibrary.dcmd.JMXExecutor;
+
+/*
+ * @test
+ * @summary Test of diagnostic command VM.system_properties
+ * @library /testlibrary
+ * @build com.oracle.java.testlibrary.*
+ * @build com.oracle.java.testlibrary.dcmd.*
+ * @run testng SystemPropertiesTest
+ */
+public class SystemPropertiesTest {
+ private final static String PROPERTY_NAME = "SystemPropertiesTestPropertyName";
+ private final static String PROPERTY_VALUE = "SystemPropertiesTestPropertyValue";
+
+ public void run(CommandExecutor executor) {
+ System.setProperty(PROPERTY_NAME, PROPERTY_VALUE);
+
+ OutputAnalyzer output = executor.execute("VM.system_properties");
+ output.shouldContain(PROPERTY_NAME + "=" + PROPERTY_VALUE);
+ }
+
+ @Test
+ public void jmx() {
+ run(new JMXExecutor());
+ }
+}
diff --git a/hotspot/test/serviceability/dcmd/vm/UptimeTest.java b/hotspot/test/serviceability/dcmd/vm/UptimeTest.java
new file mode 100644
index 00000000000..b646f570faa
--- /dev/null
+++ b/hotspot/test/serviceability/dcmd/vm/UptimeTest.java
@@ -0,0 +1,89 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import org.testng.annotations.Test;
+import org.testng.Assert;
+
+import com.oracle.java.testlibrary.OutputAnalyzer;
+import com.oracle.java.testlibrary.dcmd.CommandExecutor;
+import com.oracle.java.testlibrary.dcmd.JMXExecutor;
+
+import java.text.NumberFormat;
+import java.text.ParseException;
+
+/*
+ * @test
+ * @summary Test of diagnostic command VM.uptime
+ * @library /testlibrary
+ * @build com.oracle.java.testlibrary.*
+ * @build com.oracle.java.testlibrary.dcmd.*
+ * @run testng UptimeTest
+ */
+public class UptimeTest {
+ public void run(CommandExecutor executor) {
+ double someUptime = 1.0;
+ long startTime = System.currentTimeMillis();
+ try {
+ synchronized (this) {
+ /* Loop to guard against spurious wake ups */
+ while (System.currentTimeMillis() < (startTime + someUptime * 1000)) {
+ wait((int) someUptime * 1000);
+ }
+ }
+ } catch (InterruptedException e) {
+ Assert.fail("Test error: Exception caught when sleeping:", e);
+ }
+
+ OutputAnalyzer output = executor.execute("VM.uptime");
+
+ output.stderrShouldBeEmpty();
+
+ /*
+ * Output should be:
+ * [pid]:
+ * xx.yyy s
+ *
+ * If there is only one line in output there is no "[pid]:" printout;
+ * skip first line, split on whitespace and grab first half
+ */
+ int index = output.asLines().size() == 1 ? 0 : 1;
+ String uptimeString = output.asLines().get(index).split("\\s+")[0];
+
+ try {
+ double uptime = NumberFormat.getNumberInstance().parse(uptimeString).doubleValue();
+ if (uptime < someUptime) {
+ Assert.fail(String.format(
+ "Test failure: Uptime was less than intended sleep time: %.3f s < %.3f s",
+ uptime, someUptime));
+ }
+ } catch (ParseException e) {
+ Assert.fail("Test failure: Could not parse uptime string: " +
+ uptimeString, e);
+ }
+ }
+
+ @Test
+ public void jmx() {
+ run(new JMXExecutor());
+ }
+}
diff --git a/hotspot/test/testlibrary/com/oracle/java/testlibrary/dcmd/CommandExecutor.java b/hotspot/test/testlibrary/com/oracle/java/testlibrary/dcmd/CommandExecutor.java
new file mode 100644
index 00000000000..dd2d3b83cc9
--- /dev/null
+++ b/hotspot/test/testlibrary/com/oracle/java/testlibrary/dcmd/CommandExecutor.java
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * 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.
+ */
+
+package com.oracle.java.testlibrary.dcmd;
+
+import com.oracle.java.testlibrary.OutputAnalyzer;
+
+/**
+ * Abstract base class for Diagnostic Command executors
+ */
+public abstract class CommandExecutor {
+
+ /**
+ * Execute a diagnostic command
+ *
+ * @param cmd The diagnostic command to execute
+ * @return an {@link jdk.testlibrary.OutputAnalyzer} encapsulating the output of the command
+ * @throws CommandExecutorException if there is an exception on the "calling side" while trying to execute the
+ * Diagnostic Command. Exceptions thrown on the remote side are available as textual representations in
+ * stderr, regardless of the specific executor used.
+ */
+ public final OutputAnalyzer execute(String cmd) throws CommandExecutorException {
+ System.out.printf("Running DCMD '%s' through '%s'%n", cmd, this.getClass().getSimpleName());
+ OutputAnalyzer oa = executeImpl(cmd);
+
+ System.out.println("---------------- stdout ----------------");
+ System.out.println(oa.getStdout());
+ System.out.println("---------------- stderr ----------------");
+ System.out.println(oa.getStderr());
+ System.out.println("----------------------------------------");
+ System.out.println();
+
+ return oa;
+ }
+
+ protected abstract OutputAnalyzer executeImpl(String cmd) throws CommandExecutorException;
+}
diff --git a/hotspot/test/testlibrary/com/oracle/java/testlibrary/dcmd/CommandExecutorException.java b/hotspot/test/testlibrary/com/oracle/java/testlibrary/dcmd/CommandExecutorException.java
new file mode 100644
index 00000000000..67b37d1de61
--- /dev/null
+++ b/hotspot/test/testlibrary/com/oracle/java/testlibrary/dcmd/CommandExecutorException.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * 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.
+ */
+
+package com.oracle.java.testlibrary.dcmd;
+
+/**
+ * CommandExecutorException encapsulates exceptions thrown (on the "calling side") from the execution of Diagnostic
+ * Commands
+ */
+public class CommandExecutorException extends RuntimeException {
+ private static final long serialVersionUID = -7039597746579144280L;
+
+ public CommandExecutorException(String message, Throwable e) {
+ super(message, e);
+ }
+}
diff --git a/hotspot/test/testlibrary/com/oracle/java/testlibrary/dcmd/FileJcmdExecutor.java b/hotspot/test/testlibrary/com/oracle/java/testlibrary/dcmd/FileJcmdExecutor.java
new file mode 100644
index 00000000000..947edad1d84
--- /dev/null
+++ b/hotspot/test/testlibrary/com/oracle/java/testlibrary/dcmd/FileJcmdExecutor.java
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * 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.
+ */
+
+package com.oracle.java.testlibrary.dcmd;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * Executes Diagnostic Commands on the target VM (specified by pid) using the jcmd tool and its ability to read
+ * Diagnostic Commands from a file.
+ */
+public class FileJcmdExecutor extends PidJcmdExecutor {
+
+ /**
+ * Instantiates a new FileJcmdExecutor targeting the current VM
+ */
+ public FileJcmdExecutor() {
+ super();
+ }
+
+ /**
+ * Instantiates a new FileJcmdExecutor targeting the VM indicated by the given pid
+ *
+ * @param target Pid of the target VM
+ */
+ public FileJcmdExecutor(String target) {
+ super(target);
+ }
+
+ protected List createCommandLine(String cmd) throws CommandExecutorException {
+ File cmdFile = createTempFile();
+ writeCommandToTemporaryFile(cmd, cmdFile);
+
+ return Arrays.asList(jcmdBinary, Integer.toString(pid),
+ "-f", cmdFile.getAbsolutePath());
+ }
+
+ private void writeCommandToTemporaryFile(String cmd, File cmdFile) {
+ try (PrintWriter pw = new PrintWriter(cmdFile)) {
+ pw.println(cmd);
+ } catch (IOException e) {
+ String message = "Could not write to file: " + cmdFile.getAbsolutePath();
+ throw new CommandExecutorException(message, e);
+ }
+ }
+
+ private File createTempFile() {
+ try {
+ File cmdFile = File.createTempFile("input", "jcmd");
+ cmdFile.deleteOnExit();
+ return cmdFile;
+ } catch (IOException e) {
+ throw new CommandExecutorException("Could not create temporary file", e);
+ }
+ }
+
+}
diff --git a/hotspot/test/testlibrary/com/oracle/java/testlibrary/dcmd/JMXExecutor.java b/hotspot/test/testlibrary/com/oracle/java/testlibrary/dcmd/JMXExecutor.java
new file mode 100644
index 00000000000..46c92054fdf
--- /dev/null
+++ b/hotspot/test/testlibrary/com/oracle/java/testlibrary/dcmd/JMXExecutor.java
@@ -0,0 +1,187 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * 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.
+ */
+
+package com.oracle.java.testlibrary.dcmd;
+
+import com.oracle.java.testlibrary.OutputAnalyzer;
+
+import javax.management.*;
+import javax.management.remote.JMXConnector;
+import javax.management.remote.JMXConnectorFactory;
+import javax.management.remote.JMXServiceURL;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+
+import java.lang.management.ManagementFactory;
+
+import java.util.HashMap;
+
+/**
+ * Executes Diagnostic Commands on the target VM (specified by a host/port combination or a full JMX Service URL) using
+ * the JMX interface. If the target is not the current VM, the JMX Remote interface must be enabled beforehand.
+ */
+public class JMXExecutor extends CommandExecutor {
+
+ private final MBeanServerConnection mbs;
+
+ /**
+ * Instantiates a new JMXExecutor targeting the current VM
+ */
+ public JMXExecutor() {
+ super();
+ mbs = ManagementFactory.getPlatformMBeanServer();
+ }
+
+ /**
+ * Instantiates a new JMXExecutor targeting the VM indicated by the given host/port combination or a full JMX
+ * Service URL
+ *
+ * @param target a host/port combination on the format "host:port" or a full JMX Service URL of the target VM
+ */
+ public JMXExecutor(String target) {
+ String urlStr;
+
+ if (target.matches("^\\w[\\w\\-]*(\\.[\\w\\-]+)*:\\d+$")) {
+ /* Matches "hostname:port" */
+ urlStr = String.format("service:jmx:rmi:///jndi/rmi://%s/jmxrmi", target);
+ } else if (target.startsWith("service:")) {
+ urlStr = target;
+ } else {
+ throw new IllegalArgumentException("Could not recognize target string: " + target);
+ }
+
+ try {
+ JMXServiceURL url = new JMXServiceURL(urlStr);
+ JMXConnector c = JMXConnectorFactory.connect(url, new HashMap<>());
+ mbs = c.getMBeanServerConnection();
+ } catch (IOException e) {
+ throw new CommandExecutorException("Could not initiate connection to target: " + target, e);
+ }
+ }
+
+ protected OutputAnalyzer executeImpl(String cmd) throws CommandExecutorException {
+ String stdout = "";
+ String stderr = "";
+
+ String[] cmdParts = cmd.split(" ", 2);
+ String operation = commandToMethodName(cmdParts[0]);
+ Object[] dcmdArgs = produceArguments(cmdParts);
+ String[] signature = {String[].class.getName()};
+
+ ObjectName beanName = getMBeanName();
+
+ try {
+ stdout = (String) mbs.invoke(beanName, operation, dcmdArgs, signature);
+ }
+
+ /* Failures on the "local" side, the one invoking the command. */
+ catch (ReflectionException e) {
+ Throwable cause = e.getCause();
+ if (cause instanceof NoSuchMethodException) {
+ /* We want JMXExecutor to match the behavior of the other CommandExecutors */
+ String message = "Unknown diagnostic command: " + operation;
+ stderr = exceptionTraceAsString(new IllegalArgumentException(message, e));
+ } else {
+ rethrowExecutorException(operation, dcmdArgs, e);
+ }
+ }
+
+ /* Failures on the "local" side, the one invoking the command. */
+ catch (InstanceNotFoundException | IOException e) {
+ rethrowExecutorException(operation, dcmdArgs, e);
+ }
+
+ /* Failures on the remote side, the one executing the invoked command. */
+ catch (MBeanException e) {
+ stdout = exceptionTraceAsString(e);
+ }
+
+ return new OutputAnalyzer(stdout, stderr);
+ }
+
+ private void rethrowExecutorException(String operation, Object[] dcmdArgs,
+ Exception e) throws CommandExecutorException {
+ String message = String.format("Could not invoke: %s %s", operation,
+ String.join(" ", (String[]) dcmdArgs[0]));
+ throw new CommandExecutorException(message, e);
+ }
+
+ private ObjectName getMBeanName() throws CommandExecutorException {
+ String MBeanName = "com.sun.management:type=DiagnosticCommand";
+
+ try {
+ return new ObjectName(MBeanName);
+ } catch (MalformedObjectNameException e) {
+ String message = "MBean not found: " + MBeanName;
+ throw new CommandExecutorException(message, e);
+ }
+ }
+
+ private Object[] produceArguments(String[] cmdParts) {
+ Object[] dcmdArgs = {new String[0]}; /* Default: No arguments */
+
+ if (cmdParts.length == 2) {
+ dcmdArgs[0] = cmdParts[1].split(" ");
+ }
+ return dcmdArgs;
+ }
+
+ /**
+ * Convert from diagnostic command to MBean method name
+ *
+ * Examples:
+ * help --> help
+ * VM.version --> vmVersion
+ * VM.command_line --> vmCommandLine
+ */
+ private static String commandToMethodName(String cmd) {
+ String operation = "";
+ boolean up = false; /* First letter is to be lower case */
+
+ /*
+ * If a '.' or '_' is encountered it is not copied,
+ * instead the next character will be converted to upper case
+ */
+ for (char c : cmd.toCharArray()) {
+ if (('.' == c) || ('_' == c)) {
+ up = true;
+ } else if (up) {
+ operation = operation.concat(Character.toString(c).toUpperCase());
+ up = false;
+ } else {
+ operation = operation.concat(Character.toString(c).toLowerCase());
+ }
+ }
+
+ return operation;
+ }
+
+ private static String exceptionTraceAsString(Throwable cause) {
+ StringWriter sw = new StringWriter();
+ cause.printStackTrace(new PrintWriter(sw));
+ return sw.toString();
+ }
+
+}
diff --git a/hotspot/test/testlibrary/com/oracle/java/testlibrary/dcmd/JcmdExecutor.java b/hotspot/test/testlibrary/com/oracle/java/testlibrary/dcmd/JcmdExecutor.java
new file mode 100644
index 00000000000..3ef8ba810e8
--- /dev/null
+++ b/hotspot/test/testlibrary/com/oracle/java/testlibrary/dcmd/JcmdExecutor.java
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * 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.
+ */
+
+package com.oracle.java.testlibrary.dcmd;
+
+import com.oracle.java.testlibrary.JDKToolFinder;
+import com.oracle.java.testlibrary.OutputAnalyzer;
+import com.oracle.java.testlibrary.ProcessTools;
+
+import java.util.List;
+
+/**
+ * Base class for Diagnostic Command Executors using the jcmd tool
+ */
+public abstract class JcmdExecutor extends CommandExecutor {
+ protected String jcmdBinary;
+
+ protected abstract List createCommandLine(String cmd) throws CommandExecutorException;
+
+ protected JcmdExecutor() {
+ jcmdBinary = JDKToolFinder.getJDKTool("jcmd");
+ }
+
+ protected OutputAnalyzer executeImpl(String cmd) throws CommandExecutorException {
+ List commandLine = createCommandLine(cmd);
+
+ try {
+ System.out.printf("Executing command '%s'%n", commandLine);
+ OutputAnalyzer output = ProcessTools.executeProcess(new ProcessBuilder(commandLine));
+ System.out.printf("Command returned with exit code %d%n", output.getExitValue());
+
+ return output;
+ } catch (Exception e) {
+ String message = String.format("Caught exception while executing '%s'", commandLine);
+ throw new CommandExecutorException(message, e);
+ }
+ }
+}
diff --git a/hotspot/test/testlibrary/com/oracle/java/testlibrary/dcmd/MainClassJcmdExecutor.java b/hotspot/test/testlibrary/com/oracle/java/testlibrary/dcmd/MainClassJcmdExecutor.java
new file mode 100644
index 00000000000..6f298c412e2
--- /dev/null
+++ b/hotspot/test/testlibrary/com/oracle/java/testlibrary/dcmd/MainClassJcmdExecutor.java
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * 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.
+ */
+
+package com.oracle.java.testlibrary.dcmd;
+
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * Executes Diagnostic Commands on the target VM (specified by main class) using the jcmd tool
+ */
+public class MainClassJcmdExecutor extends JcmdExecutor {
+ private final String mainClass;
+
+ /**
+ * Instantiates a new MainClassJcmdExecutor targeting the current VM
+ */
+ public MainClassJcmdExecutor() {
+ super();
+ mainClass = System.getProperty("sun.java.command").split(" ")[0];
+ }
+
+ /**
+ * Instantiates a new MainClassJcmdExecutor targeting the VM indicated by the given main class
+ *
+ * @param target Main class of the target VM
+ */
+ public MainClassJcmdExecutor(String target) {
+ super();
+ mainClass = target;
+ }
+
+ protected List createCommandLine(String cmd) throws CommandExecutorException {
+ return Arrays.asList(jcmdBinary, mainClass, cmd);
+ }
+
+}
diff --git a/hotspot/test/testlibrary/com/oracle/java/testlibrary/dcmd/PidJcmdExecutor.java b/hotspot/test/testlibrary/com/oracle/java/testlibrary/dcmd/PidJcmdExecutor.java
new file mode 100644
index 00000000000..cc00518a4a3
--- /dev/null
+++ b/hotspot/test/testlibrary/com/oracle/java/testlibrary/dcmd/PidJcmdExecutor.java
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * 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.
+ */
+
+package com.oracle.java.testlibrary.dcmd;
+
+import com.oracle.java.testlibrary.ProcessTools;
+
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * Executes Diagnostic Commands on the target VM (specified by pid) using the jcmd tool
+ */
+public class PidJcmdExecutor extends JcmdExecutor {
+ protected final int pid;
+
+ /**
+ * Instantiates a new PidJcmdExecutor targeting the current VM
+ */
+ public PidJcmdExecutor() {
+ super();
+ try {
+ pid = ProcessTools.getProcessId();
+ } catch (Exception e) {
+ throw new CommandExecutorException("Could not determine own pid", e);
+ }
+ }
+
+ /**
+ * Instantiates a new PidJcmdExecutor targeting the VM indicated by the given pid
+ *
+ * @param target Pid of the target VM
+ */
+ public PidJcmdExecutor(String target) {
+ super();
+ pid = Integer.valueOf(target);
+ }
+
+ protected List createCommandLine(String cmd) throws CommandExecutorException {
+ return Arrays.asList(jcmdBinary, Integer.toString(pid), cmd);
+ }
+
+}
From dc9bb3c2017b60310f27bec69b254ae93117a16d Mon Sep 17 00:00:00 2001
From: Jiangli Zhou
Date: Fri, 30 Jan 2015 20:31:05 -0500
Subject: [PATCH 11/61] 8071962: The SA code needs to be updated to support
Symbol lookup from the shared archive
Support shared symbols lookup.
Reviewed-by: minqi, sspitsyn, dsamersoff, iklam
---
.../sun/jvm/hotspot/memory/SymbolTable.java | 19 ++-
.../hotspot/utilities/CompactHashTable.java | 120 ++++++++++++++++++
.../share/vm/classfile/compactHashtable.hpp | 1 +
hotspot/src/share/vm/runtime/vmStructs.cpp | 17 ++-
4 files changed, 151 insertions(+), 6 deletions(-)
create mode 100644 hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/CompactHashTable.java
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/SymbolTable.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/SymbolTable.java
index 7510d08bfd0..cefdcf2aa30 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/SymbolTable.java
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/SymbolTable.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -44,15 +44,22 @@ public class SymbolTable extends sun.jvm.hotspot.utilities.Hashtable {
private static synchronized void initialize(TypeDataBase db) {
Type type = db.lookupType("SymbolTable");
theTableField = type.getAddressField("_the_table");
+ sharedTableField = type.getAddressField("_shared_table");
}
// Fields
private static AddressField theTableField;
+ private static AddressField sharedTableField;
+
+ private CompactHashTable sharedTable;
// Accessors
public static SymbolTable getTheTable() {
Address tmp = theTableField.getValue();
- return (SymbolTable) VMObjectFactory.newObject(SymbolTable.class, tmp);
+ SymbolTable table = (SymbolTable) VMObjectFactory.newObject(SymbolTable.class, tmp);
+ Address shared = sharedTableField.getStaticFieldAddress();
+ table.sharedTable = (CompactHashTable)VMObjectFactory.newObject(CompactHashTable.class, shared);
+ return table;
}
public SymbolTable(Address addr) {
@@ -73,8 +80,9 @@ public class SymbolTable extends sun.jvm.hotspot.utilities.Hashtable {
/** Clone of VM's "temporary" probe routine, as the SA currently
does not support mutation so lookup() would have no effect
- anyway. Returns null if the given string is not in the symbol
- table. */
+ anyway. Searches the regular symbol table and the shared symbol
+ table. Null is returned if the given name is not found in both
+ tables. */
public Symbol probe(byte[] name) {
long hashValue = hashSymbol(name);
for (HashtableEntry e = (HashtableEntry) bucket(hashToIndex(hashValue)); e != null; e = (HashtableEntry) e.next()) {
@@ -85,7 +93,8 @@ public class SymbolTable extends sun.jvm.hotspot.utilities.Hashtable {
}
}
}
- return null;
+
+ return sharedTable.probe(name, hashValue);
}
public interface SymbolVisitor {
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/CompactHashTable.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/CompactHashTable.java
new file mode 100644
index 00000000000..d17c980bc7d
--- /dev/null
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/CompactHashTable.java
@@ -0,0 +1,120 @@
+/*
+ * Copyright (c) 2015, 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * 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.
+ *
+ */
+
+package sun.jvm.hotspot.utilities;
+
+import java.util.*;
+import sun.jvm.hotspot.debugger.*;
+import sun.jvm.hotspot.oops.*;
+import sun.jvm.hotspot.types.*;
+import sun.jvm.hotspot.runtime.*;
+import sun.jvm.hotspot.utilities.*;
+
+public class CompactHashTable extends VMObject {
+ static {
+ VM.registerVMInitializedObserver(new Observer() {
+ public void update(Observable o, Object data) {
+ initialize(VM.getVM().getTypeDataBase());
+ }
+ });
+ }
+
+ private static synchronized void initialize(TypeDataBase db) throws WrongTypeException {
+ Type type = db.lookupType("SymbolCompactHashTable");
+ baseAddressField = type.getAddressField("_base_address");
+ bucketCountField = type.getCIntegerField("_bucket_count");
+ tableEndOffsetField = type.getCIntegerField("_table_end_offset");
+ bucketsField = type.getAddressField("_buckets");
+ uintSize = db.lookupType("juint").getSize();
+ }
+
+ // Fields
+ private static CIntegerField bucketCountField;
+ private static CIntegerField tableEndOffsetField;
+ private static AddressField baseAddressField;
+ private static AddressField bucketsField;
+ private static long uintSize;
+
+ private static int BUCKET_OFFSET_MASK = 0x3FFFFFFF;
+ private static int BUCKET_TYPE_SHIFT = 30;
+ private static int COMPACT_BUCKET_TYPE = 1;
+
+ public CompactHashTable(Address addr) {
+ super(addr);
+ }
+
+ private int bucketCount() {
+ return (int)bucketCountField.getValue(addr);
+ }
+
+ private int tableEndOffset() {
+ return (int)tableEndOffsetField.getValue(addr);
+ }
+
+ private boolean isCompactBucket(int bucket_info) {
+ return (bucket_info >> BUCKET_TYPE_SHIFT) == COMPACT_BUCKET_TYPE;
+ }
+
+ private int bucketOffset(int bucket_info) {
+ return bucket_info & BUCKET_OFFSET_MASK;
+ }
+
+ public Symbol probe(byte[] name, long hash) {
+ long symOffset;
+ Symbol sym;
+ Address baseAddress = baseAddressField.getValue(addr);
+ Address bucket = bucketsField.getValue(addr);
+ Address bucketEnd = bucket;
+ long index = hash % bucketCount();
+ int bucketInfo = (int)bucket.getCIntegerAt(index * uintSize, uintSize, true);
+ int bucketOffset = bucketOffset(bucketInfo);
+ int nextBucketInfo = (int)bucket.getCIntegerAt((index+1) * uintSize, uintSize, true);
+ int nextBucketOffset = bucketOffset(nextBucketInfo);
+
+ bucket = bucket.addOffsetTo(bucketOffset * uintSize);
+
+ if (isCompactBucket(bucketInfo)) {
+ symOffset = bucket.getCIntegerAt(0, uintSize, true);
+ sym = Symbol.create(baseAddress.addOffsetTo(symOffset));
+ if (sym.equals(name)) {
+ return sym;
+ }
+ } else {
+ bucketEnd = bucket.addOffsetTo(nextBucketOffset * uintSize);
+ while (bucket.lessThan(bucketEnd)) {
+ long symHash = bucket.getCIntegerAt(0, uintSize, true);
+ if (symHash == hash) {
+ symOffset = bucket.getCIntegerAt(uintSize, uintSize, true);
+ Address symAddr = baseAddress.addOffsetTo(symOffset);
+ sym = Symbol.create(symAddr);
+ if (sym.equals(name)) {
+ return sym;
+ }
+ }
+ bucket = bucket.addOffsetTo(2 * uintSize);
+ }
+ }
+ return null;
+ }
+}
diff --git a/hotspot/src/share/vm/classfile/compactHashtable.hpp b/hotspot/src/share/vm/classfile/compactHashtable.hpp
index 3e32fc07df9..28149643727 100644
--- a/hotspot/src/share/vm/classfile/compactHashtable.hpp
+++ b/hotspot/src/share/vm/classfile/compactHashtable.hpp
@@ -188,6 +188,7 @@ public:
// dump time.
//
template class CompactHashtable VALUE_OBJ_CLASS_SPEC {
+ friend class VMStructs;
uintx _base_address;
juint _entry_count;
juint _bucket_count;
diff --git a/hotspot/src/share/vm/runtime/vmStructs.cpp b/hotspot/src/share/vm/runtime/vmStructs.cpp
index 5b3ca8a6b42..7d82c03e6cb 100644
--- a/hotspot/src/share/vm/runtime/vmStructs.cpp
+++ b/hotspot/src/share/vm/runtime/vmStructs.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,7 @@
#include "classfile/javaClasses.hpp"
#include "classfile/loaderConstraints.hpp"
#include "classfile/placeholders.hpp"
+#include "classfile/compactHashtable.hpp"
#include "classfile/stringTable.hpp"
#include "classfile/systemDictionary.hpp"
#include "ci/ciField.hpp"
@@ -243,6 +244,7 @@ typedef TwoOopHashtable KlassTwoOopHashtable;
typedef Hashtable KlassHashtable;
typedef HashtableEntry KlassHashtableEntry;
typedef TwoOopHashtable SymbolTwoOopHashtable;
+typedef CompactHashtable SymbolCompactHashTable;
//--------------------------------------------------------------------------------
// VM_STRUCTS
@@ -624,6 +626,7 @@ typedef TwoOopHashtable SymbolTwoOopHashtable;
/***************/ \
\
static_field(SymbolTable, _the_table, SymbolTable*) \
+ static_field(SymbolTable, _shared_table, SymbolCompactHashTable) \
\
/***************/ \
/* StringTable */ \
@@ -632,6 +635,16 @@ typedef TwoOopHashtable SymbolTwoOopHashtable;
static_field(StringTable, _the_table, StringTable*) \
\
/********************/ \
+ /* CompactHashTable */ \
+ /********************/ \
+ \
+ nonstatic_field(SymbolCompactHashTable, _base_address, uintx) \
+ nonstatic_field(SymbolCompactHashTable, _entry_count, juint) \
+ nonstatic_field(SymbolCompactHashTable, _bucket_count, juint) \
+ nonstatic_field(SymbolCompactHashTable, _table_end_offset, juint) \
+ nonstatic_field(SymbolCompactHashTable, _buckets, juint*) \
+ \
+ /********************/ \
/* SystemDictionary */ \
/********************/ \
\
@@ -1580,6 +1593,8 @@ typedef TwoOopHashtable SymbolTwoOopHashtable;
declare_type(ResourceArea, Arena) \
declare_toplevel_type(Chunk) \
\
+ declare_toplevel_type(SymbolCompactHashTable) \
+ \
/***********************************************************/ \
/* Thread hierarchy (needed for run-time type information) */ \
/***********************************************************/ \
From 5eb21ad94f4e3f81b20aaf72160fd93b98bb2746 Mon Sep 17 00:00:00 2001
From: Alexander Kulyakthin
Date: Mon, 2 Feb 2015 09:37:53 +0100
Subject: [PATCH 12/61] 8071464: Clear up SVC jdk/test/* JRE layout
dependencies other than those on tools.jar
Reviewed-by: sla
---
jdk/test/com/sun/jdi/ShellScaffold.sh | 12 ++----------
jdk/test/demo/jvmti/DemoRun.java | 7 ++-----
2 files changed, 4 insertions(+), 15 deletions(-)
diff --git a/jdk/test/com/sun/jdi/ShellScaffold.sh b/jdk/test/com/sun/jdi/ShellScaffold.sh
index d2fd876a509..cf0cdbe43d0 100644
--- a/jdk/test/com/sun/jdi/ShellScaffold.sh
+++ b/jdk/test/com/sun/jdi/ShellScaffold.sh
@@ -259,7 +259,7 @@ setup()
;;
esac
- if [ -r $jdk/bin/dt_shmem.dll -o -r $jdk/jre/bin/dt_shmem.dll ] ; then
+ if [ -r $jdk/bin/dt_shmem.dll ] ; then
transport=dt_shmem
address=kkkk.$$
else
@@ -933,18 +933,10 @@ dojstack()
debuggeeCmd=`$jdk/bin/jps -v | $grep $debuggeeKeyword`
realDebuggeePid=`echo "$debuggeeCmd" | sed -e 's@ .*@@'`
if [ ! -z "$realDebuggeePid" ] ; then
- if [ -r "$jdk/lib/sa-jdi.jar" ] ; then
- # disableVersionCheck can be removed after 6475822
- # is fixed.
- moption="-m -J-Dsun.jvm.hotspot.runtime.VM.disableVersionCheck"
- else
- moption=
- fi
-
echo "-- debuggee process info ----------------------" >&2
echo " $debuggeeCmd" >&2
echo "-- debuggee threads: jstack $moption $realDebuggeePid" >&2
- $jdk/bin/$jstack $moption $realDebuggeePid >&2
+ $jdk/bin/$jstack $realDebuggeePid >&2
echo "=============================================" >&2
echo >&2
fi
diff --git a/jdk/test/demo/jvmti/DemoRun.java b/jdk/test/demo/jvmti/DemoRun.java
index 907e5ce97e7..ea1296a7b8a 100644
--- a/jdk/test/demo/jvmti/DemoRun.java
+++ b/jdk/test/demo/jvmti/DemoRun.java
@@ -115,10 +115,7 @@ public class DemoRun {
*/
public void runit(String class_name, String vm_options[])
{
- String jre_home = System.getProperty("java.home");
- String sdk_home = (jre_home.endsWith("jre") ?
- (jre_home + File.separator + "..") :
- jre_home );
+ String sdk_home = System.getProperty("java.home");
String cdir = System.getProperty("test.classes", ".");
String os_arch = System.getProperty("os.arch");
String os_name = System.getProperty("os.name");
@@ -126,7 +123,7 @@ public class DemoRun {
String libsuffix = os_name.contains("Windows")?".dll":
os_name.contains("OS X")?".dylib":".so";
boolean hprof = demo_name.equals("hprof");
- String java = jre_home
+ String java = sdk_home
+ File.separator + "bin"
+ File.separator + "java";
/* Array of strings to be passed in for exec:
From ba4a04aa0520a7df3e0a741778b2efc8130fcca9 Mon Sep 17 00:00:00 2001
From: Thomas Schatzl
Date: Mon, 2 Feb 2015 10:38:39 +0100
Subject: [PATCH 13/61] 8069760: When iterating over a card, G1 often iterates
over much more references than are contained in the card
Properly bound the iteration work for objArray-oops.
Reviewed-by: mgerdin, kbarrett
---
.../vm/gc_implementation/g1/heapRegion.cpp | 37 ++++++++-----------
1 file changed, 15 insertions(+), 22 deletions(-)
diff --git a/hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp b/hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp
index d5eaf9f8da3..68a67678208 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -420,7 +420,7 @@ oops_on_card_seq_iterate_careful(MemRegion mr,
oop obj;
HeapWord* next = cur;
- while (next <= start) {
+ do {
cur = next;
obj = oop(cur);
if (obj->klass_or_null() == NULL) {
@@ -429,45 +429,38 @@ oops_on_card_seq_iterate_careful(MemRegion mr,
}
// Otherwise...
next = cur + block_size(cur);
- }
+ } while (next <= start);
// If we finish the above loop...We have a parseable object that
// begins on or before the start of the memory region, and ends
// inside or spans the entire region.
-
- assert(obj == oop(cur), "sanity");
assert(cur <= start, "Loop postcondition");
assert(obj->klass_or_null() != NULL, "Loop postcondition");
- assert((cur + block_size(cur)) > start, "Loop postcondition");
- if (!g1h->is_obj_dead(obj)) {
- obj->oop_iterate(cl, mr);
- }
-
- while (cur < end) {
+ do {
obj = oop(cur);
+ assert((cur + block_size(cur)) > (HeapWord*)obj, "Loop invariant");
if (obj->klass_or_null() == NULL) {
// Ran into an unparseable point.
return cur;
- };
+ }
- // Otherwise:
- next = cur + block_size(cur);
+ // Advance the current pointer. "obj" still points to the object to iterate.
+ cur = cur + block_size(cur);
if (!g1h->is_obj_dead(obj)) {
- if (next < end || !obj->is_objArray()) {
- // This object either does not span the MemRegion
- // boundary, or if it does it's not an array.
- // Apply closure to whole object.
+ // Non-objArrays are sometimes marked imprecise at the object start. We
+ // always need to iterate over them in full.
+ // We only iterate over object arrays in full if they are completely contained
+ // in the memory region.
+ if (!obj->is_objArray() || (((HeapWord*)obj) >= start && cur <= end)) {
obj->oop_iterate(cl);
} else {
- // This obj is an array that spans the boundary.
- // Stop at the boundary.
obj->oop_iterate(cl, mr);
}
}
- cur = next;
- }
+ } while (cur < end);
+
return NULL;
}
From 788217a445a180abf095a97229ba6d9c3f707e57 Mon Sep 17 00:00:00 2001
From: Frederic Parain
Date: Mon, 2 Feb 2015 18:20:14 +0100
Subject: [PATCH 14/61] 8068655: frame::safe_for_sender() computes incorrect
sender_sp value for interpreted frames
Reviewed-by: dcubed, coleenp, bdelsart
---
hotspot/src/cpu/x86/vm/frame_x86.cpp | 25 ++++++++++++++++++-------
1 file changed, 18 insertions(+), 7 deletions(-)
diff --git a/hotspot/src/cpu/x86/vm/frame_x86.cpp b/hotspot/src/cpu/x86/vm/frame_x86.cpp
index 71d89bb82f5..654f0689ec2 100644
--- a/hotspot/src/cpu/x86/vm/frame_x86.cpp
+++ b/hotspot/src/cpu/x86/vm/frame_x86.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -123,7 +123,9 @@ bool frame::safe_for_sender(JavaThread *thread) {
}
intptr_t* sender_sp = NULL;
+ intptr_t* sender_unextended_sp = NULL;
address sender_pc = NULL;
+ intptr_t* saved_fp = NULL;
if (is_interpreted_frame()) {
// fp must be safe
@@ -132,7 +134,12 @@ bool frame::safe_for_sender(JavaThread *thread) {
}
sender_pc = (address) this->fp()[return_addr_offset];
+ // for interpreted frames, the value below is the sender "raw" sp,
+ // which can be different from the sender unextended sp (the sp seen
+ // by the sender) because of current frame local variables
sender_sp = (intptr_t*) addr_at(sender_sp_offset);
+ sender_unextended_sp = (intptr_t*) this->fp()[interpreter_frame_sender_sp_offset];
+ saved_fp = (intptr_t*) this->fp()[link_offset];
} else {
// must be some sort of compiled/runtime frame
@@ -144,8 +151,11 @@ bool frame::safe_for_sender(JavaThread *thread) {
}
sender_sp = _unextended_sp + _cb->frame_size();
+ sender_unextended_sp = sender_sp;
// On Intel the return_address is always the word on the stack
sender_pc = (address) *(sender_sp-1);
+ // Note: frame::sender_sp_offset is only valid for compiled frame
+ saved_fp = (intptr_t*) *(sender_sp - frame::sender_sp_offset);
}
@@ -156,7 +166,6 @@ bool frame::safe_for_sender(JavaThread *thread) {
// only if the sender is interpreted/call_stub (c1 too?) are we certain that the saved ebp
// is really a frame pointer.
- intptr_t *saved_fp = (intptr_t*)*(sender_sp - frame::sender_sp_offset);
bool saved_fp_safe = ((address)saved_fp < thread->stack_base()) && (saved_fp > sender_sp);
if (!saved_fp_safe) {
@@ -165,7 +174,7 @@ bool frame::safe_for_sender(JavaThread *thread) {
// construct the potential sender
- frame sender(sender_sp, saved_fp, sender_pc);
+ frame sender(sender_sp, sender_unextended_sp, saved_fp, sender_pc);
return sender.is_interpreted_frame_valid(thread);
@@ -194,7 +203,6 @@ bool frame::safe_for_sender(JavaThread *thread) {
// Could be the call_stub
if (StubRoutines::returns_to_call_stub(sender_pc)) {
- intptr_t *saved_fp = (intptr_t*)*(sender_sp - frame::sender_sp_offset);
bool saved_fp_safe = ((address)saved_fp < thread->stack_base()) && (saved_fp > sender_sp);
if (!saved_fp_safe) {
@@ -203,7 +211,7 @@ bool frame::safe_for_sender(JavaThread *thread) {
// construct the potential sender
- frame sender(sender_sp, saved_fp, sender_pc);
+ frame sender(sender_sp, sender_unextended_sp, saved_fp, sender_pc);
// Validate the JavaCallWrapper an entry frame must have
address jcw = (address)sender.entry_frame_call_wrapper();
@@ -568,8 +576,11 @@ bool frame::is_interpreted_frame_valid(JavaThread* thread) const {
if (!m->is_valid_method()) return false;
// stack frames shouldn't be much larger than max_stack elements
-
- if (fp() - sp() > 1024 + m->max_stack()*Interpreter::stackElementSize) {
+ // this test requires the use the unextended_sp which is the sp as seen by
+ // the current frame, and not sp which is the "raw" pc which could point
+ // further because of local variables of the callee method inserted after
+ // method arguments
+ if (fp() - unextended_sp() > 1024 + m->max_stack()*Interpreter::stackElementSize) {
return false;
}
From eb678303333806b59bc5e92f6f84d1d222a96fe1 Mon Sep 17 00:00:00 2001
From: Mikael Auno
Date: Tue, 3 Feb 2015 12:26:40 +0100
Subject: [PATCH 15/61] 8072401: [TESTBUG] Some of the newly added DCMD tests
fail due to lack of -XX:+UsePerfData
Reviewed-by: jbachorik, sla
---
hotspot/test/serviceability/dcmd/framework/HelpTest.java | 2 +-
.../test/serviceability/dcmd/framework/InvalidCommandTest.java | 2 +-
hotspot/test/serviceability/dcmd/framework/VMVersionTest.java | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/hotspot/test/serviceability/dcmd/framework/HelpTest.java b/hotspot/test/serviceability/dcmd/framework/HelpTest.java
index 3c4df10dabb..fd0a57d607a 100644
--- a/hotspot/test/serviceability/dcmd/framework/HelpTest.java
+++ b/hotspot/test/serviceability/dcmd/framework/HelpTest.java
@@ -35,7 +35,7 @@ import org.testng.annotations.Test;
* @library /testlibrary
* @build com.oracle.java.testlibrary.*
* @build com.oracle.java.testlibrary.dcmd.*
- * @run testng HelpTest
+ * @run testng/othervm -XX:+UsePerfData HelpTest
*/
public class HelpTest {
public void run(CommandExecutor executor) {
diff --git a/hotspot/test/serviceability/dcmd/framework/InvalidCommandTest.java b/hotspot/test/serviceability/dcmd/framework/InvalidCommandTest.java
index d073ac0ffd1..b584308ed1a 100644
--- a/hotspot/test/serviceability/dcmd/framework/InvalidCommandTest.java
+++ b/hotspot/test/serviceability/dcmd/framework/InvalidCommandTest.java
@@ -35,7 +35,7 @@ import org.testng.annotations.Test;
* @library /testlibrary
* @build com.oracle.java.testlibrary.*
* @build com.oracle.java.testlibrary.dcmd.*
- * @run testng InvalidCommandTest
+ * @run testng/othervm -XX:+UsePerfData InvalidCommandTest
*/
public class InvalidCommandTest {
diff --git a/hotspot/test/serviceability/dcmd/framework/VMVersionTest.java b/hotspot/test/serviceability/dcmd/framework/VMVersionTest.java
index ca834db2d34..c46faae3287 100644
--- a/hotspot/test/serviceability/dcmd/framework/VMVersionTest.java
+++ b/hotspot/test/serviceability/dcmd/framework/VMVersionTest.java
@@ -36,7 +36,7 @@ import org.testng.annotations.Test;
* @library /testlibrary
* @build com.oracle.java.testlibrary.*
* @build com.oracle.java.testlibrary.dcmd.*
- * @run testng VMVersionTest
+ * @run testng/othervm -XX:+UsePerfData VMVersionTest
*/
public class VMVersionTest {
public void run(CommandExecutor executor) {
From 5ae2ec81e74e25aacdecbb4bfac6bae78a8ca99e Mon Sep 17 00:00:00 2001
From: Mikael Auno
Date: Tue, 3 Feb 2015 12:49:13 +0100
Subject: [PATCH 16/61] 8072403: [TESTBUG] HeapDumpTest and HeapDumpAllTest
fails to find jhat in non-JDK runs
Reviewed-by: jbachorik, sla
---
hotspot/test/serviceability/dcmd/gc/HeapDumpTest.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hotspot/test/serviceability/dcmd/gc/HeapDumpTest.java b/hotspot/test/serviceability/dcmd/gc/HeapDumpTest.java
index d616e6590ae..132f9a2e86d 100644
--- a/hotspot/test/serviceability/dcmd/gc/HeapDumpTest.java
+++ b/hotspot/test/serviceability/dcmd/gc/HeapDumpTest.java
@@ -51,7 +51,7 @@ public class HeapDumpTest {
}
private void verifyHeapDump(String fileName) {
- String jhat = JDKToolFinder.getTestJDKTool("jhat");
+ String jhat = JDKToolFinder.getJDKTool("jhat");
String[] cmd = { jhat, "-parseonly", "true", fileName };
ProcessBuilder pb = new ProcessBuilder(cmd);
From a0057ef650e4089ab519fb760873682c792a4242 Mon Sep 17 00:00:00 2001
From: Mikael Auno
Date: Tue, 3 Feb 2015 12:49:33 +0100
Subject: [PATCH 17/61] 8072405: [TESTBUG] DCMD tests needs at least compact3
profile
Reviewed-by: jbachorik, sla
---
hotspot/test/TEST.groups | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/hotspot/test/TEST.groups b/hotspot/test/TEST.groups
index 80eb42eb8c0..e0f2a6f0fc2 100644
--- a/hotspot/test/TEST.groups
+++ b/hotspot/test/TEST.groups
@@ -145,7 +145,8 @@ needs_compact3 = \
gc/survivorAlignment \
runtime/InternalApi/ThreadCpuTimesDeadlock.java \
serviceability/threads/TestFalseDeadLock.java \
- compiler/codecache/jmx
+ compiler/codecache/jmx \
+ serviceability/dcmd
# Compact 2 adds full VM tests
compact2 = \
From dc5a35154deb88bca2a69cdc4bcb08e0dad35c4e Mon Sep 17 00:00:00 2001
From: Stefan Johansson
Date: Tue, 3 Feb 2015 15:50:06 +0100
Subject: [PATCH 18/61] 8069034:
gc/g1/TestEagerReclaimHumongousRegionsClearMarkBits.java nightly failure
When checking for humongous objects to reclaim, we dirty cards that might belong to freed regions. Fixed by checking the region before dirtying.
Reviewed-by: tschatzl, brutisso
---
.../share/vm/gc_implementation/g1/g1CollectedHeap.cpp | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
index 0d81bbfec83..6759dd96761 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
@@ -3525,9 +3525,14 @@ class RegisterHumongousWithInCSetFastTestClosure : public HeapRegionClosure {
size_t card_index;
while (hrrs.has_next(card_index)) {
jbyte* card_ptr = (jbyte*)bs->byte_for_index(card_index);
- if (*card_ptr != CardTableModRefBS::dirty_card_val()) {
- *card_ptr = CardTableModRefBS::dirty_card_val();
- _dcq.enqueue(card_ptr);
+ // The remembered set might contain references to already freed
+ // regions. Filter out such entries to avoid failing card table
+ // verification.
+ if (!g1h->heap_region_containing(bs->addr_for(card_ptr))->is_free()) {
+ if (*card_ptr != CardTableModRefBS::dirty_card_val()) {
+ *card_ptr = CardTableModRefBS::dirty_card_val();
+ _dcq.enqueue(card_ptr);
+ }
}
}
r->rem_set()->clear_locked();
From d9fe0af0483e5954ba1d68107fb448669724a464 Mon Sep 17 00:00:00 2001
From: Jaroslav Bachorik
Date: Tue, 3 Feb 2015 16:46:05 +0100
Subject: [PATCH 19/61] 8066708: JMXStartStopTest fails to connect to port
38112
Reviewed-by: smarks, dsamersoff, olagneau
---
.../jmxremote/startstop/JMXStartStopTest.java | 599 ++++++++++--------
1 file changed, 346 insertions(+), 253 deletions(-)
diff --git a/jdk/test/sun/management/jmxremote/startstop/JMXStartStopTest.java b/jdk/test/sun/management/jmxremote/startstop/JMXStartStopTest.java
index bc755ac411e..a516acfd449 100644
--- a/jdk/test/sun/management/jmxremote/startstop/JMXStartStopTest.java
+++ b/jdk/test/sun/management/jmxremote/startstop/JMXStartStopTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,9 @@
import java.io.File;
import java.io.IOException;
+import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
+import java.net.BindException;
import java.net.ConnectException;
import java.net.ServerSocket;
import java.rmi.RemoteException;
@@ -31,15 +33,15 @@ import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;
import java.util.ArrayList;
import java.util.Arrays;
-import java.util.Iterator;
import java.util.List;
import java.util.Objects;
+import java.util.Random;
import java.util.Set;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.concurrent.atomic.AtomicInteger;
import java.util.function.Consumer;
+import java.util.stream.Collectors;
import javax.management.*;
import javax.management.remote.*;
@@ -47,6 +49,8 @@ import javax.net.ssl.SSLHandshakeException;
import jdk.testlibrary.ProcessTools;
import jdk.testlibrary.JDKToolLauncher;
+import sun.management.Agent;
+import sun.management.AgentConfigurationError;
/**
* @test
@@ -54,65 +58,55 @@ import jdk.testlibrary.JDKToolLauncher;
* @library /lib/testlibrary
* @build jdk.testlibrary.* JMXStartStopTest JMXStartStopDoSomething
* @run main/othervm/timeout=600 -XX:+UsePerfData JMXStartStopTest
- * @summary Makes sure that enabling/disabling the management agent through
- * JCMD achieves the desired results
+ * @summary Makes sure that enabling/disabling the management agent through JCMD
+ * achieves the desired results
*/
public class JMXStartStopTest {
+
private static final String TEST_SRC = System.getProperty("test.src");
private static final boolean verbose = false;
/**
- * Dynamically allocates two distinct ports using {@linkplain java.net.ServerSocket}
- * It keeps each of those ports blocked until it is first accessed by its getter
+ * Dynamically allocates distinct ports from the ephemeral range 49152-65535
*/
private static class PortAllocator {
- private final int port1, port2;
- private final ServerSocket ss1, ss2;
- PortAllocator() {
- try {
- ss1 = new ServerSocket(0);
- ss2 = new ServerSocket(0);
- port1 = ss1.getLocalPort();
- port2 = ss2.getLocalPort();
- } catch (IOException e) {
- throw new Error("Error while obtaining free ports", e);
- }
- }
- public int getPort1() {
- if (!ss1.isClosed()) {
- try {
- ss1.close();
- } catch (IOException e) {
- // just ignore
- }
- }
- return port1;
- }
+ private final static int LOWER_BOUND = 49152;
+ private final static int UPPER_BOUND = 65535;
- public int getPort2() {
- if (!ss2.isClosed()) {
- try {
- ss2.close();
- } catch (IOException e) {
- // just ignore
+ private final static Random RND = new Random(System.currentTimeMillis());
+
+ private static int[] allocatePorts(final int numPorts) {
+ int[] ports = new int[numPorts];
+ for (int i = 0; i < numPorts; i++) {
+ int port = -1;
+ while (port == -1) {
+ port = RND.nextInt(UPPER_BOUND - LOWER_BOUND + 1) + LOWER_BOUND;
+ for (int j = 0; j < i; j++) {
+ if (ports[j] == port) {
+ port = -1;
+ break;
+ }
+ }
}
+ System.err.println("*** port = " + port);
+ ports[i] = port;
}
- return port2;
+ return ports;
}
}
- private static void dbg_print(String msg){
+ private static void dbg_print(String msg) {
if (verbose) {
- System.out.println("DBG: " +msg);
+ System.out.println("DBG: " + msg);
}
}
private static int listMBeans(MBeanServerConnection server,
- ObjectName pattern,
- QueryExp query)
- throws Exception {
+ ObjectName pattern,
+ QueryExp query)
+ throws Exception {
Set names = server.queryNames(pattern,query);
for (ObjectName name : names) {
@@ -131,9 +125,8 @@ public class JMXStartStopTest {
return names.size();
}
-
private static void testConnectLocal(long pid)
- throws Exception {
+ throws Exception {
String jmxUrlStr = null;
@@ -208,12 +201,12 @@ public class JMXStartStopTest {
String jmxUrlStr = (rmiPort != 0) ?
String.format(
- "service:jmx:rmi://localhost:%d/jndi/rmi://localhost:%d/jmxrmi",
- rmiPort,
+ "service:jmx:rmi://localhost:%d/jndi/rmi://localhost:%d/jmxrmi",
+ rmiPort,
port) :
String.format(
- "service:jmx:rmi:///jndi/rmi://localhost:%d/jmxrmi",
- port);
+ "service:jmx:rmi:///jndi/rmi://localhost:%d/jmxrmi",
+ port);
JMXServiceURL url = new JMXServiceURL(jmxUrlStr);
@@ -292,7 +285,21 @@ public class JMXStartStopTest {
if (m.getName().startsWith("test_")) {
long t1 = System.currentTimeMillis();
try {
- m.invoke(null);
+ boolean retry = false;
+ do {
+ try {
+ m.invoke(null);
+ retry = false;
+ } catch (InvocationTargetException e) {
+ if (e.getCause() instanceof BindException ||
+ e.getCause() instanceof java.rmi.ConnectException) {
+ System.out.println("Failed to allocate ports. Retrying ...");
+ retry = true;
+ } else {
+ throw e;
+ }
+ }
+ } while (retry);
System.out.println("=== PASSED");
} catch (Throwable e) {
failures.add(new Failure(e, m.getName() + " failed"));
@@ -326,13 +333,23 @@ public class JMXStartStopTest {
public synchronized void start() throws InterruptedException, IOException, TimeoutException {
if (started.compareAndSet(false, true)) {
try {
+ AtomicBoolean error = new AtomicBoolean(false);
p = ProcessTools.startProcess(
- "JMXStartStopDoSomething",
- pb,
- (line) -> line.equals("main enter"),
- 5,
- TimeUnit.SECONDS
+ "JMXStartStopDoSomething{" + name + "}",
+ pb,
+ (line) -> {
+ boolean ok = line.equals("main enter");
+ error.set(line.contains("BindException"));
+
+ return ok || error.get();
+ },
+ 5,
+ TimeUnit.SECONDS
);
+ if (error.get()) {
+ throw new BindException("Starting process failed due to " +
+ "the requested port not being available");
+ }
pid = p.getPid();
} catch (TimeoutException e) {
p.destroy();
@@ -347,7 +364,7 @@ public class JMXStartStopTest {
}
public synchronized void stop()
- throws IOException, InterruptedException {
+ throws IOException, InterruptedException {
if (started.compareAndSet(true, false)) {
p.getOutputStream().write(0);
p.getOutputStream().flush();
@@ -374,16 +391,16 @@ public class JMXStartStopTest {
* @throws TimeoutException
*/
private static Something doSomething(String name, String ... args)
- throws Exception {
+ throws Exception {
List pbArgs = new ArrayList<>(Arrays.asList(
- "-cp",
- System.getProperty("test.class.path")
+ "-cp",
+ System.getProperty("test.class.path")
));
pbArgs.addAll(Arrays.asList(args));
pbArgs.add("JMXStartStopDoSomething");
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
- pbArgs.toArray(new String[pbArgs.size()])
+ pbArgs.toArray(new String[pbArgs.size()])
);
Something s = new Something(pb, name);
s.start();
@@ -399,7 +416,7 @@ public class JMXStartStopTest {
*/
private static void jcmd(String ... command) throws IOException, InterruptedException {
if (command.length == 0) {
- jcmd(null, (Consumer)null);
+ jcmd(null, c->{});
} else {
jcmd(null, command);
}
@@ -408,7 +425,7 @@ public class JMXStartStopTest {
/**
* Run the "jcmd" command
*
- * @param c {@linkplain Consumer} instance; may be null
+ * @param c {@linkplain Consumer} instance
* @param command Command with parameters; space separated string
* @throws IOException
* @throws InterruptedException
@@ -419,8 +436,9 @@ public class JMXStartStopTest {
/**
* Run the "jcmd" command
+ *
* @param target The target application name (or PID)
- * @param c {@linkplain Consumer} instance; may be null
+ * @param c {@linkplain Consumer} instance
* @param command Command with parameters; space separated string
* @throws IOException
* @throws InterruptedException
@@ -430,21 +448,37 @@ public class JMXStartStopTest {
JDKToolLauncher l = JDKToolLauncher.createUsingTestJDK("jcmd");
l.addToolArg(target);
- for(String cmd : command) {
+ for (String cmd : command) {
l.addToolArg(cmd);
}
+
+ AtomicBoolean portUnavailable = new AtomicBoolean(false);
Process p = ProcessTools.startProcess(
"jcmd",
new ProcessBuilder(l.getCommand()),
- c
+ line -> {
+ if (line.contains("BindException") ||
+ line.contains(Agent.getText(AgentConfigurationError.CONNECTOR_SERVER_IO_ERROR))) {
+ portUnavailable.set(true);
+ } else {
+ c.accept(line);
+ }
+ }
);
p.waitFor();
dbg_print("[jcmd] --------");
+ if (portUnavailable.get()) {
+ String cmd = Arrays.asList(l.getCommand()).stream()
+ .collect(
+ Collectors.joining(" ", "", ": Unable to bind address")
+ );
+ throw new BindException(cmd);
+ }
}
private static final String CMD_STOP = "ManagementAgent.stop";
- private static final String CMD_START= "ManagementAgent.start";
+ private static final String CMD_START = "ManagementAgent.start";
private static final String CMD_START_LOCAL = "ManagementAgent.start_local";
static void test_01() throws Exception {
@@ -452,22 +486,22 @@ public class JMXStartStopTest {
// restart on other port
System.out.println("**** Test one ****");
- PortAllocator pa = new PortAllocator();
+ int ports[] = PortAllocator.allocatePorts(2);
Something s = doSomething(
- "test_01",
- "-Dcom.sun.management.jmxremote.port=" + pa.getPort1(),
- "-Dcom.sun.management.jmxremote.authenticate=false",
- "-Dcom.sun.management.jmxremote.ssl=false");
+ "test_01",
+ "-Dcom.sun.management.jmxremote.port=" + ports[0],
+ "-Dcom.sun.management.jmxremote.authenticate=false",
+ "-Dcom.sun.management.jmxremote.ssl=false");
try {
- testConnect(pa.getPort1());
+ testConnect(ports[0]);
jcmd(CMD_STOP);
- testNoConnect(pa.getPort1());
+ testNoConnect(ports[0]);
- jcmd(CMD_START, "jmxremote.port=" + pa.getPort2());
- testConnect(pa.getPort2());
+ jcmd(CMD_START, "jmxremote.port=" + ports[1]);
+ testConnect(ports[1]);
} finally {
s.stop();
}
@@ -479,15 +513,15 @@ public class JMXStartStopTest {
System.out.println("**** Test two ****");
+ int[] ports = PortAllocator.allocatePorts(1);
Something s = doSomething("test_02");
- PortAllocator pa = new PortAllocator();
try {
jcmd(CMD_START,
- "jmxremote.port=" + pa.getPort1(),
- "jmxremote.authenticate=false",
- "jmxremote.ssl=false");
+ "jmxremote.port=" + ports[0],
+ "jmxremote.authenticate=false",
+ "jmxremote.ssl=false");
- testConnect(pa.getPort1());
+ testConnect(ports[0]);
} finally {
// debugPortUsage(pa);
s.stop();
@@ -500,25 +534,25 @@ public class JMXStartStopTest {
System.out.println("**** Test three ****");
+ int[] ports = PortAllocator.allocatePorts(2);
Something s = doSomething("test_03");
- PortAllocator pa = new PortAllocator();
try {
jcmd(CMD_START,
- "jmxremote.port=" + pa.getPort1(),
- "jmxremote.authenticate=false",
- "jmxremote.ssl=false");
+ "jmxremote.port=" + ports[0],
+ "jmxremote.authenticate=false",
+ "jmxremote.ssl=false");
// Second agent shouldn't start
jcmd(CMD_START,
- "jmxremote.port=" + pa.getPort2(),
- "jmxremote.authenticate=false",
- "jmxremote.ssl=false");
+ "jmxremote.port=" + ports[1],
+ "jmxremote.authenticate=false",
+ "jmxremote.ssl=false");
// First agent should connect
- testConnect(pa.getPort1());
+ testConnect(ports[0]);
// Second agent should not connect
- testNoConnect(pa.getPort2());
+ testNoConnect(ports[1]);
} finally {
s.stop();
}
@@ -530,16 +564,16 @@ public class JMXStartStopTest {
System.out.println("**** Test four ****");
+ int[] ports = PortAllocator.allocatePorts(2);
Something s = doSomething("test_04");
- PortAllocator pa = new PortAllocator();
try {
jcmd(CMD_START,
- "jmxremote.port=" + pa.getPort1(),
- "jmxremote.rmi.port=" + pa.getPort2(),
- "jmxremote.authenticate=false",
- "jmxremote.ssl=false");
+ "jmxremote.port=" + ports[0],
+ "jmxremote.rmi.port=" + ports[1],
+ "jmxremote.authenticate=false",
+ "jmxremote.ssl=false");
- testConnect(pa.getPort1(), pa.getPort2());
+ testConnect(ports[0], ports[1]);
} finally {
s.stop();
}
@@ -550,13 +584,12 @@ public class JMXStartStopTest {
// but should leave remote server disabled
System.out.println("**** Test five ****");
-
+ int[] ports = PortAllocator.allocatePorts(1);
Something s = doSomething("test_05");
- PortAllocator pa = new PortAllocator();
try {
jcmd(CMD_START_LOCAL);
- testNoConnect(pa.getPort1());
+ testNoConnect(ports[0]);
testConnectLocal(s.getPid());
} finally {
s.stop();
@@ -566,94 +599,36 @@ public class JMXStartStopTest {
static void test_06() throws Exception {
// Run an app without JMX enabled
// start JMX by jcmd on one port, specify rmi port explicitly
- // attempt to start it again
- // 1) with the same port
- // 2) with other port
- // 3) attempt to stop it twice
+ // attempt to start it again with the same port
// Check for valid messages in the output
System.out.println("**** Test six ****");
+ int[] ports = PortAllocator.allocatePorts(2);
Something s = doSomething("test_06");
- PortAllocator pa = new PortAllocator();
try {
jcmd(CMD_START,
- "jmxremote.port=" + pa.getPort1(),
- "jmxremote.authenticate=false",
- "jmxremote.ssl=false");
+ "jmxremote.port=" + ports[0],
+ "jmxremote.authenticate=false",
+ "jmxremote.ssl=false");
- testConnect(pa.getPort1(), pa.getPort2());
+ testConnect(ports[0], ports[1]);
- final AtomicInteger checks = new AtomicInteger();
+ final AtomicBoolean checks = new AtomicBoolean(false);
jcmd(
- line -> {
- if (line.contains("java.lang.RuntimeException: Invalid agent state")) {
- checks.getAndUpdate((op) -> op | 1);
- }
- },
- CMD_START,
- "jmxremote.port=" + pa.getPort1(),
- "jmxremote.authenticate=false",
- "jmxremote.ssl=false");
+ line -> {
+ if (line.contains("java.lang.RuntimeException: Invalid agent state")) {
+ checks.set(true);
+ }
+ },
+ CMD_START,
+ "jmxremote.port=" + ports[0],
+ "jmxremote.authenticate=false",
+ "jmxremote.ssl=false");
- jcmd(
- line -> {
- if (line.contains("java.lang.RuntimeException: Invalid agent state")) {
- checks.getAndUpdate((op) -> op | 2);
- }
- },
- CMD_START,
- "jmxremote.port=" + pa.getPort2(),
- "jmxremote.authenticate=false",
- "jmxremote.ssl=false");
-
- jcmd(CMD_STOP);
- jcmd(CMD_STOP);
-
- int busyPort;
- try (ServerSocket ss = new ServerSocket(0))
- {
- busyPort = ss.getLocalPort();
- int retryCntr = 1;
- do {
- final boolean[] retry = new boolean[]{false};
- jcmd(
- line -> {
- boolean match = line.contains("Port already in use: " +
- busyPort);
- System.out.println("[match] " + line + " => " + match);
- if (match) {
- checks.getAndUpdate((op) -> op | 4);
- retry[0] = false;
- } else if (line.contains("Exception thrown by the agent")) {
- retry[0] = true;
- }
- },
- CMD_START,
- "jmxremote.port=" + ss.getLocalPort(),
- "jmxremote.rmi.port=" + pa.getPort2(),
- "jmxremote.authenticate=false",
- "jmxremote.ssl=false"
- );
- if (!retry[0]) {
- break;
- }
- System.out.println("Attempt " + retryCntr + " >>>");
- System.out.println("Unexpected reply from the agent. Retrying in 500ms ...");
- Thread.sleep(500);
- } while (retryCntr++ < 10);
- }
- if ((checks.get() & 1) == 0) {
- throw new Exception("Starting agent on port " + pa.getPort1() + " should " +
- "report an invalid agent state");
- }
- if ((checks.get() & 2) == 0) {
- throw new Exception("Starting agent on poprt " + pa.getPort2() + " should " +
- "report an invalid agent state");
- }
- if ((checks.get() & 4) == 0) {
- throw new Exception("Starting agent on port " + busyPort + " should " +
- "report port in use");
+ if (!checks.get()) {
+ throw new Exception("Starting agent on port " + ports[0] + " should "
+ + "report an invalid agent state");
}
} finally {
s.stop();
@@ -661,68 +636,188 @@ public class JMXStartStopTest {
}
static void test_07() throws Exception {
- // Run an app without JMX enabled, but with some properties set
- // in command line.
- // make sure these properties overridden corectly
+ // Run an app without JMX enabled
+ // start JMX by jcmd on one port, specify rmi port explicitly
+ // attempt to start it again with other port
+ // Check for valid messages in the output
System.out.println("**** Test seven ****");
- Something s = doSomething(
- "test_07",
- "-Dcom.sun.management.jmxremote.authenticate=false",
- "-Dcom.sun.management.jmxremote.ssl=true");
- PortAllocator pa = new PortAllocator();
-
+ int[] ports = PortAllocator.allocatePorts(2);
+ Something s = doSomething("test_07");
try {
- testNoConnect(pa.getPort1());
+ jcmd(CMD_START,
+ "jmxremote.port=" + ports[0],
+ "jmxremote.authenticate=false",
+ "jmxremote.ssl=false");
+
+ testConnect(ports[0], ports[1]);
+
+ final AtomicBoolean checks = new AtomicBoolean(false);
+
jcmd(
- CMD_START,
- "jmxremote.port=" + pa.getPort2(),
- "jmxremote.authenticate=false",
- "jmxremote.ssl=false"
- );
- testConnect(pa.getPort2());
+ line -> {
+ if (line.contains("java.lang.RuntimeException: Invalid agent state")) {
+ checks.set(true);
+ }
+ },
+ CMD_START,
+ "jmxremote.port=" + ports[1],
+ "jmxremote.authenticate=false",
+ "jmxremote.ssl=false");
+
+ if (!checks.get()) {
+ throw new Exception("Starting agent on poprt " + ports[1] + " should "
+ + "report an invalid agent state");
+ }
} finally {
s.stop();
}
}
static void test_08() throws Exception {
- // Run an app with JMX enabled and with some properties set
- // in command line.
- // stop JMX agent and then start it again with different property values
- // make sure these properties overridden corectly
+ // Run an app without JMX enabled
+ // start JMX by jcmd on one port, specify rmi port explicitly
+ // attempt to stop it twice
+ // Check for valid messages in the output
System.out.println("**** Test eight ****");
- PortAllocator pa = new PortAllocator();
-
- Something s = doSomething(
- "test_08",
- "-Dcom.sun.management.jmxremote.port=" + pa.getPort1(),
- "-Dcom.sun.management.jmxremote.authenticate=false",
- "-Dcom.sun.management.jmxremote.ssl=true");
+ int[] ports = PortAllocator.allocatePorts(2);
+ Something s = doSomething("test_08");
try {
- testNoConnect(pa.getPort1());
+ jcmd(CMD_START,
+ "jmxremote.port=" + ports[0],
+ "jmxremote.authenticate=false",
+ "jmxremote.ssl=false");
+
+ testConnect(ports[0], ports[1]);
jcmd(CMD_STOP);
-
- testNoConnect(pa.getPort1());
-
- jcmd(
- CMD_START,
- "jmxremote.port=" + pa.getPort2(),
- "jmxremote.authenticate=false",
- "jmxremote.ssl=false"
- );
-
- testConnect(pa.getPort2());
+ jcmd(CMD_STOP);
} finally {
s.stop();
}
}
static void test_09() throws Exception {
+ // Run an app without JMX enabled
+ // attempt to start JMX using a non-available port
+ // Check for valid messages in the output
+
+ System.out.println("**** Test nine ****");
+
+ Something s = doSomething("test_09");
+
+ try (ServerSocket ss = new ServerSocket(0)) {
+ int localPort = ss.getLocalPort();
+ int[] ports;
+ do {
+ ports = PortAllocator.allocatePorts(1);
+ } while (localPort == ports[0]);
+
+ final AtomicBoolean checks = new AtomicBoolean(false);
+
+ int retryCntr = 1;
+ do {
+ final AtomicBoolean retry = new AtomicBoolean(false);
+
+ try {
+ jcmd(
+ line -> {
+ if (line.contains(Agent.getText(AgentConfigurationError.AGENT_EXCEPTION))) {
+ retry.set(true);
+ }
+ },
+ CMD_START,
+ "jmxremote.port=" + ports[0],
+ "jmxremote.rmi.port=" + localPort,
+ "jmxremote.authenticate=false",
+ "jmxremote.ssl=false"
+ );
+ } catch (BindException e) {
+ checks.set(true);
+ }
+ if (!retry.get()) {
+ break;
+ }
+ System.out.println("Attempt " + retryCntr + " >>>");
+ System.out.println("Unexpected reply from the agent. Retrying in 500ms ...");
+ Thread.sleep(500);
+ } while (retryCntr++ < 10);
+
+ if (!checks.get()) {
+ throw new Exception("Starting agent on port " + ports[0] + " should "
+ + "report port in use");
+ }
+ } finally {
+ s.stop();
+ }
+
+ }
+
+ static void test_10() throws Exception {
+ // Run an app without JMX enabled, but with some properties set
+ // in command line.
+ // make sure these properties overridden corectly
+
+ System.out.println("**** Test ten ****");
+
+ int[] ports = PortAllocator.allocatePorts(2);
+ Something s = doSomething(
+ "test_10",
+ "-Dcom.sun.management.jmxremote.authenticate=false",
+ "-Dcom.sun.management.jmxremote.ssl=true");
+
+ try {
+ testNoConnect(ports[0]);
+ jcmd(
+ CMD_START,
+ "jmxremote.port=" + ports[1],
+ "jmxremote.authenticate=false",
+ "jmxremote.ssl=false"
+ );
+ testConnect(ports[1]);
+ } finally {
+ s.stop();
+ }
+ }
+
+ static void test_11() throws Exception {
+ // Run an app with JMX enabled and with some properties set
+ // in command line.
+ // stop JMX agent and then start it again with different property values
+ // make sure these properties overridden corectly
+
+ System.out.println("**** Test eleven ****");
+ int[] ports = PortAllocator.allocatePorts(2);
+ Something s = doSomething(
+ "test_11",
+ "-Dcom.sun.management.jmxremote.port=" + ports[0],
+ "-Dcom.sun.management.jmxremote.authenticate=false",
+ "-Dcom.sun.management.jmxremote.ssl=true");
+
+ try {
+ testNoConnect(ports[0]);
+
+ jcmd(CMD_STOP);
+
+ testNoConnect(ports[0]);
+
+ jcmd(
+ CMD_START,
+ "jmxremote.port=" + ports[1],
+ "jmxremote.authenticate=false",
+ "jmxremote.ssl=false"
+ );
+
+ testConnect(ports[1]);
+ } finally {
+ s.stop();
+ }
+ }
+
+ static void test_12() throws Exception {
// Run an app with JMX enabled and with some properties set
// in command line.
// stop JMX agent and then start it again with different property values
@@ -730,87 +825,85 @@ public class JMXStartStopTest {
// in command line
// make sure these properties overridden corectly
- System.out.println("**** Test nine ****");
+ System.out.println("**** Test twelve ****");
- Something s = doSomething("test_09",
- "-Dcom.sun.management.config.file=" +
- TEST_SRC + File.separator + "management_cl.properties",
- "-Dcom.sun.management.jmxremote.authenticate=false"
+ int[] ports = PortAllocator.allocatePorts(2);
+ Something s = doSomething("test_12",
+ "-Dcom.sun.management.config.file="
+ + TEST_SRC + File.separator + "management_cl.properties",
+ "-Dcom.sun.management.jmxremote.authenticate=false"
);
- PortAllocator pa = new PortAllocator();
try {
- testNoConnect(pa.getPort1());
+ testNoConnect(ports[0]);
jcmd(CMD_STOP);
- testNoConnect(pa.getPort1());
+ testNoConnect(ports[0]);
jcmd(CMD_START,
- "config.file=" + TEST_SRC + File.separator +
- "management_jcmd.properties",
- "jmxremote.authenticate=false",
- "jmxremote.port=" + pa.getPort2()
+ "config.file=" + TEST_SRC + File.separator
+ + "management_jcmd.properties",
+ "jmxremote.authenticate=false",
+ "jmxremote.port=" + ports[1]
);
- testConnect(pa.getPort2());
+ testConnect(ports[1]);
} finally {
s.stop();
}
}
- static void test_10() throws Exception {
+ static void test_13() throws Exception {
// Run an app with JMX enabled and with some properties set
// in command line.
// stop JMX agent and then start it again with different property values
// stop JMX agent again and then start it without property value
// make sure these properties overridden corectly
- System.out.println("**** Test ten ****");
- PortAllocator pa = new PortAllocator();
-
+ System.out.println("**** Test thirteen ****");
+ int[] ports = PortAllocator.allocatePorts(1);
Something s = doSomething(
- "test_10",
- "-Dcom.sun.management.jmxremote.port=" + pa.getPort1(),
- "-Dcom.sun.management.jmxremote.authenticate=false",
- "-Dcom.sun.management.jmxremote.ssl=true");
+ "test_13",
+ "-Dcom.sun.management.jmxremote.port=" + ports[0],
+ "-Dcom.sun.management.jmxremote.authenticate=false",
+ "-Dcom.sun.management.jmxremote.ssl=true");
try {
- testNoConnect(pa.getPort1());
+ testNoConnect(ports[0]);
jcmd(CMD_STOP);
jcmd(CMD_START,
- "jmxremote.ssl=false",
- "jmxremote.port=" + pa.getPort1()
+ "jmxremote.ssl=false",
+ "jmxremote.port=" + ports[0]
);
- testConnect(pa.getPort1());
+ testConnect(ports[0]);
jcmd(CMD_STOP);
jcmd(CMD_START,
- "jmxremote.port=" + pa.getPort1()
+ "jmxremote.port=" + ports[0]
);
- testNoConnect(pa.getPort1());
+ testNoConnect(ports[0]);
} finally {
s.stop();
}
}
- static void test_11() throws Exception {
+ static void test_14() throws Exception {
// Run an app with JMX enabled
// stop remote agent
// make sure local agent is not affected
- System.out.println("**** Test eleven ****");
- PortAllocator pa = new PortAllocator();
-
+ System.out.println("**** Test fourteen ****");
+ int[] ports = PortAllocator.allocatePorts(1);
Something s = doSomething(
- "test_11",
- "-Dcom.sun.management.jmxremote.port=" + pa.getPort1(),
- "-Dcom.sun.management.jmxremote.authenticate=false",
- "-Dcom.sun.management.jmxremote.ssl=false");
+ "test_14",
+ "-Dcom.sun.management.jmxremote.port=" + ports[0],
+ "-Dcom.sun.management.jmxremote.authenticate=false",
+ "-Dcom.sun.management.jmxremote.ssl=false");
try {
- testConnect(pa.getPort1());
+ testConnect(ports[0]);
jcmd(CMD_STOP);
testConnectLocal(s.getPid());
} finally {
@@ -818,17 +911,17 @@ public class JMXStartStopTest {
}
}
- static void test_12() throws Exception {
+ static void test_15() throws Exception {
// Run an app with JMX disabled
// start local agent only
- System.out.println("**** Test twelve ****");
+ System.out.println("**** Test fifteen ****");
- Something s = doSomething("test_12");
- PortAllocator pa = new PortAllocator();
+ int[] ports = PortAllocator.allocatePorts(1);
+ Something s = doSomething("test_15");
try {
- testNoConnect(pa.getPort1());
+ testNoConnect(ports[0]);
jcmd(CMD_START + "_local");
testConnectLocal(s.getPid());
From 3e6220b1abf970e759aeedef8f561e7ff66113b5 Mon Sep 17 00:00:00 2001
From: Yasumasa Suenaga
Date: Wed, 4 Feb 2015 22:21:08 +0900
Subject: [PATCH 20/61] 8068589: GCCause should distinguish jcmd GC.run from
System.gc()
GCCause which is caused by GC.run diagnostic command should be different from System.gc() .
Reviewed-by: sla, tamao
---
hotspot/src/share/vm/gc_interface/gcCause.cpp | 3 +++
hotspot/src/share/vm/gc_interface/gcCause.hpp | 3 +++
hotspot/src/share/vm/services/diagnosticCommand.cpp | 2 +-
3 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/hotspot/src/share/vm/gc_interface/gcCause.cpp b/hotspot/src/share/vm/gc_interface/gcCause.cpp
index a364214bdd2..3e0b9dd750d 100644
--- a/hotspot/src/share/vm/gc_interface/gcCause.cpp
+++ b/hotspot/src/share/vm/gc_interface/gcCause.cpp
@@ -103,6 +103,9 @@ const char* GCCause::to_string(GCCause::Cause cause) {
case _last_ditch_collection:
return "Last ditch collection";
+ case _dcmd_gc_run:
+ return "Diagnostic Command";
+
case _last_gc_cause:
return "ILLEGAL VALUE - last gc cause - ILLEGAL VALUE";
diff --git a/hotspot/src/share/vm/gc_interface/gcCause.hpp b/hotspot/src/share/vm/gc_interface/gcCause.hpp
index cb304294639..df4a212213f 100644
--- a/hotspot/src/share/vm/gc_interface/gcCause.hpp
+++ b/hotspot/src/share/vm/gc_interface/gcCause.hpp
@@ -74,6 +74,9 @@ class GCCause : public AllStatic {
_g1_humongous_allocation,
_last_ditch_collection,
+
+ _dcmd_gc_run,
+
_last_gc_cause
};
diff --git a/hotspot/src/share/vm/services/diagnosticCommand.cpp b/hotspot/src/share/vm/services/diagnosticCommand.cpp
index a1853ea2464..d5abd05afa6 100644
--- a/hotspot/src/share/vm/services/diagnosticCommand.cpp
+++ b/hotspot/src/share/vm/services/diagnosticCommand.cpp
@@ -267,7 +267,7 @@ int VMUptimeDCmd::num_arguments() {
void SystemGCDCmd::execute(DCmdSource source, TRAPS) {
if (!DisableExplicitGC) {
- Universe::heap()->collect(GCCause::_java_lang_system_gc);
+ Universe::heap()->collect(GCCause::_dcmd_gc_run);
} else {
output()->print_cr("Explicit GC is disabled, no GC has been performed.");
}
From 00d9c7a2d133558b4be96c212ca352ba014e0384 Mon Sep 17 00:00:00 2001
From: Joseph Provino
Date: Wed, 4 Feb 2015 10:18:28 -0500
Subject: [PATCH 21/61] 8071805: BarrierSet::Other is not used and should be
removed
Remove all occurences of BarrierSet::Other because the barrier set kind is never set to Other.
Reviewed-by: tschatzl, kbarrett
---
hotspot/src/cpu/ppc/vm/templateTable_ppc_64.cpp | 1 -
hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp | 1 -
hotspot/src/cpu/x86/vm/templateTable_x86_32.cpp | 1 -
hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp | 1 -
hotspot/src/share/vm/c1/c1_LIRGenerator.cpp | 2 --
hotspot/src/share/vm/memory/barrierSet.hpp | 3 +--
hotspot/src/share/vm/opto/graphKit.cpp | 3 ---
hotspot/src/share/vm/runtime/vmStructs.cpp | 1 -
8 files changed, 1 insertion(+), 12 deletions(-)
diff --git a/hotspot/src/cpu/ppc/vm/templateTable_ppc_64.cpp b/hotspot/src/cpu/ppc/vm/templateTable_ppc_64.cpp
index 69c1e0d1be1..70d1420022d 100644
--- a/hotspot/src/cpu/ppc/vm/templateTable_ppc_64.cpp
+++ b/hotspot/src/cpu/ppc/vm/templateTable_ppc_64.cpp
@@ -143,7 +143,6 @@ static void do_oop_store(InterpreterMacroAssembler* _masm,
}
break;
case BarrierSet::ModRef:
- case BarrierSet::Other:
ShouldNotReachHere();
break;
default:
diff --git a/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp b/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp
index 438d376b2c6..fe58233ced1 100644
--- a/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp
+++ b/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp
@@ -115,7 +115,6 @@ static void do_oop_store(InterpreterMacroAssembler* _masm,
}
break;
case BarrierSet::ModRef:
- case BarrierSet::Other:
ShouldNotReachHere();
break;
default :
diff --git a/hotspot/src/cpu/x86/vm/templateTable_x86_32.cpp b/hotspot/src/cpu/x86/vm/templateTable_x86_32.cpp
index d0bdc33905c..1a8d8870c2a 100644
--- a/hotspot/src/cpu/x86/vm/templateTable_x86_32.cpp
+++ b/hotspot/src/cpu/x86/vm/templateTable_x86_32.cpp
@@ -185,7 +185,6 @@ static void do_oop_store(InterpreterMacroAssembler* _masm,
}
break;
case BarrierSet::ModRef:
- case BarrierSet::Other:
if (val == noreg) {
__ movptr(obj, NULL_WORD);
} else {
diff --git a/hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp b/hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp
index 82072f0c920..acb4e146415 100644
--- a/hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp
+++ b/hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp
@@ -189,7 +189,6 @@ static void do_oop_store(InterpreterMacroAssembler* _masm,
}
break;
case BarrierSet::ModRef:
- case BarrierSet::Other:
if (val == noreg) {
__ store_heap_oop_null(obj);
} else {
diff --git a/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp b/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp
index 8fe99af08ad..199b840629a 100644
--- a/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp
+++ b/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp
@@ -1432,7 +1432,6 @@ void LIRGenerator::pre_barrier(LIR_Opr addr_opr, LIR_Opr pre_val,
// No pre barriers
break;
case BarrierSet::ModRef:
- case BarrierSet::Other:
// No pre barriers
break;
default :
@@ -1454,7 +1453,6 @@ void LIRGenerator::post_barrier(LIR_OprDesc* addr, LIR_OprDesc* new_val) {
CardTableModRef_post_barrier(addr, new_val);
break;
case BarrierSet::ModRef:
- case BarrierSet::Other:
// No post barriers
break;
default :
diff --git a/hotspot/src/share/vm/memory/barrierSet.hpp b/hotspot/src/share/vm/memory/barrierSet.hpp
index 6743f786fb5..c27d8f4d6f6 100644
--- a/hotspot/src/share/vm/memory/barrierSet.hpp
+++ b/hotspot/src/share/vm/memory/barrierSet.hpp
@@ -39,8 +39,7 @@ public:
CardTableModRef,
CardTableExtension,
G1SATBCT,
- G1SATBCTLogging,
- Other
+ G1SATBCTLogging
};
enum Flags {
diff --git a/hotspot/src/share/vm/opto/graphKit.cpp b/hotspot/src/share/vm/opto/graphKit.cpp
index 20932a5bd51..e185d85958f 100644
--- a/hotspot/src/share/vm/opto/graphKit.cpp
+++ b/hotspot/src/share/vm/opto/graphKit.cpp
@@ -1528,7 +1528,6 @@ void GraphKit::pre_barrier(bool do_load,
case BarrierSet::ModRef:
break;
- case BarrierSet::Other:
default :
ShouldNotReachHere();
@@ -1547,7 +1546,6 @@ bool GraphKit::can_move_pre_barrier() const {
case BarrierSet::ModRef:
return true; // There is no pre-barrier
- case BarrierSet::Other:
default :
ShouldNotReachHere();
}
@@ -1578,7 +1576,6 @@ void GraphKit::post_barrier(Node* ctl,
case BarrierSet::ModRef:
break;
- case BarrierSet::Other:
default :
ShouldNotReachHere();
diff --git a/hotspot/src/share/vm/runtime/vmStructs.cpp b/hotspot/src/share/vm/runtime/vmStructs.cpp
index 5b3ca8a6b42..be0aa46ce2d 100644
--- a/hotspot/src/share/vm/runtime/vmStructs.cpp
+++ b/hotspot/src/share/vm/runtime/vmStructs.cpp
@@ -2213,7 +2213,6 @@ typedef TwoOopHashtable SymbolTwoOopHashtable;
declare_constant(BarrierSet::CardTableExtension) \
declare_constant(BarrierSet::G1SATBCT) \
declare_constant(BarrierSet::G1SATBCTLogging) \
- declare_constant(BarrierSet::Other) \
\
declare_constant(BlockOffsetSharedArray::LogN) \
declare_constant(BlockOffsetSharedArray::LogN_words) \
From 3e2dcfd880e3c8eca13bed04ec6b455f9640ea1d Mon Sep 17 00:00:00 2001
From: Alexander Harlap
Date: Wed, 4 Feb 2015 13:14:27 -0500
Subject: [PATCH 22/61] 8067460: G1:
TestResourceManagementFlagWithCommercialBuild.java failed on embedded
platform
Added extension point to detect unsupported options
Reviewed-by: dholmes, bdelsart
---
hotspot/src/share/vm/runtime/arguments.cpp | 14 ++------------
hotspot/src/share/vm/runtime/arguments.hpp | 12 ++++++++++++
hotspot/src/share/vm/runtime/arguments_ext.hpp | 1 +
3 files changed, 15 insertions(+), 12 deletions(-)
diff --git a/hotspot/src/share/vm/runtime/arguments.cpp b/hotspot/src/share/vm/runtime/arguments.cpp
index 1eaf4633dae..9dc0591f0d2 100644
--- a/hotspot/src/share/vm/runtime/arguments.cpp
+++ b/hotspot/src/share/vm/runtime/arguments.cpp
@@ -57,18 +57,6 @@
#define DEFAULT_VENDOR_URL_BUG "http://bugreport.java.com/bugreport/crash.jsp"
#define DEFAULT_JAVA_LAUNCHER "generic"
-// Disable options not supported in this release, with a warning if they
-// were explicitly requested on the command-line
-#define UNSUPPORTED_OPTION(opt, description) \
-do { \
- if (opt) { \
- if (FLAG_IS_CMDLINE(opt)) { \
- warning(description " is disabled in this release."); \
- } \
- FLAG_SET_DEFAULT(opt, false); \
- } \
-} while(0)
-
#define UNSUPPORTED_GC_OPTION(gc) \
do { \
if (gc) { \
@@ -3854,6 +3842,8 @@ jint Arguments::parse(const JavaVMInitArgs* args) {
#endif
#endif
+ ArgumentsExt::report_unsupported_options();
+
#ifndef PRODUCT
if (TraceBytecodesAt != 0) {
TraceBytecodes = true;
diff --git a/hotspot/src/share/vm/runtime/arguments.hpp b/hotspot/src/share/vm/runtime/arguments.hpp
index ae726b82fdc..9994118577d 100644
--- a/hotspot/src/share/vm/runtime/arguments.hpp
+++ b/hotspot/src/share/vm/runtime/arguments.hpp
@@ -632,4 +632,16 @@ bool Arguments::check_gc_consistency_ergo() {
return check_gc_consistency_user();
}
+// Disable options not supported in this release, with a warning if they
+// were explicitly requested on the command-line
+#define UNSUPPORTED_OPTION(opt, description) \
+do { \
+ if (opt) { \
+ if (FLAG_IS_CMDLINE(opt)) { \
+ warning(description " is disabled in this release."); \
+ } \
+ FLAG_SET_DEFAULT(opt, false); \
+ } \
+} while(0)
+
#endif // SHARE_VM_RUNTIME_ARGUMENTS_HPP
diff --git a/hotspot/src/share/vm/runtime/arguments_ext.hpp b/hotspot/src/share/vm/runtime/arguments_ext.hpp
index 4e7415154bf..9c716bc6581 100644
--- a/hotspot/src/share/vm/runtime/arguments_ext.hpp
+++ b/hotspot/src/share/vm/runtime/arguments_ext.hpp
@@ -37,6 +37,7 @@ public:
// no additional parsing needed in Arguments::parse() for the option.
// Otherwise returns false.
static inline bool process_options(const JavaVMOption *option) { return false; }
+ static inline void report_unsupported_options() { }
};
void ArgumentsExt::select_gc_ergonomically() {
From ee2ba7946a5cbe49098aa236befc4e7fad25e307 Mon Sep 17 00:00:00 2001
From: Weijun Wang
Date: Fri, 6 Feb 2015 11:38:29 +0800
Subject: [PATCH 23/61] 8072615:
test/lib/testlibrary/jdk/testlibrary/SimpleSSLContext.java wrong on Windows
Reviewed-by: xuelei
---
jdk/test/lib/testlibrary/jdk/testlibrary/SimpleSSLContext.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/jdk/test/lib/testlibrary/jdk/testlibrary/SimpleSSLContext.java b/jdk/test/lib/testlibrary/jdk/testlibrary/SimpleSSLContext.java
index 57a74fcf794..4fedb362c5c 100644
--- a/jdk/test/lib/testlibrary/jdk/testlibrary/SimpleSSLContext.java
+++ b/jdk/test/lib/testlibrary/jdk/testlibrary/SimpleSSLContext.java
@@ -56,7 +56,7 @@ public class SimpleSSLContext {
*/
public SimpleSSLContext () throws IOException {
String paths = System.getProperty("test.src.path");
- StringTokenizer st = new StringTokenizer(paths,":");
+ StringTokenizer st = new StringTokenizer(paths, File.pathSeparator);
boolean securityExceptions = false;
while (st.hasMoreTokens()) {
String path = st.nextToken();
From c0277e17c9d3ce3ad2f60b64185014051df7f800 Mon Sep 17 00:00:00 2001
From: Erik Joelsson
Date: Fri, 6 Feb 2015 09:56:30 +0100
Subject: [PATCH 24/61] 8071329: Stop exporting INCLUDE and LIB when building
on windows
Reviewed-by: ihse
---
common/autoconf/basics.m4 | 3 +
common/autoconf/generated-configure.sh | 278 ++++++++++++++++++++++++-
common/autoconf/hotspot-spec.gmk.in | 7 +
common/autoconf/spec.gmk.in | 10 +-
common/autoconf/toolchain_windows.m4 | 26 ++-
make/Main.gmk | 3 +-
make/common/NativeCompilation.gmk | 5 +-
7 files changed, 314 insertions(+), 18 deletions(-)
diff --git a/common/autoconf/basics.m4 b/common/autoconf/basics.m4
index 800c52b844b..fd677aacc3c 100644
--- a/common/autoconf/basics.m4
+++ b/common/autoconf/basics.m4
@@ -242,6 +242,9 @@ AC_DEFUN_ONCE([BASIC_INIT],
[
# Save the original command line. This is passed to us by the wrapper configure script.
AC_SUBST(CONFIGURE_COMMAND_LINE)
+ # Save the path variable before it gets changed
+ ORIGINAL_PATH="$PATH"
+ AC_SUBST(ORIGINAL_PATH)
DATE_WHEN_CONFIGURED=`LANG=C date`
AC_SUBST(DATE_WHEN_CONFIGURED)
AC_MSG_NOTICE([Configuration created at $DATE_WHEN_CONFIGURED.])
diff --git a/common/autoconf/generated-configure.sh b/common/autoconf/generated-configure.sh
index 11b5d337733..f7560f87b5b 100644
--- a/common/autoconf/generated-configure.sh
+++ b/common/autoconf/generated-configure.sh
@@ -991,6 +991,7 @@ CAT
BASH
BASENAME
DATE_WHEN_CONFIGURED
+ORIGINAL_PATH
CONFIGURE_COMMAND_LINE
target_alias
host_alias
@@ -4333,7 +4334,7 @@ TOOLCHAIN_DESCRIPTION_xlc="IBM XL C/C++"
#CUSTOM_AUTOCONF_INCLUDE
# Do not change or remove the following line, it is needed for consistency checks:
-DATE_WHEN_GENERATED=1421247827
+DATE_WHEN_GENERATED=1423212925
###############################################################################
#
@@ -4366,6 +4367,9 @@ DATE_WHEN_GENERATED=1421247827
# Save the original command line. This is passed to us by the wrapper configure script.
+ # Save the path variable before it gets changed
+ ORIGINAL_PATH="$PATH"
+
DATE_WHEN_CONFIGURED=`LANG=C date`
{ $as_echo "$as_me:${as_lineno-$LINENO}: Configuration created at $DATE_WHEN_CONFIGURED." >&5
@@ -27438,8 +27442,8 @@ $as_echo "$as_me: Trying to extract Visual Studio environment variables" >&6;}
# The trailing space for everyone except PATH is no typo, but is needed due
# to trailing \ in the Windows paths. These will be stripped later.
$ECHO "$WINPATH_BASH -c 'echo VS_PATH="'\"$PATH\" > set-vs-env.sh' >> $EXTRACT_VC_ENV_BAT_FILE
- $ECHO "$WINPATH_BASH -c 'echo VS_INCLUDE="'\"$INCLUDE \" >> set-vs-env.sh' >> $EXTRACT_VC_ENV_BAT_FILE
- $ECHO "$WINPATH_BASH -c 'echo VS_LIB="'\"$LIB \" >> set-vs-env.sh' >> $EXTRACT_VC_ENV_BAT_FILE
+ $ECHO "$WINPATH_BASH -c 'echo VS_INCLUDE="'\"$INCLUDE\;$include \" >> set-vs-env.sh' >> $EXTRACT_VC_ENV_BAT_FILE
+ $ECHO "$WINPATH_BASH -c 'echo VS_LIB="'\"$LIB\;$lib \" >> set-vs-env.sh' >> $EXTRACT_VC_ENV_BAT_FILE
$ECHO "$WINPATH_BASH -c 'echo VCINSTALLDIR="'\"$VCINSTALLDIR \" >> set-vs-env.sh' >> $EXTRACT_VC_ENV_BAT_FILE
$ECHO "$WINPATH_BASH -c 'echo WindowsSdkDir="'\"$WindowsSdkDir \" >> set-vs-env.sh' >> $EXTRACT_VC_ENV_BAT_FILE
$ECHO "$WINPATH_BASH -c 'echo WINDOWSSDKDIR="'\"$WINDOWSSDKDIR \" >> set-vs-env.sh' >> $EXTRACT_VC_ENV_BAT_FILE
@@ -27486,9 +27490,9 @@ $as_echo "present but broken" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
$as_echo "ok" >&6; }
- # Remove any trailing "\" and " " from the variables.
- VS_INCLUDE=`$ECHO "$VS_INCLUDE" | $SED 's/\\\\* *$//'`
- VS_LIB=`$ECHO "$VS_LIB" | $SED 's/\\\\* *$//'`
+ # Remove any trailing "\" ";" and " " from the variables.
+ VS_INCLUDE=`$ECHO "$VS_INCLUDE" | $SED -e 's/\\\\*;* *$//'`
+ VS_LIB=`$ECHO "$VS_LIB" | $SED 's/\\\\*;* *$//'`
VCINSTALLDIR=`$ECHO "$VCINSTALLDIR" | $SED 's/\\\\* *$//'`
WindowsSDKDir=`$ECHO "$WindowsSDKDir" | $SED 's/\\\\* *$//'`
WINDOWSSDKDIR=`$ECHO "$WINDOWSSDKDIR" | $SED 's/\\\\* *$//'`
@@ -27499,6 +27503,268 @@ $as_echo "ok" >&6; }
+
+ # Convert VS_INCLUDE into SYSROOT_CFLAGS
+ OLDIFS="$IFS"
+ IFS=";"
+ for i in $VS_INCLUDE; do
+ ipath=$i
+ IFS="$OLDIFS"
+
+ if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+
+ # Input might be given as Windows format, start by converting to
+ # unix format.
+ path="$ipath"
+ new_path=`$CYGPATH -u "$path"`
+
+ # Cygwin tries to hide some aspects of the Windows file system, such that binaries are
+ # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered
+ # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then
+ # "foo.exe" is OK but "foo" is an error.
+ #
+ # This test is therefore slightly more accurate than "test -f" to check for file precense.
+ # It is also a way to make sure we got the proper file name for the real test later on.
+ test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null`
+ if test "x$test_shortpath" = x; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: The path of ipath, which resolves as \"$path\", is invalid." >&5
+$as_echo "$as_me: The path of ipath, which resolves as \"$path\", is invalid." >&6;}
+ as_fn_error $? "Cannot locate the the path of ipath" "$LINENO" 5
+ fi
+
+ # Call helper function which possibly converts this using DOS-style short mode.
+ # If so, the updated path is stored in $new_path.
+
+ input_path="$new_path"
+ # Check if we need to convert this using DOS-style short mode. If the path
+ # contains just simple characters, use it. Otherwise (spaces, weird characters),
+ # take no chances and rewrite it.
+ # Note: m4 eats our [], so we need to use [ and ] instead.
+ has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]`
+ if test "x$has_forbidden_chars" != x; then
+ # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \)
+ shortmode_path=`$CYGPATH -s -m -a "$input_path"`
+ path_after_shortmode=`$CYGPATH -u "$shortmode_path"`
+ if test "x$path_after_shortmode" != "x$input_to_shortpath"; then
+ # Going to short mode and back again did indeed matter. Since short mode is
+ # case insensitive, let's make it lowercase to improve readability.
+ shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+ # Now convert it back to Unix-stile (cygpath)
+ input_path=`$CYGPATH -u "$shortmode_path"`
+ new_path="$input_path"
+ fi
+ fi
+
+ test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/`
+ if test "x$test_cygdrive_prefix" = x; then
+ # As a simple fix, exclude /usr/bin since it's not a real path.
+ if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then
+ # The path is in a Cygwin special directory (e.g. /home). We need this converted to
+ # a path prefixed by /cygdrive for fixpath to work.
+ new_path="$CYGWIN_ROOT_PATH$input_path"
+ fi
+ fi
+
+
+ if test "x$path" != "x$new_path"; then
+ ipath="$new_path"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting ipath to \"$new_path\"" >&5
+$as_echo "$as_me: Rewriting ipath to \"$new_path\"" >&6;}
+ fi
+
+ elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+
+ path="$ipath"
+ has_colon=`$ECHO $path | $GREP ^.:`
+ new_path="$path"
+ if test "x$has_colon" = x; then
+ # Not in mixed or Windows style, start by that.
+ new_path=`cmd //c echo $path`
+ fi
+
+
+ input_path="$new_path"
+ # Check if we need to convert this using DOS-style short mode. If the path
+ # contains just simple characters, use it. Otherwise (spaces, weird characters),
+ # take no chances and rewrite it.
+ # Note: m4 eats our [], so we need to use [ and ] instead.
+ has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]`
+ if test "x$has_forbidden_chars" != x; then
+ # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \)
+ new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+ fi
+
+
+ windows_path="$new_path"
+ if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+ unix_path=`$CYGPATH -u "$windows_path"`
+ new_path="$unix_path"
+ elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+ unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'`
+ new_path="$unix_path"
+ fi
+
+ if test "x$path" != "x$new_path"; then
+ ipath="$new_path"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting ipath to \"$new_path\"" >&5
+$as_echo "$as_me: Rewriting ipath to \"$new_path\"" >&6;}
+ fi
+
+ # Save the first 10 bytes of this path to the storage, so fixpath can work.
+ all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
+
+ else
+ # We're on a unix platform. Hooray! :)
+ path="$ipath"
+ has_space=`$ECHO "$path" | $GREP " "`
+ if test "x$has_space" != x; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: The path of ipath, which resolves as \"$path\", is invalid." >&5
+$as_echo "$as_me: The path of ipath, which resolves as \"$path\", is invalid." >&6;}
+ as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
+ fi
+
+ # Use eval to expand a potential ~
+ eval path="$path"
+ if test ! -f "$path" && test ! -d "$path"; then
+ as_fn_error $? "The path of ipath, which resolves as \"$path\", is not found." "$LINENO" 5
+ fi
+
+ ipath="`cd "$path"; $THEPWDCMD -L`"
+ fi
+
+ IFS=";"
+ SYSROOT_CFLAGS="$SYSROOT_CFLAGS -I$ipath"
+ done
+ # Convert VS_LIB into SYSROOT_LDFLAGS
+ for i in $VS_LIB; do
+ libpath=$i
+ IFS="$OLDIFS"
+
+ if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+
+ # Input might be given as Windows format, start by converting to
+ # unix format.
+ path="$libpath"
+ new_path=`$CYGPATH -u "$path"`
+
+ # Cygwin tries to hide some aspects of the Windows file system, such that binaries are
+ # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered
+ # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then
+ # "foo.exe" is OK but "foo" is an error.
+ #
+ # This test is therefore slightly more accurate than "test -f" to check for file precense.
+ # It is also a way to make sure we got the proper file name for the real test later on.
+ test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null`
+ if test "x$test_shortpath" = x; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: The path of libpath, which resolves as \"$path\", is invalid." >&5
+$as_echo "$as_me: The path of libpath, which resolves as \"$path\", is invalid." >&6;}
+ as_fn_error $? "Cannot locate the the path of libpath" "$LINENO" 5
+ fi
+
+ # Call helper function which possibly converts this using DOS-style short mode.
+ # If so, the updated path is stored in $new_path.
+
+ input_path="$new_path"
+ # Check if we need to convert this using DOS-style short mode. If the path
+ # contains just simple characters, use it. Otherwise (spaces, weird characters),
+ # take no chances and rewrite it.
+ # Note: m4 eats our [], so we need to use [ and ] instead.
+ has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]`
+ if test "x$has_forbidden_chars" != x; then
+ # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \)
+ shortmode_path=`$CYGPATH -s -m -a "$input_path"`
+ path_after_shortmode=`$CYGPATH -u "$shortmode_path"`
+ if test "x$path_after_shortmode" != "x$input_to_shortpath"; then
+ # Going to short mode and back again did indeed matter. Since short mode is
+ # case insensitive, let's make it lowercase to improve readability.
+ shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+ # Now convert it back to Unix-stile (cygpath)
+ input_path=`$CYGPATH -u "$shortmode_path"`
+ new_path="$input_path"
+ fi
+ fi
+
+ test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/`
+ if test "x$test_cygdrive_prefix" = x; then
+ # As a simple fix, exclude /usr/bin since it's not a real path.
+ if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then
+ # The path is in a Cygwin special directory (e.g. /home). We need this converted to
+ # a path prefixed by /cygdrive for fixpath to work.
+ new_path="$CYGWIN_ROOT_PATH$input_path"
+ fi
+ fi
+
+
+ if test "x$path" != "x$new_path"; then
+ libpath="$new_path"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting libpath to \"$new_path\"" >&5
+$as_echo "$as_me: Rewriting libpath to \"$new_path\"" >&6;}
+ fi
+
+ elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+
+ path="$libpath"
+ has_colon=`$ECHO $path | $GREP ^.:`
+ new_path="$path"
+ if test "x$has_colon" = x; then
+ # Not in mixed or Windows style, start by that.
+ new_path=`cmd //c echo $path`
+ fi
+
+
+ input_path="$new_path"
+ # Check if we need to convert this using DOS-style short mode. If the path
+ # contains just simple characters, use it. Otherwise (spaces, weird characters),
+ # take no chances and rewrite it.
+ # Note: m4 eats our [], so we need to use [ and ] instead.
+ has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]`
+ if test "x$has_forbidden_chars" != x; then
+ # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \)
+ new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+ fi
+
+
+ windows_path="$new_path"
+ if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+ unix_path=`$CYGPATH -u "$windows_path"`
+ new_path="$unix_path"
+ elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+ unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'`
+ new_path="$unix_path"
+ fi
+
+ if test "x$path" != "x$new_path"; then
+ libpath="$new_path"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting libpath to \"$new_path\"" >&5
+$as_echo "$as_me: Rewriting libpath to \"$new_path\"" >&6;}
+ fi
+
+ # Save the first 10 bytes of this path to the storage, so fixpath can work.
+ all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
+
+ else
+ # We're on a unix platform. Hooray! :)
+ path="$libpath"
+ has_space=`$ECHO "$path" | $GREP " "`
+ if test "x$has_space" != x; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: The path of libpath, which resolves as \"$path\", is invalid." >&5
+$as_echo "$as_me: The path of libpath, which resolves as \"$path\", is invalid." >&6;}
+ as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
+ fi
+
+ # Use eval to expand a potential ~
+ eval path="$path"
+ if test ! -f "$path" && test ! -d "$path"; then
+ as_fn_error $? "The path of libpath, which resolves as \"$path\", is not found." "$LINENO" 5
+ fi
+
+ libpath="`cd "$path"; $THEPWDCMD -L`"
+ fi
+
+ IFS=";"
+ SYSROOT_LDFLAGS="$SYSROOT_LDFLAGS -libpath:$libpath"
+ done
+ IFS="$OLDIFS"
fi
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
diff --git a/common/autoconf/hotspot-spec.gmk.in b/common/autoconf/hotspot-spec.gmk.in
index dcd2fd8f360..a3e79a861fd 100644
--- a/common/autoconf/hotspot-spec.gmk.in
+++ b/common/autoconf/hotspot-spec.gmk.in
@@ -132,6 +132,13 @@ else
ZIP_DEBUGINFO_FILES:=0
endif
+ifeq ($(OPENJDK_TARGET_OS), windows)
+ # On Windows, the Visual Studio toolchain needs the LIB and INCLUDE
+ # environment variables (in Windows path style).
+ export INCLUDE:=@VS_INCLUDE@
+ export LIB:=@VS_LIB@
+endif
+
# Sneak this in via the spec.gmk file, since we don't want to mess around too much with the Hotspot make files.
# This is needed to get the LOG setting to work properly.
include $(SRC_ROOT)/make/common/MakeBase.gmk
diff --git a/common/autoconf/spec.gmk.in b/common/autoconf/spec.gmk.in
index d25b35b2070..19b6836bb00 100644
--- a/common/autoconf/spec.gmk.in
+++ b/common/autoconf/spec.gmk.in
@@ -129,14 +129,12 @@ LIBDL:=@LIBDL@
# colon or semicolon
PATH_SEP:=@PATH_SEP@
+# Save the original path before replacing it with the Visual Studio tools
+ORIGINAL_PATH:=@ORIGINAL_PATH@
ifeq ($(OPENJDK_TARGET_OS), windows)
- # On Windows, the Visual Studio toolchain needs the LIB and INCLUDE
- # environment variables (in Windows path style), and the PATH needs to
- # be adjusted to include Visual Studio tools (but this needs to be in
- # cygwin/msys style).
+ # On Windows, the Visual Studio toolchain needs the PATH to be adjusted
+ # to include Visual Studio tools (this needs to be in cygwin/msys style).
export PATH:=@VS_PATH@
- export INCLUDE:=@VS_INCLUDE@
- export LIB:=@VS_LIB@
endif
SYSROOT_CFLAGS := @SYSROOT_CFLAGS@
diff --git a/common/autoconf/toolchain_windows.m4 b/common/autoconf/toolchain_windows.m4
index e1ec6f3db5b..aad784cd420 100644
--- a/common/autoconf/toolchain_windows.m4
+++ b/common/autoconf/toolchain_windows.m4
@@ -213,9 +213,9 @@ AC_DEFUN([TOOLCHAIN_SETUP_VISUAL_STUDIO_ENV],
AC_MSG_ERROR([Your VC command prompt seems broken, INCLUDE and/or LIB is missing.])
else
AC_MSG_RESULT([ok])
- # Remove any trailing "\" and " " from the variables.
- VS_INCLUDE=`$ECHO "$VS_INCLUDE" | $SED 's/\\\\* *$//'`
- VS_LIB=`$ECHO "$VS_LIB" | $SED 's/\\\\* *$//'`
+ # Remove any trailing "\" ";" and " " from the variables.
+ VS_INCLUDE=`$ECHO "$VS_INCLUDE" | $SED -e 's/\\\\*;* *$//'`
+ VS_LIB=`$ECHO "$VS_LIB" | $SED 's/\\\\*;* *$//'`
VCINSTALLDIR=`$ECHO "$VCINSTALLDIR" | $SED 's/\\\\* *$//'`
WindowsSDKDir=`$ECHO "$WindowsSDKDir" | $SED 's/\\\\* *$//'`
WINDOWSSDKDIR=`$ECHO "$WINDOWSSDKDIR" | $SED 's/\\\\* *$//'`
@@ -226,6 +226,26 @@ AC_DEFUN([TOOLCHAIN_SETUP_VISUAL_STUDIO_ENV],
AC_SUBST(VS_PATH)
AC_SUBST(VS_INCLUDE)
AC_SUBST(VS_LIB)
+
+ # Convert VS_INCLUDE into SYSROOT_CFLAGS
+ OLDIFS="$IFS"
+ IFS=";"
+ for i in $VS_INCLUDE; do
+ ipath=$i
+ IFS="$OLDIFS"
+ BASIC_FIXUP_PATH([ipath])
+ IFS=";"
+ SYSROOT_CFLAGS="$SYSROOT_CFLAGS -I$ipath"
+ done
+ # Convert VS_LIB into SYSROOT_LDFLAGS
+ for i in $VS_LIB; do
+ libpath=$i
+ IFS="$OLDIFS"
+ BASIC_FIXUP_PATH([libpath])
+ IFS=";"
+ SYSROOT_LDFLAGS="$SYSROOT_LDFLAGS -libpath:$libpath"
+ done
+ IFS="$OLDIFS"
fi
else
AC_MSG_RESULT([not found])
diff --git a/make/Main.gmk b/make/Main.gmk
index 3bb6dd1de19..06a820ea414 100644
--- a/make/Main.gmk
+++ b/make/Main.gmk
@@ -553,7 +553,8 @@ reconfigure:
else
@$(ECHO) "Re-running configure using default settings"
endif
- @( cd $(OUTPUT_ROOT) && $(BASH) $(TOPDIR)/configure $(CONFIGURE_COMMAND_LINE) )
+ @( cd $(OUTPUT_ROOT) && PATH="$(ORIGINAL_PATH)" \
+ $(BASH) $(TOPDIR)/configure $(CONFIGURE_COMMAND_LINE) )
ALL_TARGETS += reconfigure
diff --git a/make/common/NativeCompilation.gmk b/make/common/NativeCompilation.gmk
index 8ed6ae24195..8541e20dfef 100644
--- a/make/common/NativeCompilation.gmk
+++ b/make/common/NativeCompilation.gmk
@@ -469,9 +469,10 @@ define SetupNativeCompilationInner
$$($1_RES): $$($1_VERSIONINFO_RESOURCE) $$($1_RES_VARDEPS_FILE)
$(ECHO) $(LOG_INFO) "Compiling resource $$(notdir $$($1_VERSIONINFO_RESOURCE)) (for $$(notdir $$($1_TARGET)))"
- $(RC) $$($1_RC_FLAGS) $(CC_OUT_OPTION)$$@ $$($1_VERSIONINFO_RESOURCE)
+ $(RC) $$($1_RC_FLAGS) $(SYSROOT_CFLAGS) $(CC_OUT_OPTION)$$@ \
+ $$($1_VERSIONINFO_RESOURCE)
# Windows RC compiler does not support -showIncludes, so we mis-use CL for this.
- $(CC) $$($1_RC_FLAGS) -showIncludes -nologo -TC \
+ $(CC) $$($1_RC_FLAGS) $(SYSROOT_CFLAGS) -showIncludes -nologo -TC \
$(CC_OUT_OPTION)$$($1_RES_DEP).obj $$($1_VERSIONINFO_RESOURCE) > $$($1_RES_DEP).raw 2>&1 || exit 0
($(ECHO) $$($1_RES): \\ \
&& $(SED) $(WINDOWS_SHOWINCLUDE_SED_PATTERN) $$($1_RES_DEP).raw) > $$($1_RES_DEP)
From c9bf298a67f5402f5f73434bca0d70b38dbdb296 Mon Sep 17 00:00:00 2001
From: Erik Joelsson
Date: Fri, 6 Feb 2015 09:57:28 +0100
Subject: [PATCH 25/61] 8071329: Stop exporting INCLUDE and LIB when building
on windows
Reviewed-by: ihse
---
jdk/make/launcher/Launcher-jdk.runtime.gmk | 38 ++++------------------
1 file changed, 6 insertions(+), 32 deletions(-)
diff --git a/jdk/make/launcher/Launcher-jdk.runtime.gmk b/jdk/make/launcher/Launcher-jdk.runtime.gmk
index 220c2ff40e8..96c02be5689 100644
--- a/jdk/make/launcher/Launcher-jdk.runtime.gmk
+++ b/jdk/make/launcher/Launcher-jdk.runtime.gmk
@@ -66,19 +66,6 @@ UNPACKEXE_LANG := C
ifeq ($(OPENJDK_TARGET_OS), solaris)
UNPACKEXE_LANG := C++
endif
-UNPACKEXE_DEBUG_SYMBOLS := true
-# On windows, unpack200 is linked completely differently to all other
-# executables, using the compiler with the compiler arguments.
-# It's also linked incrementally, producing a .ilk file that needs to
-# be kept away.
-ifeq ($(OPENJDK_TARGET_OS), windows)
- BUILD_UNPACKEXE_LDEXE := $(CC)
- EXE_OUT_OPTION_save := $(EXE_OUT_OPTION)
- EXE_OUT_OPTION := -Fe
- # With the current way unpack200 is built, debug symbols aren't supported
- # anyway.
- UNPACKEXE_DEBUG_SYMBOLS := false
-endif
# The linker on older SuSE distros (e.g. on SLES 10) complains with:
# "Invalid version tag `SUNWprivate_1.1'. Only anonymous version tag is allowed in executable."
@@ -93,49 +80,36 @@ $(eval $(call SetupNativeCompilation,BUILD_UNPACKEXE, \
SRC := $(UNPACKEXE_SRC), \
LANG := $(UNPACKEXE_LANG), \
OPTIMIZATION := LOW, \
- CFLAGS := $(UNPACKEXE_CFLAGS) $(CXXFLAGS_JDKEXE) \
- -DFULL, \
+ CFLAGS := $(UNPACKEXE_CFLAGS) $(CXXFLAGS_JDKEXE) -DFULL, \
CFLAGS_release := -DPRODUCT, \
CFLAGS_linux := -fPIC, \
CFLAGS_solaris := -KPIC, \
CFLAGS_macosx := -fPIC, \
MAPFILE := $(UNPACK_MAPFILE),\
- LDFLAGS := $(UNPACKEXE_ZIPOBJS), \
- LDFLAGS_windows := $(CXXFLAGS_JDKEXE), \
- LDFLAGS_unix := $(LDFLAGS_JDKEXE) $(LDFLAGS_CXX_JDK) \
+ LDFLAGS := $(UNPACKEXE_ZIPOBJS) \
+ $(LDFLAGS_JDKEXE) $(LDFLAGS_CXX_JDK) \
$(call SET_SHARED_LIBRARY_NAME,$(LIBRARY_PREFIX)unpack$(SHARED_LIBRARY_SUFFIX)) \
$(call SET_SHARED_LIBRARY_ORIGIN), \
LDFLAGS_linux := -lc, \
LDFLAGS_solaris := $(UNPACKEXE_LDFLAGS_solaris) -lc, \
LDFLAGS_SUFFIX := $(LIBCXX), \
OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/unpackexe$(OUTPUT_SUBDIR), \
- OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/unpackexe$(OUTPUT_SUBDIR), \
+ OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/modules_cmds/$(MODULE), \
PROGRAM := unpack200, \
VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \
RC_FLAGS := $(RC_FLAGS) \
-D "JDK_FNAME=unpack200.exe" \
-D "JDK_INTERNAL_NAME=unpack200" \
-D "JDK_FTYPE=0x1L", \
- DEBUG_SYMBOLS := $(UNPACKEXE_DEBUG_SYMBOLS), \
+ DEBUG_SYMBOLS := true, \
MANIFEST := $(JDK_TOPDIR)/src/jdk.runtime/windows/native/unpack200/unpack200_proto.exe.manifest))
-ifeq ($(OPENJDK_TARGET_OS), windows)
- EXE_OUT_OPTION := $(EXE_OUT_OPTION_save)
-endif
-
ifneq ($(USE_EXTERNAL_LIBZ), true)
$(BUILD_UNPACKEXE): $(UNPACKEXE_ZIPOBJS)
endif
-# Build into object dir and copy executable afterwards to avoid .ilk file in
-# image. The real fix would be clean up linking of unpack200 using
-# -link -incremental:no
-# like all other launchers.
-$(SUPPORT_OUTPUTDIR)/modules_cmds/$(MODULE)/unpack200$(EXE_SUFFIX): $(BUILD_UNPACKEXE)
- $(call install-file)
-
-TARGETS += $(SUPPORT_OUTPUTDIR)/modules_cmds/$(MODULE)/unpack200$(EXE_SUFFIX)
+TARGETS += $(BUILD_UNPACKEXE)
################################################################################
From 8450ccc3718b87eed3c87c9bb550ccd46f97a571 Mon Sep 17 00:00:00 2001
From: Magnus Ihse Bursie
Date: Fri, 6 Feb 2015 12:37:31 +0100
Subject: [PATCH 26/61] 8072106: Properly handle dependencies for deleted
header files
Reviewed-by: erikj
---
make/common/NativeCompilation.gmk | 34 ++++++++++++++++++++++++++++---
1 file changed, 31 insertions(+), 3 deletions(-)
diff --git a/make/common/NativeCompilation.gmk b/make/common/NativeCompilation.gmk
index 8541e20dfef..6d2f8539ec9 100644
--- a/make/common/NativeCompilation.gmk
+++ b/make/common/NativeCompilation.gmk
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -53,6 +53,8 @@ else ifeq ($(OPENJDK_BUILD_OS_ENV), windows.msys)
UNIX_PATH_PREFIX :=
endif
+# This pattern is used to transform the output of the microsoft CL compiler
+# into a make syntax dependency file (.d)
WINDOWS_SHOWINCLUDE_SED_PATTERN := \
-e '/^Note: including file:/!d' \
-e 's|Note: including file: *||' \
@@ -62,6 +64,16 @@ WINDOWS_SHOWINCLUDE_SED_PATTERN := \
-e 's|$$$$| \\|g' \
#
+# This pattern is used to transform a dependency file (.d) to a list
+# of make targets for dependent files (.d.targets)
+DEPENDENCY_TARGET_SED_PATTERN := \
+ -e 's/\#.*//' \
+ -e 's/^[^:]*: *//' \
+ -e 's/ *\\$$$$//' \
+ -e '/^$$$$/ d' \
+ -e 's/$$$$/ :/' \
+ #
+
define add_native_source
# param 1 = BUILD_MYPACKAGE
# parma 2 = the source file name (..../alfa.c or .../beta.cpp)
@@ -105,8 +117,13 @@ define add_native_source
ifeq (,$$(filter %.s,$2))
# And this is the dependency file for this obj file.
$1_$2_DEP:=$$(patsubst %$(OBJ_SUFFIX),%.d,$$($1_$2_OBJ))
+ # The dependency target file lists all dependencies as empty targets
+ # to avoid make error "No rule to make target" for removed files
+ $1_$2_DEP_TARGETS:=$$(patsubst %$(OBJ_SUFFIX),%.d.targets,$$($1_$2_OBJ))
+
# Include previously generated dependency information. (if it exists)
-include $$($1_$2_DEP)
+ -include $$($1_$2_DEP_TARGETS)
ifeq ($(TOOLCHAIN_TYPE), microsoft)
$1_$2_DEBUG_OUT_FLAGS:=-Fd$$(patsubst %$(OBJ_SUFFIX),%.pdb,$$($1_$2_OBJ)) \
@@ -139,6 +156,11 @@ define add_native_source
($(ECHO) $$@: \\ \
&& $(SED) $(WINDOWS_SHOWINCLUDE_SED_PATTERN) $$($1_$2_DEP).raw) > $$($1_$2_DEP)
endif
+ # Create a dependency target file from the dependency file.
+ # Solution suggested by http://make.mad-scientist.net/papers/advanced-auto-dependency-generation/
+ ifneq ($$($1_$2_DEP),)
+ $(SED) $(DEPENDENCY_TARGET_SED_PATTERN) $$($1_$2_DEP) > $$($1_$2_DEP_TARGETS)
+ endif
endif
endef
@@ -428,7 +450,7 @@ define SetupNativeCompilationInner
$1_BUILD_INFO := $$($1_OBJECT_DIR)/_build-info.marker
# Track variable changes for all variables that affect the compilation command
- # lines for all object files in this setup. This includes at least all the
+ # lines for all object files in this setup. This includes at least all the
# variables used in the call to add_native_source below.
$1_COMPILE_VARDEPS := $$($1_CFLAGS) $$($1_EXTRA_CFLAGS) $(SYSROOT_CFLAGS) \
$$($1_CXXFLAGS) $$($1_EXTRA_CXXFLAGS) \
@@ -452,7 +474,10 @@ define SetupNativeCompilationInner
ifeq ($$(wildcard $$($1_TARGET)),)
$(ECHO) 'Creating $$($1_BASENAME) from $$(words $$(filter-out %.vardeps, $$?)) file(s)'
else
- $(ECHO) 'Updating $$($1_BASENAME) from $$(words $$(filter-out %.vardeps, $$?)) file(s)'
+ $(ECHO) $$(strip 'Updating $$($1_BASENAME)' \
+ $$(if $$(filter-out %.vardeps, $$?), \
+ 'from $$(words $$(filter-out %.vardeps, $$?)) file(s)') \
+ $$(if $$(filter %.vardeps, $$?), 'due to makefile changes'))
endif
$(TOUCH) $$@
@@ -461,7 +486,9 @@ define SetupNativeCompilationInner
ifneq (,$$($1_VERSIONINFO_RESOURCE))
$1_RES:=$$($1_OBJECT_DIR)/$$($1_BASENAME).res
$1_RES_DEP:=$$($1_RES).d
+ $1_RES_DEP_TARGETS:=$$($1_RES).d.targets
-include $$($1_RES_DEP)
+ -include $$($1_RES_DEP_TARGETS)
$1_RES_VARDEPS := $(RC) $$($1_RC_FLAGS)
$1_RES_VARDEPS_FILE := $$(call DependOnVariable, $1_RES_VARDEPS, \
@@ -476,6 +503,7 @@ define SetupNativeCompilationInner
$(CC_OUT_OPTION)$$($1_RES_DEP).obj $$($1_VERSIONINFO_RESOURCE) > $$($1_RES_DEP).raw 2>&1 || exit 0
($(ECHO) $$($1_RES): \\ \
&& $(SED) $(WINDOWS_SHOWINCLUDE_SED_PATTERN) $$($1_RES_DEP).raw) > $$($1_RES_DEP)
+ $(SED) $(DEPENDENCY_TARGET_SED_PATTERN) $$($1_RES_DEP) > $$($1_RES_DEP_TARGETS)
endif
ifneq (,$$($1_MANIFEST))
$1_GEN_MANIFEST:=$$($1_OBJECT_DIR)/$$($1_PROGRAM).manifest
From 283b6c7fbc820c5217f6575927c7428be095abb6 Mon Sep 17 00:00:00 2001
From: Magnus Ihse Bursie
Date: Fri, 6 Feb 2015 12:46:59 +0100
Subject: [PATCH 27/61] 8071767: Improve names and dependencies for image
targets
Co-authored-by: Ingemar Aberg
Reviewed-by: ihse, erikj, dholmes
---
make/Main.gmk | 36 +++++++++++++++++++++++++-----------
1 file changed, 25 insertions(+), 11 deletions(-)
diff --git a/make/Main.gmk b/make/Main.gmk
index 06a820ea414..b6533169a70 100644
--- a/make/Main.gmk
+++ b/make/Main.gmk
@@ -212,7 +212,7 @@ $(SUPPORT_OUTPUTDIR)/source_tips: FRC
@$(RM) $@
@$(call GetSourceTips)
-BOOTCYCLE_TARGET := images
+BOOTCYCLE_TARGET := product-images
bootcycle-images:
@$(ECHO) Boot cycle build step 2: Building a new JDK image using previously built image
+$(MAKE) $(MAKE_ARGS) -f Main.gmk SPEC=$(dir $(SPEC))bootcycle-spec.gmk $(BOOTCYCLE_TARGET)
@@ -443,31 +443,45 @@ $(foreach m, $(COPY_MODULES), $(eval $m: $m-copy))
ALL_MODULE_TARGETS := $(sort $(GENSRC_MODULES) $(JAVA_MODULES) \
$(GENDATA_MODULES) $(LIBS_MODULES) $(LAUNCHER_MODULES) $(COPY_MODULES))
+# The "exploded image" is a locally runnable JDK in $(BUILD_OUTPUT)/jdk.
exploded-image: $(ALL_MODULE_TARGETS)
-# The old 'jdk' target most closely matches the new exploded-image. Keep an
-# alias for ease of use.
-jdk: exploded-image
-images: test-image jimages demos samples zip-security verify-modules
+# The $(BUILD_OUTPUT)/images directory contain the resulting deliverables,
+# and in line with this, our targets for creating these are named *-image[s].
+
+# This target builds the product images, e.g. the JRE and JDK image
+# (and possibly other, more specific versions)
+product-images: jimages demos samples zip-security verify-modules
ifeq ($(OPENJDK_TARGET_OS), macosx)
- images: mac-bundles
+ product-images: mac-bundles
endif
-docs: docs-javadoc docs-jvmtidoc
+# This target builds the documentation image
+docs-image: docs-javadoc docs-jvmtidoc
+# This target builds the test image
test-image: prepare-test-image
+# all-images is the top-most target, it builds all our deliverables ("images").
+all-images: product-images test-image docs-image
+
ALL_TARGETS += buildtools gensrc gendata copy java rmic libs launchers \
- jdk.jdwp.agent-gensrc $(ALL_MODULE_TARGETS) exploded-image jdk images \
- docs test-image
+ jdk.jdwp.agent-gensrc $(ALL_MODULE_TARGETS) exploded-image \
+ product-images docs-image test-image all-images
################################################################################
-all: images
+# Traditional targets typically run by users.
+# These can be considered aliases for the targets now named by a more
+# "modern" naming scheme.
default: exploded-image
+jdk: exploded-image
+images: product-images
+docs: docs-image
+all: all-images
-ALL_TARGETS += default all
+ALL_TARGETS += default jdk images docs all
################################################################################
################################################################################
From 2f101d122b431bacccfbe88b5966b27543d798ac Mon Sep 17 00:00:00 2001
From: Athijegannathan Sundararajan
Date: Fri, 6 Feb 2015 19:28:26 +0530
Subject: [PATCH 28/61] 8071989: NashornScriptEngine returns
javax.script.ScriptContext instance with insonsistent get/remove methods
behavior for undefined attributes
Reviewed-by: attila, lagergren
---
nashorn/samples/getclassnpe.js | 122 ++++++++++++++++++
.../api/scripting/ScriptObjectMirror.java | 2 +-
.../ir/debug/ObjectSizeCalculator.java | 3 +-
.../api/scripting/ScriptEngineTest.java | 11 ++
4 files changed, 136 insertions(+), 2 deletions(-)
create mode 100644 nashorn/samples/getclassnpe.js
diff --git a/nashorn/samples/getclassnpe.js b/nashorn/samples/getclassnpe.js
new file mode 100644
index 00000000000..cc21b72e5e2
--- /dev/null
+++ b/nashorn/samples/getclassnpe.js
@@ -0,0 +1,122 @@
+#// Usage: jjs getclassnpe.js --
+
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * - Neither the name of Oracle nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * java.lang.Object.getClass() is sometimes used to do null check. This
+ * obfuscating Object.getClass() check relies on non-related intrinsic
+ * performance, which is potentially not available everywhere.
+ * See also http://cr.openjdk.java.net/~shade/scratch/NullChecks.java
+ * This nashorn script checks for such uses in your .java files in the
+ * given directory (recursively).
+ */
+
+if (arguments.length == 0) {
+ print("Usage: jjs getclassnpe.js -- ");
+ exit(1);
+}
+
+// Java types used
+var File = Java.type("java.io.File");
+var Files = Java.type("java.nio.file.Files");
+var StringArray = Java.type("java.lang.String[]");
+var ToolProvider = Java.type("javax.tools.ToolProvider");
+var MethodInvocationTree = Java.type("com.sun.source.tree.MethodInvocationTree");
+var TreeScanner = Java.type("com.sun.source.util.TreeScanner");
+
+// parse a specific .java file to check if it uses
+// Object.getClass() for null check.
+function checkGetClassNPE() {
+ // get the system compiler tool
+ var compiler = ToolProvider.systemJavaCompiler;
+ // get standard file manager
+ var fileMgr = compiler.getStandardFileManager(null, null, null);
+ // Using Java.to convert script array (arguments) to a Java String[]
+ var compUnits = fileMgr.getJavaFileObjects(
+ Java.to(arguments, StringArray));
+ // create a new compilation task
+ var task = compiler.getTask(null, fileMgr, null, null, null, compUnits);
+ // subclass SimpleTreeVisitor - to check for obj.getClass(); statements
+ var GetClassNPEChecker = Java.extend(TreeScanner);
+
+ var visitor = new GetClassNPEChecker() {
+ lineMap: null,
+ sourceFile: null,
+
+ // save compilation unit details for reporting
+ visitCompilationUnit: function(node, p) {
+ this.sourceFile = node.sourceFile;
+ this.lineMap = node.lineMap;
+ return Java.super(visitor).visitCompilationUnit(node, p);
+ },
+
+ // look for "foo.getClass();" expression statements
+ visitExpressionStatement: function(node, p) {
+ var expr = node.expression;
+ if (expr instanceof MethodInvocationTree) {
+ var name = String(expr.methodSelect.identifier);
+
+ // will match any "getClass" call with zero arguments!
+ if (name == "getClass" && expr.arguments.size() == 0) {
+ print(this.sourceFile.getName()
+ + " @ "
+ + this.lineMap.getLineNumber(node.pos)
+ + ":"
+ + this.lineMap.getColumnNumber(node.pos));
+
+ print("\t", node);
+ }
+ }
+ }
+ }
+
+ for each (var cu in task.parse()) {
+ cu.accept(visitor, null);
+ }
+}
+
+// for each ".java" file in the directory (recursively)
+function main(dir) {
+ Files.walk(dir.toPath()).
+ forEach(function(p) {
+ var name = p.toFile().absolutePath;
+ if (name.endsWith(".java")) {
+ try {
+ checkGetClassNPE(p.toFile().getAbsolutePath());
+ } catch (e) {
+ print(e);
+ }
+ }
+ });
+}
+
+main(new File(arguments[0]));
diff --git a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/ScriptObjectMirror.java b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/ScriptObjectMirror.java
index f200fee0709..61042e6faff 100644
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/ScriptObjectMirror.java
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/ScriptObjectMirror.java
@@ -448,7 +448,7 @@ public final class ScriptObjectMirror extends AbstractJSObject implements Bindin
checkKey(key);
return inGlobal(new Callable
*
*
* @see Marshaller
* @see Unmarshaller
- * @see S 7.4.1 "Named Packages" in Java Language Specification
+ * @see S 7.4.1 "Named Packages" in Java Language Specification
* @since 1.6, JAXB 1.0
*/
public abstract class JAXBContext {
@@ -352,7 +352,7 @@ public abstract class JAXBContext {
*
* To maintain compatibility with JAXB 1.0 schema to java
* interface/implementation binding, enabled by schema customization
- * <jaxb:globalBindings valueClass="false">,
+ * <jaxb:globalBindings valueClass="false">,
* the JAXB provider will ensure that each package on the context path
* has a jaxb.properties file which contains a value for the
* javax.xml.bind.context.factory property and that all values
diff --git a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/JAXBException.java b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/JAXBException.java
index 432f0531d39..7686dfbe671 100644
--- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/JAXBException.java
+++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/JAXBException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -48,7 +48,7 @@ public class JAXBException extends Exception {
* Exception reference
*
*/
- private Throwable linkedException;
+ private volatile Throwable linkedException;
static final long serialVersionUID = -5621384651494307979L;
@@ -133,7 +133,7 @@ public class JAXBException extends Exception {
* indicates that the linked exception does not exist or
* is unknown).
*/
- public synchronized void setLinkedException( Throwable exception ) {
+ public void setLinkedException( Throwable exception ) {
this.linkedException = exception;
}
diff --git a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/JAXBIntrospector.java b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/JAXBIntrospector.java
index ed75427b442..ad897aeb00c 100644
--- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/JAXBIntrospector.java
+++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/JAXBIntrospector.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -51,7 +51,7 @@ public abstract class JAXBIntrospector {
*
*
It is an instance of javax.xml.bind.JAXBElement.
*
The class of object is annotated with
- * @XmlRootElement.
+ * @XmlRootElement.
*
*
*
@@ -74,7 +74,7 @@ public abstract class JAXBIntrospector {
*
*
Convenience method to abstract whether working with either
* a javax.xml.bind.JAXBElement instance or an instance of
- * @XmlRootElement annotated Java class.
+ * @XmlRootElement annotated Java class.
*
* @param jaxbElement object that #isElement(Object) returns true.
*
diff --git a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/Marshaller.java b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/Marshaller.java
index abb41042479..827425efd3a 100644
--- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/Marshaller.java
+++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/Marshaller.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -175,7 +175,7 @@ import java.io.File;
* encoding used during these marshal operations. Client applications are
* expected to supply a valid character encoding name as defined in the
* W3C XML 1.0
- * Recommendation and supported by your Java Platform.
+ * Recommendation and supported by your Java Platform.
*
*
*
@@ -664,7 +664,7 @@ public interface Marshaller {
*
*
* Every marshaller internally maintains a
- * {@link java.util.Map}<{@link Class},{@link XmlAdapter}>,
+ * {@link java.util.Map}<{@link Class},{@link XmlAdapter}>,
* which it uses for marshalling classes whose fields/methods are annotated
* with {@link javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter}.
*
@@ -750,17 +750,17 @@ public interface Marshaller {
public Schema getSchema();
/**
- *
+ *
* Register an instance of an implementation of this class with a {@link Marshaller} to externally listen
* for marshal events.
- *
- *
+ *
+ *
* This class enables pre and post processing of each marshalled object.
* The event callbacks are called when marshalling from an instance that maps to an xml element or
* complex type definition. The event callbacks are not called when marshalling from an instance of a
* Java datatype that represents a simple type definition.
- *
- *
+ *
+ *
* External listener is one of two different mechanisms for defining marshal event callbacks.
* See Marshal Event Callbacks for an overview.
*
@@ -770,10 +770,10 @@ public interface Marshaller {
*/
public static abstract class Listener {
/**
- *
+ *
* Callback method invoked before marshalling from source to XML.
- *
- *
+ *
+ *
* This method is invoked just before marshalling process starts to marshal source.
* Note that if the class of source defines its own beforeMarshal method,
* the class specific callback method is invoked just before this method is invoked.
@@ -784,10 +784,10 @@ public interface Marshaller {
}
/**
- *
+ *
* Callback method invoked after marshalling source to XML.
- *
- *
+ *
+ *
* This method is invoked after source and all its descendants have been marshalled.
* Note that if the class of source defines its own afterMarshal method,
* the class specific callback method is invoked just before this method is invoked.
diff --git a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/SchemaOutputResolver.java b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/SchemaOutputResolver.java
index c39b78c870d..0e36f72591a 100644
--- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/SchemaOutputResolver.java
+++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/SchemaOutputResolver.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -70,11 +70,11 @@ public abstract class SchemaOutputResolver {
*
* If the {@link Result} object has a system ID, it must be an
* absolute system ID. Those system IDs are relativized by the caller and used
- * for <xs:import> statements.
+ * for <xs:import> statements.
*
* If the {@link Result} object does not have a system ID, a schema
* for the namespace URI is generated but it won't be explicitly
- * <xs:import>ed from other schemas.
+ * <xs:import>ed from other schemas.
*
* If {@code null} is returned, the schema generation for this
* namespace URI will be skipped.
diff --git a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/TypeConstraintException.java b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/TypeConstraintException.java
index fa9ae393635..1137443bcb5 100644
--- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/TypeConstraintException.java
+++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/TypeConstraintException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -57,8 +57,9 @@ public class TypeConstraintException extends java.lang.RuntimeException {
* Exception reference
*
*/
- private Throwable linkedException;
+ private volatile Throwable linkedException;
+ static final long serialVersionUID = -3059799699420143848L;
/**
* Construct a TypeConstraintException with the specified detail message. The
@@ -141,7 +142,7 @@ public class TypeConstraintException extends java.lang.RuntimeException {
* indicates that the linked exception does not exist or
* is unknown).
*/
- public synchronized void setLinkedException( Throwable exception ) {
+ public void setLinkedException( Throwable exception ) {
this.linkedException = exception;
}
diff --git a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/Unmarshaller.java b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/Unmarshaller.java
index 19dfb6e6f4b..d966659fd2d 100644
--- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/Unmarshaller.java
+++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/Unmarshaller.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -238,13 +238,12 @@ import java.io.Reader;
* to a JAXB mapped class by {@link JAXBContext}, that the root
* element's xsi:type attribute takes
* precedence over the unmarshal methods declaredType parameter.
- * These methods always return a JAXBElement<declaredType>
+ * These methods always return a JAXBElement<declaredType>
* instance. The table below shows how the properties of the returned JAXBElement
* instance are set.
*
*
- *
- *
+ *
*
*
*
@@ -284,19 +283,19 @@ import java.io.Reader;
*
*
* Schema fragment for example
- * <xs:schema>
- * <xs:complexType name="FooType">...<\xs:complexType>
- * <!-- global element declaration "PurchaseOrder" -->
- * <xs:element name="PurchaseOrder">
- * <xs:complexType>
- * <xs:sequence>
- * <!-- local element declaration "foo" -->
- * <xs:element name="foo" type="FooType"/>
+ * <xs:schema>
+ * <xs:complexType name="FooType">...<\xs:complexType>
+ * <!-- global element declaration "PurchaseOrder" -->
+ * <xs:element name="PurchaseOrder">
+ * <xs:complexType>
+ * <xs:sequence>
+ * <!-- local element declaration "foo" -->
+ * <xs:element name="foo" type="FooType"/>
* ...
- * </xs:sequence>
- * </xs:complexType>
- * </xs:element>
- * </xs:schema>
+ * </xs:sequence>
+ * </xs:complexType>
+ * </xs:element>
+ * </xs:schema>
*
* JAXBContext jc = JAXBContext.newInstance( "com.acme.foo" );
* Unmarshaller u = jc.createUnmarshaller();
@@ -309,7 +308,7 @@ import java.io.Reader;
* // local element declaration in schema.
*
* // FooType is the JAXB mapping of the type of local element declaration foo.
- * JAXBElement<FooType> foo = u.unmarshal( fooSubtree, FooType.class);
+ * JAXBElement<FooType> foo = u.unmarshal( fooSubtree, FooType.class);
*
*
*
@@ -390,7 +389,7 @@ import java.io.Reader;
* The external listener callback mechanism enables the registration of a {@link Listener}
* instance with an {@link Unmarshaller#setListener(Listener)}. The external listener receives all callback events,
* allowing for more centralized processing than per class defined callback methods. The external listener
- * receives events when unmarshalling proces is marshalling to a JAXB element or to JAXB mapped class.
+ * receives events when unmarshalling process is marshalling to a JAXB element or to JAXB mapped class.
*
* The 'class defined' and external listener event callback methods are independent of each other,
* both can be called for one event. The invocation ordering when both listener callback methods exist is
@@ -1010,7 +1009,7 @@ public interface Unmarshaller {
*
*
* Every unmarshaller internally maintains a
- * {@link java.util.Map}<{@link Class},{@link XmlAdapter}>,
+ * {@link java.util.Map}<{@link Class},{@link XmlAdapter}>,
* which it uses for unmarshalling classes whose fields/methods are annotated
* with {@link javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter}.
*
@@ -1050,7 +1049,6 @@ public interface Unmarshaller {
/**
*
Associate a context that resolves cid's, content-id URIs, to
* binary data passed as attachments.
- *
*
Unmarshal time validation, enabled via {@link #setSchema(Schema)},
* must be supported even when unmarshaller is performing XOP processing.
*
* Register an instance of an implementation of this class with {@link Unmarshaller} to externally listen
* for unmarshal events.
- *
- *
+ *
+ *
* This class enables pre and post processing of an instance of a JAXB mapped class
* as XML data is unmarshalled into it. The event callbacks are called when unmarshalling
* XML content into a JAXBElement instance or a JAXB mapped class that represents a complex type definition.
* The event callbacks are not called when unmarshalling to an instance of a
* Java datatype that represents a simple type definition.
- *
- *
+ *
+ *
* External listener is one of two different mechanisms for defining unmarshal event callbacks.
* See Unmarshal Event Callbacks for an overview.
- *
+ *
* (@link #setListener(Listener)}
* (@link #getListener()}
*
@@ -1085,10 +1083,10 @@ public interface Unmarshaller {
*/
public static abstract class Listener {
/**
- *
+ *
* Callback method invoked before unmarshalling into target.
- *
- *
+ *
+ *
* This method is invoked immediately after target was created and
* before the unmarshalling of this object begins. Note that
* if the class of target defines its own beforeUnmarshal method,
@@ -1102,10 +1100,10 @@ public interface Unmarshaller {
}
/**
- *
+ *
* Callback method invoked after unmarshalling XML data into target.
- *
- *
+ *
+ *
* This method is invoked after all the properties (except IDREF) are unmarshalled into target,
* but before target is set into its parent object.
* Note that if the class of target defines its own afterUnmarshal method,
diff --git a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlAnyAttribute.java b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlAnyAttribute.java
index ff9c13778de..b237b80221b 100644
--- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlAnyAttribute.java
+++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlAnyAttribute.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -62,7 +62,7 @@ import static java.lang.annotation.ElementType.METHOD;
* each attribute that is not statically associated with another
* JavaBean property, via {@link XmlAttribute}, is entered into the
* wildcard attribute map represented by
- * {@link Map}<{@link QName},{@link Object}>. The attribute QName is the
+ * {@link Map}<{@link QName},{@link Object}>. The attribute QName is the
* map's key. The key's value is the String value of the attribute.
*
* @author Kohsuke Kawaguchi, Sun Microsystems, Inc.
diff --git a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlAnyElement.java b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlAnyElement.java
index 3ca62ccd61b..0fcd2dc372f 100644
--- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlAnyElement.java
+++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlAnyElement.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -50,7 +50,6 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
* annotation for the other JavaBean properties on the class, is added to this
* "catch-all" property.
*
- *
- * <foo xmlns:e="extra">
- * <a>1
- * <e:other /> // this will be bound to DOM, because unmarshalling is orderless
- * <b>3
- * <e:other />
- * <c>5 // this will be bound to DOM, because the annotation doesn't remember namespaces.
- * </foo>
+ * <foo xmlns:e="extra">
+ * <a>1</a>
+ * <e:other /> // this will be bound to DOM, because unmarshalling is orderless
+ * <b>3</b>
+ * <e:other />
+ * <c>5</c> // this will be bound to DOM, because the annotation doesn't remember namespaces.
+ * </foo>
*
*
*
*
* The following schema would produce the following Java class:
*
@@ -152,14 +151,14 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
* It can unmarshal instances like
*
*
- * <bar xmlns:e="extra">
- * <a>1
- * <e:other /> // this will be bound to DOM, because unmarshalling is orderless
- * <b>3
- * <e:other />
- * <c>5 // this now goes to Bar.c
- * <e:other /> // this will go to Foo.any
- * </bar>
+ * <bar xmlns:e="extra">
+ * <a>1</a>
+ * <e:other /> // this will be bound to DOM, because unmarshalling is orderless
+ * <b>3</b>
+ * <e:other />
+ * <c>5</c> // this now goes to Bar.c
+ * <e:other /> // this will go to Foo.any
+ * </bar>
*
- * <foo xmlns:e="extra">
- * <a>1 // this will unmarshal to a {@link JAXBElement} instance whose value is 1.
- * <e:other /> // this will unmarshal to a DOM {@link Element}.
- * <b>3 // this will unmarshal to a {@link JAXBElement} instance whose value is 1.
- * </foo>
+ * <foo xmlns:e="extra">
+ * <a>1</a> // this will unmarshal to a {@link JAXBElement} instance whose value is 1.
+ * <e:other /> // this will unmarshal to a DOM {@link Element}.
+ * <b>3</b> // this will unmarshal to a {@link JAXBElement} instance whose value is 1.
+ * </foo>
*
diff --git a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlAttribute.java b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlAttribute.java
index b37ca5d2898..8e367582ca3 100644
--- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlAttribute.java
+++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlAttribute.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -56,8 +56,8 @@ import static java.lang.annotation.RetentionPolicy.*;
* simple type.
*
* // Examples
- * @XmlAttribute List<Integer> items; //legal
- * @XmlAttribute List<Bar> foo; // illegal if Bar does not map to a schema simple type
+ * @XmlAttribute List<Integer> items; //legal
+ * @XmlAttribute List<Bar> foo; // illegal if Bar does not map to a schema simple type
*
*
*
If the type of the field or the property is a non
@@ -80,7 +80,6 @@ import static java.lang.annotation.RetentionPolicy.*;
* {@link XmlInlineBinaryData},
* {@link javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter}.
*
- *
*
*
Example 1: Map a JavaBean property to an XML attribute.
diff --git a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlElementRef.java b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlElementRef.java
index 00be7a5cc15..9f99ca3d80b 100644
--- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlElementRef.java
+++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlElementRef.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -57,8 +57,8 @@ import static java.lang.annotation.ElementType.METHOD;
* (section 5.5.5, "Element Property" of JAXB 2.0 specification). An
* element property method signature is of the form:
*
- * public void setTerm(JAXBElement extends Operator>);
- * public JAXBElement extends Operator> getTerm();
+ * public void setTerm(JAXBElement<? extends Operator>);
+ * public JAXBElement<? extends Operator> getTerm();
*
*
* An element factory method annotated with {@link XmlElementDecl} is
@@ -106,7 +106,7 @@ import static java.lang.annotation.ElementType.METHOD;
* // element name will be derived from the @XmlRootElement
* // annotation on the type (for e.g. "jar" for JarTask).
* @XmlElementRef
- * List<Task> tasks;
+ * List<Task> tasks;
* }
*
* abstract class Task {
@@ -122,16 +122,16 @@ import static java.lang.annotation.ElementType.METHOD;
* ...
* }
*
- * <!-- XML Schema fragment -->
- * <xs:element name="target" type="Target">
- * <xs:complexType name="Target">
- * <xs:sequence>
- * <xs:choice maxOccurs="unbounded">
- * <xs:element ref="jar">
- * <xs:element ref="javac">
- * </xs:choice>
- * </xs:sequence>
- * </xs:complexType>
+ * <!-- XML Schema fragment -->
+ * <xs:element name="target" type="Target">
+ * <xs:complexType name="Target">
+ * <xs:sequence>
+ * <xs:choice maxOccurs="unbounded">
+ * <xs:element ref="jar">
+ * <xs:element ref="javac">
+ * </xs:choice>
+ * </xs:sequence>
+ * </xs:complexType>
*
*
*
@@ -144,14 +144,14 @@ import static java.lang.annotation.ElementType.METHOD;
*
* will produce the following XML output:
*
*
*
diff --git a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlElementWrapper.java b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlElementWrapper.java
index 71aeec1141a..fc7d09c05e8 100644
--- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlElementWrapper.java
+++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlElementWrapper.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -44,15 +44,15 @@ import java.lang.annotation.Target;
* int[] names;
*
* // XML Serialization Form 1 (Unwrapped collection)
- * <names> ... </names>
- * <names> ... </names>
+ * <names> ... </names>
+ * <names> ... </names>
*
* // XML Serialization Form 2 ( Wrapped collection )
- * <wrapperElement>
- * <names> value-of-item </names>
- * <names> value-of-item </names>
+ * <wrapperElement>
+ * <names> value-of-item </names>
+ * <names> value-of-item </names>
* ....
- * </wrapperElement>
+ * </wrapperElement>
*
*
*
The two serialized XML forms allow a null collection to be
diff --git a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlElements.java b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlElements.java
index 4d52a73c037..e15bb1e4146 100644
--- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlElements.java
+++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlElements.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -83,21 +83,21 @@ import java.lang.annotation.Target;
* }
*
* <!-- XML Representation for a List of {1,2.5}
- * XML output is not wrapped using another element -->
+ * XML output is not wrapped using another element -->
* ...
- * <A> 1 </A>
- * <B> 2.5 </B>
+ * <A> 1 </A>
+ * <B> 2.5 </B>
* ...
*
- * <!-- XML Schema fragment -->
- * <xs:complexType name="Foo">
- * <xs:sequence>
- * <xs:choice minOccurs="0" maxOccurs="unbounded">
- * <xs:element name="A" type="xs:int"/>
- * <xs:element name="B" type="xs:float"/>
- * <xs:choice>
- * </xs:sequence>
- * </xs:complexType>
+ * <!-- XML Schema fragment -->
+ * <xs:complexType name="Foo">
+ * <xs:sequence>
+ * <xs:choice minOccurs="0" maxOccurs="unbounded">
+ * <xs:element name="A" type="xs:int"/>
+ * <xs:element name="B" type="xs:float"/>
+ * <xs:choice>
+ * </xs:sequence>
+ * </xs:complexType>
*
*
*
@@ -115,19 +115,19 @@ import java.lang.annotation.Target;
* public List items;
* }
*
- * <!-- XML Schema fragment -->
- * <xs:complexType name="Foo">
- * <xs:sequence>
- * <xs:element name="bar">
- * <xs:complexType>
- * <xs:choice minOccurs="0" maxOccurs="unbounded">
- * <xs:element name="A" type="xs:int"/>
- * <xs:element name="B" type="xs:float"/>
- * </xs:choice>
- * </xs:complexType>
- * </xs:element>
- * </xs:sequence>
- * </xs:complexType>
+ * <!-- XML Schema fragment -->
+ * <xs:complexType name="Foo">
+ * <xs:sequence>
+ * <xs:element name="bar">
+ * <xs:complexType>
+ * <xs:choice minOccurs="0" maxOccurs="unbounded">
+ * <xs:element name="A" type="xs:int"/>
+ * <xs:element name="B" type="xs:float"/>
+ * </xs:choice>
+ * </xs:complexType>
+ * </xs:element>
+ * </xs:sequence>
+ * </xs:complexType>
*
*
*
Example 3: Change element name based on type using an adapter.
@@ -146,19 +146,19 @@ import java.lang.annotation.Target;
* @XmlType(name="PX") class PX extends P {...}
* @XmlType(name="PY") class PY extends P {...}
*
- * <!-- XML Schema fragment -->
- * <xs:complexType name="Foo">
- * <xs:sequence>
- * <xs:element name="bar">
- * <xs:complexType>
- * <xs:choice minOccurs="0" maxOccurs="unbounded">
- * <xs:element name="A" type="PX"/>
- * <xs:element name="B" type="PY"/>
- * </xs:choice>
- * </xs:complexType>
- * </xs:element>
- * </xs:sequence>
- * </xs:complexType>
+ * <!-- XML Schema fragment -->
+ * <xs:complexType name="Foo">
+ * <xs:sequence>
+ * <xs:element name="bar">
+ * <xs:complexType>
+ * <xs:choice minOccurs="0" maxOccurs="unbounded">
+ * <xs:element name="A" type="PX"/>
+ * <xs:element name="B" type="PY"/>
+ * </xs:choice>
+ * </xs:complexType>
+ * </xs:element>
+ * </xs:sequence>
+ * </xs:complexType>
*
*
* @author
Kohsuke Kawaguchi, Sun Microsystems, Inc.
Sekhar Vajjhala, Sun Microsystems, Inc.
diff --git a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlEnumValue.java b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlEnumValue.java
index 1948f3670a2..bcdebcb1a5f 100644
--- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlEnumValue.java
+++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlEnumValue.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -56,23 +56,23 @@ import static java.lang.annotation.ElementType.FIELD;
*
In the absence of this annotation, {@link Enum#name()} is used
* as the XML representation.
*
- *
Example 1: Map enum constant name -> enumeration facet
+ *
Example 1: Map enum constant name -> enumeration facet
*
* @XmlList annotation, on the other hand, allows multiple values to be
@@ -74,16 +74,16 @@ import static java.lang.annotation.ElementType.PARAMETER;
* class Foo {
* @XmlElement
* @XmlList
- * List<String> data;
+ * List<String> data;
* }
*
*
* the above code will produce XML like this:
*
*
This annotation can be used with the following annotations:
diff --git a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlMixed.java b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlMixed.java
index 8259b59540f..83c5da66d12 100644
--- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlMixed.java
+++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlMixed.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -57,16 +57,16 @@ import javax.xml.bind.JAXBElement;
*
* Below is an example of binding and creation of mixed content.
*
* The following is an XML instance document with mixed content
*
- * <letterBody>
- * Dear Mr.<name>Robert Smith</name>
- * Your order of <quantity>1</quantity> <productName>Baby
- * Monitor</productName> shipped from our warehouse. ....
- * </letterBody>
+ * <letterBody>
+ * Dear Mr.<name>Robert Smith</name>
+ * Your order of <quantity>1</quantity> <productName>Baby
+ * Monitor</productName> shipped from our warehouse. ....
+ * </letterBody>
*
* that can be constructed using following JAXB API calls.
*
* LetterBody lb = ObjectFactory.createLetterBody();
- * JAXBElement<LetterBody> lbe = ObjectFactory.createLetterBody(lb);
+ * JAXBElement<LetterBody> lbe = ObjectFactory.createLetterBody(lb);
* List gcl = lb.getContent(); //add mixed content to general content property.
* gcl.add("Dear Mr."); // add text information item as a String.
*
diff --git a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlNsForm.java b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlNsForm.java
index 769df76146a..4dfd5fa1176 100644
--- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlNsForm.java
+++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlNsForm.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -36,8 +36,7 @@ package javax.xml.bind.annotation;
* The namespace qualification values are used in the annotations
* defined in this packge. The enumeration values are mapped as follows:
*
- *
- *
+ *
*
*
*
Enum Value
diff --git a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlRootElement.java b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlRootElement.java
index 80506a4d05a..b84e71beca2 100644
--- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlRootElement.java
+++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlRootElement.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -54,7 +54,7 @@ import static java.lang.annotation.ElementType.TYPE;
*
This annotation can be used with the following annotations:
* {@link XmlType}, {@link XmlEnum}, {@link XmlAccessorType},
* {@link XmlAccessorOrder}.
- *
+ *
*
* Example 1: Associate an element with XML Schema type
@@ -74,11 +74,11 @@ import static java.lang.annotation.ElementType.TYPE;
*
*
*
*
* The annotation causes an global element declaration to be produced
@@ -86,14 +86,14 @@ import static java.lang.annotation.ElementType.TYPE;
* the XML schema type to which the class is mapped.
*
*
Example 2: Customize namespace prefix, namespace URI
@@ -90,11 +89,11 @@ import static java.lang.annotation.RetentionPolicy.*;
* )
* )
*
- * <!-- XML Schema fragment -->
+ * <!-- XML Schema fragment -->
* <schema
* xmlns:xs="http://www.w3.org/2001/XMLSchema"
* xmlns:po="http://www.example.com/PO1"
- * targetNamespace="http://www.example.com/PO1">
+ * targetNamespace="http://www.example.com/PO1">
*
*
*
@@ -105,11 +104,11 @@ import static java.lang.annotation.RetentionPolicy.*;
* ...
* )
*
- * <!-- XML Schema fragment -->
+ * <!-- XML Schema fragment -->
* <schema
* xmlns="http://www.w3.org/2001/XMLSchema"
* xmlns:po="http://www.example.com/PO1"
- * elementFormDefault="unqualified">
+ * elementFormDefault="unqualified">
*
*
@@ -180,11 +179,11 @@ public @interface XmlSchema {
* More precisely, the value must be either "", "##generate", or
*
* a valid lexical representation of xs:anyURI that begins
- * with <scheme>:.
+ * with <scheme>:.
*
*
* A schema generator is expected to generate a corresponding
- * <xs:import namespace="..." schemaLocation="..."/> (or
+ * <xs:import namespace="..." schemaLocation="..."/> (or
* no schemaLocation attribute at all if the empty string is specified.)
* However, the schema generator is allowed to use a different value in
* the schemaLocation attribute (including not generating
diff --git a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlSchemaType.java b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlSchemaType.java
index eac31a6533f..a25b291df06 100644
--- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlSchemaType.java
+++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlSchemaType.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -66,12 +66,12 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
* public XMLGregorianCalendar date;
* }
*
- * <!-- Example: Local XML Schema element -->
- * <xs:complexType name="USPrice"/>
- * <xs:sequence>
- * <xs:element name="date" type="xs:date"/>
- * </sequence>
- * </xs:complexType>
+ * <!-- Example: Local XML Schema element -->
+ * <xs:complexType name="USPrice"/>
+ * <xs:sequence>
+ * <xs:element name="date" type="xs:date"/>
+ * </sequence>
+ * </xs:complexType>
*
*
*
Example 2: Customize mapping of XMLGregorianCalendar at package
diff --git a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlTransient.java b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlTransient.java
index fbd4d6eaa3c..055e90e3ca0 100644
--- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlTransient.java
+++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlTransient.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -79,12 +79,12 @@ import static java.lang.annotation.RetentionPolicy.*;
* }
*
*
- * <!-- Example: XML Schema fragment -->
- * <xs:complexType name="USAddress">
- * <xs:sequence>
- * <xs:element name="name" type="xs:string"/>
- * </xs:sequence>
- * </xs:complexType>
+ * <!-- Example: XML Schema fragment -->
+ * <xs:complexType name="USAddress">
+ * <xs:sequence>
+ * <xs:element name="name" type="xs:string"/>
+ * </xs:sequence>
+ * </xs:complexType>
*
*
* @author Sekhar Vajjhala, Sun Microsystems, Inc.
diff --git a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlType.java b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlType.java
index 0f4b2506927..42e71396338 100644
--- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlType.java
+++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlType.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -64,7 +64,7 @@ import java.lang.annotation.Target;
* mapping of JavaBean properties and fields contained within the
* class. The schema type to which the class is mapped can either be
* named or anonymous. A class can be mapped to an anonymous schema
- * type by annotating the class with @XmlType(name="").
+ * type by annotating the class with @XmlType(name="").
*
* Either a global element, local element or a local attribute can be
* associated with an anonymous type as follows:
@@ -112,14 +112,14 @@ import java.lang.annotation.Target;
* The following table shows the mapping of the class to a XML Schema
* complex type or simple type. The notational symbols used in the table are:
*
- *
-> : represents a mapping
+ *
-> : represents a mapping
*
[x]+ : one or more occurances of x
*
[ @XmlValue property ]: JavaBean property annotated with
* @XmlValue
Example 6: Define a factoryClass and factoryMethod
diff --git a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlValue.java b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlValue.java
index ecf23aceb49..1ab10854a4f 100644
--- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlValue.java
+++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlValue.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -67,7 +67,6 @@ import static java.lang.annotation.RetentionPolicy.*;
* type, then the type must map to a XML Schema simple type.
*
*
- *
*
* If the annotated JavaBean property is the sole class member being
* mapped to XML Schema construct, then the class is mapped to a
@@ -89,10 +88,10 @@ import static java.lang.annotation.RetentionPolicy.*;
* public java.math.BigDecimal price;
* }
*
- * <!-- Example 1: XML Schema fragment -->
- * <xs:simpleType name="USPrice">
- * <xs:restriction base="xs:decimal"/>
- * </xs:simpleType>
+ * <!-- Example 1: XML Schema fragment -->
+ * <xs:simpleType name="USPrice">
+ * <xs:restriction base="xs:decimal"/>
+ * </xs:simpleType>
*
*
*
@@ -110,17 +109,16 @@ import static java.lang.annotation.RetentionPolicy.*;
* public String currency;
* }
*
- * <!-- Example 2: XML Schema fragment -->
- * <xs:complexType name="InternationalPrice">
- * <xs:simpleContent>
- * <xs:extension base="xs:decimal">
- * <xs:attribute name="currency" type="xs:string"/>
- * </xs:extension>
- * </xs:simpleContent>
- * </xs:complexType>
+ * <!-- Example 2: XML Schema fragment -->
+ * <xs:complexType name="InternationalPrice">
+ * <xs:simpleContent>
+ * <xs:extension base="xs:decimal">
+ * <xs:attribute name="currency" type="xs:string"/>
+ * </xs:extension>
+ * </xs:simpleContent>
+ * </xs:complexType>
*
*
- *
*
* @author Sekhar Vajjhala, Sun Microsystems, Inc.
* @see XmlType
diff --git a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/adapters/XmlAdapter.java b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/adapters/XmlAdapter.java
index 4ca79b0358d..4a500814f02 100644
--- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/adapters/XmlAdapter.java
+++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/adapters/XmlAdapter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -76,11 +76,11 @@ package javax.xml.bind.annotation.adapters;
*
Step 1: Determine the desired XML representation for HashMap.
*
*
- * <hashmap>
- * <entry key="id123">this is a value</entry>
- * <entry key="id312">this is another value</entry>
+ * <hashmap>
+ * <entry key="id123">this is a value</entry>
+ * <entry key="id312">this is another value</entry>
* ...
- * </hashmap>
+ * </hashmap>
*
*
*
Step 2: Determine the schema definition that the
@@ -88,20 +88,20 @@ package javax.xml.bind.annotation.adapters;
*
*
*
* @param
diff --git a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/attachment/AttachmentUnmarshaller.java b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/attachment/AttachmentUnmarshaller.java
index 548f3c9bafe..3ce6621a44b 100644
--- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/attachment/AttachmentUnmarshaller.java
+++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/attachment/AttachmentUnmarshaller.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -70,7 +70,7 @@ public abstract class AttachmentUnmarshaller {
*
*
The returned DataHandler instance must be configured
* to meet the following required mapping constaint.
- *
+ *
*
*
*
@@ -100,7 +100,7 @@ public abstract class AttachmentUnmarshaller {
*
*
*
- * Note that it is allowable to support additional mappings.
+ * Note that it is allowable to support additional mappings.
*
* @param cid It is expected to be a valid lexical form of the XML Schema
* xs:anyURI datatype. If {@link #isXOPPackage()}
diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/version.properties b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/version.properties
index 1ae4b3cd94f..b18bbc710b0 100644
--- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/version.properties
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/version.properties
@@ -23,7 +23,7 @@
# questions.
#
-build-id=2.2.11-b141124.1933
-build-version=JAX-WS RI 2.2.11-b141124.1933
+build-id=2.2.11-b150127.1410
+build-version=JAX-WS RI 2.2.11-b150127.1410
major-version=2.2.11
-svn-revision=312b19a2e0e312b55e1ea6f531bd595955cd581f
+svn-revision=28121d09ed8ac02b76788709ccb4cdb66e03bbfa
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle.properties b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle.properties
index d8194d0aa17..427db1f466e 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle.properties
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle.properties
@@ -30,10 +30,10 @@ BASEDIR_DOESNT_EXIST = \
Non-existent directory: {0}
VERSION = \
- schemagen 2.2.12-b141016.1821
+ schemagen 2.2.12-b150126.1924
FULLVERSION = \
- schemagen full version "2.2.12-b141016.1821"
+ schemagen full version "2.2.12-b150126.1924"
USAGE = \
Usage: schemagen [-options ...] \n\
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_de.properties b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_de.properties
index fff47122d87..435ed7150a6 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_de.properties
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_de.properties
@@ -27,8 +27,8 @@ UNEXPECTED_NGCC_TOKEN = Nicht erkanntes {0} in Zeile {1} Spalte {2}
BASEDIR_DOESNT_EXIST = Nicht vorhandenes Verzeichnis: {0}
-VERSION = schemagen 2.2.12-b141016.1821
+VERSION = schemagen 2.2.12-b150126.1924
-FULLVERSION = schemagen vollst\u00E4ndige Version "2.2.12-b141016.1821"
+FULLVERSION = schemagen vollst\u00E4ndige Version "2.2.12-b150126.1924"
USAGE = Verwendung: schemagen [-options ...] \nOptionen: \n\\ \\ \\ \\ -d : Gibt an, wo die von Prozessor und javac generierten Klassendateien gespeichert werden sollen\n\\ \\ \\ \\ -cp : Gibt an, wo die vom Benutzer angegebenen Dateien gespeichert sind\n\\ \\ \\ \\ -classpath : Gibt an, wo die vom Benutzer angegebenen Dateien gespeichert sind\n\\ \\ \\ \\ -encoding : Gibt die Codierung f\u00FCr die Annotationsverarbeitung/den javac-Aufruf an \n\\ \\ \\ \\ -episode : Generiert Episodendatei f\u00FCr separate Kompilierung\n\\ \\ \\ \\ -version : Zeigt Versionsinformation an\n\\ \\ \\ \\ -fullversion : Zeigt vollst\u00E4ndige Versionsinformationen an\n\\ \\ \\ \\ -help : Zeigt diese Verwendungsmeldung an
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_es.properties b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_es.properties
index 60ecdc915a5..c6d5aad27fa 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_es.properties
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_es.properties
@@ -27,8 +27,8 @@ UNEXPECTED_NGCC_TOKEN = Aparece un {0} inesperado en la l\u00EDnea {1} y la colu
BASEDIR_DOESNT_EXIST = Directorio no existente: {0}
-VERSION = schemagen 2.2.12-b141016.1821
+VERSION = schemagen 2.2.12-b150126.1924
-FULLVERSION = versi\u00F3n completa de schemagen "2.2.12-b141016.1821"
+FULLVERSION = versi\u00F3n completa de schemagen "2.2.12-b150126.1924"
USAGE = Sintaxis: schemagen [-options ...] \nOpciones: \n\\ \\ \\ \\ -d : especifique d\u00F3nde se colocan los archivos de clase generados por javac y el procesador\n\\ \\ \\ \\ -cp : especifique d\u00F3nde se encuentran los archivos especificados por el usuario\n\\ \\ \\ \\ -encoding : especifique la codificaci\u00F3n que se va a utilizar para el procesamiento de anotaciones/llamada de javac\n\\ \\ \\ \\ -episode : genera un archivo de episodio para una compilaci\u00F3n diferente\n\\ \\ \\ \\ -version : muestra la informaci\u00F3n de la versi\u00F3n\n\\ \\ \\ \\ -fullversion : muestra la informaci\u00F3n completa de la versi\u00F3n\n\\ \\ \\ \\ -help : muestra este mensaje de sintaxis
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_fr.properties b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_fr.properties
index 1b9109796f0..756a94788fa 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_fr.properties
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_fr.properties
@@ -27,8 +27,8 @@ UNEXPECTED_NGCC_TOKEN = Un \u00E9l\u00E9ment {0} inattendu appara\u00EEt \u00E0
BASEDIR_DOESNT_EXIST = R\u00E9pertoire {0} inexistant
-VERSION = schemagen 2.2.12-b141016.1821
+VERSION = schemagen 2.2.12-b150126.1924
-FULLVERSION = version compl\u00E8te de schemagen "2.2.12-b141016.1821"
+FULLVERSION = version compl\u00E8te de schemagen "2.2.12-b150126.1924"
USAGE = Syntaxe : schemagen [-options ...] \nOptions : \n\ \ \ \ -d : indiquez o\u00F9 placer les fichiers de classe g\u00E9n\u00E9r\u00E9s par le processeur et le compilateur javac\n\ \ \ \ -cp : indiquez o\u00F9 trouver les fichiers sp\u00E9cifi\u00E9s par l'utilisateur\n\ \ \ \ -classpath : indiquez o\u00F9 trouver les fichiers sp\u00E9cifi\u00E9s par l'utilisateur\n\ \ \ \ -encoding : indiquez l'encodage \u00E0 utiliser pour l'appel de javac/traitement de l'annotation \n\ \ \ \ -episode : g\u00E9n\u00E9rez un fichier d'\u00E9pisode pour la compilation s\u00E9par\u00E9e\n\ \ \ \ -version : affichez les informations de version\n\ \ \ \ -fullversion : affichez les informations compl\u00E8tes de version\n\ \ \ \ -help : affichez ce message de syntaxe
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_it.properties b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_it.properties
index ba82f11fe95..992b68e2c77 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_it.properties
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_it.properties
@@ -27,8 +27,8 @@ UNEXPECTED_NGCC_TOKEN = {0} imprevisto visualizzato sulla riga {1} colonna {2}
BASEDIR_DOESNT_EXIST = Directory non esistente: {0}
-VERSION = schemagen 2.2.12-b141016.1821
+VERSION = schemagen 2.2.12-b150126.1924
-FULLVERSION = versione completa schemagen "2.2.12-b141016.1821"
+FULLVERSION = versione completa schemagen "2.2.12-b150126.1924"
USAGE = Uso: schemagen [-options ...] \nOpzioni: \n\ \ \ \ -d : specifica dove posizionare il processore e i file della classe generata javac\n\ \ \ \ -cp : specifica dove trovare i file specificati dall'utente\n\ \ \ \ -classpath : specifica dove trovare i file specificati dall'utente\n\ \ \ \ -encoding : specifica la codifica da usare per l'elaborazione dell'annotazione/richiamo javac \n\ \ \ \ -episode : genera il file di episodio per la compilazione separata\n\ \ \ \ -version : visualizza le informazioni sulla versione\n\ \ \ \ -fullversion : visualizza le informazioni sulla versione completa\n\ \ \ \ -help : visualizza questo messaggio sull'uso
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_ja.properties b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_ja.properties
index bd3107c2387..bf3e933ce1c 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_ja.properties
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_ja.properties
@@ -27,8 +27,8 @@ UNEXPECTED_NGCC_TOKEN = \u4E88\u671F\u3057\u306A\u3044{0}\u304C\u884C{1}\u3001\u
BASEDIR_DOESNT_EXIST = \u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u304C\u5B58\u5728\u3057\u307E\u305B\u3093: {0}
-VERSION = schemagen 2.2.12-b141016.1821
+VERSION = schemagen 2.2.12-b150126.1924
-FULLVERSION = schemagen\u30D5\u30EB\u30FB\u30D0\u30FC\u30B8\u30E7\u30F3"2.2.12-b141016.1821"
+FULLVERSION = schemagen\u30D5\u30EB\u30FB\u30D0\u30FC\u30B8\u30E7\u30F3"2.2.12-b150126.1924"
USAGE = \u4F7F\u7528\u65B9\u6CD5: schemagen [-options ...] \n\u30AA\u30D7\u30B7\u30E7\u30F3: \n\ \ \ \ -d : \u30D7\u30ED\u30BB\u30C3\u30B5\u304A\u3088\u3073javac\u304C\u751F\u6210\u3057\u305F\u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u7F6E\u304F\u4F4D\u7F6E\u3092\u6307\u5B9A\u3057\u307E\u3059\n\ \ \ \ -cp : \u30E6\u30FC\u30B6\u30FC\u304C\u6307\u5B9A\u3057\u305F\u30D5\u30A1\u30A4\u30EB\u3092\u691C\u7D22\u3059\u308B\u4F4D\u7F6E\u3092\u6307\u5B9A\u3057\u307E\u3059\n\ \ \ \ -classpath : \u30E6\u30FC\u30B6\u30FC\u304C\u6307\u5B9A\u3057\u305F\u30D5\u30A1\u30A4\u30EB\u3092\u691C\u7D22\u3059\u308B\u4F4D\u7F6E\u3092\u6307\u5B9A\u3057\u307E\u3059\n\ \ \ \ -encoding : \u6CE8\u91C8\u51E6\u7406/javac\u547C\u51FA\u3057\u306B\u4F7F\u7528\u3059\u308B\u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0\u3092\u6307\u5B9A\u3057\u307E\u3059\n\ \ \ \ -episode : \u30B3\u30F3\u30D1\u30A4\u30EB\u3054\u3068\u306B\u30A8\u30D4\u30BD\u30FC\u30C9\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u751F\u6210\u3057\u307E\u3059\n\ \ \ \ -version : \u30D0\u30FC\u30B8\u30E7\u30F3\u60C5\u5831\u3092\u8868\u793A\u3057\u307E\u3059\n\ \ \ \ -fullversion : \u30D5\u30EB\u30FB\u30D0\u30FC\u30B8\u30E7\u30F3\u60C5\u5831\u3092\u8868\u793A\u3057\u307E\u3059\n\ \ \ \ -help : \u3053\u306E\u4F7F\u7528\u4F8B\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u8868\u793A\u3057\u307E\u3059
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_ko.properties b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_ko.properties
index 642294c211d..31ba0ab9637 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_ko.properties
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_ko.properties
@@ -27,8 +27,8 @@ UNEXPECTED_NGCC_TOKEN = \uC608\uC0C1\uCE58 \uC54A\uC740 {0}\uC774(\uAC00) {1}\uD
BASEDIR_DOESNT_EXIST = \uC874\uC7AC\uD558\uC9C0 \uC54A\uB294 \uB514\uB809\uD1A0\uB9AC: {0}
-VERSION = schemagen 2.2.12-b141016.1821
+VERSION = schemagen 2.2.12-b150126.1924
-FULLVERSION = schemagen \uC815\uC2DD \uBC84\uC804 "2.2.12-b141016.1821"
+FULLVERSION = schemagen \uC815\uC2DD \uBC84\uC804 "2.2.12-b150126.1924"
USAGE = \uC0AC\uC6A9\uBC95: schemagen [-options ...] \n\uC635\uC158: \n\ \ \ \ -d : \uD504\uB85C\uC138\uC11C \uBC0F javac\uC5D0\uC11C \uC0DD\uC131\uD55C \uD074\uB798\uC2A4 \uD30C\uC77C\uC744 \uBC30\uCE58\uD560 \uC704\uCE58\uB97C \uC9C0\uC815\uD569\uB2C8\uB2E4.\n\ \ \ \ -cp : \uC0AC\uC6A9\uC790\uAC00 \uC9C0\uC815\uD55C \uD30C\uC77C\uC744 \uCC3E\uC744 \uC704\uCE58\uB97C \uC9C0\uC815\uD569\uB2C8\uB2E4.\n\ \ \ \ -classpath : \uC0AC\uC6A9\uC790\uAC00 \uC9C0\uC815\uD55C \uD30C\uC77C\uC744 \uCC3E\uC744 \uC704\uCE58\uB97C \uC9C0\uC815\uD569\uB2C8\uB2E4.\n\ \ \ \ -encoding : \uC8FC\uC11D \uCC98\uB9AC/javac \uD638\uCD9C\uC5D0 \uC0AC\uC6A9\uD560 \uC778\uCF54\uB529\uC744 \uC9C0\uC815\uD569\uB2C8\uB2E4. \n\ \ \ \ -episode : \uBCC4\uB3C4 \uCEF4\uD30C\uC77C\uC744 \uC704\uD574 episode \uD30C\uC77C\uC744 \uC0DD\uC131\uD569\uB2C8\uB2E4.\n\ \ \ \ -version : \uBC84\uC804 \uC815\uBCF4\uB97C \uD45C\uC2DC\uD569\uB2C8\uB2E4.\n\ \ \ \ -fullversion : \uC815\uC2DD \uBC84\uC804 \uC815\uBCF4\uB97C \uD45C\uC2DC\uD569\uB2C8\uB2E4.\n\ \ \ \ -help : \uC774 \uC0AC\uC6A9\uBC95 \uBA54\uC2DC\uC9C0\uB97C \uD45C\uC2DC\uD569\uB2C8\uB2E4.
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_pt_BR.properties b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_pt_BR.properties
index c4284ad4ff2..c2f4155d874 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_pt_BR.properties
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_pt_BR.properties
@@ -27,8 +27,8 @@ UNEXPECTED_NGCC_TOKEN = {0} inesperado aparece na linha {1} coluna {2}
BASEDIR_DOESNT_EXIST = Diret\u00F3rio n\u00E3o existente: {0}
-VERSION = gera\u00E7\u00E3o do esquema 2.2.12-b141016.1821
+VERSION = gera\u00E7\u00E3o do esquema 2.2.12-b150126.1924
-FULLVERSION = vers\u00E3o completa da gera\u00E7\u00E3o do esquema "2.2.12-b141016.1821"
+FULLVERSION = vers\u00E3o completa da gera\u00E7\u00E3o do esquema "2.2.12-b150126.1924"
USAGE = Uso: gera\u00E7\u00E3o do esquema [-options ...] \nOp\u00E7\u00F5es: \n\\ \\ \\ \\ -d : especificar onde colocar o processador e os arquivos da classe gerados por javac\n\\ \\ \\ \\ -cp : especificar onde localizar arquivos especificados pelo usu\u00E1rio\n\\ \\ \\ \\ -classpath : especificar onde localizar os arquivos especificados pelo usu\u00E1rio\n\\ \\ \\ \\ -encoding : especificar codifica\u00E7\u00E3o a ser usada para processamento de anota\u00E7\u00E3o/chamada javac \n\\ \\ \\ \\ -episode : gerar arquivo do epis\u00F3dio para compila\u00E7\u00E3o separada\n\\ \\ \\ \\ -version : exibir informa\u00E7\u00F5es da vers\u00E3o\n\\ \\ \\ \\ -fullversion : exibir informa\u00E7\u00F5es da vers\u00E3o completa\n\\ \\ \\ \\ -help : exibir esta mensagem de uso
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_zh_CN.properties b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_zh_CN.properties
index c89cc1ebf51..cec06517656 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_zh_CN.properties
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_zh_CN.properties
@@ -27,8 +27,8 @@ UNEXPECTED_NGCC_TOKEN = \u5728\u7B2C {1} \u884C, \u7B2C {2} \u5217\u51FA\u73B0\u
BASEDIR_DOESNT_EXIST = \u4E0D\u5B58\u5728\u7684\u76EE\u5F55: {0}
-VERSION = schemagen 2.2.12-b141016.1821
+VERSION = schemagen 2.2.12-b150126.1924
-FULLVERSION = schemagen \u5B8C\u6574\u7248\u672C "2.2.12-b141016.1821"
+FULLVERSION = schemagen \u5B8C\u6574\u7248\u672C "2.2.12-b150126.1924"
USAGE = \u7528\u6CD5: schemagen [-options ...] \n\u9009\u9879: \n\ \ \ \ -d : \u6307\u5B9A\u653E\u7F6E\u5904\u7406\u7A0B\u5E8F\u548C javac \u751F\u6210\u7684\u7C7B\u6587\u4EF6\u7684\u4F4D\u7F6E\n\ \ \ \ -cp : \u6307\u5B9A\u67E5\u627E\u7528\u6237\u6307\u5B9A\u6587\u4EF6\u7684\u4F4D\u7F6E\n\ \ \ \ -classpath : \u6307\u5B9A\u67E5\u627E\u7528\u6237\u6307\u5B9A\u6587\u4EF6\u7684\u4F4D\u7F6E\n\ \ \ \ -encoding : \u6307\u5B9A\u7528\u4E8E\u6CE8\u91CA\u5904\u7406/javac \u8C03\u7528\u7684\u7F16\u7801\n\ \ \ \ -episode : \u751F\u6210\u7247\u6BB5\u6587\u4EF6\u4EE5\u4F9B\u5355\u72EC\u7F16\u8BD1\n\ \ \ \ -version : \u663E\u793A\u7248\u672C\u4FE1\u606F\n\ \ \ \ -fullversion : \u663E\u793A\u5B8C\u6574\u7684\u7248\u672C\u4FE1\u606F\n\ \ \ \ -help : \u663E\u793A\u6B64\u7528\u6CD5\u6D88\u606F
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_zh_TW.properties b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_zh_TW.properties
index f6e5241eebc..938aef76528 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_zh_TW.properties
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_zh_TW.properties
@@ -27,8 +27,8 @@ UNEXPECTED_NGCC_TOKEN = \u672A\u9810\u671F\u7684 {0} \u986F\u793A\u65BC\u884C {1
BASEDIR_DOESNT_EXIST = \u4E0D\u5B58\u5728\u7684\u76EE\u9304: {0}
-VERSION = schemagen 2.2.12-b141016.1821
+VERSION = schemagen 2.2.12-b150126.1924
-FULLVERSION = schemagen \u5B8C\u6574\u7248\u672C "2.2.12-b141016.1821"
+FULLVERSION = schemagen \u5B8C\u6574\u7248\u672C "2.2.12-b150126.1924"
USAGE = \u7528\u6CD5: schemagen [-options ...] \n\u9078\u9805: \n\\ \\ \\ \\ -d : \u6307\u5B9A\u8655\u7406\u5668\u4EE5\u53CA javac \u7522\u751F\u7684\u985E\u5225\u6A94\u6848\u653E\u7F6E\u4F4D\u7F6E\n\\ \\ \\ \\ -cp : \u6307\u5B9A\u8981\u5C0B\u627E\u4F7F\u7528\u8005\u6307\u5B9A\u6A94\u6848\u7684\u4F4D\u7F6E\n\\ \\ \\ \\ -classpath : \u6307\u5B9A\u8981\u5C0B\u627E\u4F7F\u7528\u8005\u6307\u5B9A\u6A94\u6848\u7684\u4F4D\u7F6E\n\\ \\ \\ \\ -encoding : \u6307\u5B9A\u8981\u7528\u65BC\u8A3B\u89E3\u8655\u7406/javac \u547C\u53EB\u7684\u7DE8\u78BC \n\\ \\ \\ \\ -episode : \u7522\u751F\u7368\u7ACB\u7DE8\u8B6F\u7684\u4E8B\u4EF6 (episode) \u6A94\u6848\n\\ \\ \\ \\ -version : \u986F\u793A\u7248\u672C\u8CC7\u8A0A\n\\ \\ \\ \\ -fullversion : \u986F\u793A\u5B8C\u6574\u7248\u672C\u8CC7\u8A0A\n\\ \\ \\ \\ -help : \u986F\u793A\u6B64\u7528\u6CD5\u8A0A\u606F
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle.properties b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle.properties
index adbe668bfb0..fd88f7f2d7f 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle.properties
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle.properties
@@ -171,20 +171,20 @@ Driver.CompilingSchema = \
Driver.FailedToGenerateCode = \
Failed to produce code.
-# DO NOT localize the 2.2.12-b141016.1821 string - it is a token for an mvn
+# DO NOT localize the 2.2.12-b150126.1924 string - it is a token for an mvn
Driver.FilePrologComment = \
- This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.12-b141016.1821 \n\
+ This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.12-b150126.1924 \n\
See http://java.sun.com/xml/jaxb \n\
Any modifications to this file will be lost upon recompilation of the source schema. \n\
Generated on: {0} \n
Driver.Version = \
- xjc 2.2.12-b141016.1821
+ xjc 2.2.12-b150126.1924
Driver.FullVersion = \
- xjc full version "2.2.12-b141016.1821"
+ xjc full version "2.2.12-b150126.1924"
-Driver.BuildID = 2.2.12-b141016.1821
+Driver.BuildID = 2.2.12-b150126.1924
# for JDK integration - include version in source zip
jaxb.jdk.version=@@JAXB_JDK_VERSION@@
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_de.properties b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_de.properties
index df277d39716..97271e9de79 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_de.properties
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_de.properties
@@ -96,14 +96,14 @@ Driver.CompilingSchema = Ein Schema wird kompiliert ...
Driver.FailedToGenerateCode = Code konnte nicht erzeugt werden.
-# DO NOT localize the 2.2.12-b141016.1821 string - it is a token for an mvn
-Driver.FilePrologComment = Diese Datei wurde mit der JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.12-b141016.1821 generiert \nSiehe http://java.sun.com/xml/jaxb \n\u00c4nderungen an dieser Datei gehen bei einer Neukompilierung des Quellschemas verloren. \nGeneriert: {0} \n
+# DO NOT localize the 2.2.12-b150126.1924 string - it is a token for an mvn
+Driver.FilePrologComment = Diese Datei wurde mit der JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.12-b150126.1924 generiert \nSiehe http://java.sun.com/xml/jaxb \n\u00c4nderungen an dieser Datei gehen bei einer Neukompilierung des Quellschemas verloren. \nGeneriert: {0} \n
-Driver.Version = xjc 2.2.12-b141016.1821
+Driver.Version = xjc 2.2.12-b150126.1924
-Driver.FullVersion = xjc vollst\u00E4ndige Version "2.2.12-b141016.1821"
+Driver.FullVersion = xjc vollst\u00E4ndige Version "2.2.12-b150126.1924"
-Driver.BuildID = 2.2.12-b141016.1821
+Driver.BuildID = 2.2.12-b150126.1924
# for JDK integration - include version in source zip
jaxb.jdk.version=@@JAXB_JDK_VERSION@@
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_es.properties b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_es.properties
index d27e3ef36d3..eadb52fac88 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_es.properties
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_es.properties
@@ -96,14 +96,14 @@ Driver.CompilingSchema = Compilando un esquema...
Driver.FailedToGenerateCode = Fallo al producir c\u00f3digo.
-# DO NOT localize the 2.2.12-b141016.1821 string - it is a token for an mvn
-Driver.FilePrologComment = Este archivo ha sido generado por la arquitectura JavaTM para la implantaci\u00f3n de la referencia de enlace (JAXB) XML v2.2.12-b141016.1821 \nVisite http://java.sun.com/xml/jaxb \nTodas las modificaciones realizadas en este archivo se perder\u00e1n si se vuelve a compilar el esquema de origen. \nGenerado el: {0} \n
+# DO NOT localize the 2.2.12-b150126.1924 string - it is a token for an mvn
+Driver.FilePrologComment = Este archivo ha sido generado por la arquitectura JavaTM para la implantaci\u00f3n de la referencia de enlace (JAXB) XML v2.2.12-b150126.1924 \nVisite http://java.sun.com/xml/jaxb \nTodas las modificaciones realizadas en este archivo se perder\u00e1n si se vuelve a compilar el esquema de origen. \nGenerado el: {0} \n
-Driver.Version = xjc 2.2.12-b141016.1821
+Driver.Version = xjc 2.2.12-b150126.1924
-Driver.FullVersion = versi\u00F3n completa de xjc "2.2.12-b141016.1821"
+Driver.FullVersion = versi\u00F3n completa de xjc "2.2.12-b150126.1924"
-Driver.BuildID = 2.2.12-b141016.1821
+Driver.BuildID = 2.2.12-b150126.1924
# for JDK integration - include version in source zip
jaxb.jdk.version=@@JAXB_JDK_VERSION@@
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_fr.properties b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_fr.properties
index 8f3deded4f1..dd19a1687df 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_fr.properties
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_fr.properties
@@ -96,14 +96,14 @@ Driver.CompilingSchema = compilation d'un sch\u00e9ma...
Driver.FailedToGenerateCode = Echec de la production du code.
-# DO NOT localize the 2.2.12-b141016.1821 string - it is a token for an mvn
-Driver.FilePrologComment = Ce fichier a \u00e9t\u00e9 g\u00e9n\u00e9r\u00e9 par l''impl\u00e9mentation de r\u00e9f\u00e9rence JavaTM Architecture for XML Binding (JAXB), v2.2.12-b141016.1821 \nVoir http://java.sun.com/xml/jaxb \nToute modification apport\u00e9e \u00e0 ce fichier sera perdue lors de la recompilation du sch\u00e9ma source. \nG\u00e9n\u00e9r\u00e9 le : {0} \n
+# DO NOT localize the 2.2.12-b150126.1924 string - it is a token for an mvn
+Driver.FilePrologComment = Ce fichier a \u00e9t\u00e9 g\u00e9n\u00e9r\u00e9 par l''impl\u00e9mentation de r\u00e9f\u00e9rence JavaTM Architecture for XML Binding (JAXB), v2.2.12-b150126.1924 \nVoir http://java.sun.com/xml/jaxb \nToute modification apport\u00e9e \u00e0 ce fichier sera perdue lors de la recompilation du sch\u00e9ma source. \nG\u00e9n\u00e9r\u00e9 le : {0} \n
-Driver.Version = xjc 2.2.12-b141016.1821
+Driver.Version = xjc 2.2.12-b150126.1924
-Driver.FullVersion = version compl\u00E8te xjc "2.2.12-b141016.1821"
+Driver.FullVersion = version compl\u00E8te xjc "2.2.12-b150126.1924"
-Driver.BuildID = 2.2.12-b141016.1821
+Driver.BuildID = 2.2.12-b150126.1924
# for JDK integration - include version in source zip
jaxb.jdk.version=@@JAXB_JDK_VERSION@@
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_it.properties b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_it.properties
index 21f60a899e8..f259cb3d291 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_it.properties
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_it.properties
@@ -96,14 +96,14 @@ Driver.CompilingSchema = compilazione di uno schema in corso...
Driver.FailedToGenerateCode = Produzione del codice non riuscita.
-# DO NOT localize the 2.2.12-b141016.1821 string - it is a token for an mvn
-Driver.FilePrologComment = Questo file \u00e8 stato generato dall''architettura JavaTM per XML Binding (JAXB) Reference Implementation, v2.2.12-b141016.1821 \nVedere http://java.sun.com/xml/jaxb \nQualsiasi modifica a questo file andr\u00e0 persa durante la ricompilazione dello schema di origine. \nGenerato il: {0} \n
+# DO NOT localize the 2.2.12-b150126.1924 string - it is a token for an mvn
+Driver.FilePrologComment = Questo file \u00e8 stato generato dall''architettura JavaTM per XML Binding (JAXB) Reference Implementation, v2.2.12-b150126.1924 \nVedere http://java.sun.com/xml/jaxb \nQualsiasi modifica a questo file andr\u00e0 persa durante la ricompilazione dello schema di origine. \nGenerato il: {0} \n
-Driver.Version = xjc 2.2.12-b141016.1821
+Driver.Version = xjc 2.2.12-b150126.1924
-Driver.FullVersion = versione completa xjc "2.2.12-b141016.1821"
+Driver.FullVersion = versione completa xjc "2.2.12-b150126.1924"
-Driver.BuildID = 2.2.12-b141016.1821
+Driver.BuildID = 2.2.12-b150126.1924
# for JDK integration - include version in source zip
jaxb.jdk.version=@@JAXB_JDK_VERSION@@
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_ja.properties b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_ja.properties
index 342dbcaca62..9674081427e 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_ja.properties
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_ja.properties
@@ -96,14 +96,14 @@ Driver.CompilingSchema = \u30b9\u30ad\u30fc\u30de\u306e\u30b3\u30f3\u30d1\u30a4\
Driver.FailedToGenerateCode = \u30b3\u30fc\u30c9\u306e\u751f\u6210\u306b\u5931\u6557\u3057\u307e\u3057\u305f\u3002
-# DO NOT localize the 2.2.12-b141016.1821 string - it is a token for an mvn
-Driver.FilePrologComment = \u3053\u306e\u30d5\u30a1\u30a4\u30eb\u306f\u3001JavaTM Architecture for XML Binding(JAXB) Reference Implementation\u3001v2.2.12-b141016.1821\u306b\u3088\u3063\u3066\u751f\u6210\u3055\u308c\u307e\u3057\u305f \nhttp://java.sun.com/xml/jaxb\u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044 \n\u30bd\u30fc\u30b9\u30fb\u30b9\u30ad\u30fc\u30de\u306e\u518d\u30b3\u30f3\u30d1\u30a4\u30eb\u6642\u306b\u3053\u306e\u30d5\u30a1\u30a4\u30eb\u306e\u5909\u66f4\u306f\u5931\u308f\u308c\u307e\u3059\u3002 \n\u751f\u6210\u65e5: {0} \n
+# DO NOT localize the 2.2.12-b150126.1924 string - it is a token for an mvn
+Driver.FilePrologComment = \u3053\u306e\u30d5\u30a1\u30a4\u30eb\u306f\u3001JavaTM Architecture for XML Binding(JAXB) Reference Implementation\u3001v2.2.12-b150126.1924\u306b\u3088\u3063\u3066\u751f\u6210\u3055\u308c\u307e\u3057\u305f \nhttp://java.sun.com/xml/jaxb\u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044 \n\u30bd\u30fc\u30b9\u30fb\u30b9\u30ad\u30fc\u30de\u306e\u518d\u30b3\u30f3\u30d1\u30a4\u30eb\u6642\u306b\u3053\u306e\u30d5\u30a1\u30a4\u30eb\u306e\u5909\u66f4\u306f\u5931\u308f\u308c\u307e\u3059\u3002 \n\u751f\u6210\u65e5: {0} \n
-Driver.Version = xjc 2.2.12-b141016.1821
+Driver.Version = xjc 2.2.12-b150126.1924
-Driver.FullVersion = xjc\u30D5\u30EB\u30FB\u30D0\u30FC\u30B8\u30E7\u30F3"2.2.12-b141016.1821"
+Driver.FullVersion = xjc\u30D5\u30EB\u30FB\u30D0\u30FC\u30B8\u30E7\u30F3"2.2.12-b150126.1924"
-Driver.BuildID = 2.2.12-b141016.1821
+Driver.BuildID = 2.2.12-b150126.1924
# for JDK integration - include version in source zip
jaxb.jdk.version=@@JAXB_JDK_VERSION@@
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_ko.properties b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_ko.properties
index 97cf258262e..3715185d805 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_ko.properties
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_ko.properties
@@ -96,14 +96,14 @@ Driver.CompilingSchema = \uc2a4\ud0a4\ub9c8\ub97c \ucef4\ud30c\uc77c\ud558\ub294
Driver.FailedToGenerateCode = \ucf54\ub4dc \uc0dd\uc131\uc744 \uc2e4\ud328\ud588\uc2b5\ub2c8\ub2e4.
-# DO NOT localize the 2.2.12-b141016.1821 string - it is a token for an mvn
-Driver.FilePrologComment = \uc774 \ud30c\uc77c\uc740 JAXB(JavaTM Architecture for XML Binding) \ucc38\uc870 \uad6c\ud604 2.2.12-b141016.1821 \ubc84\uc804\uc744 \ud1b5\ud574 \uc0dd\uc131\ub418\uc5c8\uc2b5\ub2c8\ub2e4. \nhttp://java.sun.com/xml/jaxb\ub97c \ucc38\uc870\ud558\uc2ed\uc2dc\uc624. \n\uc774 \ud30c\uc77c\uc744 \uc218\uc815\ud558\uba74 \uc18c\uc2a4 \uc2a4\ud0a4\ub9c8\ub97c \uc7ac\ucef4\ud30c\uc77c\ud560 \ub54c \uc218\uc815 \uc0ac\ud56d\uc774 \uc190\uc2e4\ub429\ub2c8\ub2e4. \n\uc0dd\uc131 \ub0a0\uc9dc: {0} \n
+# DO NOT localize the 2.2.12-b150126.1924 string - it is a token for an mvn
+Driver.FilePrologComment = \uc774 \ud30c\uc77c\uc740 JAXB(JavaTM Architecture for XML Binding) \ucc38\uc870 \uad6c\ud604 2.2.12-b150126.1924 \ubc84\uc804\uc744 \ud1b5\ud574 \uc0dd\uc131\ub418\uc5c8\uc2b5\ub2c8\ub2e4. \nhttp://java.sun.com/xml/jaxb\ub97c \ucc38\uc870\ud558\uc2ed\uc2dc\uc624. \n\uc774 \ud30c\uc77c\uc744 \uc218\uc815\ud558\uba74 \uc18c\uc2a4 \uc2a4\ud0a4\ub9c8\ub97c \uc7ac\ucef4\ud30c\uc77c\ud560 \ub54c \uc218\uc815 \uc0ac\ud56d\uc774 \uc190\uc2e4\ub429\ub2c8\ub2e4. \n\uc0dd\uc131 \ub0a0\uc9dc: {0} \n
-Driver.Version = XJC 2.2.12-b141016.1821
+Driver.Version = XJC 2.2.12-b150126.1924
-Driver.FullVersion = XJC \uC815\uC2DD \uBC84\uC804 "2.2.12-b141016.1821"
+Driver.FullVersion = XJC \uC815\uC2DD \uBC84\uC804 "2.2.12-b150126.1924"
-Driver.BuildID = 2.2.12-b141016.1821
+Driver.BuildID = 2.2.12-b150126.1924
# for JDK integration - include version in source zip
jaxb.jdk.version=@@JAXB_JDK_VERSION@@
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_pt_BR.properties b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_pt_BR.properties
index 395ede3aefc..9f44278b4eb 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_pt_BR.properties
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_pt_BR.properties
@@ -96,14 +96,14 @@ Driver.CompilingSchema = compilando um esquema...
Driver.FailedToGenerateCode = Falha ao produzir o c\u00f3digo.
-# DO NOT localize the 2.2.12-b141016.1821 string - it is a token for an mvn
-Driver.FilePrologComment = Este arquivo foi gerado pela Arquitetura JavaTM para Implementa\u00e7\u00e3o de Refer\u00eancia (JAXB) de Bind XML, v2.2.12-b141016.1821 \nConsulte http://java.sun.com/xml/jaxb \nTodas as modifica\u00e7\u00f5es neste arquivo ser\u00e3o perdidas ap\u00f3s a recompila\u00e7\u00e3o do esquema de origem. \nGerado em: {0} \n
+# DO NOT localize the 2.2.12-b150126.1924 string - it is a token for an mvn
+Driver.FilePrologComment = Este arquivo foi gerado pela Arquitetura JavaTM para Implementa\u00e7\u00e3o de Refer\u00eancia (JAXB) de Bind XML, v2.2.12-b150126.1924 \nConsulte http://java.sun.com/xml/jaxb \nTodas as modifica\u00e7\u00f5es neste arquivo ser\u00e3o perdidas ap\u00f3s a recompila\u00e7\u00e3o do esquema de origem. \nGerado em: {0} \n
-Driver.Version = xjc 2.2.12-b141016.1821
+Driver.Version = xjc 2.2.12-b150126.1924
-Driver.FullVersion = vers\u00E3o completa de xjc "2.2.12-b141016.1821"
+Driver.FullVersion = vers\u00E3o completa de xjc "2.2.12-b150126.1924"
-Driver.BuildID = 2.2.12-b141016.1821
+Driver.BuildID = 2.2.12-b150126.1924
# for JDK integration - include version in source zip
jaxb.jdk.version=@@JAXB_JDK_VERSION@@
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_zh_CN.properties b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_zh_CN.properties
index 048488a1500..11276a8352a 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_zh_CN.properties
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_zh_CN.properties
@@ -96,14 +96,14 @@ Driver.CompilingSchema = \u6b63\u5728\u7f16\u8bd1\u6a21\u5f0f...
Driver.FailedToGenerateCode = \u65e0\u6cd5\u751f\u6210\u4ee3\u7801\u3002
-# DO NOT localize the 2.2.12-b141016.1821 string - it is a token for an mvn
-Driver.FilePrologComment = \u6b64\u6587\u4ef6\u662f\u7531 JavaTM Architecture for XML Binding (JAXB) \u5f15\u7528\u5b9e\u73b0 v2.2.12-b141016.1821 \u751f\u6210\u7684\n\u8bf7\u8bbf\u95ee http://java.sun.com/xml/jaxb \n\u5728\u91cd\u65b0\u7f16\u8bd1\u6e90\u6a21\u5f0f\u65f6, \u5bf9\u6b64\u6587\u4ef6\u7684\u6240\u6709\u4fee\u6539\u90fd\u5c06\u4e22\u5931\u3002\n\u751f\u6210\u65f6\u95f4: {0} \n
+# DO NOT localize the 2.2.12-b150126.1924 string - it is a token for an mvn
+Driver.FilePrologComment = \u6b64\u6587\u4ef6\u662f\u7531 JavaTM Architecture for XML Binding (JAXB) \u5f15\u7528\u5b9e\u73b0 v2.2.12-b150126.1924 \u751f\u6210\u7684\n\u8bf7\u8bbf\u95ee http://java.sun.com/xml/jaxb \n\u5728\u91cd\u65b0\u7f16\u8bd1\u6e90\u6a21\u5f0f\u65f6, \u5bf9\u6b64\u6587\u4ef6\u7684\u6240\u6709\u4fee\u6539\u90fd\u5c06\u4e22\u5931\u3002\n\u751f\u6210\u65f6\u95f4: {0} \n
-Driver.Version = xjc 2.2.12-b141016.1821
+Driver.Version = xjc 2.2.12-b150126.1924
-Driver.FullVersion = xjc \u5B8C\u6574\u7248\u672C "2.2.12-b141016.1821"
+Driver.FullVersion = xjc \u5B8C\u6574\u7248\u672C "2.2.12-b150126.1924"
-Driver.BuildID = 2.2.12-b141016.1821
+Driver.BuildID = 2.2.12-b150126.1924
# for JDK integration - include version in source zip
jaxb.jdk.version=@@JAXB_JDK_VERSION@@
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_zh_TW.properties b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_zh_TW.properties
index 185fc08bdb7..27227f5b5c5 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_zh_TW.properties
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_zh_TW.properties
@@ -96,14 +96,14 @@ Driver.CompilingSchema = \u6b63\u5728\u7de8\u8b6f\u7db1\u8981...
Driver.FailedToGenerateCode = \u7121\u6cd5\u7522\u751f\u7a0b\u5f0f\u78bc.
-# DO NOT localize the 2.2.12-b141016.1821 string - it is a token for an mvn
-Driver.FilePrologComment = \u6b64\u6a94\u6848\u662f\u7531 JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.12-b141016.1821 \u6240\u7522\u751f \n\u8acb\u53c3\u95b1 http://java.sun.com/xml/jaxb \n\u4e00\u65e6\u91cd\u65b0\u7de8\u8b6f\u4f86\u6e90\u7db1\u8981, \u5c0d\u6b64\u6a94\u6848\u6240\u505a\u7684\u4efb\u4f55\u4fee\u6539\u90fd\u5c07\u6703\u907a\u5931. \n\u7522\u751f\u6642\u9593: {0} \n
+# DO NOT localize the 2.2.12-b150126.1924 string - it is a token for an mvn
+Driver.FilePrologComment = \u6b64\u6a94\u6848\u662f\u7531 JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.12-b150126.1924 \u6240\u7522\u751f \n\u8acb\u53c3\u95b1 http://java.sun.com/xml/jaxb \n\u4e00\u65e6\u91cd\u65b0\u7de8\u8b6f\u4f86\u6e90\u7db1\u8981, \u5c0d\u6b64\u6a94\u6848\u6240\u505a\u7684\u4efb\u4f55\u4fee\u6539\u90fd\u5c07\u6703\u907a\u5931. \n\u7522\u751f\u6642\u9593: {0} \n
-Driver.Version = xjc 2.2.12-b141016.1821
+Driver.Version = xjc 2.2.12-b150126.1924
-Driver.FullVersion = xjc \u5B8C\u6574\u7248\u672C "2.2.12-b141016.1821"
+Driver.FullVersion = xjc \u5B8C\u6574\u7248\u672C "2.2.12-b150126.1924"
-Driver.BuildID = 2.2.12-b141016.1821
+Driver.BuildID = 2.2.12-b150126.1924
# for JDK integration - include version in source zip
jaxb.jdk.version=@@JAXB_JDK_VERSION@@
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/Options.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/Options.java
index fefa33f9830..275dfd70ced 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/Options.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/Options.java
@@ -32,18 +32,18 @@ import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.io.StringWriter;
-import java.lang.reflect.Array;
-import java.lang.reflect.InvocationTargetException;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLClassLoader;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.Date;
import java.util.Enumeration;
import java.util.HashSet;
import java.util.List;
+import java.util.ServiceLoader;
import java.util.Set;
import com.sun.codemodel.internal.CodeWriter;
@@ -354,9 +354,7 @@ public class Options
*/
public List getAllPlugins() {
if(allPlugins==null) {
- allPlugins = new ArrayList();
- ClassLoader ucl = getUserClassLoader(SecureLoader.getClassClassLoader(getClass()));
- allPlugins.addAll(Arrays.asList(findServices(Plugin.class,ucl)));
+ allPlugins = findServices(Plugin.class);
}
return allPlugins;
@@ -924,118 +922,44 @@ public class Options
/**
* If a plugin failed to load, report.
*/
- private static String pluginLoadFailure;
+ private String pluginLoadFailure;
/**
* Looks for all "META-INF/services/[className]" files and
* create one instance for each class name found inside this file.
*/
- private static T[] findServices( Class clazz, ClassLoader classLoader ) {
- // if true, print debug output
- final boolean debug = com.sun.tools.internal.xjc.util.Util.getSystemProperty(Options.class,"findServices")!=null;
-
- // if we are running on Mustang or Dolphin, use ServiceLoader
- // so that we can take advantage of JSR-277 module system.
+ private List findServices( Class clazz) {
+ final List result = new ArrayList();
+ final boolean debug = getDebugPropertyValue();
try {
- Class> serviceLoader = Class.forName("java.util.ServiceLoader");
- if(debug)
- System.out.println("Using java.util.ServiceLoader");
- Iterable itr = (Iterable)serviceLoader.getMethod("load",Class.class,ClassLoader.class).invoke(null,clazz,classLoader);
- List r = new ArrayList();
- for (T t : itr)
- r.add(t);
- return r.toArray((T[])Array.newInstance(clazz,r.size()));
- } catch (ClassNotFoundException e) {
- // fall through
- } catch (IllegalAccessException e) {
- Error x = new IllegalAccessError();
- x.initCause(e);
- throw x;
- } catch (InvocationTargetException e) {
- Throwable x = e.getTargetException();
- if (x instanceof RuntimeException)
- throw (RuntimeException) x;
- if (x instanceof Error)
- throw (Error) x;
- throw new Error(x);
- } catch (NoSuchMethodException e) {
- Error x = new NoSuchMethodError();
- x.initCause(e);
- throw x;
- }
-
- String serviceId = "META-INF/services/" + clazz.getName();
-
- // used to avoid creating the same instance twice
- Set classNames = new HashSet();
-
- if(debug) {
- System.out.println("Looking for "+serviceId+" for add-ons");
- }
-
- // try to find services in CLASSPATH
- try {
- Enumeration e = classLoader.getResources(serviceId);
- if(e==null) return (T[])Array.newInstance(clazz,0);
-
- ArrayList a = new ArrayList();
- while(e.hasMoreElements()) {
- URL url = e.nextElement();
- BufferedReader reader=null;
-
- if(debug) {
- System.out.println("Checking "+url+" for an add-on");
- }
-
- try {
- reader = new BufferedReader(new InputStreamReader(url.openStream()));
- String impl;
- while((impl = reader.readLine())!=null ) {
- // try to instanciate the object
- impl = impl.trim();
- if(classNames.add(impl)) {
- Class implClass = classLoader.loadClass(impl);
- if(!clazz.isAssignableFrom(implClass)) {
- pluginLoadFailure = impl+" is not a subclass of "+clazz+". Skipping";
- if(debug)
- System.out.println(pluginLoadFailure);
- continue;
- }
- if(debug) {
- System.out.println("Attempting to instanciate "+impl);
- }
- a.add(clazz.cast(implClass.newInstance()));
- }
- }
- reader.close();
- } catch( Exception ex ) {
- // let it go.
- StringWriter w = new StringWriter();
- ex.printStackTrace(new PrintWriter(w));
- pluginLoadFailure = w.toString();
- if(debug) {
- System.out.println(pluginLoadFailure);
- }
- if( reader!=null ) {
- try {
- reader.close();
- } catch( IOException ex2 ) {
- // ignore
- }
- }
- }
- }
-
- return a.toArray((T[])Array.newInstance(clazz,a.size()));
+ // TCCL allows user plugins to be loaded even if xjc is in jdk
+ // We have to use our SecureLoader to obtain it because we are trying to avoid SecurityException
+ final ClassLoader tccl = SecureLoader.getContextClassLoader();
+ final ServiceLoader sl = ServiceLoader.load(clazz, tccl);
+ for (T t : sl)
+ result.add(t);
} catch( Throwable e ) {
// ignore any error
StringWriter w = new StringWriter();
e.printStackTrace(new PrintWriter(w));
pluginLoadFailure = w.toString();
- if(debug) {
+ if(debug)
System.out.println(pluginLoadFailure);
- }
- return (T[])Array.newInstance(clazz,0);
+ }
+ return result;
+ }
+
+ private static boolean getDebugPropertyValue() {
+ final String debugPropertyName = Options.class.getName() + ".findServices";
+ if (System.getSecurityManager() != null) {
+ return AccessController.doPrivileged(new PrivilegedAction() {
+ @Override
+ public Boolean run() {
+ return Boolean.getBoolean(debugPropertyName);
+ }
+ });
+ } else {
+ return Boolean.getBoolean(debugPropertyName);
}
}
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/ElementCollectionAdapter.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/ElementCollectionAdapter.java
index 426a06b1b39..d17afa13387 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/ElementCollectionAdapter.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/ElementCollectionAdapter.java
@@ -40,7 +40,7 @@ import com.sun.codemodel.internal.JForEach;
import com.sun.codemodel.internal.JType;
import com.sun.codemodel.internal.JVar;
import com.sun.tools.internal.xjc.model.CElementInfo;
-import static com.sun.tools.internal.xjc.model.Aspect.EXPOSED;
+import static com.sun.tools.internal.xjc.outline.Aspect.EXPOSED;
import com.sun.tools.internal.xjc.outline.FieldAccessor;
import com.sun.tools.internal.xjc.outline.FieldOutline;
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/ElementSingleAdapter.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/ElementSingleAdapter.java
index cad3f700def..77a63b152d7 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/ElementSingleAdapter.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/ElementSingleAdapter.java
@@ -33,7 +33,7 @@ import com.sun.codemodel.internal.JVar;
import com.sun.codemodel.internal.JConditional;
import com.sun.codemodel.internal.JExpr;
import com.sun.codemodel.internal.JExpression;
-import com.sun.tools.internal.xjc.model.Aspect;
+import com.sun.tools.internal.xjc.outline.Aspect;
import com.sun.tools.internal.xjc.outline.FieldOutline;
import com.sun.tools.internal.xjc.outline.FieldAccessor;
import com.sun.tools.internal.xjc.model.CElementInfo;
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/TypeAndAnnotationImpl.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/TypeAndAnnotationImpl.java
index 444a5576175..a9182ec74ae 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/TypeAndAnnotationImpl.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/TypeAndAnnotationImpl.java
@@ -36,7 +36,7 @@ import com.sun.tools.internal.xjc.generator.annotation.spec.XmlJavaTypeAdapterWr
import com.sun.tools.internal.xjc.model.CAdapter;
import com.sun.tools.internal.xjc.model.TypeUse;
import com.sun.tools.internal.xjc.model.nav.NType;
-import static com.sun.tools.internal.xjc.model.Aspect.EXPOSED;
+import static com.sun.tools.internal.xjc.outline.Aspect.EXPOSED;
import com.sun.tools.internal.xjc.outline.Outline;
import com.sun.xml.internal.bind.v2.runtime.SwaRefAdapterMarker;
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/BeanGenerator.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/BeanGenerator.java
index a8082b3eb35..6b383810edd 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/BeanGenerator.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/BeanGenerator.java
@@ -25,7 +25,7 @@
package com.sun.tools.internal.xjc.generator.bean;
-import static com.sun.tools.internal.xjc.model.Aspect.EXPOSED;
+import static com.sun.tools.internal.xjc.outline.Aspect.EXPOSED;
import java.io.Serializable;
import java.net.URL;
@@ -90,7 +90,7 @@ import com.sun.tools.internal.xjc.model.CPropertyInfo;
import com.sun.tools.internal.xjc.model.CTypeRef;
import com.sun.tools.internal.xjc.model.Model;
import com.sun.tools.internal.xjc.model.CClassRef;
-import com.sun.tools.internal.xjc.model.Aspect;
+import com.sun.tools.internal.xjc.outline.Aspect;
import com.sun.tools.internal.xjc.outline.ClassOutline;
import com.sun.tools.internal.xjc.outline.EnumConstantOutline;
import com.sun.tools.internal.xjc.outline.EnumOutline;
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/ElementOutlineImpl.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/ElementOutlineImpl.java
index c0ed6134d6a..8d71f17ad36 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/ElementOutlineImpl.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/ElementOutlineImpl.java
@@ -39,7 +39,7 @@ import com.sun.codemodel.internal.JMethod;
import com.sun.codemodel.internal.JMod;
import com.sun.codemodel.internal.JType;
import com.sun.tools.internal.xjc.model.CElementInfo;
-import com.sun.tools.internal.xjc.model.Aspect;
+import com.sun.tools.internal.xjc.outline.Aspect;
import com.sun.tools.internal.xjc.outline.ElementOutline;
/**
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/ImplStructureStrategy.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/ImplStructureStrategy.java
index 5e3a32d0876..9a9a559831a 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/ImplStructureStrategy.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/ImplStructureStrategy.java
@@ -42,7 +42,7 @@ import com.sun.codemodel.internal.JType;
import com.sun.codemodel.internal.JVar;
import com.sun.tools.internal.xjc.generator.annotation.spec.XmlAccessorTypeWriter;
import com.sun.tools.internal.xjc.model.CClassInfo;
-import com.sun.tools.internal.xjc.model.Aspect;
+import com.sun.tools.internal.xjc.outline.Aspect;
import com.sun.tools.internal.xjc.outline.Outline;
/**
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/ObjectFactoryGeneratorImpl.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/ObjectFactoryGeneratorImpl.java
index 71d6a5d551a..6ed5b8327bb 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/ObjectFactoryGeneratorImpl.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/ObjectFactoryGeneratorImpl.java
@@ -51,7 +51,7 @@ import com.sun.tools.internal.xjc.model.CElementInfo;
import com.sun.tools.internal.xjc.model.CPropertyInfo;
import com.sun.tools.internal.xjc.model.Constructor;
import com.sun.tools.internal.xjc.model.Model;
-import com.sun.tools.internal.xjc.model.Aspect;
+import com.sun.tools.internal.xjc.outline.Aspect;
import com.sun.tools.internal.xjc.outline.FieldAccessor;
import com.sun.tools.internal.xjc.outline.FieldOutline;
import com.sun.xml.internal.bind.v2.TODO;
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/PackageOutlineImpl.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/PackageOutlineImpl.java
index 04d024c3b87..5ffc3e31150 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/PackageOutlineImpl.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/PackageOutlineImpl.java
@@ -49,7 +49,7 @@ import com.sun.tools.internal.xjc.model.CTypeRef;
import com.sun.tools.internal.xjc.model.CValuePropertyInfo;
import com.sun.tools.internal.xjc.model.Model;
import com.sun.tools.internal.xjc.outline.PackageOutline;
-import com.sun.tools.internal.xjc.model.Aspect;
+import com.sun.tools.internal.xjc.outline.Aspect;
/**
* {@link PackageOutline} enhanced with schema2java specific
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/PrivateObjectFactoryGenerator.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/PrivateObjectFactoryGenerator.java
index b43bd348af9..0d28eb4cc23 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/PrivateObjectFactoryGenerator.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/PrivateObjectFactoryGenerator.java
@@ -32,7 +32,7 @@ import com.sun.codemodel.internal.JPackage;
import com.sun.codemodel.internal.fmt.JPropertyFile;
import com.sun.tools.internal.xjc.model.CElementInfo;
import com.sun.tools.internal.xjc.model.Model;
-import com.sun.tools.internal.xjc.model.Aspect;
+import com.sun.tools.internal.xjc.outline.Aspect;
import com.sun.tools.internal.xjc.runtime.JAXBContextFactory;
/**
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/PublicObjectFactoryGenerator.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/PublicObjectFactoryGenerator.java
index 31afd1df0ee..f0105e59806 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/PublicObjectFactoryGenerator.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/PublicObjectFactoryGenerator.java
@@ -28,7 +28,7 @@ package com.sun.tools.internal.xjc.generator.bean;
import com.sun.codemodel.internal.JPackage;
import com.sun.tools.internal.xjc.model.CElementInfo;
import com.sun.tools.internal.xjc.model.Model;
-import com.sun.tools.internal.xjc.model.Aspect;
+import com.sun.tools.internal.xjc.outline.Aspect;
/**
* Generates public ObjectFactory.
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/field/AbstractField.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/field/AbstractField.java
index 79a7c2084d3..318fa4271d9 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/field/AbstractField.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/field/AbstractField.java
@@ -63,8 +63,8 @@ import com.sun.tools.internal.xjc.model.CTypeInfo;
import com.sun.tools.internal.xjc.model.CTypeRef;
import com.sun.tools.internal.xjc.model.CValuePropertyInfo;
import com.sun.tools.internal.xjc.model.nav.NClass;
-import com.sun.tools.internal.xjc.model.Aspect;
-import static com.sun.tools.internal.xjc.model.Aspect.IMPLEMENTATION;
+import com.sun.tools.internal.xjc.outline.Aspect;
+import static com.sun.tools.internal.xjc.outline.Aspect.IMPLEMENTATION;
import com.sun.tools.internal.xjc.outline.ClassOutline;
import com.sun.tools.internal.xjc.outline.FieldAccessor;
import com.sun.tools.internal.xjc.outline.FieldOutline;
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/field/ContentListField.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/field/ContentListField.java
index 0535385cefe..331ca3ed8c2 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/field/ContentListField.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/field/ContentListField.java
@@ -38,7 +38,7 @@ import com.sun.codemodel.internal.JVar;
import com.sun.tools.internal.xjc.generator.bean.ClassOutlineImpl;
import com.sun.tools.internal.xjc.generator.bean.MethodWriter;
import com.sun.tools.internal.xjc.model.CPropertyInfo;
-import com.sun.tools.internal.xjc.model.Aspect;
+import com.sun.tools.internal.xjc.outline.Aspect;
import com.sun.xml.internal.bind.api.impl.NameConverter;
import java.io.Serializable;
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/field/NoExtendedContentField.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/field/NoExtendedContentField.java
index b1fe84d32de..28c061fe9e9 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/field/NoExtendedContentField.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/field/NoExtendedContentField.java
@@ -40,7 +40,7 @@ import com.sun.tools.internal.xjc.generator.bean.MethodWriter;
import com.sun.tools.internal.xjc.model.CElement;
import com.sun.tools.internal.xjc.model.CPropertyInfo;
import com.sun.tools.internal.xjc.model.CReferencePropertyInfo;
-import com.sun.tools.internal.xjc.model.Aspect;
+import com.sun.tools.internal.xjc.outline.Aspect;
import com.sun.xml.internal.bind.api.impl.NameConverter;
import java.io.Serializable;
import java.util.Set;
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/field/UnboxedField.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/field/UnboxedField.java
index d1d60072d9e..97eaabdb59c 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/field/UnboxedField.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/field/UnboxedField.java
@@ -35,7 +35,7 @@ import com.sun.codemodel.internal.JVar;
import com.sun.tools.internal.xjc.generator.bean.ClassOutlineImpl;
import com.sun.tools.internal.xjc.generator.bean.MethodWriter;
import com.sun.tools.internal.xjc.model.CPropertyInfo;
-import com.sun.tools.internal.xjc.model.Aspect;
+import com.sun.tools.internal.xjc.outline.Aspect;
import com.sun.tools.internal.xjc.outline.FieldAccessor;
import com.sun.xml.internal.bind.api.impl.NameConverter;
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CAdapter.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CAdapter.java
index fb5ce6a5f5c..b4f90f58249 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CAdapter.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CAdapter.java
@@ -34,6 +34,7 @@ import com.sun.tools.internal.xjc.model.nav.EagerNClass;
import com.sun.tools.internal.xjc.model.nav.NClass;
import com.sun.tools.internal.xjc.model.nav.NType;
import com.sun.tools.internal.xjc.model.nav.NavigatorImpl;
+import com.sun.tools.internal.xjc.outline.Aspect;
import com.sun.tools.internal.xjc.outline.Outline;
import com.sun.xml.internal.bind.v2.model.core.Adapter;
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CArrayInfo.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CArrayInfo.java
index 2fc179cf2da..d1d3c142a63 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CArrayInfo.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CArrayInfo.java
@@ -28,6 +28,7 @@ package com.sun.tools.internal.xjc.model;
import javax.xml.namespace.QName;
import com.sun.codemodel.internal.JType;
+import com.sun.tools.internal.xjc.outline.Aspect;
import com.sun.xml.internal.bind.v2.model.util.ArrayInfoUtil;
import com.sun.tools.internal.xjc.model.nav.NClass;
import com.sun.tools.internal.xjc.model.nav.NType;
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CBuiltinLeafInfo.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CBuiltinLeafInfo.java
index d4f50da7f3c..48ee3c7b1b3 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CBuiltinLeafInfo.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CBuiltinLeafInfo.java
@@ -49,6 +49,7 @@ import com.sun.codemodel.internal.JExpr;
import com.sun.codemodel.internal.JExpression;
import com.sun.codemodel.internal.JType;
import com.sun.tools.internal.xjc.model.nav.NClass;
+import com.sun.tools.internal.xjc.outline.Aspect;
import com.sun.xml.internal.bind.v2.model.annotation.Locatable;
import com.sun.xml.internal.bind.v2.model.core.BuiltinLeafInfo;
import com.sun.xml.internal.bind.v2.model.core.Element;
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CClassInfo.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CClassInfo.java
index c74ee55c578..9dcb52738da 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CClassInfo.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CClassInfo.java
@@ -45,6 +45,7 @@ import com.sun.istack.internal.Nullable;
import com.sun.tools.internal.xjc.Language;
import com.sun.tools.internal.xjc.model.nav.NClass;
import com.sun.tools.internal.xjc.model.nav.NType;
+import com.sun.tools.internal.xjc.outline.Aspect;
import com.sun.tools.internal.xjc.outline.Outline;
import com.sun.tools.internal.xjc.reader.Ring;
import com.sun.tools.internal.xjc.reader.xmlschema.BGMBuilder;
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CClassRef.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CClassRef.java
index f546e28ce2e..9e22dfd60b3 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CClassRef.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CClassRef.java
@@ -30,6 +30,7 @@ import javax.xml.namespace.QName;
import com.sun.codemodel.internal.JClass;
import com.sun.tools.internal.xjc.model.nav.NClass;
import com.sun.tools.internal.xjc.model.nav.NType;
+import com.sun.tools.internal.xjc.outline.Aspect;
import com.sun.tools.internal.xjc.outline.Outline;
import com.sun.tools.internal.xjc.reader.xmlschema.bindinfo.BIClass;
import com.sun.tools.internal.xjc.reader.xmlschema.bindinfo.BIEnum;
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CElementInfo.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CElementInfo.java
index 6a7419bdddd..8526bfaff7b 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CElementInfo.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CElementInfo.java
@@ -43,6 +43,7 @@ import static com.sun.tools.internal.xjc.model.CElementPropertyInfo.CollectionMo
import com.sun.tools.internal.xjc.model.nav.NClass;
import com.sun.tools.internal.xjc.model.nav.NType;
import com.sun.tools.internal.xjc.model.nav.NavigatorImpl;
+import com.sun.tools.internal.xjc.outline.Aspect;
import com.sun.tools.internal.xjc.outline.Outline;
import com.sun.tools.internal.xjc.reader.xmlschema.bindinfo.BIInlineBinaryData;
import com.sun.tools.internal.xjc.reader.xmlschema.bindinfo.BIFactoryMethod;
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CEnumLeafInfo.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CEnumLeafInfo.java
index 2914606bc84..463f8d3df26 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CEnumLeafInfo.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CEnumLeafInfo.java
@@ -34,6 +34,7 @@ import com.sun.codemodel.internal.JClass;
import com.sun.codemodel.internal.JExpression;
import com.sun.tools.internal.xjc.model.nav.NClass;
import com.sun.tools.internal.xjc.model.nav.NType;
+import com.sun.tools.internal.xjc.outline.Aspect;
import com.sun.tools.internal.xjc.outline.Outline;
import com.sun.xml.internal.bind.v2.model.annotation.Locatable;
import com.sun.xml.internal.bind.v2.model.core.EnumLeafInfo;
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CReferencePropertyInfo.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CReferencePropertyInfo.java
index d5c64a83679..d7bbf3b38e5 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CReferencePropertyInfo.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CReferencePropertyInfo.java
@@ -26,7 +26,7 @@
package com.sun.tools.internal.xjc.model;
import java.util.Collection;
-import java.util.HashSet;
+import java.util.LinkedHashSet;
import java.util.Set;
import java.util.Map;
@@ -60,7 +60,7 @@ public final class CReferencePropertyInfo extends CPropertyInfo implements Refer
/**
* List of referenced elements.
*/
- private final Set elements = new HashSet();
+ private final Set elements = new LinkedHashSet();
private final boolean isMixed;
private WildcardMode wildcard;
@@ -87,7 +87,7 @@ public final class CReferencePropertyInfo extends CPropertyInfo implements Refer
// so the Java types of the substitution members need to be taken into account
// when computing the signature
- final class RefList extends HashSet {
+ final class RefList extends LinkedHashSet {
RefList() {
super(elements.size());
addAll(elements);
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CTypeInfo.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CTypeInfo.java
index a987439c694..53fec35534c 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CTypeInfo.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CTypeInfo.java
@@ -29,6 +29,7 @@ import com.sun.codemodel.internal.JClass;
import com.sun.codemodel.internal.JType;
import com.sun.tools.internal.xjc.model.nav.NClass;
import com.sun.tools.internal.xjc.model.nav.NType;
+import com.sun.tools.internal.xjc.outline.Aspect;
import com.sun.tools.internal.xjc.outline.Outline;
import com.sun.xml.internal.bind.v2.model.core.TypeInfo;
@@ -44,7 +45,7 @@ public interface CTypeInfo extends TypeInfo, CCustomizable {
* Returns the {@link JClass} that represents the class being bound,
* under the given {@link Outline}.
*
- * @see NType#toType(Outline, Aspect)
+ * @see NType#toType(Outline, com.sun.tools.internal.xjc.outline.Aspect)
*/
JType toType(Outline o, Aspect aspect);
}
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CWildcardTypeInfo.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CWildcardTypeInfo.java
index 58506956982..8da2c69a2cf 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CWildcardTypeInfo.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CWildcardTypeInfo.java
@@ -29,6 +29,7 @@ import com.sun.codemodel.internal.JType;
import com.sun.tools.internal.xjc.model.nav.NClass;
import com.sun.tools.internal.xjc.model.nav.NType;
import com.sun.tools.internal.xjc.model.nav.NavigatorImpl;
+import com.sun.tools.internal.xjc.outline.Aspect;
import com.sun.tools.internal.xjc.outline.Outline;
import com.sun.xml.internal.bind.v2.model.core.WildcardTypeInfo;
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/EagerNClass.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/EagerNClass.java
index 2fadd1cfea5..979269f345a 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/EagerNClass.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/EagerNClass.java
@@ -30,7 +30,7 @@ import java.util.HashSet;
import java.util.Set;
import com.sun.codemodel.internal.JClass;
-import com.sun.tools.internal.xjc.model.Aspect;
+import com.sun.tools.internal.xjc.outline.Aspect;
import com.sun.tools.internal.xjc.outline.Outline;
/**
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/EagerNType.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/EagerNType.java
index dbb598c0db4..fc7f2058fd3 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/EagerNType.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/EagerNType.java
@@ -28,7 +28,7 @@ package com.sun.tools.internal.xjc.model.nav;
import java.lang.reflect.Type;
import com.sun.codemodel.internal.JType;
-import com.sun.tools.internal.xjc.model.Aspect;
+import com.sun.tools.internal.xjc.outline.Aspect;
import com.sun.tools.internal.xjc.outline.Outline;
/**
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/NClass.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/NClass.java
index 3499949bdb2..9a48f0f08ce 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/NClass.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/NClass.java
@@ -26,7 +26,7 @@
package com.sun.tools.internal.xjc.model.nav;
import com.sun.codemodel.internal.JClass;
-import com.sun.tools.internal.xjc.model.Aspect;
+import com.sun.tools.internal.xjc.outline.Aspect;
import com.sun.tools.internal.xjc.outline.Outline;
/**
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/NClassByJClass.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/NClassByJClass.java
index 558f15740ea..61b82533b67 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/NClassByJClass.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/NClassByJClass.java
@@ -26,7 +26,7 @@
package com.sun.tools.internal.xjc.model.nav;
import com.sun.codemodel.internal.JClass;
-import com.sun.tools.internal.xjc.model.Aspect;
+import com.sun.tools.internal.xjc.outline.Aspect;
import com.sun.tools.internal.xjc.outline.Outline;
/**
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/NParameterizedType.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/NParameterizedType.java
index b7a2c9a647d..1747c735b92 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/NParameterizedType.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/NParameterizedType.java
@@ -26,7 +26,7 @@
package com.sun.tools.internal.xjc.model.nav;
import com.sun.codemodel.internal.JClass;
-import com.sun.tools.internal.xjc.model.Aspect;
+import com.sun.tools.internal.xjc.outline.Aspect;
import com.sun.tools.internal.xjc.outline.Outline;
/**
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/NType.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/NType.java
index 4e30ccf7c38..e95c2084386 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/NType.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/NType.java
@@ -26,7 +26,7 @@
package com.sun.tools.internal.xjc.model.nav;
import com.sun.codemodel.internal.JType;
-import com.sun.tools.internal.xjc.model.Aspect;
+import com.sun.tools.internal.xjc.outline.Aspect;
import com.sun.tools.internal.xjc.outline.Outline;
/**
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/Aspect.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/outline/Aspect.java
similarity index 91%
rename from jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/Aspect.java
rename to jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/outline/Aspect.java
index 7d825b60844..f8fa0b13355 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/Aspect.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/outline/Aspect.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
* questions.
*/
-package com.sun.tools.internal.xjc.model;
+package com.sun.tools.internal.xjc.outline;
import com.sun.tools.internal.xjc.generator.bean.ImplStructureStrategy;
@@ -35,6 +35,8 @@ import com.sun.tools.internal.xjc.generator.bean.ImplStructureStrategy;
* This is an enumeration of all possible aspects.
*
* @author Kohsuke Kawaguchi
+ *
+ * TODO: move this to the model package. We cannot do this before JAXB3 because of old plugins
*/
public enum Aspect {
/**
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/outline/Outline.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/outline/Outline.java
index 49a8b911e93..d49f2c0ba04 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/outline/Outline.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/outline/Outline.java
@@ -33,7 +33,6 @@ import com.sun.codemodel.internal.JCodeModel;
import com.sun.codemodel.internal.JPackage;
import com.sun.codemodel.internal.JType;
import com.sun.tools.internal.xjc.ErrorReceiver;
-import com.sun.tools.internal.xjc.model.Aspect;
import com.sun.tools.internal.xjc.model.CClassInfo;
import com.sun.tools.internal.xjc.model.CClassInfoParent;
import com.sun.tools.internal.xjc.model.CElementInfo;
diff --git a/jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/version.properties b/jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/version.properties
index 1ae4b3cd94f..b18bbc710b0 100644
--- a/jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/version.properties
+++ b/jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/version.properties
@@ -23,7 +23,7 @@
# questions.
#
-build-id=2.2.11-b141124.1933
-build-version=JAX-WS RI 2.2.11-b141124.1933
+build-id=2.2.11-b150127.1410
+build-version=JAX-WS RI 2.2.11-b150127.1410
major-version=2.2.11
-svn-revision=312b19a2e0e312b55e1ea6f531bd595955cd581f
+svn-revision=28121d09ed8ac02b76788709ccb4cdb66e03bbfa
From 892b06056c33ac73735f737c03a72ab5835d5e4f Mon Sep 17 00:00:00 2001
From: Lev Priima
Date: Thu, 12 Feb 2015 10:34:35 -0500
Subject: [PATCH 52/61] 8072909: TimSort fails with
ArrayIndexOutOfBoundsException on worst case long arrays
Reviewed-by: rriggs, dholmes
---
.../classes/java/util/ComparableTimSort.java | 2 +-
.../share/classes/java/util/TimSort.java | 2 +-
.../java/util/Arrays/TimSortStackSize2.java | 169 ++++++++++++++++++
3 files changed, 171 insertions(+), 2 deletions(-)
create mode 100644 jdk/test/java/util/Arrays/TimSortStackSize2.java
diff --git a/jdk/src/java.base/share/classes/java/util/ComparableTimSort.java b/jdk/src/java.base/share/classes/java/util/ComparableTimSort.java
index e7c7ac020bd..6237b3fd2e6 100644
--- a/jdk/src/java.base/share/classes/java/util/ComparableTimSort.java
+++ b/jdk/src/java.base/share/classes/java/util/ComparableTimSort.java
@@ -147,7 +147,7 @@ class ComparableTimSort {
*/
int stackLen = (len < 120 ? 5 :
len < 1542 ? 10 :
- len < 119151 ? 24 : 40);
+ len < 119151 ? 24 : 49);
runBase = new int[stackLen];
runLen = new int[stackLen];
}
diff --git a/jdk/src/java.base/share/classes/java/util/TimSort.java b/jdk/src/java.base/share/classes/java/util/TimSort.java
index 9966f74df37..af66d8092c5 100644
--- a/jdk/src/java.base/share/classes/java/util/TimSort.java
+++ b/jdk/src/java.base/share/classes/java/util/TimSort.java
@@ -177,7 +177,7 @@ class TimSort {
*/
int stackLen = (len < 120 ? 5 :
len < 1542 ? 10 :
- len < 119151 ? 24 : 40);
+ len < 119151 ? 24 : 49);
runBase = new int[stackLen];
runLen = new int[stackLen];
}
diff --git a/jdk/test/java/util/Arrays/TimSortStackSize2.java b/jdk/test/java/util/Arrays/TimSortStackSize2.java
new file mode 100644
index 00000000000..86194320f59
--- /dev/null
+++ b/jdk/test/java/util/Arrays/TimSortStackSize2.java
@@ -0,0 +1,169 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * 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 8072909
+ * @run main/othervm TimSortStackSize2 67108864
+ * not for regular execution on all platforms:
+ * run main/othervm -Xmx8g TimSortStackSize2 1073741824
+ * run main/othervm -Xmx32g TimSortStackSize2 2147483644
+ * @summary Test TimSort stack size on big arrays
+ */
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Comparator;
+import java.util.List;
+
+public class TimSortStackSize2 {
+
+ public static void main(String[] args) {
+ int lengthOfTest = Integer.parseInt(args[0]);
+ boolean passed = true;
+ try {
+ Arrays.sort(new TimSortStackSize2(lengthOfTest).createArray(),
+ new Comparator